swarm - trying to receive a message

I bought this board at SF and started my first test using the windows Swarm_M138_GUI.exe

I had a rssi of -94 and I was able to send two messages and within an hour saw them in the web console:

https://bumblebee.hive.swarm.space/messages

then i tried in messages, send a new message

I never saw anything come in the windows Swarm_M138_GUI.exe (tried messages received oldest, newest)

back in the web console the next day I saw this so it seems to have queued it up:

Message 48673011

Sent To Device

0x03567

Date Requested (EST)

2023-02-23 17:23:01

a day ago

Date Sent to Ground Station (EST)

2023-02-24 00:04:59

17 hours ago

Date Sent to Satellite (EST)

2023-02-24 01:44:14

16 hours ago

QUESTION 1. Can I use the windows Swarm_M138_GUI.exe to receive a message ? If so I must be doing something wrong.

For more advanced testing I want to connect the modem with a ESP32 and read I have to open the jumper links on the back of the board to use the TXO and RXI pins directly.

I also read If you are expecting to receive a message, make sure you have the Messages Received notifications enabled, via the $MM N=E message.

I saw three different examples of receiving messages but not sure which one I should be using ?

Example9_ReceiveTest (don’t see $MM N=E in this code but thought it was required to receive messages ?)

  • Enable message notifications

  • Set up a callback for the unsolicited $RD receive data messages

  • Print the messages from the callback

Example17_RxMessageManagement

  • Get the received message count

  • Read the newest unread message

  • Read the oldest unread message

Example19_ReadSingleRxMessage Read a single message using its msg_id

QUESTION 2 - can you recommend which example to try with an ESP32 to receive a message sent from the web console https://bumblebee.hive.swarm.space ?

thanks

Hi @ jimk123,

Question 1:

You can use the GUI to read received messages, but you need to enter the commands manually into the message window:

$MM C=U

$MM C=*

$R=O

$R=N

etc.

If you are doing this manually, I recommend writing down the message ID number (msg_id) so you can re-read the message using that ID number. There is no “list all read messages” command.

"

Reading the newest received message:

$MM R=N*01

$MM AI=10650,6578616d706c65206d657373616765,21990235111426,1584494275*52

The message (msg_id = 21990235111426) is returned. The message was sent with the application ID 10650. The hexadecimal data returned is 6578616d706c65206d657373616765 (in ascii = “example message”). The epoch seconds at which the Modem received the message is 1584494275 (Date/Time = Wednesday, March 18, 2020 1:17:55 PM). This message is now marked as read.

"

There is more information about receiving messages here:

https://forum.sparkfun.com/viewtopic.ph … 75#p239075

Question 2:

Example9 print the receive signal strength (RSSI). It does not access the received messages.

Example17 is the best place to start. It tells you how many messages have been received and lets you read them one at a time.

Example19 lets you read a single message using its msg_id. Please see the comment above - I recommend writing down the msg_id each time you read a message.

Looking at the latest Swarm modem manual, I see that they have added a $MM L=U command which will list the ten oldest unread messages. That is a new feature with firmware 2.0.2. I do not think it is possible to upgrade the modem firmware. You will only be able to use this command if your modem is running 2.0.2 or 2.0.3.

https://swarm.space/swarm-m138-modem-product-manual/

Best wishes,

Paul

Actually, Example13 is the best place to start for received messages. It enables the message notifications and will print the notification each time a new message arrives. If you want to access messages that have already been received, then use Example17.

Best wishes,

Paul

thanks for the quick reply Paul, I will continue testing !

Hi Paul

I got a larger ground plan , 16" aluminum disc and the signal is now around -100db

$RT RSSI=-100*1c

$RT RSSI=-100*1c

$RT RSSI=-101*1d

$RT RSSI=-101*1d

I sent a message from the swarm console and tried the commands you suggested but got some errors:

$MM C=U*0B

$MM 0*10

$MM C=**74

$MM 0*10

$R=O*20

$CMD ERR,CMD_NOTIMPLEMENTED*0d

$R=N*21

$CMD ERR,CMD_NOTIMPLEMENTED*0d

$MM R=N*01

$MM ERR,DBX_NOMORE*5c

in the swarm console it shows:

Date Sent to Ground Station (EST)

2023-03-02 15:28:06

13 minutes ago

Date Sent to Satellite (EST)

2023-03-02 15:31:42

9 minutes ago

I assume the ‘Date Sent to Satellite’ means it is queued up in the satellite and ready to receive on them modem ?

thanks

some more info,

in the m138 widows GUI there are buttons I tried pressing those but no new message.

message received - notify enable (MM N=E)

message received - count unread (MM C=U)

message received - read oldest (MM R=O)

message received - read newest(MM R=N)

$MM N=E*16

$MM OK*24

$MM C=U*0B

$MM 0*10

$MM R=O*00

$MM ERR,DBX_NOMORE*5c

$MM R=N*01

$MM ERR,DBX_NOMORE*5c

once I run enable messages does the modem download and store any new incoming message internally and then when I run get message receive count unread it should show a value=1 and then I run the get newest or oldest message ?

Ah, sorry. That should be:

$MM R=O

$MM R=N

to read the oldest and newest message.

Keep trying $MM C=U . When it returns a value > 0, you have an unread message.

Date Sent to Satellite means the message has been sent from the ground station to a satellite that will be passing over your location. You need to keep your modem on until the satellite passes overhead and attempts to ‘downlink’ the message to your modem.

btw the blue LED is flashing pretty often and in dashboard, devices it says last heard Mar 2, 2023 3:57 pm, so I assume that is a good sign.

A good sign… Good luck!

re: Keep trying $MM C=U . When it returns a value > 0, you have an unread message.

will do, thanks

Hi Paul

I still cannot receive a message, here is the sequence of commands I am trying:

seems to get a good signal

$RT 1*17

$RT OK*22

$RT RSSI=-100*1c

$RT RSSI=-100*1c

$RT RSSI=-100*1c

$RT RSSI=-100*1c

$RT RSSI=-100*1c

I run this command once to enable receiving messages

$MM N=E*16

$MM OK*24

then periodically I run

$MM C=U*0B

$MM 0*10

once it has a value of 1 that means the modem downloaded the message from the satellite and I can view it ?

MM R=N

Do you have access to to a Swarm M138 https://www.sparkfun.com/products/21287 and confirm this works ? If I cannot get this working I will have to ask SF to return it.

thanks

Hi,

If you can successfully transmit a message, then you should be able to receive a message. The modem needs to be able to receive a signal from the satellite in order to transmit an uplink message.

You need to be a little careful. Once you have read a message, or marked it as read, you can only read it again if you know its message ID. (That’s the one thing I don’t like about the Swarm modem.)

I will try to find time to set up and test a modem over the weekend. Downlink worked OK for me last year - when I wrote the library and GUI - but I haven’t tested it since then.

Until later,

Paul

Thanks Paul

OK. I have my modem and antennas connected up. I’m going to document these tests as I go, so there will be several posts over the next few hours…

I’m using the SparkFun Swarm modem, connected to my PC via USB. The TX and RX jumpers are closed.

My Swarm modem is running firmware v2.0.0 ($FV 2022-02-05T00:02:19,v2.0.0*03).

I’m using a passive GPS antenna - but only because I have a very early version of the modem and it does not provide the 3.3V for an active antenna. All later modems provide power for an active GPS antenna.

I’m using the Swarm antenna with a square aluminium ground plane (8" x 8" - the same size as the SparkFun PCB ground plane). It is mounted on a pole, just above the roof line of my house. It is connected to the modem via 15m of RG58 cable.

I’m running the GUI on Windows 11 Pro. I’m running the .exe from the GitHub repo.

(Just FYI: I compiled the GUI .exe on an older Windows PC and uploaded that to GitHub last year. I will try and find time today to make the GUI compile itself using GitHub Actions. That way it should be possible to create GUI executables for Linux and MacOS too.)

The red LED on the modem has stopped flashing. The green LED flashes once every few seconds. This shows I have a good GPS signal.

RSSI is about -96 dB:

I am going to disable the Receive Test messages so I can see the message notifications. I have enabled Message Received Notifications. I have no unread messages:

I am going to transmit a “Hello World” test message so the Swarm system knows my location:

I’ve logged into Hive and have queued a “Send Message”:

The uplink message went through after about 70 minutes:

The downlink message has not yet been sent to satellite:

morning Paul,

so far so good , that is what I am seeing on my side. curious in the swarm web site if you click on “devices” does “last heard” timestamp match up with when your “hello world” message got sent ? In my testing that time stamp only seems to change when it transmits a message, At first I thought it was a ping and would would update when a satellite passed over but that does not seem to be the case.