Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Sara Damiano

Forum Replies Created

Viewing 10 posts - 181 through 190 (of 465 total)
  • Author
    Posts
  • in reply to: Double_logger example modification #14055
    Sara Damiano
    Moderator

      @stoltzfus-12osu-edu – that is very interesting to know.  Do you happen to know exactly what version of the library you’d had prior to updating?  If not, how long (at least roughly) would the long time since you updated be?  A month or two? A year?  The specification for the post format hasn’t changed at all since it was first developed, but if there could be something in my code that changed about the way I create the post request that I’ve somehow overlooked and decreased the success rate, I want to track it down.

      in reply to: PlatormIO: ..Python 2.7 interpreter error #14044
      Sara Damiano
      Moderator

        It’s very, very intentional that ModularSensors uses that Atlas sensors only in I2C mode and I do not intend to change this.  When using Atlas sensors in UART mode, each sensor must have an individually dedicated UART port.  The Mayfly has exactly two hardware (processor implemented) UART’s – one dedicated to the computer/programming and the other dedicated to modem communication.  It is possible to replicate UART functionality with “bit banging” libraries like AltSoftwareSerial or SoftwareSerial, but both of these have serious limitations.  AltSoftwareSerial has acceptable quality communication but it is strictly limited to being used on pins 5 and 6 – which are spread on two different Grove ports on the Mayfly – and even then, monopolizes both of those pins.  SoftwareSerial has poor communication quality, conflicts with every other library using interrupts including those absolutely required to wake the logger from deep sleep, and besides requires two dedicated pins.  If the Atlas sensors are used as I2C devices, they can be connected to hardware already dedicated only to processor implemented I2C communication.  This gives them the best quality communication, allows up to 126 devices on the same connection, and does not waste other data pins on the Mayfly.  ModularSensors will continue to use I2C to support Atlas sensors.

        in reply to: Manual upload of CSV files on MonitorMyWatershed #14043
        Sara Damiano
        Moderator

          It would be so much better if the website at least told you *why* and upload failed!  All you get is a “failed” which could mean anything – the format was bad, the file was too big, there was an internet blip, who knows.  The only way right now to even get an inking as to why it fails is to turn on “developer tools” (F12 in Firefox, I think also in Chrome) in your browser before posting the data and then searching through all the many tiny requests on the console for the right post request and hoping the error message is there and is interpret-able – and often it isn’t.

          in reply to: Double_logger example modification #14042
          Sara Damiano
          Moderator

            Also, just so you understand, ModularSensors isn’t powerful enough to “stash” recent data and save it for later.  So when you’re in production and only connecting once an hour, the data being sent on the hour will only be for that one point.  If for some reason there’s something wrong with the cellular connection in that moment it is supposed to send (thunderstorm, planetary alignment, the XBee being moody, etc), the data will not be sent.  The logger will not try to send out the back-log.  You’ll have to go fill in the gaps later from the SD card data.  It’s definitely on my list to get that working so we could send more data per connection and reduce the connection overhead to data ratio, but I haven’t figured it out yet.

            in reply to: Double_logger example modification #14041
            Sara Damiano
            Moderator

              @w3asa – I don’t have formal training in computer science or even in electrical engineering.   I have one bachelor’s level degree – in chemistry.


              @stoltzfus-12osu-edu
              – two things with your code – and I completely understand why you did it the way you did – because the example did.  Blame the chemist.

              1 – you’re creating each variable 3 times instead of creating it once and then referring it to that same one later.  Each time you use that “new” keyword it creates a new variable, but you can only assign one variable of each type to a sensor so the other two weren’t getting updated.  In the double logging example it worked fine to create the variables with “new” right in the variable array because there was no overlap between the two arrays.  But that definitely wansn’t made clear and is confusing.  Anyway, to fix that change your variable arrays so that instead of creating a new variable they use the same variable that you already created up in the sensor sections like so:

              Since you only use the free RAM in one of the two arrays and battery in the other and you didn’t create either at the top, it’s fine to create them “new” in the array. If you decide you do want them in both or the look of the code bothers you, you can create the free ram and battery variables with statements like Variable *yourVarName = new ProcessorStats_FreeRam(&mcuBoard, ...) up in the processor section or elsewhere above.

              2 – Modems in ModularSensors are special; they don’t get updated like regular variables tied to a sensor.  The signal quality isn’t update until *after* you send out some data.  With each cycle, the signal strength saved to the csv and posted is actually the data from one cycle prior.  And if you never post data (you don’t) and explicitly update the modem metadata, the values don’t update.  You’d want to add publishing code like this in the “high” section right after turning off the SD card.

               

               

              in reply to: Manual upload of CSV files on MonitorMyWatershed #14034
              Sara Damiano
              Moderator

                The csv uploading tools are very sensitive to an irregularities in the files.  We would very much like to improve them, but right now that’s pending time and, mostly, budget.

                in reply to: MaximDS18 on I2C Hub #14029
                Sara Damiano
                Moderator

                  If your goal is to have everything on that one 4-port splitter – it won’t work.

                  The DS18 isn’t I2C – it’s OneWire.  If you really want to use it on that Grove port, you should be able to use it as either D16(SCL) or D17(SDA), but I strongly suspect that attempting to dual-use one of the I2C pins for OneWire would screw up communication with actual I2C devices (like the build in clock or ADC and your little display).  I’d be surprised if you could even get a sketch to run.  The I2C library (from Arduino core) has a bug (a while loop with no timeout) such that if either pin on the I2C bus is held low during any I2C communication the board will freeze in endless wait.  If you really have your heart set on that connection pattern, you can experiment with it, but I’d just just a different port if I were you.

                  in reply to: PlatormIO: ..Python 2.7 interpreter error #13994
                  Sara Damiano
                  Moderator

                    If you need the SD library in your program, you need to include it in your platformio.ini file in the lib_dep section.  Add RTCTimer and Sodaq_DS3231 there while you’re at it since it looks like you use them.

                    Other answers:

                    in reply to: PlatormIO: ..Python 2.7 interpreter error #13987
                    Sara Damiano
                    Moderator

                      You need to include the Arduino library – add #include <Arduino.h> to the top of your program.  The Arduino IDE adds that automatically and does some other “massaging” of files when it converts an ino to a real cpp file that gcc then compiles; PlatformIO doesn’t.  Depending on how you’ve structured your program, that may cause a few more snags.  The two things your most likely to hit are:

                      • pre-processor defines within a file (ie #define) which the Arduino IDE applies as global build flags rather than single-compile-unit defines
                        • the defines you have for pin numbers and headers are probably ok
                      • the basic cpp requirement that a function be declared or defined before it is used, which the Arduino IDE does some squirrlyness to get around.
                        • If you have any functions in your program other than setup(){..} and loop(){...} make sure they’re above the setup and loop functions.  You may also have to re-order your functions depending on the order in which you’ve created/used them.

                      Like most things, PlatformIO has some documentation on this:  https://docs.platformio.org/en/latest/faq.html#convert-arduino-file-to-c-manually

                      I don’t know what all you’re doing in your program, but I’m it might be easier to start with the ModularSensors examples and use the already existing support for Atlas sensors.  And, of course, documentation for that:  https://github.com/EnviroDIY/ModularSensors/wiki/Atlas-Sensors

                      in reply to: PlatormIO: ..Python 2.7 interpreter error #13981
                      Sara Damiano
                      Moderator

                        In episode 9, copy and paste from the folder that you already saved on your computer from when you cloned the whole library not from GitHub.

                        You should generally create a whole new project for each logger/program – just like in the Arduino IDE.  The platformio.ini file must be in the top level directory for the project – not in a sub-directory.  If you really want to have multiple loggers/programs in your project, each program must be in its own sub-folder and you must use the src_dir option within the platformio section of the platformio.ini file to specify which directory you wish to build from.  The structure of the ini file is well documented:  https://docs.platformio.org/en/latest/projectconf/section_platformio.html#src-dir

                         

                        I was under the impression you already knew there was 2G available before buying the units.  I don’t think it’s worth writing up a separate program just to check signal strength unless you’re planning to make multiple trips to the site, one to check signal and another to actually deploy the Mayfly.  You’ll see within the first few minutes of running your logging program if you have signal based on the blink pattern of the modem and whether data appears online.  If you find out at the last minute that you don’t have signal, just yank the modem off and deploy without it.  Your logger board will be powered up ~5-10s extra every logging cycle trying to communicate with a modem that’s not there, but unless you’re in a really shady spot or not using solar, it’s not worth stressing over.

                      Viewing 10 posts - 181 through 190 (of 465 total)