Commit 5d49fd6b authored by TMRh20's avatar TMRh20 Committed by mz-fuzzy

RPi Bugfix: False Hardware Failure indication

Was finally able to successfully recreate conditions to consistently
cause 'HARDWARE FAILURE RADIO NOT RESPONDING' messages on RPI master
node:
1: Using RPi B2.0 with Raspbian 4.1.20+ armv61
2. Using 2 matching nrf24l01 non-PA modules w/ext antenna
3. Using RF24Gateway + RF24Ethernet
4. Using Arduino Due as RF24Ethernet node

Test scenario: Mesh working normally for very long periods of time.
Re-introduced an old node using Arduino Due. Immediately started
noticing error msgs on master node.

Solution: Increasing the wait time from 85 to 95ms seems to prevent
false indications of hardware failures. It appears, the code was just
not waiting long enough.
parent 874fee84
......@@ -798,7 +798,7 @@ bool RF24::write( const void* buf, uint8_t len, const bool multicast )
while( ! ( get_status() & ( _BV(TX_DS) | _BV(MAX_RT) ))) {
#if defined (FAILURE_HANDLING) || defined (RF24_LINUX)
if(millis() - timer > 85){
if(millis() - timer > 95){
errNotify();
#if defined (FAILURE_HANDLING)
return 0;
......@@ -844,7 +844,7 @@ bool RF24::writeBlocking( const void* buf, uint8_t len, uint32_t timeout )
if(millis() - timer > timeout){ return 0; } //If this payload has exceeded the user-defined timeout, exit and return 0
}
#if defined (FAILURE_HANDLING) || defined (RF24_LINUX)
if(millis() - timer > (timeout+85) ){
if(millis() - timer > (timeout+95) ){
errNotify();
#if defined (FAILURE_HANDLING)
return 0;
......@@ -891,7 +891,7 @@ bool RF24::writeFast( const void* buf, uint8_t len, const bool multicast )
//From the user perspective, if you get a 0, just keep trying to send the same payload
}
#if defined (FAILURE_HANDLING) || defined (RF24_LINUX)
if(millis() - timer > 85 ){
if(millis() - timer > 95 ){
errNotify();
#if defined (FAILURE_HANDLING)
return 0;
......@@ -965,7 +965,7 @@ bool RF24::txStandBy(){
return 0;
}
#if defined (FAILURE_HANDLING) || defined (RF24_LINUX)
if( millis() - timeout > 85){
if( millis() - timeout > 95){
errNotify();
#if defined (FAILURE_HANDLING)
return 0;
......@@ -998,7 +998,7 @@ bool RF24::txStandBy(uint32_t timeout, bool startTx){
}
}
#if defined (FAILURE_HANDLING) || defined (RF24_LINUX)
if( millis() - start > (timeout+85)){
if( millis() - start > (timeout+95)){
errNotify();
#if defined (FAILURE_HANDLING)
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment