Openhab, Mosquitto, ESP-8266 12E wifi gateway
I want to setup openhab using my esp-8266 12E as gateway as described in http://forum.mysensors.org/topic/1870/esp8266-wifi-gateway-port-for-mysensors. May someone help me to accomplish this task?
I am searching on google since a week. I have installed openhab and mosquitto on my raspberry pi. ESP-8266 gateway is also ready. Openhab Demo is also working.
As far as I understand, I have to add following lines to openhab.cfg file;
192.168.0.31 is the static address I have assigned to my esp-8266 12E through router. 5003 is the port defined in Esp8266Gateway sketch.
Please help me if I have something missing in my setup.
I have few confusions, How openhab will understand the information sent by sensor node? Will it assign ID to my sensors or I have to define the id in gw.begin()? If so then give me an example for this purpose.
@vickey You need either a gateway with MQTT support, or a separate piece of software to bridge the MySensors-to-MQTT conversion, running on e.g. the Raspberry Pi.
A WiFi gateway supporting MQTT currently does not exist (only a wired ethernet version), so your best bet is running the bridge on the Raspberry Pi, or switch to the ethernet gateway.
I wrote such a bridge, which you can find here. It is not very well documented, but search this forum as other people have used it in the past with succes.
I use it (also in combination with the WiFi gateway) as MQTT bridge.
@Yveaux, How to implement your bridge? Is there any wiki stuff related to your bridge?
Please stop pm'ing me that you need help -- I have a life you know
@Yveaux. I tried a lot but could not found any way how to use your bridge. How to run this bridge on rpi? May you please give me hints?
I gave up trying to set the openhab.. mosquitto and all that on my Rpi, honestly I am very new on the rpi and linux.. that is fact ..but other side there is not easy guide to follow in order to install successfully the openhab + mosquitto +my sensors. I have spent a sum of 12 hours without getting to much valuable. Instead I have decided to go to Domotic Z I have followed that guide https://www.domoticz.com/wiki/Domoticz_RaspberryPi_SD_Image , it took me 1 hour to set up everything and now I have fully working my ESP8266 gateway sending my sensors data to domoticZ on my RPI
@luisgcu I am also new to this kind of stuff. I tried Domoticz but failed to get my ESP8266 gateway working. May you share your setup? Did you use Mysensors library or lua scripts?
@vikey , I know your pain.. I passed that way.. I am kind on the mid way out of the bush.. still lot of things that I am not understand very well.. ie how to use the new my sensor library.. this need a lot time reading and testing..
I am going to explain what I did to get what i have so far.
1- Install the arduino core for the esp8266 (read all the detail on how add the esp8266 core to arduino) Download link
2- I am using Mysensor v1.5 you may download the whole thing from here install the library as usual "add zip library" .
3-Next step is connect your ESP8266 to your PC and using arduino ide select in tools-->boards -->Generic ESP8266 module.
4- Next step is to open the sketch ESp8266gateway : File-->examples-->Mysensors-->Esp8266gateway.
5- Inside the code you need to edit your wifi name and password.
6-I have added to that sketch a line to put a fixed ip adress to my ESP8266 . The new My sensor library do not need all that.. but did have time to try once again to get it working..
so I place le line of code below on the Setup(); after the hw_init();
WiFi.config(IPAddress(192,168,xx,xx), IPAddress(192,168,x,x), IPAddress(255,255,255,0));
7-Next step is upload the code to the ESP8266, you may connect to the ESP8266 using the serial monitor and check if the module is connected to your wifi
8- use any example within my sensor library examples, the one work perfect is the Dallastemperatura Sensor example here
This is what I have done already but failed.
I get following error in my ESP-8266 Gateway debug
ESP8266 MySensors Gateway Connecting to Ahmed .............Connected! IP: 192.168.0.31 ctx: cont sp: 3ffebcb0 end: 3ffec010 offset: 01b0 >>>stack>>> 3ffebe60: 3ffea8af 000000ff 3ffea940 40205384 3ffebe70: 3ffea8af 00000030 3ffea940 402053d0 3ffebe80: a8e1fc0a 000000a8 3ffea940 40205587 3ffebe90: 3ffea8af 0000000a 3ffea940 40204dd7 3ffebea0: 0000001f ffffffff 40201c55 0000000a 3ffebeb0: 000000ff 3ffea8a8 3ffea8af 40203c7d 3ffebec0: 00000000 ffdfffff ffffffff 3fffc6fc 3ffebed0: 00000001 3ffeaff0 00000000 3fffdc20 3ffebee0: 3ffec03c 00000030 3ffec070 4020b6e1 3ffebef0: 3ffebf2e 40243cbc 3fff1e58 0000000a 3ffebf00: 000000ff 00000000 0000000d 4020335e 3ffebf10: 40217e00 3ffead34 3ffe9390 3ffe93a4 3ffebf20: 00000065 3ffea940 3ffebf65 40203379 3ffebf30: 00000000 3ffea940 3ffea94a 0000000a 3ffebf40: 000000ff 00000000 3ffea8a8 40203f38 3ffebf50: 0000001d 3ffea8af 3ffea940 402053bc 3ffebf60: 3ffe92f8 a8e1fc0a 3ffea940 00000001 3ffebf70: 00000001 00000000 3ffea8a8 402040b0 3ffebf80: 00000001 0000000a 3ffea8a8 4020422b 3ffebf90: 00000000 0000000a 3ffea8a8 40204381 3ffebfa0: 0000007f 3ffec03c 40201cac 3ffeaff0 3ffebfb0: 40202320 00000001 0000000a 40201d4f 3ffebfc0: 1f00a8c0 00ffffff 0100a8c0 3ffec03c 3ffebfd0: 3ffe9328 3ffead34 3ffec070 402026ef 3ffebfe0: 3ffe98a8 1f00a8c0 00000000 00000000 3ffebff0: 3fffdc20 00000000 3ffec034 40201d1f 3ffec000: 00000000 00000000 3ffeaff0 40100398 <<<stack<<< ets Jan 8 2013,rst cause:1, boot mode:(3,3) load 0x4010f000, len 1264, room 16 tail 0 chksum 0x42 csum 0x42 ~ld
And how did you configure domoticz? Did you use "Mysensors gateway with lan interface" type in hardware section or anything else? And may you send me the library files you used (I mean that complete zip which worked for you).