Receive data

All the details on receiving both ASCII and binary data on your RockBLOCK

You can make a simple HTTP POST to our web service. The message is queued on the satellite network almost instantly, ready for RockBLOCK to download (on your command).

The Mailbox Check

Many applications might not require you to transmit many (if any) MO messages. Instead, these applications might rely on a steady stream of MT messages sent to your RockBLOCK.

Use the +SBDIX command to check for the existence of ASCII or Binary MT messages that are in the queue - this is called a mailbox check. During the mailbox check, the modem will send a blank MO message. This will result in a small charge for each mailbox check completed.

🚧

Cost of mailbox check

RockBLOCK Credits: 1 per mailbox check
Cloudloop fixed charge: $0.02 per mailbox check

/* Check modem communication */

AT\r

/* Receive response */

OK\r

/* Turn off Flow Control */

AT&K0\r

/* Receive response */

OK\r

/* Initiate an Extended SBD Session */

AT+SBDIX\r

/* Receive response */

+SBDIX: <MO status>, <MOMSN>, <MT status>, <MTMSN>, <MT length>, <MT queued>\r

/* See SBDIX Key for information on each parameter */

As you're only checking for MT messages, no MO message will be defined using the +SBDWT / +SBDWB commands.

πŸ“˜

SBDIX Key

The SBDIX command denotes the status of your sent, received and queued messages:

- Any returned number with a value of 0 to 2 indicates your message has been successfully transmitted. Any number above 2 indicates that the message has not been successfully transmitted.

- This number denotes the MO message number and cycles between 0 and 65535.

0 - No messages waiting to be received. 1 - New message successfully received. 2 - Error during mailbox check / message reception.

- This number denotes the MT message number and cycles between 0 and 65535.

- The size (in bytes) of the MT message.

- The number of MT messages in the queue waiting to be downloaded.

Let's consider that, after executing the +SBDIX command, the result is +SBDIX: 0, 1, 1, 1, 6, 8. This means that:

  • Your blank MO message has been sent successfully during the mailbox check.
  • This is blank MO message number 1.
  • You have successfully received a new MT message.
  • This is MT message number 1.
  • This MT message is 6 bytes long.
  • You have 8 more MT messages in the queue waiting to be downloaded.

This latest MT message now needs to be transferred to your controller before a new one is downloaded again via the same +SBDIX command.

🚧

You can only read one message at a time.

Your RockBLOCK's modem isn't equipped with gobs of memory. Make sure you transfer the MT messages to your Arduino/Raspberry Pi or other controller after each +SBDIX command using the +SBDRT/+SBDRB commands.

πŸ“˜

Line endings

Note that RockBLOCK expects commands to be terminated with a carriage return (\r) character. This is hex 0x0D.

Using a line-feed (\n) hex 0x0A character will not work!

Receive ASCII data example

Let's consider the eight MT messages queued above as being Hello1, Hello2, ... , Hello8. As you are transferring ASCII data, you'll need to execute the following commands to download and transfer them to your controller one by one.

/* ---------------------------------------------------------------*/
/* First mailbox check - sends blank MO and receives "Hello1" MT */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 1, 1, 1, 6, 8\r
OK\r

/* Transfer "Hello1" message to your controller */

AT+SBDRT\r

/* Receive response */

+SBDRT:\r
Hello1\r
OK\r

/* ---------------------------------------------------------------*/
/* Second mailbox check - sends blank MO and receives "Hello2" MT */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 2, 1, 2, 6, 7\r
OK\r

/* Transfer "Hello2" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
Hello2\r
OK\r

/* ---------------------------------------------------------------*/
/* Third Mailbox check - sends blank MO and receives "Hello3" MT  */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 3, 1, 3, 6, 6\r
OK\r

/* Transfer "Hello3" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
Hello3\r
OK\r

/* ---------------------------------------------------------------*/
/* Last Mailbox check - sends blank MO and receives "Hello8" MT   */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 8, 1, 8, 6, 0\r
OK\r

/* Transfer "Hello8" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
Hello8\r
OK\r

πŸ“˜

Receiving Binary Data

The system commands to receive binary data are exactly as described above, but you'll need to replace the +SBDRT command with +SBDRB.

Removing messages in the queue (ASCII)

It may be necessary to remove all the MT messages stacked in the queue - this is easily done, but there is a delay of one cycle. Let's consider that you'd only like to transfer messages up to "Hello3". At "Hello2", you'll need to issue the commands as shown below.

Β§/* ---------------------------------------------------------------*/
/* Second mailbox check - sends blank MO and receives "Hello2" MT */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 2, 0, 2, 6, 7\r
OK\r

/* Transfer "Hello2" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
Hello2\r
OK\r

/* Flush the MT buffer, deleting messages "Hello4" to "Hello8" */

AT+SBDWT=FLUSH_MT\r

/* Receive Response */

OK\r

/* ---------------------------------------------------------------*/
/* Third mailbox check - sends "FLUSH_MT" MO and receives "Hello3" MT */
/* ---------------------------------------------------------------*/

/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 3, 0, 3, 6, 6\r
OK\r

/* Transfer "Hello3" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
Hello3\r
OK\r

/* ---------------------------------------------------------------*/
/* Forth mailbox check - sends blank MO and receives "FLUSH_MT" MT */
/* ---------------------------------------------------------------*/


/* Execute Send/Receive */

AT+SBDIX\r

/* Receive response */

+SBDIX: 0, 4, 0, 4, 8, 0\r
OK\r

/* Transfer "FLUSH_MT" message to your controller */

AT+SBDRT\r

/* Receive Response */

+SBDRT:\r
FLUSH_MT\r
OK\r

Comparing SBDIX results from Hello3 in the normal and flushed examples:

Normal (SBDIX: 0, 3, 1, 3, 6, 6)

  • Successful transfer of blank MO message.
  • 3 Blank MO messages transferred so far.
  • MT message successfully received.
  • 3 MT messages transferred so far.
  • MT message size was 6 bytes.
  • 6 MT messages waiting in the queue to be downloaded.

Flushed (SBDIX: 0, 2, 1, 3, 6, 0)

  • Successful transfer of blank MO message.
  • 3 Blank MO messages transferred so far.
  • MT message successfully received.
  • 3 MT messages transferred so far.
  • MT message size was 6 bytes.
  • 0 MT messages waiting in the queue to be downloaded.

🚧

Remember: The MT buffer isn't flushed immediately

The command to flush the buffer is executed in the next cycle. If you want to download message MT[A] and clear the queue containing messages MT[A+1],MT[A+2],...,MT[A+N] you'll need to run the FLUSH_MT command at message MT[A-1].

πŸ“˜

R7 CORE / RockBLOCK admin ONLY!

The FLUSH_MTcommand is only available to devices which are running through the CORE or RockBLOCK portals. If you are a Cloudloop user, or running your RockBLOCK through a 3rd party provider, this feature is not available.

Removing MT messages in the gateway queue (Binary)

Use FLUSH_MT to remove messages queued in the Iridium Gateway and waiting to be downloaded.

/* Flush the gateway buffer, deleting binary messages equivalent to "Hello4" to "Hello8" */

AT+SBDWB=8\r

/* Receive Response */

READY

/* Stream Binary equivalent to FLUSH_MT - "46 4c 55 53 48 5f 4d 54" + <Binary Checksum>" */

464c5553485f4d54+<checksum>\r

/* Receive Response */

OK\r

AT commands in this chapter

+SBDIX[A]
+SBDRT
+SBDWT
+SBDD