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

Reply To: Coding to send data from a non-Mayfly logger

Home Forums Monitor My Watershed Coding to send data from a non-Mayfly logger Reply To: Coding to send data from a non-Mayfly logger


    @oakleynode something to note is that the MMW/ODM2 packet design with UUIDs make an extra heavy packet. The packet design is not optimally designed for wireless conditions, the thingspeak packets are much lighter. If your site is on the edge of the wireless range,  which varies a lot of with weather conditions, its going to have more trouble with the MMW UUID overheads. A site that I have on the very edge of wireless connectivity is https://monitormywatershed.org/sites/TUCA_GV01/.  I implement a sequence number in all my packets to be able to easily characterize reliability. I have been upgrading the antenna on the site to be able to improve the wireless signal strength.

    I’ve found  the server is pretty exacting, and the error responses are wip. In addition due to some undocumented compression routines on the server, if the POST timestamp is too old, and that region of the database its going to insert into is compressed,  it then initiates an uncompres for that region and that can take an undefined  looong, time . Which can the client POSTer to define a times-out.


    I’m an advocate of reliability for ModularSensors,   – and that also has meant characterizing the server, and in the process of testing my devices I’m finding server issues, one example   https://github.com/ODM2/ODM2DataSharingPortal/issues/685

    My reliability enhancements  can do multiples POSTs per connection . Over a celluar connection (with 9600bard to the modem) the first POST has had responses of ~ 2.5sec, and subsequent ones 10seconds. However the server is not set up to take too many serial POSTs.  Discussion https://github.com/ODM2/ODM2DataSharingPortal/issues/673#issuecomment-1692514992

    For the ODM example,  seems to me it is missing the “Content-Length: ”

    The best documentation is the code.


    I got the POST working on a Wio Terminal device (WiFi), but I needed to get wire-shark out to be able to sniff the packet to see exactly what the WioT device driver was outputting.

    Here is an example of a trace from the transmitting device that succeeded (with a couple of changes to UUIDs so this won’t work)

    POST /api/data-stream/ HTTP/1.1
    Host: data.envirodiy.org
    TOKEN: d9e65186-6cf6-4803-xxxx-4d9b1142bd48
    Content-Length: 508
    Content-Type: application/json


    and in this case over WiFi the response is faster

    — Response Code — 201 waited 632 mS Timeout 10000