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 - 281 through 290 (of 465 total)
  • Author
    Posts
  • in reply to: uBee R410 setup issues #13582
    Sara Damiano
    Moderator

      It’s awesome that you’ve created your own publisher! I’m really excited you’ve been able to pick up and modify this library to be useful for something new!

      Ok. I see what’s happening. The R410M takes a *really* long time to close sockets (like 2 minutes). To speed things up, I call the socket close “asynchronously” – that is, tell it to close and move on. But what I think is happening here is that I’m telling the socket to close before opening a new one, just to be safe. (AT+USOCL=0,1 is close sock 0 with async flag) So the ‘close’ command goes out and the u-blox either spits out a not allowed error if the socket in question wasn’t open or says ok and starts doing whatever it is that takes it ages to do it to close a socket. In your case, it must believe the socket is open (it said ok). Then without waiting for that socket to finish closing, we ask the ublox to open a new socket (AT+USOCR=6 – open socket, 6=TCP, don’t tell it the number), which it does. But, idiotically, it assigns us the new socket as socket 0 +USOCR: 0 which it is supposed to be in the process of closing. It even happily sets socket options (USOSO) and connects (USOCO), but, low and behold, somewhere in there the socket close command finally took effect and when you try to write to the socket.. you’re not allowed. Why the chip isn’t smart enough to assign a new socket number when we try to create the new socket after asynchronously closing the old one, I do not know. I also don’t understand why it didn’t return an error when asked to close the socket. Based on your log, it shouldn’t have been open in the first place. I don’t think I’ve ever seen it do that before.

      Enough babble; how to fix it. Unfortunately, I think you’re going to have to do it within the TinyGSM library. In that library, open up the TinyGsmClientSaraR4.h file and scroll down to line 97ish. Un-comment the chunk for “synchronous close” and comment out the chunk for “faster asynchronous close”. It will slow you connecting down (by up to 2 minutes..) but hopefully it won’t reassign you a new socket overlapping a closing one.

      The double AT commands are because echo is being turned on by default every time the board powers up. I think the echo settings are *supposed* to be stored, but like the baud rate, are not. It isn’t a problem; the repeated commands get tossed. If you want to turn it off to save yourself some scrolling, you can find the modemWakeFxn in SodaqUbeeR410M and modify it to turn off the echo:

      in reply to: uBee R410 setup issues #13561
      Sara Damiano
      Moderator

        Doh. Yes, I thought of that as I was driving home. Do add the lines setting the wake pin high.

        Do you know what version of the firmware you’re running? To check, you can either hook it up to the u-blox m-center on your computer, run a pass through sketch and send it the commands AT+CGMR? and AT+GMR?, or tack these lines in after the modem setup:

        The AT+USOWR=0,##commands are attempting to write data over an TCP socket. Usually when I’ve seen the “operation not allowed” it’s either because either the socket was already closed somehow or it was never open in the first place. All those other commands that are failing are trying to check the socket status or get data from it. They’ll also spit out that “not allowed” error if the socket they’re asking about isn’t live. What happened in your log before that first failure? Were there any USOWR commands that got ok back? Was there a +UUSOCL in there (that means that the socket was closed externally)? What was the result of the +USOCR command (opening the socket)?

        The reason I asked about the firmware is mostly curiosity. One of the “improvements” in the latest version was related to it locking up and I have noticed improvements with the newer firmware, but it should be able to get through with the older version

        in reply to: Sleep code not working with Maxbotix 7389 #13559
        Sara Damiano
        Moderator

          a. We saw no evidence that the sensor had any issue related to condensation during the tests given that there was a hydrophobic coating on the sensor face and that the bad data occurred at random temperatures as opposed to only when the temperatures were low.

          That’s good to know. What was the fluoropolymer grease you used?

          b. Reading out the serial data with a pause between digits rather than at normal speed seemed to help eliminate bad data when the weather was warm. But, this did not solve the problem when cooler weather arrived in the fall.

          I’m not quite sure what your code looked like, but this doesn’t make sense, so of course it doesn’t make a difference. The Maxbotix talks to your Mayfly at 9600baud sending an R####\r every cycle (150ms-ish). That is exactly the rate that the Mayfly listens and records the data in. That’s not a changeable setting. Any “pause” you add in your code is just a pause in reading out from the buffer that whatever underlying serial library you’re using already stored the characters in. No matter the rate you read your data out from the buffer at, the input rate doesn’t change. The only caveat to that is that SoftwareSerial is just pretending to be a serial port and so it’s possible to throw off the character accuracy if the processor is doing too much when the characters come in. The result of the SoftwareSerial errors would be total garbage though (as in not even printable characters), not readings like “R0300\r”.

          c. There was no bad data during the testing of the sensor with continuously power independent of the Mayfly, including at temperatures well below freezing.

          Good to know it works. Good to know. Assuming you’re not manually triggering the sonar every time, that’s the internal range filtering doing its job. I’d guess you could get similar results by powering up the sonar just 5-10 seconds before taking a reading. Based on the spec sheet, it takes 5 readings for the filtering to take effect. It doesn’t specify the maximum number of readings the filtering considers, but the sonar “boots” up in ~160ms and, as long as pin 4 is left floating, completes a reading every ~148ms. So if you power up the Maxbotix for even 10s before you accept readings (10s before opening your serial port that is) it will have already had a chance to take over 60 readings which is probably plenty for good filtering.

          in reply to: uBee R410 setup issues #13551
          Sara Damiano
          Moderator

            Yes, it’s probably related to the same issues that @acgold had. These ublox modules just seem to be so much more finicky than the 2G SIM800’s were.

            Could you try switching to the “ModemLast” branch? That’s where the most recent work is and I’d prefer to do more of the troubleshooting on that branch since it’s mostly modifications to the setup of the modem.

            in reply to: Yosemite library cant be found! #13547
            Sara Damiano
            Moderator

              sensors/YosemitechY504.h is part of the ModularSensors library, not part of the Yosemitech library.

              You need to post more details of what exactly you’re trying to do and exactly what error messages you’re getting before I can help more.

              in reply to: uBee R410 setup issues #13542
              Sara Damiano
              Moderator

                I’ve attached some annotations showing what’s happening in your logs.

                in reply to: uBee R410 setup issues #13541
                Sara Damiano
                Moderator

                  Ugh. I should just get one of these R410 uBee’s just to help other people out.

                  It looks like it’s powering down when it’s supposed to be waking up and visa-versa.

                  I could babble at length about it, but my first suggestion to try and make it work it is to add a ~500ms delay [delay(500);] after the modemPowerUp() and another matching delay after the modem.wake(); in your setup function. Just see if that works.

                  in reply to: Editing Variable UUIDs #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.

                    in reply to: Yosemite library cant be found! #13537
                    Sara Damiano
                    Moderator

                      In what way does it “not see it?”. You mean a program won’t compile? Or you cannot see the examples in the library drop downs? What does you library folder look like? Your program? Do you also have SensorModbusMaster installed and include that in your sketch? The Yosemitech library depends on it.

                      in reply to: Yosemite library cant be found! #13534
                      Sara Damiano
                      Moderator

                        Is this what you’re looking for: https://github.com/EnviroDIY/YosemitechModbus

                        Did you download all of the libraries in this “Libraries” repository (https://github.com/EnviroDIY/Libraries)? I know there’s a big, green, inviting “download” button on the GitHub page, but because of the way the libraries are in linked repositories, if you download them that way all you will get is a bunch of empty folders. You have to download from this link (https://github.com/EnviroDIY/Libraries/blob/master/libraries.zip?raw=true) and then follow the instructions here: https://github.com/EnviroDIY/Libraries#installing-libraries-in-the-arduinocc-ide and here: https://www.arduino.cc/en/Guide/Libraries#toc5.

                      Viewing 10 posts - 281 through 290 (of 465 total)