-
Notifications
You must be signed in to change notification settings - Fork 639
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 support for DYP A02YYU ultrasonic sensor #2622
Conversation
eb08cda
to
cbaec01
Compare
Thanks! Still, I do think it might be useful to keep payload / overall data string examples around. Small example w/ test sensor cpp update |
Sure, I'll try to do some data capture from the sensor this week end and I'll submit them. |
Hello Max, As promised, please find attached some data capture from the device. Unfortunately, I couldn't capture data from my faulty device, it doesn't power up anymore :( I think it's definitely dead. I'll think about how to exploit those data in the test and also how to simulate faulty/corrupted data. Basically, with the faulty device, some values were randomly dropped or zeroed. It should be easy to replicate that pattern for the tests. I've also looked at your test and it's a very good thing, I'll try to contibute to this effort. I'd have one question about this though, in the standard behavior, several frames that are parsed in once within a tick() call. The test will only test the latest parsed value. would it be possible to check at all parsed values? |
Most naïve approach would be to just throttle the input to one frame per tick()? (like it does currently) Otherwise, manually pick results with an extra external method to handle one frame at a time. Bulk of the data passed at once continues to only have one result at the end. |
This brings the support of DYP A02YYU waterproof ultrasonic sensor to espurna.
It will need a UART port configured as 9600/8N1 (RX pin only is enough). To enable this sensor, the follwing build flags shall be configured:
A02YYU_SUPPORT set to 1
A02YYU_PORT set to the UART port ID
This has been tested on an esp8266 D1 Mini reporting steady distance measurements over more than 2 weeks.