Esp32 vs raspberry pi #2

Thread Starter

PureeTofu

Joined Aug 10, 2022
2
Having used both the rPi and the ESP32 I would recommend going with the rPi as it is a complete controller with lots of I/O to control things.

I recently completed a test stand built on a rPi that runs some high current relays while sensing 20 channels of current draw. What is cool is you can write and run the program all on the same computer.

While I also like the ESP32 I keep that to IOT things like the 4 channel RGBW controller that runs the under counter LEDs in my kitchen.
Is there a way to get a Raspberry Pi to emulate an ESP32?

I'd like to work on this project leveraging an existing Raspberry Pi 4 (4GB)
SwitchBot MQTT ESP32 Bridge (Home Assistant)
 

ag-123

Joined Apr 28, 2017
276
The difference is one has gigabytes of memory and storage, and a much faster processor (especially Pi 4).
The other is more about doing IO. as it has more IO pheriperials, ADC, uart, i2c, spi etc
These days there is also a new "competitor" to esp32 -> the pico W
https://www.raspberrypi.com/products/raspberry-pi-pico/
so normally, RPi runs the big memory hungry apps, esp32 or other microcontrollers host the sensors.
 

Thread Starter

PureeTofu

Joined Aug 10, 2022
2
The difference is one has gigabytes of memory and storage, and a much faster processor (especially Pi 4).
The other is more about doing IO. as it has more IO pheriperials, ADC, uart, i2c, spi etc
These days there is also a new "competitor" to esp32 -> the pico W
https://www.raspberrypi.com/products/raspberry-pi-pico/
so normally, RPi runs the big memory hungry apps, esp32 or other microcontrollers host the sensors.
I'm aware of the power differences and uses between the two.
However, I have four RPi4's sitting idle....zero ESP32's

So my question remains, is there a way to complete this ESP32 project using an RPi4?
 

Ya’akov

Joined Jan 27, 2019
9,170
The ESP32’s Xtensa architecture is completely different from the ARM achitecture of the RPi. Whole in theory you could write an emulator on the ARM for the Xtensa, the question is “why would you want to?”

You say you have RPis to use but unless your time is worth literally nothing to you the few dollars it would cost to get an ESP32 dev board are completely insignificant compared to the time you‘d have to spend to use an RPi as if it was one.

I can’t quite understand how you are picturing the relationship between the RPi and the ESP32 hardware. The CPU and peripherals of each are so disparate that except for the fact that they are both sorts of computers, and small, there is really nothing else to make them similar.

Can you expand on your thinking here?
 

ag-123

Joined Apr 28, 2017
276
I'm aware of the power differences and uses between the two.
However, I have four RPi4's sitting idle....zero ESP32's

So my question remains, is there a way to complete this ESP32 project using an RPi4?
just 2 cents, normally, the need of a particular peripheral would determine its use, e.g. if you need an ADC.
There are 2 ways to do it, you could get a ADS1115 16-bit, 860-SPS, 4-channel, delta-sigma ADC with PGA, oscillator, VREF, comparator and I2C
https://www.adafruit.com/product/1085
https://www.ti.com/product/ADS1115
^ this is pretty good with integrated PGA and it can interface with RPi over I2C. limited to 400 kbps I think, the I2C speeds.
or you could get a microcontroller with the ADC in it
so it could perhaps transmit over Wifi e.g. esp32 or perhaps usb
Raspberry Pico, STM32 and various other e.g. ARM based microcontrollers offer those peripherals (e.g. ADC), and some of them have USB device in it. that makes it 12 Mbps max throughput for USB full speed connections.
In practice, you would normally see less than 12 Mbps as USB is a shared bus and your keyboard, mouse etc would occupy slots for all that polling (by the host/ pc)
some smaller apps can possibly be completely done on the microcontroller itself, making it independent of a 'server' / host.

RPi, etc normally fill the gap where there are applications that is too cramped to put in a microcontroller, which normally has less than 1 MB ram.
One of those things about Rpi with the abundance of memory, is that apps tend to be developed in 'high' level language (e.g. python, java) rather than straight c/c++ and bare metal programming. For microcontrollers, you are pretty much left with c/c++ and even *assembly language* as its means.
assembly language aren't really used much these days, it is mostly c/c++, but you may need to resort to that if you use a microcontroller with
1k sram and 4k flash, yes 1k sram, not 1 meg.
 
Last edited:
Top