Some time ago I purchased an HC-SR04 distance sensor which worked perfectly with the SR04 sensor module in Trig/Echo mode. I then switched to the A02YYUW (listed at DFRobot as SKU:SEN0311) which uses a serial UART with 4 byte output (Header,DATA_H,DATA_L,SUM), 9600 baud. The SR04 module supports both Trig/Echo and UART serial devices, but I cant seem to read any data from the A02YYUW when using the SR04 module.
If I connect the sensor Tx output to GPIO3 and the Tasmota module configuration Generic(18) configured for RX GPIO3 = SerialRx and issue a SerialSend4 command from the console, I can see lots of data coming in the console:
MQT: Water_Tank/tele/RESULT = {"SerialReceived":"06F8FDFF06F8FDFF06F8FDFF06F8F,,,,,8FDFF"}
I get exactly 519 values at roughly 7 sec intervals, which is probably the Rx buffer filling up as SerialSend4 means send as binary and value for SerialDelimiter is 255 (disabled).
Now, when I set the module configuration so that RX GPIO3 = SR04 Ech/RX the SR04 driver correctly sets the sensor mode to SR04_MODE_SER_RECEIVER, Mode 2 - Serial receive only. This mode doesn't use the SR04 Tri/TX assignment and the sensor specification says: When "RX" floats or input High level, the sensor outputs processed values, the data is more steady, response time: 100-300ms; when input Low level, the module outputs real-time value, response time: 100ms.
However, the xsns_22_sr04 driver never sees any input bytes from the sensor.
I do get a single entry in the console on restart:
RSL: RESULT = {"SerialReceived":"FF06F9FEFF06F7FC,,,,,,FAFF06F3F8FF06F308"}
but after that every attempt by SR4 to read there is no input data. For some reason the serial input buffer is empty, ie, the function call: sonar_serial->available() is always false
I'm using tasmota-sensors firmware version 12.1.1
If anyone can suggest what I'm doing wrong I would be very grateful.