diff --git a/README.md b/README.md index acc3918..bef22cb 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A typical example sketch for sending sensordata look like this. The sketch is optimized for very low power comsumption and unstable networks. - define SAMPLING_INT 32 + #define SAMPLING_INT 32 #define RF24CHANNEL 0x66 #define RF24ADDRESS 0x45c431ae12LL #define WITH_CHECKSUM 1 @@ -40,7 +40,7 @@ networks. client.setBuffer(myBuffer, 100); //use skip! initLCB(); //init time2 readBatLCB(); - startLCB(); + startLCB(); //Board blinks 3x } @@ -56,7 +56,7 @@ networks. #if WITH_CHECKSUM client.addChecksum(); #endif - sendOrBufferLCB(); + sendOrBufferLCB(); //Board blinks 1 time on success and 2 times on error //Read battery voltage _after_ long uptime!!! readBatLCB(); } diff --git a/libraries/BayEOSBoards/examples/LowCurrentBoard/RF24TemplateSPIFlash/RF24TemplateSPIFlash.ino b/libraries/BayEOSBoards/examples/LowCurrentBoard/RF24TemplateSPIFlash/RF24TemplateSPIFlash.ino index b983a8a..1c952e1 100644 --- a/libraries/BayEOSBoards/examples/LowCurrentBoard/RF24TemplateSPIFlash/RF24TemplateSPIFlash.ino +++ b/libraries/BayEOSBoards/examples/LowCurrentBoard/RF24TemplateSPIFlash/RF24TemplateSPIFlash.ino @@ -19,8 +19,8 @@ void setup() myBuffer.init(flash); //This will restore old pointers //myBuffer.reset(); //This will set all pointers to zero myBuffer.skip(); //This will move read pointer to write pointer - myBuffer.setRTC(myRTC, 0); //Nutze RTC relativ! - client.setBuffer(myBuffer, 20); //use skip! + myBuffer.setRTC(myRTC, RTC_RELATIVE_SECONDS); //use the rtc clock but relative + client.setBuffer(myBuffer, 120); //use skip! initLCB(); //init time2 readBatLCB(); startLCB(); diff --git a/libraries/BaySIM800/BaySIM800.cpp b/libraries/BaySIM800/BaySIM800.cpp index 558283d..f949cdc 100644 --- a/libraries/BaySIM800/BaySIM800.cpp +++ b/libraries/BaySIM800/BaySIM800.cpp @@ -36,8 +36,9 @@ uint8_t BaySIM800::init(void){ printlnP_OK("AT",200); printlnP("AT+CPIN?"); i++; - if(i>2) return 6; + if(i>2) return 8; } + if(_base64buffer[4]=='I') return 7; //NOT INSERTED if(_base64buffer[5]=='U') return 3; //SIM PUK if(_base64buffer[5]=='I'){ //SIM PIN printlnP_OK("AT",200); @@ -47,19 +48,24 @@ uint8_t BaySIM800::init(void){ if(wait_forOK(30000)) { return 2; //Wrong PIN } - wait_for("SMS Ready",20000); } + for(i=0;i<127;i++){ + printlnP("AT+CPIN?"); + if(! wait_for("+CPIN: READY",200)) break; + } + if(i==127) return 4; //No +CPIN: READY + // Waiting for Modem to Connect for(i=0;i<127;i++){ if(isRegistered()) break; delay(500); } - if(i==127) return 4; + if(i==127) return 5; for(i=0;i<127;i++){ if(isAttached()) break; delay(500); } - if(i==127) return 5; + if(i==127) return 6; printlnP_OK("AT+HTTPTERM",200); printlnP_OK("AT+SAPBR=0,1",200); diff --git a/libraries/BaySIM800/BaySIM800.h b/libraries/BaySIM800/BaySIM800.h index 476f648..5877ca1 100644 --- a/libraries/BaySIM800/BaySIM800.h +++ b/libraries/BaySIM800/BaySIM800.h @@ -53,9 +53,10 @@ class BaySIM800 : public BayEOS { * 1 == Communication-ERROR * 2 == PIN failed * 3 == PIN locked - * 4 == Not CREG - * 5 == Not CGATT - * 6 == No SIM Card + * 4 == No CPIN READY + * 5 == Not CREG + * 6 == Not CGATT + * 7 == No SIM Card * * if unlock_only is set, function returns already after unlocking the modem */