Skip to content

MyRaspberry/PICO_W_MQTT_pub_sub

Repository files navigation

PICO_W_MQTT_pub_sub

subscription loop SLOW

on a PICO W with CP829

a minimal MQTT

  • publish every minute
  • subscribe ( and loop ) to remote commands to drive the board LED : MQTT BLINKY

PROBLEM: the 'mqtt_client.loop()' waits over 1 second and blocks the MAIN timer loop


test results: how many seconds need a counter to 1.000.000

# JOB1M : 14.8 sec
# JOB1M + JOB1min : 26.5 sec
# JOB1M + JOB1min + JOB1sec : 38.1 sec
# JOB1M + JOB1min + JOB1sec + JOBt : 56.2 sec
# and enable in JOB1sec mqtt_client.loop(timeout=0.01) : 1524.1 sec

but remote operation ( of board LED ) works

open ISSUE


on RPI4 is a 'mosquitto broker' running

use some alias to show the feed from the PICO_W and to drive commands ( pub to topic/set ) Screenshot RPI4

PICO_W MU Editor REPL

topic/set commands come through if there is a 'mqtt_client.loop()' Screenshot PICO_W IDE here show the problematic timing Screenshot PICO_W_IDE show time


try on TLS again, not work CP829,


nuke flash CP810 timing mqtt_client.loop() 0.001xxx sec 1Mloop 59.1 sec

TLS also not work, but copy in adafruit_minimqtt from 21.12.2022 OK
( a trick i used back then and found the files in my backup )

make set of new alias mqttxubR in RPI4 and show/operate REMOTE broker

Screenshot REMOTE broker TLS

if use it without timeout parameter: Screenshot PICO_W_IDE show time


more old info to this

old TLS ISSUE

work BLOG: upgrade to CP829 in HOLD for timing and memory issues


About

subscription loop SLOW

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages