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

Response code 504 sending data to data.envirodiy.org

Home Forums Mayfly Data Logger Response code 504 sending data to data.envirodiy.org

This topic contains 9 replies, has 2 voices, and was last updated by  BrianJastram 3 days, 10 hours ago.

  • Author
    Posts
  • #13210

    dan@wachusett
    Participant

    I am in need of help troubleshooting why my Mayfly logger cannot send data to EnviroDIY.
    Here are some details from the serial monitor:

    09:51:58.564 -> Now running DWRI_CitSci.ino on Logger WACHUSETT-01
    09:51:58.564 ->
    09:51:58.564 -> Using ModularSensors Library version 0.22.6
    09:51:58.564 -> WARNING: THIS EXAMPLE WAS WRITTEN FOR A DIFFERENT VERSION OF MODULAR SENSORS!!
    09:51:59.201 -> Logger timezone is set to UTC
    09:51:59.201 -> RTC timezone is set to UTC
    09:51:59.201 -> This logger has a variable array with 5 variables, of which 5 come from 3 sensors and 0 are calculated.
    09:51:59.201 -> Current RTC time is: 2019-10-07T13:52:05Z
    09:51:59.201 -> Logger setup finished!
    09:52:03.976 -> Attempting to connect to the internet and synchronize RTC with NIST
    09:52:28.204 -> Clock set!
    09:52:28.204 -> Setting up sensors…
    09:52:29.260 -> Data will be saved as WACHUSETT-01_2019-10-07.csv
    09:52:29.260 -> Putting processor to sleep
    10:00:00.234 -> ——————————————
    10:00:06.335 ->
    10:00:06.335 -> \/—- Line Saved to SD Card —-\/
    10:00:06.335 -> 2019-10-07 14:00:00,0.0,21.10,2.8,4.761,23.00
    10:00:06.335 ->
    10:00:06.335 ->
    10:00:24.801 ->
    10:00:24.801 -> Sending data to data.envirodiy.org
    10:00:37.415 -> — Response Code —
    10:00:37.415 -> 504
    —————————-
    Data is being written to the sd card, but it keeps failing when trying to send the data. When I look at my Hologram account I can see that the data is being sent. So for some reason the EnviroDIY server is not able to accept the data coming in.

    I checked all of the UUIDs, registration token and sampling feature. They are all correct. Is there something else I need to do in order for this to work? Please let me know if other information is required to help troubleshoot.

    Thanks for your help!
    Dan

  • #13211

    BrianJastram
    Participant

    Maybe it’s a ModularSensors Library problem. I’m using version 0.23.11

  • #13212

    dan@wachusett
    Participant

    That was a good suggestion Brian. I updated my ModularSensor library from GitHub to version 0.23.16. I am still getting the 504 Response code however:

    I am unable to tell from this output if something is not right. The first line looks suspicious – “Sending data to [0] data.envirodiy.org”.
    Perhaps someone else can spot something not right in this output?

    Thanks

  • #13213

    BrianJastram
    Participant

    Dan,
    My output looks like this:
    Sending data to [ 0 ] data.envirodiy.org
    POST /api/data-stream/ HTTP/1.1
    Host: data.envirodiy.org
    TOKEN: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Length: 318
    Content-Type: application/json

    {“sampling_feature”:”XXXX”,”timestamp”:”2019-10-08T07:25:00-06:00″,”XXXX”:0.00,”XXXX”:4.806,”XXXX”:23.00,”XXXX”:-57,”XXXX”:90}

    Response Code —
    201

  • #13215

    dan@wachusett
    Participant

    Brian,

    Other than your Response code [201], the only difference I see between my output and yours is that you use a 6 hour offset from UTC, while I do not. I know my data is being transmitted because I can see the event in the activity log on my Hologram IO account. Did you use Arduino IDE or Platform IO? Would that make any difference in how the sketch is compiled and uploaded to the Mayfly? I used Arduino IDE.

  • #13216

    BrianJastram
    Participant

    Dan,

    I’m using Platform IO.
    I assume you’re talking about the ‘Recent Data Sessions Table’ when you referenced the hologram activity log. I use that also and have noticed (and submitted a ticket for the fact) that when my data makes it through to MMW a single data session uses about 2-3 K bytes of data and all these other times I’m experiencing data NOT being transmitted to MMW there is still 300-400 bytes of data in a data session.

    Regarding differences in how the sketch is compiled, I was guided to Platform IO for this MMW project. One thing Platform IO has is this Platformoi.ini file

    It helps with libraries and stuff. It lives in your root directory (C:\Users\brian.jastram\Documents\GitHub\MWMO-Deployments)

  • #13218

    dan@wachusett
    Participant

    I was able to compile and upload the sketch using PlatformIO on Atom, however the Response Code 504 persists. I used the ModularSensors Library version 0.23.16. Since the data is being written to the microSD card and the 2G cell modem is sending the data to EnviroDIY, I am out of ideas on why the EnviroDIY host is not able to take the data. I double checked all the UUIDs again, they are all correct.

    Any other ideas on what could be going wrong? I am getting no error messages, so its difficult to debug anything.

    Thanks

  • #13219

    BrianJastram
    Participant

    Dan,
    That is so frustrating. It sounds like you are making good efforts at troubleshooting.
    Besides trying ModularSensors Library version 0.23.11 and checking that the *.ino file and Platformio.ini file are not conflicting I’m running out of ideas. You’ve got your modem connected to the internet but that MMW connection just ins’t happening.
    You might find some clues in this post: https://www.envirodiy.org/topic/logging-to-mmw-with-gprsbee-rev-7-issue-wake-sleep-and-server-response-504/

  • #13220

    dan@wachusett
    Participant

    Brian,

    I rebuilt the project with ModularSensors Library version 0.23.11 and it worked! I don’t really know what all the differences were between versions, but I did notice a couple of things that may have been the cause (though maybe not, I really have no idea what most of these settings mean)…

    I Removed the suggested build flags from my .ino file for the GSM_RX Buffer, Max Packet size and GSM_Yield.
    I noticed that the 0.23.16 had a buffer set to 64, whereas library 0.23.11 has it set to 512. Perhaps that was an issue???
    Also, I tried to change the timeZone to 0 so it would use UTC and I got the 504 Response Code again, so maybe this was the actual problem in the first place. After I switched back to timeZone = -5 the data was uploaded to EnviroDIY just fine. I got my sensor out in the water today:
    http://monitormywatershed.org/sites/WACHUSETT-01/

    Thanks for all the assistance, I really appreciate it!

  • #13221

    BrianJastram
    Participant

    Fantastic! That’s just great. It feels good to have helped.

You must be logged in to reply to this topic.