Hey community, hope everyone is creating something awesome with our beloved MicroPython+NodeMCU
Let's cut to the chase - I am successfully able to PUBLISH and SUBSCRIBE to messages on Adafruit and it just works. The real problem is that when I try to merge these two-independent programs into one, everything gets destroyed.
1. The broker gets stuck and just sits there like a fossil.
2. Hardly ever my NodeMCU publishes or responds to a subscribed message and that too in multiple resets of the board.
Please help me out here. I am in PAIN
PUBLISH & SUBSCRIBE in the same program
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: PUBLISH & SUBSCRIBE in the same program
Maybe you can tell us a little more about your broker and your client program
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: PUBLISH & SUBSCRIBE in the same program
coincidentally, I just updated my github MQTT examples to support the lastest MicroPython and CircuitPython releases. I included an example on using Publish and Subscribe in the same file. Check out the file pubAndSub.py. It might have what you are looking for.
https://github.com/MikeTeachman/micropy ... tt-esp8266
https://github.com/MikeTeachman/micropy ... tt-esp8266