Home › Forums › Mayfly Data Logger › Meter Hydros 21 address
- This topic has 8 replies, 3 voices, and was last updated 2021-04-07 at 4:52 PM by Matt Barney.
-
AuthorPosts
-
-
2021-04-07 at 10:21 AM #15351
When using the Hydros 21, is there any problem with leaving its SDI address at 0 and updating the address in the code to match? The reason I want to do this is that I have a user who’s purchased the sensor, and I’m preparing to program and ship a Mayfly kit to them. They’re located across the country from me, so I don’t have access to their sensor, and they don’t have programming skills. It should work with a “0” address, correct?
Thanks,
Matt -
2021-04-07 at 1:52 PM #15356
Matt, unfortunately, I’m nearly sure that it has to be changed.
See the warning in: https://envirodiy.github.io/ModularSensors/group__sensor__hydros21.html#sensor_hydros21_ctor
-
2021-04-07 at 3:18 PM #15357
Thanks Anthony. That warning is pretty clear. But I wonder why that’s a constraint.
It looks like “0” is a valid address according to the SDI-12 spec, and Meter supports it. Perhaps there’s something in ModularSensors that doesn’t like it. Scanning through the code, I don’t see anything right off.
Matt
-
2021-04-07 at 3:56 PM #15358
Matt, my understanding is that the warning to not use address “0” came from a Meter/Decagon integration manual and from real-world experience. If I’m not mistaken, some sensor manufacturers reserve the “0” address for all sensors to use all the time, even when their address has been changed. This allows for a back-door to poll a line for all the connected sensors to find out the status of what’s connected. When manufacturers do this, they often disable sending data from that address. This is also the case for some Modbus implementations.
I think Meter has implemented this convention for some but not all of their sensors. I can’t remember which. Also, since Meter has purchased Decagon, we’ve seen them slowly modify their SDI-12 protocols with firmware updates, sometimes silently.
Sara & Shannon can likely provide more detail. Alternately, you could call Decagon/Meter. They are a small company and would likely connect you to an engineer relatively quickly.
-
2021-04-07 at 4:28 PM #15359
Meter Group sensors that use SDI12 protocol (like the Hydros 21) come from the factory with a default SDI12 address of ‘0’. Their sensors are programmed to output a serial data string containing the current measurement upon powerup if the address is set to ‘0’. Meter Group’s dataloggers all talk to their sensors like this. You can see it in action if you use a sketch using SoftwareSerial to monitor the sensor data pin and capture the serial data string immediately after you apply power to the sensor. That would work fine if you were only using one sensor on the bus, and only wanted one reading. Since we typically take 6 to 10 readings and average them, plus we usually have several other SDI12 sensors all connected to the same data wire, then having individual addressed for each sensor is imperative. If you connect 2 or more Meter Group sensors to the same data pin and they’re both set to channel ‘0’, they’ll both attempt to send the serial string at the same time, and you won’t be able to capture it properly with the Mayfly logger.
In order for the Meter Group sensors to properly respond to SDI12 commands, they need to be programmed to any other channel EXCEPT ‘0’.
Most other sensors don’t have this specification, and we sometimes leave them as ‘0’ if we’re just testing it. But for deployments, we’ve been using our own “in-house” channel allocations, just to keep things simple. For example, our turbidity sensors are usually channel ‘2’ or ‘3’, oxygen sensors are ‘5’, etc. That makes it a little easier to keep track of when juggling the sketches for hundreds of stations, each with different combinations of sensors.
-
2021-04-07 at 4:39 PM #15360
Thank you both for those details!
So to be clear: if I have only 1 SDI-12 sensor on the bus, and it’s at address 0, it should work properly with ModularSensors, even if I’m averaging 6 readings and collecting conductivity, temp, and depth each time. Is that correct?
-
2021-04-07 at 4:48 PM #15361
Shannon, thanks for those additional details!!!
Matt, from what I read in Shannon’s description, keeping the address set to ‘0’ might result in you only taking 1 measurement for averaging, even if you asked for 6.
-
2021-04-07 at 4:48 PM #15362
No, the Meter Group sensor will not work with Modular Sensors if its address is set to ‘0’. When it’s set to ‘0’, the data string is not in proper SDI12 delimeted format and Modular Sensors won’t be able to see anything. Plus, the only way to get it to take multiple readings would be to turn the sensor power off and back on each time you want to take a reading, and use a Serial parsing code to capture the data instead of Modular Sensors SDI12 libraries.
So in order to use Modular Sensors code using SDI12 commands with a Meter Group sensor, you MUST change the channel to something other than ‘0’.
-
2021-04-07 at 4:52 PM #15363
Ok, I see. Thanks so much for taking the time to provide all these details – very helpful!
Best,
MattTrout Unlimited
-
-
AuthorPosts
- You must be logged in to reply to this topic.