-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On POST from Mayfly occasionally loosing data #483
Comments
That's what I would have expected as well. |
@neillh10, we are currently having some difficulties with server resources that might be causing unexpected drops. I'd like to check the server logs - could you share the IP address from which the data are POST'd? |
Hi @tslawecki thanks for the quick response. Right now to facilitate Mayfly integration testing its on a simple accelerated 2min between readings, and then accumulate 2readings and post them. So its on a fairly async 4min schedule. A POSTLOG record is so the core Time above the record 1595511000,1,4.685,-31 would have been formated on the outgoing post as , sequenceNumber, Vbat, RSSI So would be no further attempts made. Currently there are NO repeat attempts, though that is what I am now working on, and was hoping to run it over the weekend. I'm away as from tomorrow for a few days. My algorithm, (unless you suggest otherwise) is if I don't get a Http Status 201, is to store the record, for a later repeat attempt. From past experience with wireless systems, there can be times when there is a fog or other atmospheric conditions where there is no wireless connection to the cell tower. Then of course when the weather clears up, the connection is established. |
I've added the following comment to the description //establish a connection to internet over modem |
I had some overnight tests running - POSTing every 14minutes with a 3min delay. That is 2min readings, and collecting 7samples before attempting the POST. tu_rc_test05_TimeSeriesResults 200724_0703.xlsx Debug log of the start of the test run. I'm planning on putting on a test that is the target for the hydrologists - samples every 15minutes, take 8 samples, then upload (every 2hours). I'll try an offset of 7minutes to shift it off the the 15minute interval. |
In a test run last night 404 POST attempts, spaced as 2 POSTS every 4minutes, 399 successfully pushed ALL the records. 4 of the POSTS failed to be recorded at ALL (success, not a partial record). The testing time was from UTC 2020-07-28 2:54 to 2020-07-28 16:20 ~ my IP still shows as the same above However starting from 2020-07-28 6:54, none of the POSTs received a response HTTP Status 201. But of these 205 POST attempts, all 201 were actually fully inserted into the database, with 4 not being there. I can tell from the EnviroDIY_Mayfly_SampleNum The 4 that never made it into the server database, where all at the same time between UTC (server time) 2020-07-28 6:50 and 2020-07-28 7:02 The none HTTP Status 201, were largely timeouts ( no response received from server). Taken from the Mayfly POSTLOG (Mayfly POST time, followed by HTTP status) In case its useful, I restarted the test this morning UTC Mayfly 2020-07-28T17:19:00-08:00 , all readings with retrys successfully delivered. For testing purposes, I inspect my private test log, and of course I love recording successes!!!. The new test format is take readings 2minutes apart, post after 8 readings, with an offset of 1minute. The first 8 POSTs are attempted whatever the http response is. This test record is 2020-07-28T17:51:00-08:00 first 5 POSTs, 504, but then received 201s. Then immediately repeated the 5 failed POSTs with success. Then all 8 POSTs status 201 on the following attempts |
@neilh10, this detailed info is very useful! @tslawecki, any thoughts? |
Oops just did POSTS from a Mayfly I'm preparing for the field with a Xbee3 LTE Verizon, and it inserted a partial dataload. Its target is https://monitormywatershed.org/sites/tu_rc_test04/ Unfortunately I can't see what the IP number (I'll output it next build) - and the RevX Systems interface is very simple. Here is the listing with Mayfly_SampleNum at end 2020-07-29 9:45 | -8:00 | 2020-07-29 17:45 | 0.16198 | 0.0257 | 18.35 | 15.42 | | | | | -81 | 5.14 | 4 tu_rc_test04_TimeSeriesResults_200729_1353.xlsx This is the series of 8 posts as seen from the Mayfly debug log, Field EnviroDIY_Mayfly_SampleNum (Seq), 1->8 ... zzzZZ Processor awake @ 1596019920 <--LoggerBase
|
I've put in some code that lists the Xbee LTE modem IP. |
@neilh10, it would be very helpful to hear what you are experiencing since we found a fix for the intermittent Gateway server errors, as described in #484 (comment). |
After some extensive testing this last week, I'm seeing complete delivery of the whole records. No Partial records. Hurrah. |
While doing some new Mayfly development, extending the functions so that there is a sendEveryX readings, some POSTED individual readings appears to be lost, while a record with timestamp is still accepted.
This sendEveryX feature allows the Mayfly data logger to collect samples, and then periodically setup a connection to the internet, and send all the previously connected data samples on one TCP/IP connection.
edit :
Looking at the code the algorithm is
//establish a connection to internet over modem
repeat while there are SensorsReadings Queued
{
_outClient->connect(enviroDIYHost, enviroDIYPort // establish a TCP/IP connection,
then POST it
_outClient->readBytes(tempBuffer, REQUIRED_MIN_RSP_SZ); // read any response
_outClient->stop(); //tear down TCP/IP connection
}
// Turn off modem
edit_end
delete , only one POST was made per TCP/IP connection. end_delete
From the Mayflys functionality each POST is a unique event.
I would expect that either the whole record is accepted, or the whole record is lost.
At this point, I've not checked what HTTP Status code the Mayfly received for the partial record.
Just wondering if there is some thing I should be doing differently. Thanks.
Test Detail
With this test run the Mayfly, it is setup to take a minimal set of readings every 2minutes, and sendEveryX=2.
So does two POSTS, in quick succession, every 4 minutes, with either 5secs between POSTS (timeout no response from server), or if an ack was received, HTTP Status 201, an immediate 2nd post.
For an overnight test run from 2020-07-23 0:26 (line 4732) to 2020-07-23 19:12 (line 5292) - attached XLS
there are 12 data losses at
2020-07-23 1:04 2020-07-23 2:04 2020-07-23 2:08 ..
A standard post with data sequence is SampleNumber, Vbat, RSSI
and Mayfly debug lists this on a sample POST
POST /api/data-stream/ HTTP/1.1
Host: data.envirodiy.org
TOKEN: e47f83b1-51c6-4be9-9951-c0029849a39b
Content-Length: 228
Content-Type: application/json
{"sampling_feature":"bdcb95ef-097e-4013-8c5f-73810e4bba55","timestamp":"2020-07-23T11:50:00-08:00","199c4833-482b-43af-a0da-8db5fdc64871":4,"2ab799ea-0ff5-4798-b9a6-9549345f7310":4.685,"ac3c5798-2004-4fc3-9679-111977c6b0a8":-30}
and for the above sequence it received a
HTTP/1.1 2014-4fc3-9679-111977c6b0a8
which is take to be a successful POST. Sometimes there is no response from the POST and times out after 5seconds.
The target is https://monitormywatershed.org/sites/tu_rc_test05/ and downloaded data is
tu_rc_test05_TimeSeriesResults 200723_1215b.xlsx
The text was updated successfully, but these errors were encountered: