Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

PICO W // MicroPython // MQTT TLS problems

K
kll Posted 6 months agoHardware
i have a PICO W project that works under
MicroPython 1.23.0
but not in newer versions
micropython.org/download/RPI_PICO_W/
so i asked Twitter Friends
and now filed a ISSUE
github.com/micropython/micropython/issues/16792


but that is not all the story:

actually i was there already when i used CircuitPython
and switch to MicroPython for that reason



even more, while using PICO W and MicroPython 1.23
i have instability, looks like possibly socket reason also:
after some hours of reporting ( publishing ) to HIVEMQ TLS
it stops



now an other ISSUE, what i actually can not report as i ( have to ) use a OLD MP version,
is that i can start main.py from THONNY
( and even close THONNY and it runs on )
but when i plug it into a charger IT NOT START

this is what i want to dig deeper here:

A: minimal version


i make a minimal version just BLINK
( boot.py, main.py, secrets.py )
and that boots on power ON ( charger )
( and i see it blink )
using boot .py to
* enable WIFI login
* on fix IP
* even enable WEBREPL ( ok that needs add
webrepl_cfg.py
content one line:
PASS = ''
( means NO password as i had problems to use a password from Android )

MPY: soft reboot
www try connect WIFI XXXXXX
www ('192.168.1.215', '255.255.255.0', '192.168.1.1', '8.8.8.8')
WebREPL server started on http://192.168.1.215:8266/
Started webrepl in normal mode





so here i am try to find where the

auto boot on power up


fails, by including code from original project
what was already a "one file tutorial project"
see my WP BLOG

compared to the big project with many .py modules
also featuring webserver for LOCAL OPERATION
while also remote MQTT HIVEMQ TLS can operate ( from linux commandline mosquitto, Node Red, win 10 MQTT explorer )

BLOG Archive



B: build in the ASYNC program structure


with JOB
1 sec print '.'
1 sec led.toggle()
1 min print text

test WEBREPL while THONNY open OK
THONNY CLOSE
powercycle : BLINK works
WEBREPL does not open?




C: full MAIN.PY


with
1 sec led.toggle()

test WEBREPL while THONNY open OK
THONNY CLOSE
powercycle : BLINK NOT work



and try to backwards by COMMENT out code

so yes, when i take out all MQTT code
THONNY CLOSE
powercycle : BLINK works

when i start with MQTT setup
and use
mqtt_client.connect()
THONNY CLOSE
powercycle : BLINK NOT work


for confirm test power on
* i disable ( the not working WEBREPL ) to ? free sockets? NO
* i test MQTT NO TLS ( local RPI Mosquitto ) NO
* * add try MicroPython v1.25.0-preview.304.g1034b1755 on 2025-02-19; Raspberry Pi Pico W with RP2040
NO


now i know but i can not do anything about it
that means i have 2 good reasons to PIT MicroPython
* can not upgrade after 1.23 when want use MQTT TLS
* can not use in production ( power from charger without THONNY main.py start )