author3

Foghorn1961

Inbox View Profile
3CommentsSouthpark, TX
What, I say what more do you need to know about a southern gentle-rooster?
  • Hacking a Sonoff to Work With Home-Assistant and MQTT

    El Ape, I made a change in the code to call client.loop(); inside of the loop() function like the example on pubsubclient. It works nicely now. I can turn the load on and off and receive status from another client on android. I wouldn't think I would need to call client loop for every program loop and I don't understand how the keep alive timer works. Will dig some more. Almost to China. Maybe when I get there I'll find those ESP8266 modules I ordered from Aliexpress 3 weeks ago....

    View Instructable »
  • Hacking a Sonoff to Work With Home-Assistant and MQTT

    Thanks for the quick response El Ape. I tried 2.4.0-rc2 and it worked the same as 2.3.0. I am using pubsubclient 2.6.0 already. I tried Flashmode DIO and it wont respond after boot. When I switch back to DOUT I am back to it starting ok then getting a socket error on the MQTT server. At first I thought it was crashing but that was a bad assumption. I now see that it is just dropping the connection to the mqtt server. On the server side (Mosquitto server running on a RPI3) it says:Client xxx has exceeded timeout, disconnecting.Socket error on client xxx disconnecting.After a few minutes more the sonoff client showsINFO: Attempting MQTT connection.....ERROR: failed, rc=-2DEBUG: try again in 5 seconds. On the next attempt it connects to the server successfully again, then looses the connec...

    see more »

    Thanks for the quick response El Ape. I tried 2.4.0-rc2 and it worked the same as 2.3.0. I am using pubsubclient 2.6.0 already. I tried Flashmode DIO and it wont respond after boot. When I switch back to DOUT I am back to it starting ok then getting a socket error on the MQTT server. At first I thought it was crashing but that was a bad assumption. I now see that it is just dropping the connection to the mqtt server. On the server side (Mosquitto server running on a RPI3) it says:Client xxx has exceeded timeout, disconnecting.Socket error on client xxx disconnecting.After a few minutes more the sonoff client showsINFO: Attempting MQTT connection.....ERROR: failed, rc=-2DEBUG: try again in 5 seconds. On the next attempt it connects to the server successfully again, then looses the connection again.I will keep digging deeper and try to better understand what the MQTT server expects. Could just be a server setting? When I was a kid they told me if I dig deep enough I will end up in China. Now it appears to be true after all:)

    View Instructable »