homieiot / homie-esp8266

💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 308 forks source link

.subscribe() does not register #116

Closed lighthousebulb closed 8 years ago

lighthousebulb commented 8 years ago

This got me pretty frustrated yesterday. But it seems that none of my nodes will register properly. The .subscribe()-function does not work. This is really wired, because I wrote sketches before and it just worked. Now even the example stopped working.

I used a up to date platform-io environment and even tried it with a up to date Adruino-IDE. After some frustrating hours I tried the LightOnOff.ino-Example.

The homie-node comes online and sends it initial Device properties. But the $nodes-property keeps empty. If I try to set the light „on“ I just get something like “Node xxx not registered” on the serial line.

marvinroger commented 8 years ago

Are you using the v1.5.0?

lighthousebulb commented 8 years ago

Yes! v1.5.0

marvinroger commented 8 years ago

So you say it was working before... What have you done in this timelapse? Maybe you've updated the esp8266/Arduino version? Which version by the way, 2.2.0, 2.3.0?

peterhanzlik commented 8 years ago

I had the same problem until I noticed that I was missing: Homie.registerNode(lightNode);. In v1.5.0 it is mandatory, in v2.0.0 it is not used. I mixed up examples from v2 and tried to use them in v1.5. Perhaps the same happened in your case as well.

marvinroger commented 8 years ago

Oh yes, this might be a problem. You have to use the docs and examples contained in your release, not in the Git development version (unless you want to test cutting edge features, not stable... at all!).

lighthousebulb commented 8 years ago

Awesome! Yes, that was the problem! @peterhanzlik good hint