EnviroDIY / Arduino-SDI-12

An Arduino library for SDI-12 communication with a wide variety of environmental sensors. This library provides a general software solution, without requiring any additional hardware.
https://github.com/EnviroDIY/Arduino-SDI-12/wiki
BSD 3-Clause "New" or "Revised" License
158 stars 99 forks source link

Missing check for 8.33mS marking before checking address for sdi12 slave/sensor #121

Open ZachaRuba opened 1 year ago

ZachaRuba commented 1 year ago

Hello,

I did not see anywere in your library a check for marking before handling a command when using as an sdi12 sensor. This can cause problems when commands end with the same address as your sensor. For example, sensor address is 0. If there are multiple sensors on the dataline, you might receive 1D0! In this case, your sensor might respond with an acknowledgement, 0! and corrupt the response from the other sensor.

https://www.sdi-12.org/archives_folder/SDI-12%20Specification%201.3%20July%2018%202005.pdf image

ZachaRuba commented 1 year ago

Here is a project that is intended for an SDI-12 slave using a PIC microcontroller. You can see that when processing commands, they are looking for a marking. https://github.com/RxTx1200/SDI-12_slave/blob/master/command.c#L16 https://github.com/RxTx1200/SDI-12_slave/blob/master/main.c#L155