-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT - Serial bridge #2190
MQTT - Serial bridge #2190
Conversation
fc849c5
to
9a2f879
Compare
You're 8 hours too late. I have just released this functionality. ;-) |
@arendst Your implementation is using the hardware serial. In a software serial implementation you can choose pins, and you will not have the ESP's reset messages on the serial line. (For example, I can't use the hardware implementation as my projector will go into serial error mode when it receives the bytes output by the ESP at boot.) Correct me if I've missed something or said something wrong. :-) |
You are right but what currently uses tasmotaserial I see exceptions randomly so I choose the hardware option this time. I'll look into your implementation too. |
Whitespace characters can be sent by escaping them in the MQTT message. This is needed for the reason that the message handler framework drops whitespace characters.
@arendst I've been testing the basic implementation (using 38400 bps) for around 48 hours now and it seems to work (for now). I hope it will work for you as well. :-) Above the advantages I have mentioned before, this also has the comfort of working on devices that use the hardware serial for something else, like the older Sonoff Dual. |
Convinced! I will add to next pre-release. Well done. |
Implemented. |
@arendst Please excuse my bluntness, but the implementation in my pull request is still superior to yours.
Points 1., 2. and 3. make it impossible to use your implementation as a transparent serial bridge, which is required in multiple serial port use cases. (Where you have to transfer raw binary data) I am not pushing you to use my implementation as it is, but please fix these issues (1. to 4.) as having a transparent serial bridge has more opportunities than having a text only one. (Also, the transparent implementation has no drawbacks compared to the text only one.) |
Thanks guys. I was literally looking at writing this last week ... I will run it up over the weekend and see how I go... A |
5.12.0h * Add support for Software Serial bridge using commands SerialDelimiter, SBaudrate and SSerialSend. Supports 8N1 and text only (arendst#2190) * Add support for Hardware Serial bridge using commands SerialDelimiter, Baudrate and SerialSend. Supports 8N1 and text only (arendst#2182)
Software serial - MQTT bridge implemented as an xdrv. Useful when interfacing with devices having only a serial port for communication like for example projectors and older AV receivers.
Quick info and usage: