UMDBPP / MARS

Arduino code for the Mechanically Actuated Release System (MARS), previously GANONDORF
MIT License
1 stars 0 forks source link

command response not working #10

Closed mowca closed 7 years ago

mowca commented 7 years ago

program is not getting BytesRead > 0

zacharyburnett commented 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);
    }
zacharyburnett commented 7 years ago

So it never sees BytesRead as greater than 0

meaning BytesRead = _readXbeeMsg(ReadData, 1); never gets valid info

mowca commented 7 years ago

Destination address was being set to 6 in transmitted packets. Xbee is configures as address 5 on mars

mowca commented 7 years ago

commands not sending valid command

zacharyburnett commented 7 years ago

Huh, that's weird. I must have made a mistake when transferring it from scorch