Using Sim800L with Arduino Mega for Modbus TCP/IP

Hello!

I'm trying to get my Arduino Mega to run Modbus using Sim800L's GPRS. I've implemented Modbus on Mega before for wifi and serial, but with Sim800 I had no luck yet. Working with wifi and serial, I was able to find a lot of libraries and could identify the one I needed but in Sim800's case, I can't even find a library.

The point of the project is to get a sim card that has a static IP, use its GPRS to connect to it and control it using Modbus. I already got Sim800 to work, I can't make and recieve calls, send SMS or read them, connect it to GPRS and read data from internet.

Thanks for the replies in advance.

The point of the project is to get a sim card that has a static IP

A sim card doesn't have an IP address.

PaulS:
A sim card doesn't have an IP address.

So what's IP do we use while connecting to a 3G modem that has a sim card inserted into it?

So what's IP do we use while connecting to a 3G modem that has a sim card inserted into it?

The question doesn't make sense. The Arduino does not communicate with the 3G modem using ethernet. So, there are no IP addresses involved.

You may have the Arduino wearing an ethernet shield, too. If so, then the Arduino has an IP address, but that is not involved with how it communicates with the modem.

Just forget about the arduino for a second. When you insert a sim card to a 3G modem you can use it with a static IP. I used this before with PLCs to handle modbus registers. In that case I'd connect the PLC to the 3G modem with an ethernet cable.
Now in this project I have a SIM800L and an Arduino Mega. I want to do the same thing pretty much, with lower costs. In this setup my Arduino connects to SIM800 module with two cables, using serial. After your answers I feel really far now, what takes an IP in this scenerio?

You have to ask your GSM provider if they have this "fixed IP" option. Otherwise, they use DHCP and they never have the same IP address...

Have you read this document ?

Good luck

tk5ep:
You have to ask your GSM provider if they have this "fixed IP" option. Otherwise, they use DHCP and they never have the same IP address...

Have you read this document ?
https://cdn-shop.adafruit.com/product-files/2637/SIM800+Series_TCPIP_Application+Note_V1.01.pdf

Good luck

Yeah I have a fixed IP sim card. Thanks for the documentation I think it's actually what I needed. I'll work on it and if I can figure out I'll let you guys know as well. Thanks!