I implemented the "reset" hack for XBee modules to overcome the duty cycle.
My setup stopped TX'ing after about 27 minutes without this.
Now the gluonpilot will send a reset command every 5 minutes. To do this, you need to know the guard time for entering command mode of your XBee module (GUARD_TIME "+++" GUARD_TIME --> entering command mode). Use the digi config tool to read it out. Mine was 1000ms, which is long and accounts for a total of 2,5 seconds of no communication. Make it smaller if you intend to control your plane over XBee.
Code in communication_telemetry_task() in communication_csv.c:
- Code: Select all
if (c % 6000 == 0) // reset every 5 minutes
{
uart1_puts("\r\nResetting XBEE...\r\n") ;
vTaskDelay( ( ( portTickType ) 1001 / portTICK_RATE_MS ) ); // guard time wait 1000ms
uart1_puts("+++");
vTaskDelay( ( ( portTickType ) 1001 / portTICK_RATE_MS ) ); // guard time wait 1000ms
uart1_puts("ATFR\r\n") ;
vTaskDelay( ( ( portTickType ) 10 / portTICK_RATE_MS ) ); // wait 10ms
}