While playing with my Pico Pi I was trying to get the Wifi to work, the code worked while being powered by USB but as soon as I only connected it to 3v batterys (X2 AA 1.5v) it just made a humming sound and I wasnt sure what what going on.
Spoiler alert, after using 4.5v (3X AA 1.5V) batterys it worked so my assumption is the wifi module needs more power 🤷
These are just some of the steps I followed and will build upon these (and update here) as I learn.
LED Communication / Boot Sequence
I added a boot sequence
to the start-up by quickly flashing the LED on/off 3 times. The value here was I knew my code was executing and could debug from there.
1 | async def boot_led(): |
Text Logging
Im not a MicroPython expert and it does look to have existing in logging modules however I like to do things a little more manual first and then once I understand the process use a module. The value I feel is I then 1. appreciate what is abstracted away from me and 2. understand the actual problem its solving.
1 | import time |
https://github.com/carlpaton/PicoPiHoon/blob/main/Pi%20Pico%20W/SMARSCar/mylog.py#L3
I then added a except
in my main code
1 | try: |
https://github.com/carlpaton/PicoPiHoon/blob/main/Pi%20Pico%20W/SMARSCar/main.py#L22
This gave me basic logging like the below. Ideally I’d like to include a stack strace but currently it wasnt needed.
1 | YYYY-MM-DD hh:ss:sss - The error message that was thrown |
Hardward Debug
The Pico has hardward debug ability using debug pins. I figured out my problem with the steps above so this kind of debug is something I will probably explore later. The video linked below shows how to do this with another Pico Pi (Warning it look complicated :D)