Send data using WLAN from Serial control node (ttyUSB0) from Raspberry Pi Zero W to a Raspberry Pi 4B

Hi all,

currently I use the serial control node (ttyUSB0) of a Raspberry Pi 4B (1) to read data from a directly connected heating device and showing this data in a Node-RED dashboard.

However, since the rpi4B (1) is actually supposed to be placed elsewhere, I would like to move this tasks to another device, such as the Raspberry Pi Zero W (2), which will then transmit the data to the rpi4B (1) via WLAN.

I have the following questions for anyone who is interested in this topic or already familiar with it:

Will Node-RED and the functions I need for the described use case above (using serial node & sending data using WLAN) run on the rPi0W (2)?

Which Pi OS do I need to install onto the rPi0W?
Which type (32bit or 64bit)?
(I guess 32bit is ok...)

Which network node do I need on the rPi0W (2) to send the data using WLAN to the other device rpi4B (1) which will then be connected directly (wired) to the router?

Any other suggestions or tips?

Thank you very much and kind regards
Thomas

They should do.

You have to use 32bit if it is an original model or 64bit if it is the 2nd generation.

It probably doesn't really matter that much. Personally, I would direct everything via an MQTT broker running on the rpi4 since that is a much more flexible approach though obviously it does require an additional service to be running but the Mosquitto broker is so efficient, very unlikely you will notice the overheads even with high message loads.

I guess if you already have a rpi0w, it makes some sense to use it. However, a lot of us would recommend using an ESP32 for things like this. It is generally much easier to manage and is very reliable. Again, connect the ESP32 over Wi-Fi to post to MQTT for the easiest and most flexible setup.

@TotallyInformation

First of all: Thank you very very much for your quick and detailed answer!!!

While Googling this topic, I also came across the ESP32.
In my case, because of the USB interface, I’d probably have to go with the ESP32-S2?

And is it really true that I could program this device using Visual Studio - which I already use for simple Windows and Office programs - and the Arduino IDE extension?

And last question:
On which forum can I get the same excellent support (for then setting up this (reading data from an USB port and sending it using MQTT) in Visual Studio) as I do on this forum?

Thank you and again kind regards
Thomas

So are you sure your heating device has a USB interface and not serial ??

Depending on what sort of protocol it is running - your best bet would be to look at one of the pre-rolled firmwares rather than doing it yourself. the most flexilbe would be ESPHome for what you are trying to achieve.

Craig

Hard to know without knowing the device you are trying to connect.

Oh, I don't know, I hate VS. :smiley:

As Craig says, I would use ESPHome where you rarely need to dip into C/C++ programming, though one of the nice things of ESPHome is that you can dip into it if you need/want to. Mostly you use configuration using YAML which you can easily do with VSCode.

There is nowhere with the excellent support you can get here! :rofl:

ESPHome has its own forum which isn't too bad. It also has a very wide range of existing device support that you might be able to use.

ESP devices are VERY widely used so there is a lot of information and help available in various places. I you are using it with Node-RED, you may well get some help here as well. :wink:

Let us know what device you are using for input and maybe we can help further.

[quote="nosered1966, post:3, topic:101125"]
And is it really true that I could program this device using Visual Studio
[/quote]

I have done it once using VS Codium, but by far prefer the Arduino IDE for ease of use.

To reiterate though, actual programming of ESP's is rarely needed these days unless you want something super specific. There are excellent firmwares such as ESPHome that do all the hard bits for you.

Ah, I was talking about actually programming the device using VSC and my preference of Arduino IDE. I am experimenting with ESPHome.

@craigcurtin
Thank you for helping!

Well, the heating device is already "under my control" (I probably can't control anything on this old thing - I can only read data. It's kind of a hobby...) using these nodes:

It is an 20 years old Viessmann Vitodens 200 gas condensing boiler with an Optolink interface, connected using a Optolink cable with an USB A plug plugged into my rpi4B.

ESPHome:
I didn't know it but it looks interesting...

I have one more serious question: In this age of “CyberSecurity”, should I be concerned about adding a Chinese processor to my home network?

The ESP32-S2 and ESP32-C3-Super-Mini are brilliant devices. They have WiFi and Bluetooth built-in. You'll have a lot of fun using them. I use many of them around the house/garage/garden/greenhouse to sense temperature/humidity/pressure and report the readings to Node-RED. For the last couple of years I've flashed them with Micro-Python and "rolled" my own code.

Honestly, in this day-and-age, that is the least of your worries!!

But no, not in this case, it is too simple a device to worry about. Especially with the widely used, open source firmware.

However, because you already have a USB output connector, while this is easier for the Pi, not quite so easy for the ESP. If you were simply using the minimal serial wires (RX, TX, Gnd?), you could wire that direct to the ESP which, I vaguely remember does have suitable input connections? Dave would likely know better than I since I only use the raw dev boards (no USB inputs) with simple sensors and then dump everything out to MQTT. I do have some more complex ESP based devices such as some M5Stack devices. But even so, I've never used the USB on any of them except for programming the firmware I'm afraid so I don't know how possible/easy it is - might be super easy, might not.

If you can sort out the connectivity, the rest is pretty easy. Even if you need some custom code (likely given your explanation), that is easy enough with the Arduino IDE and the MQTT Arduino library.

But actually even easier with ESPHome since that allows you to create small C++ breakouts within the YAML config for truly custom functions. And ESPHome takes care of all of the MQTT, Wi-Fi connectivity, over-the-air programming for you.

Of course, if you are a Python person, then, as Dave say's you could also use Micro Python instead.


Oh, and of course, I should have pointed out that your home is most certainly jam-packed FULL of Chinese microprocessors! If you have any kind of low-cost electronics in the house, they will be mostly Chinese.

If you have any Chinese camera's or other low-cost commercial IoT devices, those are the ones to worry about. Or indeed, low-cost Chinese networking equipment of any kind. Children's "AI enhanced" toys are the latest appalling cases.