Closed mowca closed 7 years ago
at line 422 of MARS.ino
// initalize a counter to record how many bytes were read this iteration
int BytesRead = 0;
//// Read message from xbee
// xbee data arrives all at the same time, so its not necessary to remember
// it between iterations, so we use a local buffer
uint8_t ReadData[100];
// read the data from the xbee with a 1ms timeout
BytesRead = _readXbeeMsg(ReadData, 1);
// if data was read, record it in the Xbee Rcvd counter
if (BytesRead > 0)
{
XbeeRcvdByteCtr += BytesRead;
}
// if data was read, process it as a CCSDS packet
if (BytesRead > 0)
{
// log the received data
logPkt(xbeeLogFile, ReadData, BytesRead, LOG_RCVD);
// respond to it
command_response(ReadData, BytesRead, IMUData, ENVData, PWRData);
}
So it never sees BytesRead
as greater than 0
meaning BytesRead = _readXbeeMsg(ReadData, 1);
never gets valid info
Destination address was being set to 6 in transmitted packets. Xbee is configures as address 5 on mars
commands not sending valid command
Huh, that's weird. I must have made a mistake when transferring it from scorch
program is not getting BytesRead > 0