Post
by vlasoveqn » Wed Apr 21, 2021 7:49 pm
Hello everyone, first post here!
Like the OP, I also am having similar trouble with 'network.WLAN(network.STA_IF)'.
First, a moment of context/background: I first used this version of MicroPython sometime in mid-2019, but rapidly decided to switch to the LoBo fork due to restrictions on the use &/or size of SPI ROM and SPI RAM. Since then, I've been developing ESP32 firmware with that flavor of fork, but recently switched back to the main fork (terminology?) because LoBo was not actively being developed, did not (truly) support BLE, and looked as if the fork had been abandoned.
So, it took just a bit of effort to reinstall ESP-IDF, the xtensa toolchain, etc. (on Ubuntu Linux), but now have everything working properly. And, boy, do I like the new ease of firmware building!
Anyway, I'm very impressed by the breadth of support for most ESP32 internal hardware. HOWEVER, in the process of beginning to port my modules, I encountered the dreaded Guru Meditation Error -- when instantiating a network.WLAN object! MicroPython rebooting occurs regardless of whether the argument of network.WLAN is network.STA_IF or network.AP_IF. I have also temporarily removed all my custom modules, so there's no possibility that any custom additions to the firmware might be causing this issue. The behavior persists. This is extremely problematic, because I was planning on using two of the ESP32 units together to test BLE integration (one as GATT client, one as GATT server)--but this requires me to interact with one unit via telnet over WiFi, and now I can't do that despite BlueTooth working (!!). I'm also using a custom PCB that doesn't use USB, Ethernet, etc. and it's only easy to use direct serial communication with one unit at a time (I have to use a specially made jig, of which I only have one).
For the record, I'm using ESP-IDF v4.1.1, CPython 3.9.2 on Ubuntu, and a fork of the master MicroPython branch from git. Before you ask or assume anything, I'm definitely not a professional programmer, and have never used git until recently--I'm still stuck in the Subversion world of 20 years ago (it still works now, for local work!!). If anyone needs information about which MicroPython branch I'm using, as of which date, you'll have to suggest the specific git commands to get that info... until I get more comfortable with it.
As I have never done any language development of MicroPython--and don't plan on doing any in the near future--it's a bit tricky to troubleshoot any cause of the 'kernel panic' phenomena by looking at C code, as I'm not a C expert and at this time don't know much about MicroPython interpreter innards, operation, or implementation in C. So, if anyone wants to jump in and help me here, I would _greatly_ appreciate it! Has anyone else other than the OP encountered this behavior?
Thanks!
By the way, the OP seemingly solved the problem by erasing the flash and reflashing, I think, but this did not work for me.