-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting trapped in publish? #81
Comments
please include minimal code that reliably demonstrates the issue |
Hello, I also seem to have this issue. After an MQTT publish the code seems to hang with no error. This can be within a few hours upto a day or two. #NTP #MQTT #Binary to HEX #Continuity try: If you have a GPIO, its not a bad idea to connect it to the RESET pinreset_pin = DigitalInOut(board.IO6) MQTT TopicUse this topic if you'd like to connect to a standard MQTT brokermqtt_topic = "LOG/"+ ID +"/DATA" Get our username, key and desired timezoneaio_username = secrets["aio_username"] print("MAC ID addr:", ID) print("Connecting to %s"%secrets["ssid"]) radio = wifi.radio CodeDefine callback methods which are called when events occurpylint: disable=unused-argument, redefined-outer-namedef connect(mqtt_client, userdata, flags, rc): def disconnect(mqtt_client, userdata, rc): def subscribe(mqtt_client, userdata, topic, granted_qos): def unsubscribe(mqtt_client, userdata, topic, pid): def publish(mqtt_client, userdata, topic, pid): def message(client, topic, message): Create a socket poolpool = socketpool.SocketPool(wifi.radio) Set up a MiniMQTT Clientmqtt_client = MQTT.MQTT( Connect callback handlers to mqtt_clientmqtt_client.on_connect = connect Create library object, use 'slow' 100KHz frequency!HTi2c = board.I2C() Connect to a PM2.5 sensor over I2Cpm25 = PM25_I2C(PMi2c, reset_pin) print("Found PM2.5 sensor, reading data...") while True:
` |
The code in #81 (comment) is in dire need of reformatting - use the triple backtick to include larger chunks of code. |
When using a MatrixPortal with CircuitPython, “publish” will intermittently hang indefinitely without returning any error messages rendering the M4 unresponsive.
This is documented in Adafruit Forums.
The text was updated successfully, but these errors were encountered: