My heating central unit provides an serial interface (old school RS232), for which I’ve written a script to use it for home automation
I’d like to reduce devices and logic, so I’m thinking on replacing a whole RaspberryPi for this with a “RS232 over WiFi”-kind of thing or an ESP32.
I’m searching all over with no real solution, but perhaps someone here has similar requirements. Is there any way to either port a python script to ESP32 or some decent RS232-over-WiFi-dongles or whatever?
Always a question worth asking but there can be some reasons one might want to move something like this to an ESP32 or ESP8266 (none of which apply to @binderth’s case I think).
space available, an RPi Zero may be too big
Analog GPIO pin support, for example I know that ESP8266’s usually have at least one analog pin where the RPi 0 has only digital pins
a microcontroller is going to be way more reliable and require much less maintenance than a SBC (single board computer), especially if you don’t have deployment and monitoring tools like Ansible/Chef/Puppet/etc and Zabbix/Prometheus/etc.
if you have a lot of them to deploy, it’s less work to deploy lots of cloned configs to microcontrollers than SBCs
There can be lots of really fantastic reasons to choose a microcontroller even if you happen to have a working version on a SBC.
As an example, I myself have as a todo (very low priority) to replace my RPi 3 in the garage that controls and senses the garage doors with a NodeMCU. The reason why is even though I do use Ansible and Zabbix, I’m kind of tired of maintaining it. It doesn’t take much but it does consume some time to keep the OS patched and the configuration running as I want. I’m also looking to replace the RPi 0 I have in the utility room which is connected to the door sensors for the same reasons.
Regarding question you placed in topic - “RS232 via WiFi/ESP32 possible?” - all depends on serial protocol and latency it can accept. There are protocols which have strict rules on how much time bus participants have to make or answer call. If your wifi based routing is slow, this thing will not work.
I recall there was a ebus-rs232+wifi (or even ethernet) adapter was terminated exactly this reason.