0

M4 vs ESP32-S2 and IDE Considerations for Multi Sensor Auto
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

M4 vs ESP32-S2 and IDE Considerations for Multi Sensor Auto

by Kit101 on Wed Jan 13, 2021 5:41 pm

Hello all,

I am part way through a fairy in involved (and definitely over the top) data collection and automation system for my greenhouse. I started here: viewtopic.php?f=19&t=173977 but have since moved onto questions relating to circuit python, chips and IDEs etc. I want to avoid using a pi etc, I'd prefer a device that stores the scrip and relays data back to a PC or cloud.

My question is whether you think the M4 or ESP32 is best suited (or perhaps a something else), for a project that is written in Python and requires around 10 different sensors, their relevant libraries, and several outputs for relay control etc, as well as relaying information over USB or potentially Wi-Fi.

I've been told that the M4 is best suited for Python "for the memory capacity. Python has a lot of overhead and it is easy to run out of memory when loading multiple libraries." Also, while the ESP32 has more memory on paper, room is taken up with the Ethernet stack.

Would love to hear your suggestions on this or what boards you would recommend. Should I re-write in C++ and use Arduino IDE? (that would require learning C++ first..)

So far I am leaning towards the Metro Grand central M4 or the Metro ESP32-S2 with CircuitPython.

Many thanks,
Pete

Kit101
 
Posts: 24
Joined: Sat Mar 21, 2020 6:30 am

Re: M4 vs ESP32-S2 and IDE Considerations for Multi Sensor

by tannewt on Wed Jan 13, 2021 7:37 pm

I'd suggest the ESP32-S2. It's got significantly more memory than any M4 and native WiFi.

tannewt
 
Posts: 2034
Joined: Thu Oct 06, 2016 8:48 pm

Re: M4 vs ESP32-S2 and IDE Considerations for Multi Sensor

by Kit101 on Thu Jan 14, 2021 9:31 am

tannewt wrote:I'd suggest the ESP32-S2. It's got significantly more memory than any M4 and native WiFi.


I've just read through the specs and guides and it does appear to be able to do what I need, thanks. If I'm using circuitPython, am I limited to standard python and adafruit libraries? My script uses a few others such as the Google APIs, TKinter etc. Is it as simple as copying the libraries onto the board?

Thanks

Kit101
 
Posts: 24
Joined: Sat Mar 21, 2020 6:30 am

Re: M4 vs ESP32-S2 and IDE Considerations for Multi Sensor

by tannewt on Thu Jan 14, 2021 4:29 pm

Yes, you will be limited by the subset of Python that CircuitPython can run. Normal Python libraries do not "just work" on CircuitPython usually because they use much more RAM than an embedded system has. If you have existing Python libraries you want to use, then I'd suggest using a raspberry pi instead with regular Python instead.

tannewt
 
Posts: 2034
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.