well said, TTN force people into Cloud (TTN, Amazon, Google) and we prefer doing all locally. However i need LoRa because of the long range and i dont know how to make it work without TTN Cloud for free. If you know any solution for small people for Lora server, let me know. Cheers
Yep pretty easy one I use RakWireless products for my Lora gateways and when you install them you can use them as remote gw for cloud services like TTN, TTS, Helium…) but it installs also on it (runs on a Raspberry Pi) Chirpstack Lora that basically is an open-source complete Lora server ecosystem and you can interface it in a very similar way through MQTT with HA and it can support a large number of gw and devices if run on an enough powerful computer https://www.chirpstack.io
wow, very interesting i will check it out. My current solution for TTN was to send very small amount of data, but thats not good as i want to check sudden weather and soil condition changes, so the best would be an unlimited home based lora server. Thanks
yep but don’t forget Lora is not designed for large amounts of data, it’s not wifi ! And even if you are using your own Lora network you still have to comply with that (excepted if you plan to do that in a middle of nowhere where no Lora network exists/are present
i know how to calculate and minimize the traffic thanks to TTN extreme strict server policy. The bottleneck was never the radio but the TTN server. On the other hand i am in the middle of nowhere, hoping to get Starlink soon
Hi,
I used your config, but with my credentials, but I get an error message.
This is the logs I get. Since I tried all the configs you and @vincen posed on this topic, I allow myself to ask if you see a mistake from my part
This is the content of my bridge.conf
connection thethings_network_V3
address eu1.cloud.thethings.network:8883
topic # in 0
remote_username xx@ttn
remote_password NNSXS.xx
start_type automatic
try_private false
bridge_insecure true
notifications false
cleansession false
bridge_capath /etc/ssl/certs
Here is the logs with the error
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing...
[23:25:10] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[23:25:10] INFO: Starting NGINX for authentication handling...
[services.d] done.
[23:25:10] INFO: Starting mosquitto MQTT broker...
1643408710: Loading config file /share/mosquitto/bridge.conf
1643408710: Warning: Bridge thethings_network_V3 using insecure mode.
1643408710: mosquitto version 1.6.12 starting
1643408710: |-- *** auth-plug: startup
[23:25:11] INFO: Successfully send discovery information to Home Assistant.
[23:25:11] INFO: Successfully send service information to the Supervisor.
1643408710: Config loaded from /etc/mosquitto/mosquitto.conf.
1643408710: Loading plugin: /usr/share/mosquitto/auth-plug.so
1643408710: ├── Username/password checking enabled.
1643408710: ├── TLS-PSK checking enabled.
1643408710: └── Extended authentication not enabled.
1643408710: Opening ipv4 listen socket on port 1883.
1643408710: Opening ipv6 listen socket on port 1883.
1643408710: Opening websockets listen socket on port 1884.
1643408710: Opening ipv4 listen socket on port 8883.
1643408710: Opening ipv6 listen socket on port 8883.
1643408710: Opening websockets listen socket on port 8884.
1643408710: Warning: Mosquitto should not be run as root/administrator.
1643408710: Connecting bridge thethings_network_V3 (eu1.cloud.thethings.network:8883)
1643408710: mosquitto version 1.6.12 running
1643408710: New connection from 127.0.0.1 on port 1883.
1643408710: Socket error on client <unknown>, disconnecting.
1643408712: New connection from 172.30.32.1 on port 1
The thing i dont understand is that in MQTT using the same credentials i can connect no problem (the HA server and my pc are on ne same network)
Any help will by really appreciated
Sorry to say and no offense but you’re clearly not in same config as me so might be normal it doesn’t work… For info I posted configuration that works fine here: The Things Stack integration ? (on TTN V3)? - #5 by vincen Please correct your mqtt config, restart it and see how it goes
Hi,
Sorry I was looking at the wrong config, I changed it but no luck.
I was wondering is your setup? Are you using the add-on inside of home assistant or it’s hosted elsewhere. The thing I don’t understand is that in node red add-on its working perfectly (I turned it off for this test to avoid any problem)
This is the config I used
connection thethings_network_V3
address eu1.cloud.thethings.network
bridge_protocol_version mqttv311
remote_username my user here @ttn
start_type automatic
notifications false
try_private false
remote_password NNSXS.my key here
bridge_insecure true
topic # in 0
cleansession true
And the logs are the same
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing...
[15:04:10] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[15:04:10] INFO: Starting NGINX for authentication handling...
[15:04:10] INFO: Starting mosquitto MQTT broker...
1643551450: Loading config file /share/mosquitto/bridge.conf
1643551450: Warning: Bridge thethings_network_V3 using insecure mode.
1643551450: mosquitto version 1.6.12 starting
1643551450: |-- *** auth-plug: startup
[15:04:10] INFO: Successfully send discovery information to Home Assistant.
[15:04:10] INFO: Successfully send service information to the Supervisor.
1643551450: Config loaded from /etc/mosquitto/mosquitto.conf.
1643551450: Loading plugin: /usr/share/mosquitto/auth-plug.so
1643551450: ├── Username/password checking enabled.
1643551450: ├── TLS-PSK checking enabled.
1643551450: └── Extended authentication not enabled.
1643551450: Opening ipv4 listen socket on port 1883.
1643551450: Opening ipv6 listen socket on port 1883.
1643551450: Opening websockets listen socket on port 1884.
1643551450: Opening ipv4 listen socket on port 8883.
1643551450: Opening ipv6 listen socket on port 8883.
1643551450: Opening websockets listen socket on port 8884.
1643551450: Warning: Mosquitto should not be run as root/administrator.
1643551450: Connecting bridge thethings_network_V3 (eu1.cloud.thethings.network:1883)
1643551450: mosquitto version 1.6.12 running
1643551450: New connection from 127.0.0.1 on port 1883.
1643551450: Socket error on client <unknown>, disconnecting.
1643551454: New connection from 172.30.32.1 on port 1883.
Thanks for the help
Kind regards
Thank you very much, it functions very well. I have a dragino LT22222l that has two relais. Can i drive them in HA and mqtt.
thanks in advance
Sorry missed your message I’m using add-on of hassio that has Mosquitto broker in it
never tried downlink like that as my Lora devices are ondy sensors but it should be possible. According at TTN/TTS documentation MQTT Server | The Things Stack for LoRaWAN you can publish payload through MQTT I would suggest to try first with a MQTT client to debug it easily (I use MQTT snooper on my phone for that like I did rpeviously to get easily structure of uplink payloads
Tanks for replay.
I dont now how i can configure the switch.yaml file.
Well as I indicated before, first use an MQTT client on your phone or tablet connected at TTN/TTS mqtt broker to find out more easily the proper syntax to use (following the official documentation MQTT Server | The Things Stack for LoRaWAN) and once it works this way you’ll be able to push these messages through HA
Well, following you i used mqtt explorer and i have seen that what i put on my mqtt bridge, don’t pass
to the TTN MQTT Server even if i have changed topic in bridge.conf from ’ # in 0’ to ‘# both 0’.
I used MQTT publish in my HA for testing but noothng see in TTN MQTT Server.
Regards
Sorry but quite confused by your explanations… If you use an mqtt client on your phone you don’t connect it at mqtt broker of ha, but mqtt server of TTN/TTS for test Then using dragino documentation, find out how to properly format the Lora downlink message and once it works you can try to do the same from HA through its own MQTT server
I was able to get the bridge to the HA MQTT add-on to work fine. I’m using it now with Node-Red. Thanks for that!
Now I’m trying to get it to work directly through the configuration.yaml, bypassing Node-Red, but I only get state of sensor.temp_ds = ‘unknown’.
Here’s what I have in my config file:
- platform: mqtt
state_topic: "v3/mqtt-rpi3b@ttn/devices/eui-70b3d57ed004d338/up"
name: "Temp DS"
value_template: '{{ value_json.uplink_message.decoded_payload.degreesC }}'
unit_of_measurement: "°C"
But it doesn’t work. I’m pretty sure state_topic is right, because I find it on my MQTT client app connected to TTS MQTT server. Did you do anything else to get it to work?
Thanks for your help in gett HA mqtt working with TTN.
I use Rak edge lite as my gateway and whilst I can get it to work with TTN, I cannot get the gateway to connect to my Chirpstack server. Chirpstack does not allow me to connect the RAK gateway as it states the connection is refused when I try to add the gateway. I have tried all different ports/addresses but no luck.
How do you configure your rak gateway to support Chirpstack?
that is quite a different problem so would be better to start a new thread for that problem or even better in Rak Wireless forum https://forum.rakwireless.com
Did you try to use the chipstarck server included with RAK softwares to configure gateway ?
Sorry to dig up this old thread, but trying to figure out why I can’t get the ssl version of TTNv3 working, only port 1883 works.
connection bridge-nam1
address nam1.cloud.thethings.network:8883
bridge_protocol_version mqttv311
bridge_insecure true
start_type automatic
notifications false
try_private false
remote_username USER@ttn
remote_password SECRET
topic # in 0 /ttn/
cleansession true
I’ve tried changing the bridge_insecure to false, but not sure if that really matters as thought that was cert to name mapping anyways. Basically it connects, then drops after a bit with both the older 1.16 based Add on and the new 2.0 based one.
Is there a chance that the TTN v3 integration will happen on HA?
It would be great to update the integration to the latest TTNv3 version
it is doable, but using mqtt gives you a very fast updates in home assistant vs regularly fetching the latest values, which would probably delayed.
Have you tried mqtt based solution?