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

Logging to ThingSpeak

Home Forums Mayfly Data Logger Logging to ThingSpeak

Viewing 7 reply threads
  • Author
    Posts
    • #13759
      Evan
      Participant

        Hello Everyone,

        I’m starting work towards logging data to ThingSpeak, and I’m wondering if anyone else has had any luck with this recently? I have found many discussions regarding logging to MMW, but little about ThingSpeak.

        The process seems relatively straight forward thanks to Sara and the resources available on GitHub. I have used the Mayfly for different projects, but have yet to utilize these fantastic guides. So, I am becoming familiar with PlatfromIO as well.

        I’ve got a Digi Xbee3 LTE-M modem, the LTE adapter, and I plan to use Hologram as my carrier. Any thoughts or pitfalls to be wary of that are not already noted?

        I intend to document my process and will share my thoughts/findings if others are interested.
        Thanks!

        -Evan

      • #13765
        Jim Moore
        Participant

          Hi Evan-

          I can’t provide any info on ThingSpeak and only have a limited knowledge based on some Dr Google research last night.  I currently have six of my Low cost EC stations deployed in Great Marsh (N. Chester County) plus two of the Mayfly decagon stations (BCMC3S and..4S).  The six EC stations are currently logging data to the µSD cards and have to be manually uploaded to MonMW which is rapidly losing its appeal!  I have been thinking of using the LoRa 900 MHz radios.  Without reinventing the wheel the LoRaWAN may be the way to go but that is currently above my pay grade!

          My other option is to simply fit my 6 sensor stations with 4G radios. I am hoping Sara and Shannon can help me with that.  I checked the Hologram pricing structure and its not at all clear what the base cost is.  GMI is supporting the two Decagon stations and the cost is $8/month plus $.60 per month for the second device so I am assuming that my additional cost would only be $3.60 per month.  Can someone confirm that?

          I have attached a GE image of the GMI array of sensors on most of the UNTs to the Great Marsh wetland.

        • #13767
          Evan
          Participant

            Hi Jim

            Thanks for your response. I’ve got a decent logger program using the Mayfly that saves everything to a microSD, thanks to the resources here. But you’re right…why should I have to go alllll the way to the sensor site to see my data?
            I’ve done some looking into the LoRaWAN myself, and if my sites were closer to one another, I would’ve for sure gone that route. I didn’t think it was too expensive?
            Check out this gateway: https://www.digikey.in/product-detail/en/laird-wireless-thermal-systems/RG191/RG191-ND/7356131
            only $250!
            And the Sodaq Explorer boards work well: https://support.sodaq.com/Boards/ExpLoRer/.
            I still would like to do some LoRaWAN, and if I do, these are what I plan to use.

            The Hologram site is indirect about pricing, intentionally, so I believe. I have signed up for the “Maker” plan, whose first SIM is free. If I can get this thing working, I intend to buy three more, for a total of 4. Because there are only four free channels with ThingSpeak, and my funding is drying up, and I believe four is all I can make. If I get that far, I will for sure, let you know what the cost seems to be. I only intend to measure four times an hour, so I don’t anticipate high rates of data transfer. But, having never gone this way, I guess I will see!

            But I am having a tough time getting this going…

            The recent change:
            Add waitForWarmUp() for modem in examples” is hanging up when compiling. It does not like this added command. Is this necessary, I see it was added to all modems?
            ~line 286 –> logging_to_ThingSpeak.ino

            I can comment it out, and I get past there, but it isn’t much longer until it is upset about the bits I pasted in for the Xbee3 LTE-M modem:

            #include <modems/DigiXBeeLTEBypass.h>

            const long modemBaud = 9600;  // All XBee’s use 9600 by default
            DigiXBeeLTEBypass modemXBLTEB(&modemSerial,
                                          modemVccPin, modemStatusPin, useCTSforStatus,
                                          modemResetPin, modemSleepRqPin,
                                          apn);
            // Create an extra reference to the modem by a generic name (not necessary)
            DigiXBeeLTEBypass modem = modemXBLTEB;
            It gets upset about the dangling “apn” stating that: “identifier “apn” is undefined.”
            Is this the Acess Point Name?
            Is there something I am missing? I have been scouring the boards before asking to no avail.
            Any help is appreciated
            -Evan

             

          • #13768
            Shannon Hicks
            Moderator

              There are lots of different places you can send your data.  ThingsSpeak is just one of several sites available that offer different levels of hosting, depending on how many stations you have, how long they’ll retain the data, and how the data is displayed.  You can even create your own mySQL database and free graphing site like I did back at the beginning of the Mayfly project more than 7 years ago.  But after adding hundreds of stations, we decided to create the MonitorMyWatershed portal to help with the increasing demand for adding new features, and receiving data from users all over the world.  It’s a powerful site, that we’re still constantly improving, but it makes sending and displaying environmental time series data easy.  But if you want to send your Mayfly data to any other site, that’s fine too.  There are several examples of people in this forum doing that.

              Hologram is just one of many cellular SIM card providers.  Again, you don’t have to use them, but we recommend them because of their ease of use, and their support of most of the cellular hardware we’ve found that’s compatible with the Mayfly.  Not all carrier and SIM card providers allow their cards to be used with the 2G, 3G, and 4G cell boards we’ve tested.  The data plans from Hologram cost $0.40 per MB.  So your monthly cost will depend on how often you send data, and how big your data payload is.  But for most of our stations, the cost is around $6 per month.

              I’ve successfully used 2G, 3G, and 4G boards with Mayfly loggers, depending on cell coverage at the many hundreds of locations we’ve deployed stations.  We also have boards that transmit their data via WiFi or Xbee radios.  I haven’t tried LoRa radios with them yet, but I know several people who have.  There are several threads on this forum where I mention the Xbee 900Mhz basestation-ethernet bridge I made that relays any data from the Xbee RF network onto the internet for uploading to the online database.  You can also buy commercial RF-ethernet bridges to do the same thing, for twice the money.  And they make LoRa bridges that do the same if you’d like to try that.

              Jim, I’d recommend just putting XbeePro HP-900 radios on your loggers and build a RF-ethernet bridge if you want to try that route.  Or the simplest thing is to buy more GPRSbee 2G cell boards to put on your stations since you still have great 2G coverage at all your sites, then just upgrade their code with the same code that’s running on your other 2 stations that transmit directly to MMW.  The code for doing that is on our GitHub repo.

            • #13770
              Evan
              Participant

                Hi Shannon

                I am not opposed to MMW at all, I had intended to use it from the beginning. I am familiar with Matlab and liked that its embedded, and if I go telemetric with my loggers, my funding will only allow for 4 loggers, so that worked out.

                I am finding that there is a lot that is new to me trying to get online, so progress has been slow. I may jump back over to MMW if I cant get speak to work.

                I definitely opted for Hologram, this is my first time through this and I leaned on the suggestions made about it.

                Thanks for the heads up about monthly cost, that’s really not too bad.

                 

              • #13777
                Sara Damiano
                Moderator

                  I’m sorry I haven’t been responding.

                  Right now the ModularSensors library doesn’t directly support LoRa or any other “radio” type communications – it’s designed around a board which has its own internet connection.  You could make it work with an ethernet/radio bridge, but it would take some more work.  So far we haven’t had enough sites where there were enough stations close enough together to push us to develop the radio support.  We have the stations right around our lab communicating by radio, but their operation is more of a first draft that we’ve not had a chance to upgrade than something I’d recommend you copy exactly.

                  As for ThingSpeak: it should work.  Yes, apn is the access point name and you need it to be correct before any cellular modem can send data on the network.  I guess that’s confusing in the ThingSpeak example because that example uses a wifi modem and wifi needs an network ID/pw instead of an APN.  In your code, either add a line const char* apn="hologram" above the modem definition or just replace the “dangling”  apn with "hologram".

                • #13791
                  Jim Moore
                  Participant

                    Hi Shannon-

                    I think I will go with the 2G network for my project.  I am not having much luck finding a source for the SIM800H.  Adafruit has them but on a different board. I ran all the numbers on the attached photo thru Dr Google without much luck.

                    Can you provide me with appropriate links to purchase this and the other bits and pieces I would need to get my EC stations on the air.  Also looking for the weather proof box with the clear lid for another project.

                    Thanks

                    Attachments:
                  • #13793
                    Shannon Hicks
                    Moderator

                      Jim, the 2G modules in your stations is the GPRSbee, made by SODAQ.  You can order it directly from them on their webshop (https://shop.sodaq.com/gprsbee-rev7.html), and they ship quickly from the Netherlands.  They used to be available through other vendors, but not anymore, so we buy them directly from SODAQ.  It come with the antenna and power jumper wire for connecting to the spare LiPo jack on the Mayfly.  Everything else you might need for building your station is in the shopping list found in the EnviroDIY sensor station manual (https://www.envirodiy.org/mayfly-sensor-station-manual/).  The enclosure we include with the starter kit is the RP1095C, available from several electronics parts vendors.

                  Viewing 7 reply threads
                  • You must be logged in to reply to this topic.