Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Editing Variable UUIDs

Home Forums Mayfly Data Logger Editing Variable UUIDs

Viewing 37 reply threads
  • Author
    Posts
    • #13263
      jbiddle
      Participant

      Hi,

      I am currently attempting to edit the variable UUIDs in the DRWI_CitSci sketch with those for the sensors that are part of my system. In the sketch there are default UUIDs provided for each variable, including those for a CTD sensor. I’m not using a CTD sensor – can I just delete those lines from my sketch or should I keep them in with the default UUID provided in the sketch?

    • #13265
      Sara Damiano
      Moderator

      Delete them.

      • #13395
        jbiddle
        Participant

        Thanks for your response.

        I’ve been out of the office and am just now getting back around to trying to set up our data logger. This is my first time trying to set up one of these data loggers, and possibly more importantly is my first time working with Arduino, so I’m still working on understanding everything.

        In the DRWI_CitSci sketch I mentioned, I’m having a few issues verifying/compiling the sketch after editing the UUIDs and a few other variables. In the first few lines of the sketch there is:

        #include <Arduino.h> // The base Arduino library
        #include <EnableInterrupt.h> // for external and pin change interrupts
        #include <LoggerBase.h> // The modular sensors library

        The error I’m receiving is: Arduino: 1.8.10 (Windows 10), Board: “EnviroDIY Mayfly 1284p”

        sketch_nov25a:36:10: error: LoggerBase.h: No such file or directory

        Multiple libraries were found for “EnableInterrupt.h”
        Used: C:\Users\Owner\Documents\Arduino\libraries\EnableInterrupt
        #include <LoggerBase.h> // The modular sensors library

        ^~~~~~~~~~~~~~

        compilation terminated.

        exit status 1
        LoggerBase.h: No such file or directory

        This report would have more information with
        “Show verbose output during compilation”
        option enabled in File -> Preferences.

        Where can I find the LoggerBase.h library?

        Additionally, another error I’ve run into is for the #include <sensors/ProcessorStats.h> line. Again, no such directory or file found.

        If you have any guidance, it would be greatly appreciated. Thanks for your patience and helping work through/learn how to do this!

    • #13399
      Sara Damiano
      Moderator

      It looks like you’re using the Arduino IDE. Managing multiple libraries for the Arduino IDE is NOT easy – it is quite a hassle. Have you installed all the libraries following the instructions here: https://github.com/EnviroDIY/Libraries#installing-libraries-in-the-arduinocc-ide? Have installed them more than one time? When you open your Arduino library folder (likely documents/Arduino/libraries), do you see only one folder for each library. If you see multiple folders with the same names, (ie, EnableInterrupt and EnableInterrupt (2) ) then you do have multiple copies of libraries and must remove the extras. If you have not done any modification of you libraries and you haven’t programmed other boards in a way that you need to be able to reproduce exactly, I would start fresh by deleting everything in your Arduino/libraries folder and reinstalling them all following the directions I linked above. If you’ve modified any other library or you have other programs depending on the exact versions of your installed libraries, you’re going to have to manually go through them and delete the conflicting versions and install anything missing. All of the dependencies for ModularSensors are listed here: https://github.com/EnviroDIY/ModularSensors/wiki/Library-Dependencies (and of course ModularSensors itself is required).

      This difficult in managing libraries is the primary reason I would never recommend the Arduino IDE. PlatformIO makes this management much easier, even though it might seem scarier to beginners at the start.

    • #13539
      jbiddle
      Participant

      Hi Sara, thanks for your help.

      I unfortunately had to put this project on hold right after you help me with my last problem, so sorry for the late response.

      I managed to fix the library issue I was having (they were stored in the wrong subfolder), and I have a few new questions if you are able to help.

      When editing the UUIDs for each variable in my sketch, there is supposed to be a UUID for both the low and high values for the Campbell OBS-3+ Sensor (“TurbLow” and “TurbHigh”). However on Monitor My Watershed I only have one UUID for the sensor for my turbidity variable. Is there a way to create a UUID for each of the low and high values on Monitor My Watershed?

      Thanks in advance for your help.

    • #13540
      Sara Damiano
      Moderator

      The OBS3+ treats the low range and high range turbidity as if they’re two completely different things. So on Monitor My Watershed you actually have to create two different variables, one for each of the high and low range, just like you would separate temperature and depth from a CTD. I *strongly* recommend you add something to the notes field for each to remind you which is which. Once you’ve create two different variables on Monitor My Watershed, it will give you two different UUID’s.

      Here’s another site with the turbidity set up for both high and low range: http://data.envirodiy.org/sites/PKCV7S/

      If you really want to have only one turbidity field streaming, you can either pick one of the two or create a calculated variable that picks between the two depending on the turbidity. For most of our sites, we’ve decided to just stream the two separately.

    • #13762
      jbiddle
      Participant

      Hi Sarah,

       

      Thanks for your response. I once again had to put this on hold for a bit but I am back to trying to get it to work.

       

      As I’ve mentioned I am new to this type of thing, but I really think I’ve hit a wall here, and am wondering if I could benefit from a bit more in-depth help. I’ve followed the directions as closely as I could and edited the DWRI_CitSci.ino code as accurately as possible, but when I verify the code I am getting the mother of all error messages and I’m not really sure how to make heads or tails of it. I could post it here but it is very, very long. Is there a way you could continue to help walk me through this process?

    • #13769
      Sara Damiano
      Moderator

      Posting here is really the best way.  You can attach the output as a text file.

    • #13784
      jbiddle
      Participant

      Thanks Sara. I’ve copied the error message and attached it as a text file. As you can see there’s a lot going on and I’m not really even sure where to begin. Any advice you have is appreciated. Thanks.

    • #13787
      Sara Damiano
      Moderator

      That’s a lot of compiler errors!

      Could you post your program (“sketch_jan07a.ino”)?  I’m guessing based on the errors that there might be a stray quotation mark or a missing semicolon somewhere that’s throwing the whole thing off.

      It looks like you have also some of the libraries installed multiple times and I’m guessing some might not be installed.  Did I mention that library management with the Arduino IDE isn’t easy?  That’s it’s biggest downside.  ModularSensors has so many dependencies that managing them gets pretty painful pretty fast with the Arduino IDE.  (Sorry!)  But it is definitely doable!

      Can you check your library folder like I described back in November?  Again, if you’ve written programs before that you want to work again exactly as they did in the past, you’ll have to crawl through each library checking for versions, but if not you might as well delete them all and start over.

    • #13800
      jbiddle
      Participant

      You did mention that it isn’t easy! I did download PlatformIO and found it to be just as foreign to me, so instead of confusing myself with two different applications I figured I’d stick with the Arduino IDE for now. I just went through and deleted what I thought was my duplicate library, other than that I’m not sure what libraries might be missing as I’ve tried to follow the directions as closely as I could. I’ve attached the sketch. Thanks for taking the time to help me.

      Attachments:
      1. sketch_jan07a.txt
    • #13802
      Sara Damiano
      Moderator

      It looks like when you created your sketch, instead of starting with a completely empty file you pasted your code into the middle of the Arduino IDE’s placeholder code.  So there are chunks of that at the beginning and end which you need to remove.

       

      From the beginning, delete this :

      void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly:

      From the end, delete this :

       

      } // ========================================================================== // Main loop function // ==========================================================================

       

      The last line in your code should be a closing curly brace.

    • #13803
      Sara Damiano
      Moderator

      If you are still getting library compiler errors after fixing your sketch, I would strongly prefer to guide you through using PlatformIO. It really is easier, even though it feels much more “programmer” then the more “hobbiest” Arduino IDE.

      Very , very briefly:

      1. Open the “PlatformIO home”, and create a new project
      2. After your project is created, delete the contents of the new platformio.ini file and replace them with the contents of the same file from the folder where you copied your code from on GitHub
      3. Delete the contents of src/main.cpp and replace it with your corrected sketch
      4. Open the PlatformIO menu (looks like a bug) and select “build.” it should download the proper versions of all the libraries and their dependencies (which might lake a few minutes ) and then compile.

      If you really, really want to use the Arduino IDE and you can’t get it to compile there, please post a screen shot of your libraries folder for the Arduino IDE (probably in documents/Arduino/libraries or something similar). Make sure the screen shot shows everything. Also go to the Arduino IDE’s library tool and list out all the libraries and versions it shows are installed. Post the screen shot , your corrected code , and the full error log your getting so I can try to figure out where to help next.

    • #13804
      jbiddle
      Participant

      Thanks.

       

      So, that helped to eliminate most of the compiling error that I was receiving. I’ve attached the error message as I’m getting it right now.

      As for the libraries, I’m 99% sure I’ve deleted all duplicate versions of the libraries, so i’m not sure where it is finding the duplicate versions. I’d be happy to try out using PlatformIO. Going back to it now I remember why I gave up trying to use it a few months ago. Every time I start VScode it tries to install the PlatformIO, but it tells me that “PlatformIO: Can not find working Python 2.7 or 3.5+ Interpreter. Please install the latest Python 3 and restart VSCode.” I have the most recent version of python, Python-3.8.1. Along with that error message is a button to select “I have Python.” If I click that, it pops open an address bar at the top of VScode and asks for the full path to Python/Python.exe. That’s where I’m getting stuck as I am not exactly sure how to give it the correct path to the python.exe

    • #13806
      Matt Barney
      Participant

      The path to your Python.exe will likely be:
      C:\Users\<your-username>\AppData\Local\Programs\Python\Python38

      If you don’t find it there, you could try the method described here:
      https://stackoverflow.com/questions/647515/how-can-i-find-where-python-is-installed-on-windows

      -Matt

    • #13807
      jbiddle
      Participant

      Hi Matt,

      Thanks. I’ve tried that and am met with “Invalid path to python interpreter.”

       

      The path is C:\Users\Josh Biddle\AppData\Local\Programs\Python\Python38-32

    • #13808
      Matt Barney
      Participant

      Hmm, are you able to successfully open the python interpreter at that location? E.g., from Windows command line, enter

    • #13809
      jbiddle
      Participant

      Yes, I can open python by entering the location from CMD and Run.

    • #13810
      Evan
      Participant

      I had some issues with Python when switching to PlatformIO from the Arduino IDE.

      I had an older version of python installed, so I thought I would be slick and update before installing Visual Code and the PlatfromIO plugin. That is where I messed up and PlatformIO was pissed.
      What alleviated my issues were completely uninstalling all python and Visual Code bits, and reinstalling them together. When you download and install the PlatformIO plugin it looks for the path to the python.exe. If it can’t find it, or you tell it incorrectly, and it is crazy picky on the verbiage, it will become upset and provide you a link to go download it. Do this, and follow the prompts. Make sure you check the box to add python to the path! this is critical.
      Ensure that your path is correct within PlatformIO, but if you let PlatfromIO take the wheel it will remember where it was saved.
      Having only ever played with the Arduino IDE, I too struggled to get PlatfromIO going. But it is superior and I probably won’t go back to the Arduino IDE.

      Good luck!

    • #13811
      jbiddle
      Participant

      Hi Sara,

      Not sure what I was doing wrong initially but I’ve managed to get platformIO installed correctly on VSCode and I’m ready to proceed.

      For step two of your instructions above – “2. After your project is created, delete the contents of the new platformio.ini file and replace them with the contents of the same file from the folder where you copied your code from on GitHub” – what files/code do you mean exactly? The DRWI_CitSci.ino, once corrected, is what will go in the src/main.cpp location correct?

    • #13812
      jbiddle
      Participant

      Thanks Evan. I managed to enter the correct path and I’ve satisfied VScode for the time being. Not sure what I was doing wrong originally, but I try to not ask too many questions. Thanks!

    • #13813
      Sara Damiano
      Moderator

      The DRWI_CitSci.ino, once corrected, is what will go in the src/main.cpp location correct?

      Correct.  🙂

      The platformio.ini you need is here:  https://github.com/EnviroDIY/ModularSensors/tree/master/examples/DRWI_CitSci

      I’ve had problems with the python path before, not just with platformio, but with other programs as well.  I’ve had to uninstall and re-installed all of python and anaconda several times over the years.  It’s not been a huge number of times, but I haven’t ever tracked down the reason it got screwy.  I’ve kind-of accepted that as an annoyance of python.

    • #13814
      jbiddle
      Participant

      Great, thank you! So far so good. The other step I’m hung up on now is installing the libraries through platformio. I’ve entered the command

      pio lib -g install https://github.com/EnviroDIY/Libraries.git#platformio

      into the platformio terminal, and have received  this error: Error: Please install Git client from https://git-scm.com/downloads

      I’ve installed the Git client but when entering the command I’m receiving the same error. Any clue what to do here?

    • #13815
      Sara Damiano
      Moderator

      The git problem is probably another “path” issue.  Did you add git to your “path” when you installed it?  I don’t remember if the installer gives you the option.

      Try checking your path and adding the directory where git installed to it.  The git executable (git.exe) is probable installed in “C:\Program Files\Git\bin”  Here are some instructions for adding a directory to the path:  https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/

       

    • #13816
      jbiddle
      Participant

      I did not add git to your path when I installed it, but I followed the instructions on the page you provided and added the location, which was C:\Program Files\Git\bin and I am still getting the same error.

    • #13817
      Sara Damiano
      Moderator

      Hm.  Did you restart VSCode after changing the path?  Can you open up a new terminal and successfully run git?

      I’m sorry; I know dealing with these setup things can be really frustrating.  I really appreciate you working through it on the forum where it might be able to help someone else, too.  It’s been such a long time since I first started out that I forget the beginning steps.

    • #13824
      jbiddle
      Participant

      That worked! I restarded VSCode and entered the command again and successfully installed the libraries.

      I then went back and tried to “build” the program and ended up with a few errors. I’ve again attached the output in a txt file.

      That’s alright, thanks for taking the time to walk me through this. I wish I had a bit more experience doing this kind of thing, but I’m learning along the way.

    • #13827
      Sara Damiano
      Moderator

      I’m sorry!  It looks like it somehow missed the dependencies in the install.  Try running the command pio lib install EnviroDIY_ModularSensors

    • #13892
      jbiddle
      Participant

      Thanks Sara.

       

      I ran that command in the PlatformIO terminal and was met with another error which I’ve attached here. Once again thanks for taking the time to walk me through this. Hopefully we’re near the end of troubleshooting!

      Attachments:
      1. 3.4.20.error.txt
    • #13902
      Sara Damiano
      Moderator

      Huh.  It’s an “access is denied” error.  I’m guessing two processes tried to write to the same temporary folder – the automatic “check for new libraries in the library folder” process and the manual install probably collided.  Did you get the same error multiple times after exiting and reopening?

    • #13905
      jbiddle
      Participant

      For some reason I haven’t gotten it into my head yet to just close the program and try again.

      I did that, twice. The second time it seemed like it made some more progress before another error. So I closed the program and tried again and I think this time everything seemed to work. I’m not seeing any more errors and it looked like the libraries were installed correctly. I attached the contents of the terminal for you to verify that.

      Seeming like there were no issues with the library this time I tried to build function again and this is what I am now met with (attached below as build_error).

    • #13906
      jbiddle
      Participant

      Here are the attachments.

    • #13907
      jbiddle
      Participant

      For some reason I can’t leave a comment with more than one attachment.

    • #13910
      Sara Damiano
      Moderator

      There’s probably a missing semi-colon or brace in your program code somewhere right above line 215.

      Check first where you pasted in the UUID’s.  Each UUID should be enclosed with quotation marks, there should be a semicolon after both the registration token and the sampling feature and a comma after each UUID/variable in the UUID list.

      You can also check for matching braces by clicking each starting brace/parenthesis.  VSCode should highlight its corresponding closing brace so you can see if they’re closed appropriately.

    • #13941
      jbiddle
      Participant

      Thank you Sarah, I managed to fix those issues.

      I’ve attached the most recent error message and the code as it exists right now. The first “serial” that it mentions in the error on line 242 is the first “serial” under the Main Setup Function section of the code. It doesn’t look like I’m missing any closing braces so I’m not sure what the issue is here. Thanks again for your help.

    • #13945
      Sara Damiano
      Moderator

      In line 239/240 you’re missing the opening brace of the setup function.  It should be void setup() { with that opening curly brace.  You can put the curly brace right after the parenthesis on line 239 or by itself on line 240.

      Missing braces and semi-colons are such a pain.  The error messages they usually cause don’t help much.

      Also, your code is missing the “loop()” function – it will set everything up and then do nothing.  You probably want to add this loop (just paste it at the end of your current code):

       

    • #13948
      jbiddle
      Participant

      I’m catching on to that! I’m now faced with a new series of errors – “expected constructor, destructor, or type conversion before ‘(‘ token” is coming up on several different lines. I attached the new error message.

      It’s obvious that the code is just missing various braces, brackets, semicolons and the like. I was under the impression that I would be able to take the DRWI_CitSci code, edit in my unique values and I shouldn’t have to make much changes beyond that. I just don’t have the experience or know-how to understand what is missing or needs to be changed, even with the error messages. So sorry for the back and forth.

      Should the loop function code go at the very end of my code after everything else?

      Attachments:
      1. 3.17.20.error2.txt
    • #13952
      Sara Damiano
      Moderator

      Well, it really is that “easy.”  “All” you do have to do is create a new project/program, make sure it’s completely blank, copy and paste the example from GitHub into your new project, select precisely each UUID and delete the example junk text, select and copy the real UUID from the MonitorMW webpage and paste it in exactly the place you removed the example from, repeat that 7+ times, install all the libraries correctly, and compile and flash your Mayfly.  That’s it.

      It just that it’s actually kind-of tricky to make sure you’ve selected exactly the right text when you’re doing all the copy-pasting and if you didn’t remember to start with something blank at the beginning things get mixed up and then you have to start deleting and fixing and then you end up in this mess.

      Looking back at the old threads.. I told you to delete the loop because you had other junk after the end of the loop and I went back too many line.  Doh.  Totally my fault.

      After adding the opening brace I mentioned in line 239 and adding the loop at the very end, after everything else, your program compiles fine for me.  Did you by chance accidentally add both an opening and closing brace instead of just the opening one?  The editor helpfully adds the closing brace for you when you type the opening one.

       

    • #13953
      Sara Damiano
      Moderator

      Here’s your program that compiled correctly for me.

      Attachments:
      1. main.ino
Viewing 37 reply threads

You must be logged in to reply to this topic.