Murata Type 1SC: Send/Receive UDP Data

Start sending data to a UDP server, and from the server back to the device. For more information about getting started with the Murata Type 1SC, visit this guide.


1. Send data from your device

Open a UDP Socket

Replace YOUR_SERVER_IP and PORT with your server's ip address and port.

AT%SOCKETCMD="ALLOCATE",1,"UDP","OPEN","YOUR_SERVER_IP",PORT

Expected Response: SOCKETCMD: 1

Set Socket Options and Activate the socket

AT%SOCKETCMD="SETOPT",1,36000,1
AT%SOCKETCMD="ACTIVATE",1

Expected Response: OK

Send UDP Payload

Send the message Hello World encoded to hex using RapidTablesarrow-up-right: 48656C6C6F20576F726C64:

AT%SOCKETDATA="SEND",1,11,"48656C6C6F20576F726C64"

Expected Response: %SOCKETDATA: 1,11

circle-info

The payload: "Hello World" is 11 bytes in size. If you're sending a different payload, make sure to count the exact number of characters you send.

Close the Socket

AT%SOCKETCMD="DELETE",1

Expected Response: OK

On your server terminal, you should see:

circle-check

The SIM by default doesn't have a public IP address, hence can only send a downlink immediately after receiving an uplink, before the socket clses. The server responds using the same IP address and port from which the data was received.

To test this, you'll need a UDP server that sends a response. You can use socat with a script that logs incoming data sent to port 9000 and sends "ACK" as a response:


3. Test Bidirectional Communication

On your device, send data and wait for a response.

Start by opening the UDP port and send data to your UDP server:

Change YOUR_SERVER_IP with your server's IP address.

The response %SOCKETEV: 1,1 (not %SOCKETCMD: 1 ) indicates that a packet was received.

Read incoming UDP data

Example Response: %SOCKETDATA: 1,1,1,"61636B0A","Sender_IP",PORT

circle-info

The hex string 61636B0A decodes to ack)

Close the Listener Socket

Expected Response: OK

circle-check

🛰️ Listen for incoming UDP packets

Follow the steps below to configure the EVK in "server mode" (listening on a specific port).

Requirements for sending UDP data to the Murata kit:

  • Public IP Mapping (NAT) or VPN Configuration Ensure the EVK is reachable via a public IP address, either through NAT port forwarding or a VPN tunnel. This is essential for delivering UDP packets to the device.

  • Static IP Assignment Assign a static IP address to the device within your APN to ensure consistent and reliable routing.

Allocate UDP Socket in Listen Mode (e.g., port 6000)

Expected Response: %SOCKETCMD: 1

Activate the Listener

Expected Response: OK

Verify Listener Info (Optional)

Expected Response: %SOCKETCMD: "ACTIVATED","UDP","EVK_IP",,,6000

Send a UDP Message

circle-info

Now use the UDP Sender application on your PC to send a UDP message to the EVK’s IP address and listening port.

Wait for UDP Event Notification

The modem will notify when a packet is received:

Read Incoming UDP Data

Example Response:

(The hex string "48656C6C6F0D0A" decodes to Hello)

Close the Listener Socket

Expected Response:


Troubleshooting

  • No data received on server: Check your firewall allows UDP port 9000 (ufw allow 9000/udp)

  • Connection timeout on device: Verify the server IP address is correct

  • No downlink received: Make sure to call AT#XRECV before closing the socket

  • General connectivity issues: Check device logs at hub.monogoto.ioarrow-up-right to verify device registration and connection status

Last updated

Was this helpful?