Permalink
Browse files

Update by Igor Dutra

  • Loading branch information...
1 parent 8493a5f commit a5d121a9bfd01e7954230cdee379f05c30f2b861 @glynhudson glynhudson committed Feb 20, 2012
Showing with 16 additions and 6 deletions.
  1. +15 −5 NanodeRF_singleCT_Pachube/NanodeRF_singleCT_Pachube.ino
  2. +1 −1 readme.txt
@@ -94,7 +94,7 @@ int RFerror=0; //RF error flag - high when no data rec
int dhcp_status = 0;
int dns_status = 0;
-//int request_attempt = 0;
+int request_attempt = 0;
char line_buf[50];
@@ -262,7 +262,7 @@ void loop () {
// generate the header with payload - note that the stash size is used,
// and that a "stash descriptor" is passed in as argument using "$H"
- //request_attempt ++;
+ request_attempt ++;
Stash::prepare(PSTR("PUT http://$F/v2/feeds/$F.csv HTTP/1.0" "\r\n"
"Host: $F" "\r\n"
"X-PachubeApiKey: $F" "\r\n"
@@ -279,11 +279,21 @@ void loop () {
dataReady =0;
}
+
+// Reset the error flags as suggested by @fjhug on forum thread http://openenergymonitor.org/emon/node/363 every 100 requests - although not a definitive solution it massively increases long-term stability
+if (request_attempt > 100) {
+ #ifdef UNO
+ delay(10000);
+ #else
+ ether.begin(sizeof Ethernet::buffer, mymac);
+ dhcp_status = 0;
+ dns_status = 0;
+ request_attempt = 0;
+ error=0;
+ #endif
+ }
- #ifdef UNO
- //if (request_attempt > 10) delay(10000); // Reset the nanode if more than 10 request attempts have been tried without a reply
- #endif
}
//**********************************************************************************************************************
View
@@ -38,7 +38,7 @@ NanodeRF_SingleCT_rtc: example to receive data via RFM12B wireless from emonTx a
NanodeRF_singleCT_RTCrelay_GLCDtemp: example to receive data via RFM12B wireless from emonTx and post to emoncms, decode header to extract current time, transmmitt time to emonGLCD display, receive temperature from emonGLCD's on-board temperature sensor. See: http://openenergymonitor.blogspot.com/2012/01/emonglcd-getting-time-for-internet.html
-NanodeRF_SingleCT_Pachube (ALPHA): *this sketch has not been properly tested* please post experiances on the forums. Receive data via RFM12B wireless and post to pachube.
+NanodeRF_SingleCT_Pachube (BETA): Receive data from emonTx via RFM12B wireless and post to pachube. *this sketch has got known stability issues* please post experiances on the forums and feel free to improve!.

0 comments on commit a5d121a

Please sign in to comment.