sparkfunX / Artemis_Global_Tracker

A global satellite tracker utilising the SparkFun Artemis module, Iridium 9603N satellite transceiver and u-blox ZOE-M8Q GNSS
Other
14 stars 10 forks source link

problems receiving messages from the satellite #23

Closed jerabaul29 closed 3 years ago

jerabaul29 commented 3 years ago

Hi,

I am using the tracker to send messages through iridium, and this works well.

However, it seems that I have troubles sending messages to the modem.

What I do to send the message from Rock7

I think this should be correct

The code I have to receive messages

The code looks something like:

    int transmission_status = iridium_sbd.sendReceiveSBDBinary(
      iridium_tx_raw_buffer, tx_buffer_amount,
      iridium_rx_raw_buffer, rx_buffer_amount
    );

    Serial.println();
    Serial.print(F("rx_buffer_amount: ")); Serial.println(rx_buffer_amount);

    if (rx_buffer_amount > 0){
        Serial.print(F("received iridium command: "));

        for (size_t i=0; i<rx_buffer_amount; i++){
            Serial.print(iridium_rx_raw_buffer[i], HEX); Serial.print(F(" "));
        }

        Serial.println();
        rx_message_available = true;
    }

The result I get

I am very puzzled, because it seems that the modem gets to know that there are unsigned chars coming in, and it knows how many, but the transmission status is reported as failure, and the buffer is still filled with 0s when I try to read it. For example, trying to send the message "BOOT", I get:

rx_buffer_amount: 4
received iridium command: 0 0 0 0
iridium transmission failed
jerabaul29 commented 3 years ago

Activating the debug output it looks like:

OK
SBDIX MO code: 0
SBDIX success!
Incoming message!
>> AT+SBDRB

Waiting for response AT+SBDRB

<< AT+SBDRB
[Binary size:4][csum:308]Waiting for response OK

<< 
OK

transmission status [0 is success]: 8
rx_buffer_amount: 4

quite puzzled, not sure what the problem is.

jerabaul29 commented 3 years ago

Aaah, sorry, I understand, I had mis-understood the meaning of a parameter to the function. I will check and confirm.

jerabaul29 commented 3 years ago

Ok, so just to confirm. My problem is that I thought that the RX buffer should have size 270 and that the rx_buffer_amount variable was only for retrieving the number of bytes received.

But inspecting the code, this is not what the rx_buffer_amount is used to (or not only). It is used:

Of course, this is a "user error" in how to use the library, nothing to do with the tracker. Still think that the fact that this param is an "inout" is quite tricky and confusing as it is not documented in details either...

But now it is fixed :) Sorry again for the noise.

PaulZC commented 3 years ago

Hi JR (@jerabaul29 ),

There is some documentation on how to use the sendReceiveSBDBinary function in the IridiumSBD I2C Library: https://github.com/sparkfun/SparkFun_IridiumSBD_I2C_Arduino_Library/tree/master/documentation#data-transmission-1

image

Best wishes, Paul