Response.statuscode = 200, but

I’m posting data to GroveStreams and it ran all night without a hitch. All of a sudden this morning, GroveStreams stopped displaying posted data and it appears it was not receiving data even though the IDE log indicates a response.statuscode of 200 to the http.put. I also noticed a couple of interspersed 403 codes in the log, which would suggest I’m getting to the server, but it isn’t always happy with the request (as I understand it). Thanks for any thoughts. By the way GroveStreams is a great service!

I’m not using GroveStreams, but are you sure you haven’t exceeded their data rate limit?

That would be my guess as well. How often are you posting data?

When you log the status code, try also logging the body of the response.

It looks like a 403 could be rate limit exceeded, or access denied: https://grovestreams.com/developers/rest_api_conventions.html

Here’s information I found on their rate limits: https://grovestreams.com/developers/limits.html

They’re doing diagnostics as well on this–we have a very good working relationship. They do think I’m exceeding their rate limit, so we’re wondering if EI is perhaps batching HTTP PUTs or if it’s being sent right on the heels of another device I have updating the same “organization” within GroveStreams. I’m issuing HTTP PUTs on a 1 minute period–far beyond their 10 second rate limit. Can anyone confirm if EI does batch up HTTP PUT calls. BTW, I really appreciate the quick feedback!!!

I’ve coded my agent to log resp.statuscode which is very helpful (I can see the 200s and 403s), but is there a way to see the message that accompanies that code? I tried resp.message based upon the documentation, but I’m getting an error that resp.message “index does not exist”. Thanks!

Finally (I hope), GroveStreams recommended I include a header X-Forwarded-For IP address for those instances where I have multiple devices behind one router. Can someone suggest the code for that (yes, I’m being a bit lazy, but have a deadline facing me)?

I’ve included the header in my code as recommended, but still don’t know how to get the imp’s IP address. So…I just put in a bogus one for now and it works fine. I also put in code to check for a 403 and introduce a 11 second delay before I resend the data. All seems to be working fine now, but I’d still really appreciate learning how to get the imp’s IP address and how to see the server’s response that accompanies the 200 or 403 status code. Thanks!

The documentation for sendsync and sendasync both describe the table you get in response.

The IP address of the imp won’t help since it’s the agent making the HTTP request, and not the imp. There is current no way to get the agent’s IP address.

OK. Makes sense…just wasn’t thinking. You know–haste makes…
Using a dummy IP address seems to work. I’ll just have to be sure to use a different one for each device at a site. Thanks!