How does mysensors relate to MQTT?
-
I think that may have made sense before the ESP8266, but in my view the esp8266 changed everything. The way I see it: it's very easy to have an esp8266 directly control either an RFM69HW or an NRF24L01+. They are very cheap to build. So, if you have that as a powered gateway node, everything from that point on can be carried by Wi-Fi to whatever aggregation point you want. If you need better coverage, just deploy however many esp8266-(RFM69/NRF24) nodes you need. Like I said, they're cheap. In contrast, a meshed network with a lot of hops can introduce noticeable latency.
Anyhow, I doubt I'll change anyone's mind, but that's the direction I'm heading. Simple is good.
@NeverDie Regardless of trying to argue on your idea of having multiple MQTT gateways. There's a single reason that might raise some problems.
At the moment MySensors has no network ID (like Wifi has). So having multiple MQTT gateways in different locations of your house, might cause multiple MQTT gateways to pick up the same message from one particular Node. This means that the data of that sensors can be received by multiple MQTT gateways. Also, if you use ACK it would mean that each gateway will ACK to that Node causing errors on the gateways that didn't send an ACK as first.
I'm interested in your solution.
Another thing that I would not like to experience is having to reset all the SID settings in each node when the router you get from your ISP is being replaced with a new one. Happened to me once and I had to update a lot of devices. That's why I like MySensors and prefer not to use WiFi for my sensors and nodes.
-
@NeverDie Regardless of trying to argue on your idea of having multiple MQTT gateways. There's a single reason that might raise some problems.
At the moment MySensors has no network ID (like Wifi has). So having multiple MQTT gateways in different locations of your house, might cause multiple MQTT gateways to pick up the same message from one particular Node. This means that the data of that sensors can be received by multiple MQTT gateways. Also, if you use ACK it would mean that each gateway will ACK to that Node causing errors on the gateways that didn't send an ACK as first.
I'm interested in your solution.
Another thing that I would not like to experience is having to reset all the SID settings in each node when the router you get from your ISP is being replaced with a new one. Happened to me once and I had to update a lot of devices. That's why I like MySensors and prefer not to use WiFi for my sensors and nodes.
@TheoL said:
@NeverDie Regardless of trying to argue on your idea of having multiple MQTT gateways. There's a single reason that might raise some problems.
At the moment MySensors has no network ID (like Wifi has). So having multiple MQTT gateways in different locations of your house, might cause multiple MQTT gateways to pick up the same message from one particular Node. This means that the data of that sensors can be received by multiple MQTT gateways. Also, if you use ACK it would mean that each gateway will ACK to that Node causing errors on the gateways that didn't send an ACK as first.
I'm interested in your solution.
That could be handled in different ways, but the simplest is to have each MQTT gateway use a different channel, and each node communicates with just one gateway (but each gateway has the potential to talk with however many nodes are assigned to it). Each RFM69 can have about 50 non-overlapping channels. So, you could have up to 50 gateways on different channels. I don't think there's a house big enough that would need more than 50 gateways. For most, one or two or three would be enough.
Regarding the SID settings, I'm not sure I understand what the issue is. I just assign each esp8266 a static IP address of of the form 192.168.x.y using the router setup. Actually, on mine, it happens automatically during the initial node setup, but that may be particular to my router.
-
@TheoL said:
@NeverDie Regardless of trying to argue on your idea of having multiple MQTT gateways. There's a single reason that might raise some problems.
At the moment MySensors has no network ID (like Wifi has). So having multiple MQTT gateways in different locations of your house, might cause multiple MQTT gateways to pick up the same message from one particular Node. This means that the data of that sensors can be received by multiple MQTT gateways. Also, if you use ACK it would mean that each gateway will ACK to that Node causing errors on the gateways that didn't send an ACK as first.
I'm interested in your solution.
That could be handled in different ways, but the simplest is to have each MQTT gateway use a different channel, and each node communicates with just one gateway (but each gateway has the potential to talk with however many nodes are assigned to it). Each RFM69 can have about 50 non-overlapping channels. So, you could have up to 50 gateways on different channels. I don't think there's a house big enough that would need more than 50 gateways. For most, one or two or three would be enough.
Regarding the SID settings, I'm not sure I understand what the issue is. I just assign each esp8266 a static IP address of of the form 192.168.x.y using the router setup. Actually, on mine, it happens automatically during the initial node setup, but that may be particular to my router.
-
@NeverDie it might be me. But I haven't found a way of letting a node communicate to a dedicated Gateway. Really interested if you find a way of doing that.
@TheoL said:
@NeverDie it might be me. But I haven't found a way of letting a node communicate to a dedicated Gateway. Really interested if you find a way of doing that.
You can program an esp8266 just like an arduino now, even using the same Arduino IDE. Except it's faster and has more memory. So, instead of an atmega328p controlling an rfm69 or nrf24, you just have the esp8266 do it. You can even use the same sketch as before. That's the basis for your gateway. Your battery powered nodes still work the old way (i.e. controlled by an atmega328p, because it's more power efficient).
-
@TheoL said:
@NeverDie it might be me. But I haven't found a way of letting a node communicate to a dedicated Gateway. Really interested if you find a way of doing that.
You can program an esp8266 just like an arduino now, even using the same Arduino IDE. Except it's faster and has more memory. So, instead of an atmega328p controlling an rfm69 or nrf24, you just have the esp8266 do it. You can even use the same sketch as before. That's the basis for your gateway. Your battery powered nodes still work the old way (i.e. controlled by an atmega328p, because it's more power efficient).
@NeverDie I understand what you mean. Interesting idea. But I'll stick to the normal radio's. Not that fund of Wifi as my WiFi signal is weak because of neighbors with more powerful routers.
I haven't really looked into the ESP. But you might know the answer. Can you install a TLS certificate on it?
-
@NeverDie I understand what you mean. Interesting idea. But I'll stick to the normal radio's. Not that fund of Wifi as my WiFi signal is weak because of neighbors with more powerful routers.
I haven't really looked into the ESP. But you might know the answer. Can you install a TLS certificate on it?
@TheoL said:
@NeverDie I understand what you mean. Interesting idea. But I'll stick to the normal radio's. Not that fund of Wifi as my WiFi signal is weak because of neighbors with more powerful routers.
I haven't really looked into the ESP. But you might know the answer. Can you install a TLS certificate on it?
You just need a better wifi router. :-) Get a multi-band one with 4x4 MIMO.
I haven't looked into TLS.
-
@TheoL said:
@NeverDie I understand what you mean. Interesting idea. But I'll stick to the normal radio's. Not that fund of Wifi as my WiFi signal is weak because of neighbors with more powerful routers.
I haven't really looked into the ESP. But you might know the answer. Can you install a TLS certificate on it?
You just need a better wifi router. :-) Get a multi-band one with 4x4 MIMO.
I haven't looked into TLS.
Here's an example of an esp8266 that's controlling an RFM69 with a dipole antenna. The footprint is barely larger than a US$ 25 cent piece.
-
Exposing all of your sensors and actuators to WiFi is a bad idea from a security point of view. But all is relative.
-
If security is a dominant concern, you could build everything using LoRa, which is inherently more secure.
Anyhow, I use wi-fi on my laptop, and I don't lose sleep over it. Should I? I mean one could always use SSH tunneling if you were extremely concerned. Wouldn't that be good enough?
-
If security is a dominant concern, you could build everything using LoRa, which is inherently more secure.
Anyhow, I use wi-fi on my laptop, and I don't lose sleep over it. Should I? I mean one could always use SSH tunneling if you were extremely concerned. Wouldn't that be good enough?
@NeverDie your laptop is not moving the metal part in your door lock (in case you have remote control of your door lock). But more importantly, I would not like to have any yokel with a laptop drive by and be able to interfere with my nodes. And as I understand it, LoRa heavily throttles communication and I don't see how it is more secure.
-
Well,
- Lora is spread spectrum, and it can operate below the noise floor, so it's harder to even detect it. LoRa can demodulate signals that are 20dB below the noise floor.
- Likewise, it's more resistant to jamming.
- I don't think some yokel will drive by with anything capable of messing with it, because he won't know you have it in the first place.
I have z-wave that I installed way back when, and that's far more hackable by a black hat than any of this stuff. Like you say, it's all relative. For all I know some foreign government could unleash a new type of stuxnet designed to criple esp8266's, no matter what the collateral damage, so I can't say the risk is zero. I just think it's vanishingly small.
-
Well,
- Lora is spread spectrum, and it can operate below the noise floor, so it's harder to even detect it. LoRa can demodulate signals that are 20dB below the noise floor.
- Likewise, it's more resistant to jamming.
- I don't think some yokel will drive by with anything capable of messing with it, because he won't know you have it in the first place.
I have z-wave that I installed way back when, and that's far more hackable by a black hat than any of this stuff. Like you say, it's all relative. For all I know some foreign government could unleash a new type of stuxnet designed to criple esp8266's, no matter what the collateral damage, so I can't say the risk is zero. I just think it's vanishingly small.