Sending Data to N211 from server

Hi, I have recently obtained my SARA-N211 and I can send UDP data to our server, and I can echo data from the N211 to the server and back OK, which confirms I have 2-way connectivity.

But what I am struggling to do is to send data packets from our server to the N211.

I have been using Netcat to do this, but I appreciate that this may not be the best solution.

Even a simple ping test does not work from the server to N211.

Does anybody have any instructions or a preferred solution for this?

Thanks in advance

Your board is probably behind a NAT.
Have you checked that the IP of your board is the same as the sending address in the packets that arrives in your server?

To have proper bi directional communication you need your board to have a fixed IP that you can access. Either a public IP or an internal one if you have your own private APN.

You can get around this problem by piggyback on the current socket that is used when you send data to the server. Echo is usually done this way.

So for example push some data to the server hourly or daily. When you send data the NAT will link the device to a port on the NAT. You will receive the data in the server and send back the data to the address and port the data came from. As long as you keep sending data back and fourth the port bindings should stay the same.
You will need to set up the socket you are sending with on your board to also receive data.

It’s not perfect but it works. You are just bound to only communicate when the board initiates it. But in battery operated devices this is usually Ok.

If you have a public IP or fixed in your own APN it might be better to have one socket for sending and one for receiving.

I checked the IP address of the packets that arrive at the server, and as this is different, then yes I do appear to be behind a NAT.

Should I be able to ping this address?


You need to setup a UDP connection from the device to the server.
You should send a response message in order to send data back to the device.
The network doesn’t allow you to make a new connection on the same ip and port to the device behind the NAT.

Best regards,

Problem is kind of “solved”. Vodafone SIM cards are 6 month trial SIM cards, and this feature is not possible with trial SIM cards.
When we switch to production cards, then this will work

1 Like