-
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
Add SerialStart, SerialIgnore commands for Serial Bridge (both Hardware and Software) #17140
Conversation
Thx. As it stands this won't be merged as it changes default behaviour in case of hardware/software serial. This should not be distinguished here in the code. Although it uses hardware serial, it uses a different driver than the inbuilt serial driver and hence should still report as Anyway, I keep this PR open as an idea of how to manage duplicate messages. BTW how often are the serial messages being received? If it is every 5 seconds (as in your tests) there is no reason to handle it here. You should do it in your back ground code and not in Tasmota. |
HI @arendst , I understand what you say. so I am going to delete everything about D_JSON_SERIALRECEIVED. About SerialStart and SerialIgnore I think they are good commands. In my case I am receiving one big message every second (VE.Direct protocol by Victron: MPPT, inverters, ....) that is why I want to ignore several (duplicate or not, I only want a message every 5 or 10 seconds or even more seconds). I am sure that there are or will be others equipments that works by outputting message by"its own". |
Add command ``SetOption35 0..255`` to skip number of received messages in Serial Bridge (default 0) (#17140)
SerialIgnore is now implemented in Serial Bridge as |
Thanks a lot, do you want me to edit the wiki page? |
That would be very kind |
Hi, PR done for wiki docs (developement branch). Whay about SerialStart? I hope you can find it also usefull. |
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR was automatically closed because of being stale. |
@arendst Bot has closed this PR. It is only pending the SerialStart stuff. I think it is a good way to improve hardware and software serial (I have read several old diccusions about this topic). DO you think is time to re-opening it again? Thanks. |
Description:
Hi, I have done two new commands that are very usefull with SerialBridge. (both commands work with hardware or software serial bridge)
If this PR is merged, I will add a new PR for "tasmota docs"
SerialStart: it is configured to work up to 3 bytes. Buffer will begin to record only when this 1, 2 or 3 bytes are recieved in that order
SerialIgnore (0 .. 255): usefull when you have a serial TX that send date every X seconds (in my case a Victron VE.Direct equipment that sends data every second) and you want to exclude data not to saturate your system.
Both commans' configuration are preserved between restarts. Configuration is saved in flash
Also, I have added code to distinguish between D_JSON_SSERIALRECEIVED and D_JSON_SERIALRECEIVED in SerialBridge (hardware vs software serial)
CAUTION: before this change, every message is recieved as D_JSON_SSERIALRECEIVED, so people using hardware serial must check if they manage well D_JSON_SERIALRECEIVED
Compiled and checked with gitpod.io
Examples:
// SerialStart 0 to disable
// SerialStart C1 to start only with C1
// SerialStart C1,C2 to start with C1, C2
// SerialStart C1,C2,C3 to start with C1, C2, C3
// SerialStart show current chars
// C1, C2, C3 must me decimal numbers representing ascii code ("PID" = 80 73 68): serialstart 80,73,68
// SerialIgnore 0 to disable => process all recieved messages
// SerialIgnore 1 is identical as SerialIgnore 0
// SerialIgnore X to "ignore" X serialrecieved messages
// SerialIgnore show current value
Output message from gitpod.io before and after this PR:
Related issue (if applicable): fixes #
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass