Emoncms Acknowledgement of data sent

Just wondering if there is any code that the Emoncms.org sends to tell that the sent data has been received ok to the sending device. I am looking at counting pulses and if my internet connection disconnects for any reason I would like the sending device to store the data until the connection is restored. 

Thanks

Robert Wall's picture

Re: Emoncms Acknowledgement of data sent

Yes, it sends back exactly that - "ok". Click on "Input API Help" on your Inputs page and try the example under APIKEY in your browser. You'll see "ok".

 

AJTaylor79's picture

Re: Emoncms Acknowledgement of data sent

Hi Robert, thanks for this. Do you know if the code for seeing this is already available for the emonBase units? If so what would I be looking for? Thanks

Robert Wall's picture

Re: Emoncms Acknowledgement of data sent

I assume you have not looked! If you do look at the emonBase code, you'll see that there is a handler for received data, especially the time (which is obtained from the server). You need to build on that code to do whatever you must. However, a warning that "ok" means that some data was received, the absence of it does not mean the data was not received by the server, only that you did not receive the response - and these are not the same thing.

AJTaylor79's picture

Re: Emoncms Acknowledgement of data sent

Hi Robert, thanks for your reply. I had looked but am always sure what I am looking for so your help is appreciated. Have you got any advice on what I should do or what others are doing to make sure that all the data is sent and to reset the counter and continue?

Robert Wall's picture

Re: Emoncms Acknowledgement of data sent

Sorry, I hadn't spotted your post until now.  Basically, as I hinted above, you have a difficult problem. If you don't get the acknowledgement, what does it mean? If you didn't get the acknowledgement because you didn't get the acknowledgement and you should send again, you double count. The only way I can see around this, which is probably much safer and easier, is to maintain a running count at the sending end and transmit the count each time rather than the increment. Then if transmission fails, so what? All you lose is the knowledge of the rate in the intervening period.  At the receiving end you do whatever sums you want to extract the rate. Unfortunately, as far as I know the public emoncms.org can't do this (but I'm open to correction on that).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.