more G-Labs products

Author Topic: Help with setting up MySensors MQTT  (Read 1378 times)

September 03, 2016, 02:04:27 AM
Read 1378 times

Orkspalter

  • *
  • Information
  • Newbie
  • Posts: 6
A long time homegenie forum lurker (knowing homegenie for about 3 years since buying a raspberry pi model B, installed it many times and gave up on it also many times because having no real HA hardware until i discovered MySensors back 4 months ago) wants to say Hello and making his first post :-)

After spending time with HomeAssitant (impressive interfacing options but lifeless UI) and try gettin into OpenHab (just too difficult) i decided to stay with HomeGenie because of the hardware features/integration like Eden board, an (ok, outdated, but thats ok as WP 8/10 has no future) WP8 App as i own a Lumia Phone and the nice looking Android HomeGenie Pro App which i would like to buy in the future if it wasn´t that pricey for controlling via tablet ;-)

The last 2 month i had a very frustrating time spending hours and hours with trial and error to get my homegenie setup running stable, trying to narrow problems down why things aren´t working .But there are so many variables and now i am at the point of frustration of making no real progress anymore in solving things and need help.

I changed power supplys on the raspberry and the relay board, switched from ethernet to WLAN and back, changed the OS from OSMC to Jessie and also tried different SD Card ending up with a brand new 64GB class10 card because of possible card corruption which the old class6 one had.
Still there are many problems with version r25 and i don´t know if that particular version is not the most stable one as i can´t compare other versions but  the Chrome Bug is pretty annoying as the UI won´t reload very often or ends up in "Module not available". The update manager isn´t working and i don´t know why, but the IP address port keeps changing from time to time from 80 to 8080, than to 8081 and i have to revert it back to 80.
Don´t get me wrong, WHEN Homegenie parttime is working for me i am really enjoying it and like it very much :-)...but there are very often moments of frustration when something isn´t working anymore which did work that wonderful  an hour before ...

OK, back to topic and my question:

For 2 weeks now i am trying to get MySensors working with HomeGenie .
I built the "MySensors ESP8266 MQTT" Gateway which is working fine, also built 5 sensors (Arduino Nanos, Relay Switch, RFID Door Lock with Relay, Motion Sensor with light level sensor and and a parking sensor with LED Ring, which is a distance sensors). All the sensors are working fine and are showing up in the Gateway serial monitor, sending MQTT messages on there topics. In Homegenie i activated the internal MQTT Broker Service and when activated, the Gateway serial Log shows MQTT connected so its working. As the client i installed CptJack MySensors via MQTT App (http://www.homegenie.it/forum/index.php?topic=758.0) pointing to the IP address of the internal broker (aka the homegenie IP ) with topic "#".
The Mysensors MQTT client is showing green light and "MQTT connected" but now the sensors should show up under modules or what point am i missing ?? Do i have to create virtual modules or maybe is the problem that the MQTT Mysensors app only has 3 sensors types in it which should get discovered (and non of my sensors that i built are that type of sensors definition) ??? I tried to add new sensor definitions but then the app wouldn´t compile any more and got errors.
Because Homegenie as a controller right now won´t recognizes my built sensors i had to give them node IDs manually in the sensors sketches so they show up in the gateway.

I came this long and i know there is only a little thing missing which i don´t get so maybe the MQTT/MySensors experienced members mvdarend, enterprised, cptjack or bkenobi could chime in and help me out ? :-)

Thanks
« Last Edit: September 05, 2016, 09:14:36 PM by Orkspalter »

September 05, 2016, 02:38:33 AM
Reply #1

Orkspalter

  • *
  • Information
  • Newbie
  • Posts: 6
MySensors ESP8266 MQTT Gateway Serial Log



¤pX¨CGH¬@>häÿ0;255;3;0;9;Starting gateway (RNNGE-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 7
cnt

connected with FRITZ!Box Fon WLAN 7270, channel 13
dhcp client start...
0;255;3;0;9;TSM:READY
f r0, scandone
.ip:192.168.XXX.XX,mask:255.255.255.0,gw:192.168.XXX.X
.IP: 192.168.XXX.XX
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
IP: 192.168.178.38
0;255;3;0;9;Attempting MQTT connection...
0;255;3;0;9;MQTT connected
0;255;3;0;9;TSP:MSG:READ 100-100-0 s=0,c=1,t=0,pt=7,l=5,sg=0:23.5
0;255;3;0;9;Sending message on topic: mygateway1-out/100/0/1/0/0
0;255;3;0;9;TSP:MSG:READ 100-100-0 s=0,c=1,t=0,pt=7,l=5,sg=0:23.7
0;255;3;0;9;Sending message on topic: mygateway1-out/100/0/1/0/0
0;255;3;0;9;TSP:MSG:READ 100-100-0 s=0,c=1,t=0,pt=7,l=5,sg=0:23.5
0;255;3;0;9;Sending message on topic: mygateway1-out/100/0/1/0/0
0;255;3;0;9;TSP:MSG:READ 100-100-0 s=0,c=1,t=0,pt=7,l=5,sg=0:23.3
0;255;3;0;9;Sending message on topic: mygateway1-out/100/0/1/0/0
pm open,type:2 0

September 05, 2016, 02:41:50 AM
Reply #2

Orkspalter

  • *
  • Information
  • Newbie
  • Posts: 6
Sensor LOG...for example MAX6675 high temperature sensor on Arduino Nano clone 


ëStarting sensor (RNNNA-, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=100)
TSM:FPAR
TSP:MSG:SEND 100-100-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSP:MSG:READ 0-0-100 s=255,c=3,t=8,pt=1,l=1,sg=0:0
TSP:MSG:FPAR RES (ID=0, dist=0)
TSP:MSG:PAR OK (ID=0, dist=1)
TSM:FPAR:OK
TSM:ID
TSM:CHKID:OK (ID=100)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-100 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
TSP:MSG:SEND 100-100-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
TSP:MSG:READ 0-0-100 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=ok:Max6675 Temp Sensor
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
TSP:MSG:SEND 100-100-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration...
TSP:MSG:SEND 100-100-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
TSP:MSG:READ 0-0-100 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=100, parent=0, distance=1, registration=1
Momentane Temperatur in Grad Celsius: 23.00
TSP:MSG:SEND 100-100-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:23.0
Momentane Temperatur in Grad Celsius: 23.75
TSP:MSG:SEND 100-100-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:23.8
Momentane Temperatur in Grad Celsius: 23.75

September 27, 2016, 01:50:56 PM
Reply #3

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
It's been a while since your post, if you're still interested in getting this to work, give a shout. I've adapted Cpt. Jacks code to support a few more devices.

(I'm still in the middle of moving house/renovating, so I'm not on the forums much lately).