Emulating a Python REPL

You have to be very careful with using the different sleep modes on the ESP32 and with MicroPython. same goes for using the soft reset. Memory will get cleared but with some of them the hardware doesn’t get reset so you end up with undefined behavior or core panics. I think that light sleep is OK to use because it keeps power to everything. Deep sleep you are going to want to delete and destroy all LVGL objects and also the display and bus drivers, frame buffers all that kind of stuff. Even tho it does keep some power to the memory I do not believe it will keep the hardware working properly in a deep sleep.

1 Like

Also I think that light sleep is the only sleep mode that allows awaking by touch. But maybe what’s referred to in the ESP32 reference manual is pulling one of the GPIOs declared as touch.

No priority, though. ATM it’s more like a research project exploring what one can do with such a display module. I may as well recycle it as a weather station :rofl: :rofl: :rofl:

Thank you for the insight into your personal life - let me give some too. I studied EE in the early 80’s and I’m a child of the generation Apollo & pocket calculators (my first one was a programmable TI SR-56, then the HP-41 that I mentioned). After 30 years in IT (5 as technical editor and 25 in Linux / data center consulting), working for the likes of IBM, Red Hat, or SUSE, I’m now in an early retirement program by my former employer Deutsche Telekom where I did technical consulting in the cloud branch first, then data privacy and application security in the cloud. In fall 2021, I restarted studying, this time at Technical University of Munich - first BSc Physics but I noticed soon that Theoretical Physics is not my turf (once engineer, always engineer I suppose), so I switched to MSc EE last year and did mostly RF and microwave stuff so far (including a module in numerical computing) but will slightly move towards embedded and IoT stuff I think. On top, I keep attending master courses in Astrophysics at TUM, and hacking gadgets.

In the old days I did mostly Perl and C (I set up my first Linux machine in spring 1993, and never let go) and refused to switch to Python for a very long time. But since Python is ubiquitous in Physics and AI, well, there we go. In EE, most people rather use Matlab so yes. But I prefer Python. When it comes to embedded, I eventually came across Circuitpython, but as I mentioned, I began to see its limits, and this is now my first actual Micropython project.

I started programming because I wanted a device that would turn my gas fireplaces off. Nothing existed so I set out on a mission to build something to do it. That lead me to the Arduino and C/C++ programming. I have a background in computers being A+ N+ S+ L+ CNA MCSE certified (just to name a few). At the age of 14 I was spending my time after school working for Pratt & Whitney. I worked in what was called the “SIM” center where I got exposure to all kinds of cutting edge technology. That is where I first got to play around with a 3D printer. This printer was HUGE. Entire jet engines were made from plastic. This is what I specifically did was Solids Modeling on a Sun/Spark workstation with 250 GB of RAM. This was in 1990 so a 250 GB of memory was a monster amount. Graduated high school at the age of 16 and enlisted in the Army. 2 years active and 4 years reserve. I got into working on the electrical systems on vehicles. I worked with a few companies helping to develop interface modules that would communicate with a vehicles computer. Bypassing the transponder systems things of that nature. in my late 20’s I started working at a campground my parent bought. I did that until I was 32. The campground got sold when I was 32 and at that point I threw a dart at a map (literally) put my tools and tool box in a 5 x 10 trailer and packed what I could around it. Threw everything else in the garbage or gave it away and I moved to Colorado with my wife. No jobs, no place to live, and didn’t have all that much money, maybe enough to live for 2 months… Just said screw it we’ll figure it out when we get there.

1 Like

The one thing I like most about python is the ability to access C code from it. You can also compile extension modules that are written in C. The beauty of Python is it being a runtime language so no compiling needing to be done, well not in the traditional sense anyway.

The biggest downside to python is it’s execution time. It’s about 200 times slower than C code. But that is easily fixed using Cython which will read Python code and generate C code that can be compiled into an extension module. So you get the fast development and once done you can compile the code to get the speed.

1 Like