-
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
Using Tasmota "script serial" in 8E1 mode calculates the parity bit wrong #19497
Comments
This is specific to Scripter. Can you reproduce with standard Tasmota Serial commands? |
It is specific to the Scripter. See "Additional context" - using "Serialsend5" works as it should. |
scripter uses tasmota serial, 8E1 is only supported on hardware serial, however hardware fallback for hardware serial port 2 on ESP8266 was not initialized properly |
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
With the Tasmota scripting function the parity check seems faulty: If it is set to 8E1 the result is not as expected. 8O1 seems to have the same issue.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Steps to reproduce the behavior:
compile firmware with: user override options:
#ifndef USE_SCRIPT
#define USE_SCRIPT // adds about 17k flash size, variable ram size
#endif
#ifdef USE_RULES
#undef USE_RULES
#endif
#define USE_SCRIPT_SERIAL
#define USE_SCRIPT_JSON_EXPORT
#define USE_SCRIPT_WEB_DISPLAY
#ifdef USE_DOMOTICZ
#undef USE_DOMOTICZ
#endif
#ifdef USE_SML_M
#undef USE_SML_M
#endif
copy the script in to the script console
Connect a oscilloscope or a terminal receiver to the serial output at GPIO15 and set it to 9600 baud and 8E1
The bytes in the script should be received with a correct parity bit set - "Even"
The first sent byte 0xBB = 1011 1011 has 6 bits set so that the parity bit should not be set.
As visible in the screenshot of my Picoscope the bit is set (red marked bits are correct while the blue ones are wrong). Strangely enough it is not always wrong.
Besides that the connected ACSystem does not respond.
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
The parity bit should be set if the number of set bits is uneven and not set when even:
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
Transmitting the same data with the Serialsend5 command gives a correct result (with an answer from the connected AC system):
17:54:09.990 CMD: SerialConfig 8E1
17:54:09.994 CMD: Grp 0, Cmd 'SERIALCONFIG', Idx 1, Len 3, Pld 8, Data '8E1'
17:56:23.640 CMD: SerialSend5 BB000104020100BD
17:56:23.646 CMD: Grp 0, Cmd 'SERIALSEND', Idx 5, Len 16, Pld -99, Data 'BB000104020100BD'
{"SerialReceived":"BB01000437040021950000000000000000730308000000000000000000006EFF40000031303C00008000000000DD0000004440000000001A00000000EE"}
Changing to 8N1 or setting 7N1 works as expected on the oscilloscope output...
see also: #19236 for further details on what we are doing...
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: