Serial1 setup question on parity bit

I need to communicate to a device with Photon on Serial1 port. The comm on the device is 2400 baud 8E1. As far as I know the Serial1 is set up as 8N1 by default.

My question is there is a way to set up Serial1 to have 8E1 standard?

Thanks,

I think the answer is currently no. It looks like there is an overload of the Serial.begin method that takes both a baud rate and a config parameter, where the latter is used to change the number of bits, parity, and stop bits, but it’s not implemented, which is why it’s not in the documentation, either.

Thanks. Looks like this killed the project I was planning for Electron, if I cannot communicate on Serial1 with 8E1 standard.

@anemeth, a PR was created for this feature:

Unfortunately, I don’t believe the author merged it into the develop branch at the time. I’ll tag @mdma to ask him what would be involved to get this done. :wink:

peekay123,

Thanks, that would be great if the parity bit can be set.

1 Like