Skip to content
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

Decagon 5TM returns data inconsistently #135

Closed
SRGDamia1 opened this issue Apr 30, 2018 · 14 comments
Closed

Decagon 5TM returns data inconsistently #135

SRGDamia1 opened this issue Apr 30, 2018 · 14 comments
Labels

Comments

@SRGDamia1
Copy link
Contributor

@fisherba reports this for site NLP01.

@SRGDamia1
Copy link
Contributor Author

@fisherba - This is really hard for me to debug seeing nothing other than some finally results that went to the website. I don't actually have a 5TM sensor available right now. It's possible that the 5TM isn't responding fast enough, that you have an older 5TM that isn't truly compatible with concurrent measurements (#115), or that something completely different is going on. I pushed a tweak to the 5TMspottiness branch increasing the allowed response time and being more careful to set values to -9999, but if you really want me to be able to help much more, I need you to post the debugging logs so I can look at what might be going wrong.

To do that, checkout the new 5TM branch. Then open SensorBase.h and find and uncomment the line #define DEBUGGING_SERIAL_OUTPUT Serial. Do the same in VariableArray.h and SDI12Sensors.h. Run a "clean" in PlatformIO (the icon on the tool bar that looks like a trashcan) and then re-upload your program onto your board with all the sensors attached. Open the serial port monitor and you should see many, many more lines printed to the screen. Let the program start and then hit the button to go into "sensor testing" mode. Let it run through a few sensor updates and then copy and paste the entire contents of your serial port monitor here.

@SRGDamia1
Copy link
Contributor Author

@fisherba - also make sure that all of your libraries are up-to-date. To do that in Atom/PlatformIO open up a command terminal (the button with the ">_" next to the serial monitor button). In the terminal type "pio lib update" and it should update the local version of all of your libraries. You can also run "pio lib -g update" if you've had PlatformIO install any libraries in another global directory instead of the .piolibdeps folder for your project.

@SRGDamia1 SRGDamia1 changed the title Decagon 5TM returns data unconsistently Decagon 5TM returns data inconsistently Apr 30, 2018
@SRGDamia1
Copy link
Contributor Author

Also, if you're for any reason running NeoSWSerial or any of the "tone" functions, they will conflict with the SDI12 library. (You won't see any compile errors, just unexpected results.)

@fisherba
Copy link
Collaborator

fisherba commented May 2, 2018

Hi @SRGDamia1, sorry for the delay, this is the first I've been able to run the test. After running the test a few times, it was only running one test, so I let it run for about a half hour (while preparing a kid breakfast and lunch) and it didn't run any additional rounds of testing. Here's the output:

pio device monitor --port /dev/cu.usbserial-A50659OO --baud 57600
Beths-MacBook-Pro-3:EnviroDIY_deployments fisher$ pio device monitor --port /dev/cu.usbserial-A50659OO --baud 57600
--- Miniterm on /dev/cu.usbserial-A50659OO  57600,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Now running NLP01.ino on Logger NLP01_Mayfly_170286
Logger timezone is UTC-6
RTC timezone is UTC
Initializing variable array with 20 variables...
The largest number of measurements to average will be 1.
There are 9 unique sensors in the group.
   ... Success!
Initializing logger NLP01_Mayfly_170286 to record at 15 minute intervals ...    ... Success!
Current RTC time is: 2018-05-02T06:59:37-06:00
Attempting to synchronize RTC with NIST
Beginning setup for sensors and variables...
Powering up sensors for setup.
Powering up sensors...
   ... Powering up Decagon5TM at SDI12-2_Pin7
Powering Decagon5TM at SDI12-2_Pin7 with pin 22
   ... Powering up MaxBotixMaxSonar at sonarStream_trigger-1
Powering MaxBotixMaxSonar at sonarStream_trigger-1 with pin 22
   ... Powering up YosemitechY504 at modbus_0x03
Powering YosemitechY504 at modbus_0x03 with pin 22
   ... Powering up YosemitechY504 at modbus_0x13
Powering YosemitechY504 at modbus_0x13 with pin 22
   ... Powering up YosemitechY504 at modbus_0x23
Powering YosemitechY504 at modbus_0x23 with pin 22
   ... Powering up YosemitechY520 at modbus_0x01
Powering YosemitechY520 at modbus_0x01 with pin 22
   ... Powering up YosemitechY520 at modbus_0x11
Powering YosemitechY520 at modbus_0x11 with pin 22
   ... Powering up EnviroDIY Mayfly at EnviroDIY Mayfly
Power to EnviroDIY Mayfly at EnviroDIY Mayfly is not controlled by this library.
   ... Powering up MaximDS3231 at I2C_0x68
Power to MaximDS3231 at I2C_0x68 is not controlled by this library.
Running setup functions.
   ... Set up of Decagon5TM at SDI12-2_Pin7 ...
Setting up Decagon5TM attached at SDI12-2_Pin7 which can return up to 3 variable[s].
It warms up in 200ms, is stable after 0ms, and takes a single measurement in 7536840ms.
1 individual measurements will be averaged for each reading.
Enabling interrupts for SDI12 on pin 7
   Activating SDI-12 instance for Decagon5TM at SDI12-2_Pin7
   Asking for sensor acknowlegement
      >>> 2!
      <<< ␀␗
   Decagon5TM at SDI12-2_Pin7 did not reply!
      >>> 2!
      <<< 2␘
   Decagon5TM at SDI12-2_Pin7 replied, unexpectedly
   Getting sensor info
      >>> 2I!
      <<< 213DECAGO\ 5TM   400
   SDI12 Address:2, SDI12 Version:1.30, Sensor Vendor:DECAGO\, Sensor Model:5TM, Sensor Version:400, Sensor Serial Number:
   ... succeeded. ...
   ... Set up of MaxBotixMaxSonar at sonarStream_trigger-1 ...
Setting up MaxBotixMaxSonar attached at sonarStream_trigger-1 which can return up to 1 variable[s].
It warms up in 160ms, is stable after 0ms, and takes a single measurement in 166ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of YosemitechY504 at modbus_0x03 ...
Setting up YosemitechY504 attached at modbus_0x03 which can return up to 3 variable[s].
It warms up in 375ms, is stable after 8000ms, and takes a single measurement in 1700ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of YosemitechY504 at modbus_0x13 ...
Setting up YosemitechY504 attached at modbus_0x13 which can return up to 3 variable[s].
It warms up in 375ms, is stable after 8000ms, and takes a single measurement in 1700ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of YosemitechY504 at modbus_0x23 ...
Setting up YosemitechY504 attached at modbus_0x23 which can return up to 3 variable[s].
It warms up in 375ms, is stable after 8000ms, and takes a single measurement in 1700ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of EnviroDIY Mayfly at EnviroDIY Mayfly ...
Setting up EnviroDIY Mayfly attached at EnviroDIY Mayfly which can return up to 2 variable[s].
It warms up in 0ms, is stable after 0ms, and takes a single measurement in 0ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of MaximDS3231 at I2C_0x68 ...
Setting up MaximDS3231 attached at I2C_0x68 which can return up to 1 variable[s].
It warms up in 0ms, is stable after 0ms, and takes a single measurement in 200ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of YosemitechY520 at modbus_0x01 ...
Setting up YosemitechY520 attached at modbus_0x01 which can return up to 2 variable[s].
It warms up in 1600ms, is stable after 10000ms, and takes a single measurement in 2700ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
   ... Set up of YosemitechY520 at modbus_0x11 ...
Setting up YosemitechY520 attached at modbus_0x11 which can return up to 2 variable[s].
It warms up in 1600ms, is stable after 10000ms, and takes a single measurement in 2700ms.
1 individual measurements will be averaged for each reading.
   ... succeeded. ...
Powering down sensors...
   ... powering down Decagon5TM at SDI12-2_Pin7
Turning off power to Decagon5TM at SDI12-2_Pin7 with pin 22
   ... powering down MaxBotixMaxSonar at sonarStream_trigger-1
Turning off power to MaxBotixMaxSonar at sonarStream_trigger-1 with pin 22
   ... powering down YosemitechY504 at modbus_0x03
Turning off power to YosemitechY504 at modbus_0x03 with pin 22
   ... powering down YosemitechY504 at modbus_0x13
Turning off power to YosemitechY504 at modbus_0x13 with pin 22
   ... powering down YosemitechY504 at modbus_0x23
Turning off power to YosemitechY504 at modbus_0x23 with pin 22
   ... powering down YosemitechY520 at modbus_0x01
Turning off power to YosemitechY520 at modbus_0x01 with pin 22
   ... powering down YosemitechY520 at modbus_0x11
Turning off power to YosemitechY520 at modbus_0x11 with pin 22
   ... powering down EnviroDIY Mayfly at EnviroDIY Mayfly
   ... powering down MaximDS3231 at I2C_0x68
Attaching variables to their parent sensors.
... Registration from Decagon5TM at SDI12-2_Pin7 for permittivity accepted.
... Registration from Decagon5TM at SDI12-2_Pin7 for temperature accepted.
... Registration from Decagon5TM at SDI12-2_Pin7 for volumetricWaterContent accepted.
... Registration from MaxBotixMaxSonar at sonarStream_trigger-1 for distance accepted.
... Registration from YosemitechY504 at modbus_0x03 for oxygenDissolvedPercentOfSaturation accepted.
... Registration from YosemitechY504 at modbus_0x03 for temperature accepted.
... Registration from YosemitechY504 at modbus_0x03 for oxygenDissolved accepted.
... Registration from YosemitechY504 at modbus_0x13 for oxygenDissolvedPercentOfSaturation accepted.
... Registration from YosemitechY504 at modbus_0x13 for temperature accepted.
... Registration from YosemitechY504 at modbus_0x13 for oxygenDissolved accepted.
... Registration from YosemitechY504 at modbus_0x23 for oxygenDissolvedPercentOfSaturation accepted.
... Registration from YosemitechY504 at modbus_0x23 for temperature accepted.
... Registration from YosemitechY504 at modbus_0x23 for oxygenDissolved accepted.
... Registration from YosemitechY520 at modbus_0x01 for temperature accepted.
... Registration from YosemitechY520 at modbus_0x01 for specificConductance accepted.
... Registration from YosemitechY520 at modbus_0x11 for temperature accepted.
... Registration from YosemitechY520 at modbus_0x11 for specificConductance accepted.
... Registration from EnviroDIY Mayfly at EnviroDIY Mayfly for Free SRAM accepted.
... Registration from EnviroDIY Mayfly at EnviroDIY Mayfly for batteryVoltage accepted.
... Registration from MaximDS3231 at I2C_0x68 for temperatureRTC accepted.
   ... Success!
Data will be saved as NLP01_Mayfly_170286_2018-05-02.csv
Successfully connected to SD Card with card/slave select on pin 12
File created!
Logger setup finished!
------------------------------------------

Push button on pin 21 at any time to enter sensor testing mode.
------------------------------------------
Entering sensor testing mode
Powering up sensors...
   ... Powering up Decagon5TM at SDI12-2_Pin7
Powering Decagon5TM at SDI12-2_Pin7 with pin 22
   ... Powering up MaxBotixMaxSonar at sonarStream_trigger-1
Powering MaxBotixMaxSonar at sonarStream_trigger-1 with pin 22
   ... Powering up YosemitechY504 at modbus_0x03
Powering YosemitechY504 at modbus_0x03 with pin 22
   ... Powering up YosemitechY504 at modbus_0x13
Powering YosemitechY504 at modbus_0x13 with pin 22
   ... Powering up YosemitechY504 at modbus_0x23
Powering YosemitechY504 at modbus_0x23 with pin 22
   ... Powering up YosemitechY520 at modbus_0x01
Powering YosemitechY520 at modbus_0x01 with pin 22
   ... Powering up YosemitechY520 at modbus_0x11
Powering YosemitechY520 at modbus_0x11 with pin 22
   ... Powering up EnviroDIY Mayfly at EnviroDIY Mayfly
Power to EnviroDIY Mayfly at EnviroDIY Mayfly is not controlled by this library.
   ... Powering up MaximDS3231 at I2C_0x68
Power to MaximDS3231 at I2C_0x68 is not controlled by this library.
Waking sensors...
   ... Wake up of Decagon5TM at SDI12-2_Pin7 ...
Waking Decagon5TM at SDI12-2_Pin7
   ... succeeded. ...
   ... Wake up of MaxBotixMaxSonar at sonarStream_trigger-1 ...
Waking MaxBotixMaxSonar at sonarStream_trigger-1
   ... succeeded. ...
   ... Wake up of YosemitechY504 at modbus_0x03 ...
   ... succeeded. ...
   ... Wake up of YosemitechY504 at modbus_0x13 ...
   ... succeeded. ...
   ... Wake up of YosemitechY504 at modbus_0x23 ...
   ... succeeded. ...
   ... Wake up of YosemitechY520 at modbus_0x01 ...
   ... succeeded. ...
   ... Wake up of YosemitechY520 at modbus_0x11 ...
   ... succeeded. ...
   ... Wake up of EnviroDIY Mayfly at EnviroDIY Mayfly ...
Waking EnviroDIY Mayfly at EnviroDIY Mayfly
   ... succeeded. ...
   ... Wake up of MaximDS3231 at I2C_0x68 ...
Waking MaximDS3231 at I2C_0x68
   ... succeeded. ...
------------------------------------------
--- Clearing all results arrays before taking new measurements ---
Clearing value array for Decagon5TM at SDI12-2_Pin7.
Clearing value array for MaxBotixMaxSonar at sonarStream_trigger-1.
Clearing value array for YosemitechY504 at modbus_0x03.
Clearing value array for YosemitechY504 at modbus_0x13.
Clearing value array for YosemitechY504 at modbus_0x23.
Clearing value array for YosemitechY520 at modbus_0x01.
Clearing value array for YosemitechY520 at modbus_0x11.
Clearing value array for EnviroDIY Mayfly at EnviroDIY Mayfly.
Clearing value array for MaximDS3231 at I2C_0x68.
- Starting reading 1 on Decagon5TM at SDI12-2_Pin7 -
   Activating SDI-12 instance for Decagon5TM at SDI12-2_Pin7
   Asking for sensor acknowlegement
      >>> 2!
      <<< 2
   Decagon5TM at SDI12-2_Pin7 replied as expected.
   Beginning concurrent measurement on Decagon5TM at SDI12-2_Pin7
      >>> 2C!
      <<< 2001␐2
   Concurrent measurement started.
- Success -
- Starting reading 1 on MaxBotixMaxSonar at sonarStream_trigger-1 -
Starting measurement on MaxBotixMaxSonar at sonarStream_trigger-1.
- Success -
- Starting reading 1 on EnviroDIY Mayfly at EnviroDIY Mayfly -
Starting measurement on EnviroDIY Mayfly at EnviroDIY Mayfly.
- Success -
-- Collected result of reading 1 from EnviroDIY Mayfly at EnviroDIY Mayfly --
Putting 4.62 in result array for variable 0 from EnviroDIY Mayfly at EnviroDIY Mayfly.
Putting 7696.00 in result array for variable 1 from EnviroDIY Mayfly at EnviroDIY Mayfly.
-- Success --
--- Finished all readings from EnviroDIY Mayfly at EnviroDIY Mayfly ---
- Starting reading 1 on MaximDS3231 at I2C_0x68 -
- Success -
-- Collected result of reading 1 from MaxBotixMaxSonar at sonarStream_trigger-1 --
Putting 359.00 in result array for variable 0 from MaxBotixMaxSonar at sonarStream_trigger-1.
-- Success --
--- Finished all readings from MaxBotixMaxSonar at sonarStream_trigger-1 ---
-- Collected result of reading 1 from MaximDS3231 at I2C_0x68 --
Putting 32.75 in result array for variable 0 from MaximDS3231 at I2C_0x68.
-- Success --
--- Finished all readings from MaximDS3231 at I2C_0x68 ---
- Starting reading 1 on YosemitechY504 at modbus_0x03 -
Starting measurement on YosemitechY504 at modbus_0x03.
- Success -
- Starting reading 1 on YosemitechY504 at modbus_0x13 -
Starting measurement on YosemitechY504 at modbus_0x13.
- Success -
- Starting reading 1 on YosemitechY504 at modbus_0x23 -
Starting measurement on YosemitechY504 at modbus_0x23.
- Success -
-- Collected result of reading 1 from YosemitechY504 at modbus_0x03 --
Putting 79.62 in result array for variable 0 from YosemitechY504 at modbus_0x03.
Putting 19.06 in result array for variable 1 from YosemitechY504 at modbus_0x03.
Putting 7.36 in result array for variable 2 from YosemitechY504 at modbus_0x03.
-- Success --
--- Finished all readings from YosemitechY504 at modbus_0x03 ---
-- Collected result of reading 1 from YosemitechY504 at modbus_0x13 --
Putting 79.45 in result array for variable 0 from YosemitechY504 at modbus_0x13.
Putting 19.42 in result array for variable 1 from YosemitechY504 at modbus_0x13.
Putting 7.29 in result array for variable 2 from YosemitechY504 at modbus_0x13.
-- Success --
--- Finished all readings from YosemitechY504 at modbus_0x13 ---
-- Collected result of reading 1 from YosemitechY504 at modbus_0x23 --
Putting 74.29 in result array for variable 0 from YosemitechY504 at modbus_0x23.
Putting 19.43 in result array for variable 1 from YosemitechY504 at modbus_0x23.
Putting 6.81 in result array for variable 2 from YosemitechY504 at modbus_0x23.
-- Success --
--- Finished all readings from YosemitechY504 at modbus_0x23 ---
- Starting reading 1 on YosemitechY520 at modbus_0x01 -
Starting measurement on YosemitechY520 at modbus_0x01.
- Success -
- Starting reading 1 on YosemitechY520 at modbus_0x11 -
Starting measurement on YosemitechY520 at modbus_0x11.
- Success -
-- Collected result of reading 1 from YosemitechY520 at modbus_0x01 --
Putting 260.43 in result array for variable 0 from YosemitechY520 at modbus_0x01.
Putting 19.10 in result array for variable 1 from YosemitechY520 at modbus_0x01.
Ignoring bad result for variable 2 from YosemitechY520 at modbus_0x01; no good results yet.
-- Success --
--- Finished all readings from YosemitechY520 at modbus_0x01 ---
-- Collected result of reading 1 from YosemitechY520 at modbus_0x11 --
Putting 268.79 in result array for variable 0 from YosemitechY520 at modbus_0x11.
Putting 18.84 in result array for variable 1 from YosemitechY520 at modbus_0x11.
Ignoring bad result for variable 2 from YosemitechY520 at modbus_0x11; no good results yet.
-- Success --
--- Finished all readings from YosemitechY520 at modbus_0x11 ---

@fisherba
Copy link
Collaborator

fisherba commented May 3, 2018

Uploading tonight for deployment tomorrow and on the first of my 5TMs when I used the EnviroDIY_ModularSensors@>=0.9.0, every other iteration of sensor test sent good values for 5TM. In the spottiness branch, every iteration of sensor test seems to send good values. What you've done is an improvement. We'll see how it does in the wild!

@SRGDamia1
Copy link
Contributor Author

Okay. I'm glad it seems to work. In the log you posted above it looks like it wasn't working.

@SRGDamia1
Copy link
Contributor Author

So, is this fixed?

@fisherba
Copy link
Collaborator

It's way better than the initial attempt. http://data.envirodiy.org/sites/NLP01/

@SRGDamia1
Copy link
Contributor Author

Does that mean fixed.. or do you still want me to try and work on this? If it's fixed, please close the issue.

@aufdenkampe
Copy link
Member

According to @fisherba, the data from this summer gave a lot of bad values.

@SRGDamia1, is the fix from this commit d347d50 likely to improve stability?

@SRGDamia1
Copy link
Contributor Author

I have no idea.

@aufdenkampe
Copy link
Member

I guess my question should have been rephrased: What was the motivation for that fix/commit?

@SRGDamia1
Copy link
Contributor Author

That "fix" to the 5TM was just because a few commits earlier that day (a72fe9b) I'd accidentally over-written the 5TM values with the D-Opto values when I was adding a few other notes. So it was just a fix to something I'd broken the same day and shouldn't make any difference at all to the actual working of the 5TM.

@aufdenkampe
Copy link
Member

Thanks. That's helpful to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants