RS232 Gateway - Serial frame data format

Hello everyone

Just starting my first project with OMG.
Initially, with a Nodemcu RS232 gateway to MQTT for testing, but after that, I’ll move to WT32-ETH01 to send data over an Ethernet cable. Big challenges to come.

The project depends on the flexibility to configure the RS232 data format (for example 9600 7N1).
config_RS232.h already has the “RS232Baud” option.

How can I add the other parameter for configuration? “I’m using PlatformIO”.

thank you for any help

Hello there.
After some research, I have found that the library used for RS232 is in fact the SoftwareSerial.h

You can see this information under .pio, modemcuv2-rs232, idedata.json

Looking inside the code from the library, we can see:

enum SoftwareSerialConfig {
SWSERIAL_5N1 = SWSERIAL_PARITY_NONE,
SWSERIAL_6N1,
SWSERIAL_7N1,
SWSERIAL_8N1,
SWSERIAL_5E1 = SWSERIAL_PARITY_EVEN,
SWSERIAL_6E1,
SWSERIAL_7E1,
SWSERIAL_8E1,
and so on… giving the possibility to : “@param config sets databits, parity, and stop bit count”

So, it´s time to make some modifications and tests.
I will reply with the results as soon as the tests are conclusive.

cheers

1 Like