https://github.com/myraspberry/pico_w_mqtt_pub_sub
subscription loop SLOW
https://github.com/myraspberry/pico_w_mqtt_pub_sub
Last synced: about 1 month ago
JSON representation
subscription loop SLOW
- Host: GitHub
- URL: https://github.com/myraspberry/pico_w_mqtt_pub_sub
- Owner: MyRaspberry
- Created: 2023-12-22T08:07:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-22T23:13:01.000Z (over 2 years ago)
- Last Synced: 2025-01-17T23:31:45.186Z (over 1 year ago)
- Language: Python
- Size: 959 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/issues/195)
______________
# 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 )

# PICO_W MU Editor REPL
topic/set commands come through if there is a 'mqtt_client.loop()'

here show the problematic timing

______________
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**

if use it without timeout parameter:

______________
> more old info to this
[old TLS ISSUE](https://github.com/adafruit/circuitpython/issues/7606)
[work BLOG: upgrade to CP829 in HOLD for timing and memory issues](http://kll.byethost7.com/kllfusion01/infusions/articles/articles.php?article_id=225)
______________