Dealing with limited GPIOs on ESP8266 vs upgrading to ESP32 for IoT security?

Joined
Apr 2, 2025
Messages
3
Hello guys,

I'm working on upgrading an old home automation hub. The original design used an ESP8266, but I'm running into two major bottlenecks now:

  1. GPIO Limitation: I need to connect an SPI display, two I2C sensors, and a couple of relays. I’m almost entirely out of usable pins on the ESP8266 without messing up the boot strapping pins (GPIO0/2/15).
  2. Security: I want to implement secure TLS/HTTPS requests to my server. The ESP8266 seems to struggle heavily with SSL handshake times and memory overhead.
I was reading through this esp32 vs esp8266 guide regarding hardware-based encryption and security engines. It seems the ESP32 handles cryptographic acceleration in hardware, which would solve my bottleneck, not to mention having way more GPIOs.

However, given the price difference and complexity (dual-core RTOS versus bare-metal loop), I'm wondering:
  • Is using an I2C port expander (like PCF8574) on the ESP8266 still a viable workaround to save cost, or is it better to just jump to ESP32 directly?
  • How much faster is the SSL handshake on an ESP32 compared to ESP8266 in your actual testing?
Would love to hear your experiences before I start redesigning the PCB.

Best regards!
 

danadak

Feb 19, 2021
1,069
Joined
Feb 19, 2021
Messages
1,069
If you have multiple pins assigned to buttons one ADC pin can handle multiple
buttons :



The I2C devices all have different addresses ? Google "I2C pin sharing pdf", lots of help.

Take a look at this : https://chatgpt.com/s/t_6a5a06b732248191b46df15bb8cd4e1c
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,285
Joined
Nov 17, 2011
Messages
14,285
However, given the price difference and complexity (dual-core RTOS versus bare-metal loop), I'm wondering:
There is almost no price difference, on the contrary: An ESP8266 module comes at 3-4 €. An ESP32 C3 supermini module comes at less than 3 €.
As for the complexity: The ESP32 controllers can easily be programmed using the Arduino environment or Visual Studio Code with the PlatformIO extension. You'll find lots of tutorials online. There is no need to hassle with the dual core complexity. All is taken care of by these development environments. You use it essentially as a single core unit (at least that's what you see on the surface of it- of course you are free to use the second core if you wish).

Any type of port extender of I2C addressing scheme will not solve the issue with SSL. I therefore recommend the switch to an ESP32 based module.

Here's an ESP32 selection guide, also available on video.
 

danadak

Feb 19, 2021
1,069
Joined
Feb 19, 2021
Messages
1,069
I am a newbee to RTOS to handle dual cores, but the first experience, simple as it was,
made a dramatic difference in code simplification. Think of all the spaghetti code we all have
been writing over the years where timing task to task was crucial to get decent behavior,
like display refresh and other tasks that want to be concurrent in execution.

So I was juggling in spaghetti code serial port, display, ADC acquisition and processing.
Having problems with display refresh with no artifacts in its display. Bingo dual core and
RTOS. Several tasks with priority control, main() on one core, and a handful on another,
all pseudo concurrent based on assigned priority, and tasks that check on other tasks and
execute if change/updates/processing needed, or not. I am not explaining this well but a simple
example is a heartbeat LED. In dual core that runs independently of main() activity and just keeps
pulsing its led w/o interfering in main(). Task priority means not all tasks run concurrently, rather
it means there are two cores running code, and with simple planning via priority each task gets its
MIPS needed and appears to run concurrently. Of course true concurrency if second core running
just one task, but most tasks only need finite MIPS hence the pseudo behavior multiple tasks.

A corollary is todays DMA creates concurrency in Hardware easy, especially the parts that have
separate busses so do not interfere with CPU execution. There are parts that have intelligent DMA
where basic data processing occurs to control DMA behavior.

Youtube great resource on this for self training.

I have used Tuniot, its a GUI block based programing environment. Great for visual learners, and
takes one out of the weeds for C/C++ programing. You can bring up a client server ap in minutes.
A couple of examples :



http://easycoding.tn/tuniot/demos/code/ ESP8266

http://easycoding.tn/esp32/demos/code/ ESP32

The tool has templates for basic designs.....

And a quick way of PC interface https://appinventor.mit.edu/

Simple talking voltmeter done using another block language

https://www.electro-tech-online.com/threads/talking-arduino-daq.161658/
 
Last edited:
Top