Home › Forums › Monitor My Watershed › Response code 504 sending data to data.envirodiy.org
- This topic has 9 replies, 2 voices, and was last updated 2019-10-10 at 3:40 PM by BrianJastram.
-
AuthorPosts
-
-
2019-10-07 at 11:05 AM #13210
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 -
2019-10-07 at 2:49 PM #13211
Maybe it’s a ModularSensors Library problem. I’m using version 0.23.11
-
2019-10-08 at 9:16 AM #13212
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:
123456789101109:00:16.719 -> Sending data to [ 0 ] data.envirodiy.org09:00:17.656 -> POST /api/data-stream/ HTTP/1.109:00:17.738 -> Host: data.envirodiy.org09:00:17.738 -> TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx09:00:17.738 -> Content-Length: 40509:00:17.738 -> Content-Type: application/json09:00:17.738 ->09:00:17.738 -> {"sampling_feature":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","timestamp":"2019-10-08T13:00:00Z","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":0.0,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":20.50,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":2.8,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":4.700,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":22.00,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":-93,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":32}09:00:17.738 ->09:00:29.527 -> -- Response Code --09:00:29.527 -> 504I 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
-
2019-10-08 at 9:35 AM #13213
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 -
2019-10-08 at 12:53 PM #13215
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.
-
2019-10-08 at 2:04 PM #13216
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
1234567891011121314151617181920212223242526272829303132333435; PlatformIO Project Configuration File;; Build options: build flags, source filter; Upload options: custom upload port, speed and extra flags; Library options: dependencies, extra library storages; Advanced options: extra scripting;; Please visit documentation for the other options and examples; http://docs.platformio.org/page/projectconf.html[platformio]description = ModularSensors example logging data to an SD card; src_dir = tutorials\logging_to_MMW; src_dir = .piolibdeps\EnviroDIY_DS3231_ID2079\examples\PCsync //http://www.unixtimestamp.com/ or http://time.sodaq.net/src_dir = SAVPW-RG[env:mayfly]monitor_speed = 115200board = mayflyplatform = atmelavrframework = arduinolib_ldf_mode = deep+lib_ignore = RTCZerobuild_flags =-DSDI12_EXTERNAL_PCINT-DNEOSWSERIAL_EXTERNAL_PCINTlib_deps =EnviroDIY_ModularSensors@=0.23.11; ^^ Use this when working from an official release of the library; https://github.com/EnviroDIY/ModularSensors.git#816badd339737d8eec3492bc36ea1a2db02e2aac; ^^ Use this when if you want to pull from the develop branchhttps://github.com/PaulStoffregen/AltSoftSerial.githttps://github.com/SRGDamia1/NeoSWSerial.githttps://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git; ^^ These are software serial port emulator libraries, you may not need themIt helps with libraries and stuff. It lives in your root directory (C:\Users\brian.jastram\Documents\GitHub\MWMO-Deployments)
-
2019-10-10 at 10:55 AM #13218
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
-
2019-10-10 at 11:14 AM #13219
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/ -
2019-10-10 at 3:20 PM #13220
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!
-
2019-10-10 at 3:40 PM #13221
Fantastic! That’s just great. It feels good to have helped.
-
-
AuthorPosts
- You must be logged in to reply to this topic.