r/MicroPythonDev • u/wo8e • Aug 11 '24
Wifi not connecting if I'm not connected to the terminal?
Just like it says on the tin, as my first micropython program I wrote an mqtt controlled relay. It worked fine until I disconnected and tried to run it in a proper case. After some blinkenlight debugging, it seems to be getting hung up in the while not sta_if.isconnected(): loop.
As soon as I hook up serial and hit reset, it connects to the wifi like normal.
Any insight would be helpful, TIA.
EDIT: version is micropython_ESP32_GENERIC-20240602-v1.23.0.bin
1
Upvotes
2
u/wo8e Sep 17 '24
TL;DR: The real world is messy.
Update: Thanks for the pointers, I ended up finding a ground/neutral bond issue that was making it angry. As a bonus, we don't get zapped in the barn anymore - we attributed it to the fence pulser being a few feet away. I wonder if the stray currents from that were enough to impact consumption at the kWh meter.
2
u/niggendran69 Aug 11 '24
Did you save the code to the esp32 memory as main.py ??
1
u/WZab Aug 18 '24
I have one, maybe stupid question. Doesn't your "proper case" block the 2.4GHz WiFi signal?