WiFi MQTTGateway
-
@LuckyFIA
A commercial solution without the source would not a be real solution for me... -
@Timurufa
Have you found a solution?On the ESP8266 you can run NodeMCU which supports MQTT. It should be quite simple to develop a lua-script on the ESP8266, which would act as gateway between a Mysensors-Serial-Gateway and MQTT.
-
The Arduino port for ESP8266 (https://github.com/esp8266/Arduino) has made major progress over the last months.
It should be relatively easy to get MySensors running on ESP8266 Arduino and either bridge the serial protocol or run an MQTT broker/client on it. -
I was playing with NodeMCU on the ESP8266. With lua-script I could send and recieve MQTT messages via serial port to mosquitto.
Plan a: modify http://forum.mysensors.org/topic/524/mqtt-client-gateway/27
- remove pubsubclient
- remove ethernet support
- use serial communication to the ESP8266 to send and recieve MQTT messages
- write lua startup scripts for ESP8266
Plan b: use the original serial gateway sketch on the arduino and implement the logic on the ESP8266 with https://github.com/esp8266/Arduino. As pubsubclient is working on the ESP8266, the mqtt client gateway sketch should be easy portable to the ESP8266.
Please vote for plan a or b. :smile:
-
I was thinking about doing same thing, but during summer. I have no time for moment. And don't know if I will success. What I think:
- Luckyfia idea is interesting. I have done a small board to plug Huzzah8266 with atsha+rfm69+nrf but it is not tested : https://github.com/scalz/MySensors-HW/tree/master/MysensorsGW_huzzah (I need to add a power connector)
- I think a MQTT client GW would be interesting because we could let Mosquitto manage. But a MQTT Broker GW is interesting too of course.
- for porting, I know that souliss have already done some work to implement some libs (radio...) on esp. Maybe it could help...
- I would prefer connect rf module with spi to esp like LuckyFia did . Maybe it is in my head, but I think maybe comm would be faster and better managed...But I think it is much more work.
A or B??? very similar, but maybe B is cleaner. I don't know.
It is very interesting project. Maybe I am wrong but with MQTT we could have easily multi GW with multi radio type in same network (of course if GW is MQTT client).
-
I was thinking about doing same thing, but during summer. I have no time for moment. And don't know if I will success. What I think:
- Luckyfia idea is interesting. I have done a small board to plug Huzzah8266 with atsha+rfm69+nrf but it is not tested : https://github.com/scalz/MySensors-HW/tree/master/MysensorsGW_huzzah (I need to add a power connector)
- I think a MQTT client GW would be interesting because we could let Mosquitto manage. But a MQTT Broker GW is interesting too of course.
- for porting, I know that souliss have already done some work to implement some libs (radio...) on esp. Maybe it could help...
- I would prefer connect rf module with spi to esp like LuckyFia did . Maybe it is in my head, but I think maybe comm would be faster and better managed...But I think it is much more work.
A or B??? very similar, but maybe B is cleaner. I don't know.
It is very interesting project. Maybe I am wrong but with MQTT we could have easily multi GW with multi radio type in same network (of course if GW is MQTT client).
@scalz said:
I...
It is very interesting project. Maybe I am wrong but with MQTT we could have easily multi GW with multi radio type in same network (of course if GW is MQTT client).You are not wrong. MQTT is the integration hub in my setup and I have multiple sensors/actors:
- mysensors NRF24L01+
- mysensors RFM69 (not yet tested)
- netatmo
- homematic (with homegear)
- FritzBox telephony
- router (Edgerouter, to disable/enable internet for specific IPs)
- pushover
- OpenHab
'Wiring' between the different systems is done with node-red.
Porting the whole library to ESP8266 is to much work for me. :smiley:
-
nice setup. I use jeedom (I like it, it is very powerful and compatible with lot of things too) and sure node-red is a good addition to controllers, for some tasks or it can help to dev some plugins I think.
for esp8266, I don't know very well esp yet, but I was software developer, so it's just a question of time I think. And you are right, it needs lot of work. Too bad LuckyFia has not shared it.But we will get same thing I hope.
-
I was playing with NodeMCU on the ESP8266. With lua-script I could send and recieve MQTT messages via serial port to mosquitto.
Plan a: modify http://forum.mysensors.org/topic/524/mqtt-client-gateway/27
- remove pubsubclient
- remove ethernet support
- use serial communication to the ESP8266 to send and recieve MQTT messages
- write lua startup scripts for ESP8266
Plan b: use the original serial gateway sketch on the arduino and implement the logic on the ESP8266 with https://github.com/esp8266/Arduino. As pubsubclient is working on the ESP8266, the mqtt client gateway sketch should be easy portable to the ESP8266.
Please vote for plan a or b. :smile:
-
Managed to run MySensors on ESP8266 (RF24 connected to HSPI of ESP8266): I'm using the dev branch with some nasty hacks here and there - but so far so good. Tested RepeaterNode and SerialGateway sketch - both working. Currently testing core functionality. PR to be prepared.
-
Managed to run MySensors on ESP8266 (RF24 connected to HSPI of ESP8266): I'm using the dev branch with some nasty hacks here and there - but so far so good. Tested RepeaterNode and SerialGateway sketch - both working. Currently testing core functionality. PR to be prepared.
-
wow. it is a good news. I'll follow your work for sure.
thank you for sharing. there are smart guys here I think. it is great :smiley: -
Managed to run MySensors on ESP8266 (RF24 connected to HSPI of ESP8266): I'm using the dev branch with some nasty hacks here and there - but so far so good. Tested RepeaterNode and SerialGateway sketch - both working. Currently testing core functionality. PR to be prepared.
Great to hear you're making progress!
Not sure it will help you, but there is some ongoing work in this branch that might be interesting for you:
https://github.com/mysensors/Arduino/tree/gateway-refactoring/libraries/MySensors
This branch allows the gateway node to be a sensor as well and an embryo for cleaning up the gateway transport and protocol layers.
Currently only support serial and ethernet (as client) but I guess it could be helpful when running on the esp as well. -
Managed to run MySensors on ESP8266 (RF24 connected to HSPI of ESP8266): I'm using the dev branch with some nasty hacks here and there - but so far so good. Tested RepeaterNode and SerialGateway sketch - both working. Currently testing core functionality. PR to be prepared.