Recent

Author Topic: "Smart" GPRS modem and IdTCPServer  (Read 4749 times)

shyub

  • Full Member
  • ***
  • Posts: 144
"Smart" GPRS modem and IdTCPServer
« on: February 07, 2022, 07:36:12 am »
Hi.

It is necessary to organize communication with level meters using a GSM network based on "Robustel m1000 pro v2" modems. However, these modems allow communication via the Modbus RTU protocol only between two points. And I have 13 sensors. The network protocol for TCP / IP modems.
Can I create a multi-threaded chat server based on IdTCPServer and poll sensors at a specified interval?
As an alternative, I consider the components TTCP_UDPPort, TModBusRTUDriver and TPLCTagNumber from the PascalSCADA library.
After all, such a problem is somehow solved ...

MarkMLl

  • Hero Member
  • *****
  • Posts: 8515
Re: "Smart" GPRS modem and IdTCPServer
« Reply #1 on: February 07, 2022, 09:13:05 am »
Can I just ask as a slight aside here: how much longer is GPRS supposed to work for? I get the impression that the operators are trying to railroad everybody onto Internet-style services even if they aren't really suitable for the application.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 6229
  • Compiler Developer
Re: "Smart" GPRS modem and IdTCPServer
« Reply #2 on: February 07, 2022, 01:34:54 pm »
Can I just ask as a slight aside here: how much longer is GPRS supposed to work for? I get the impression that the operators are trying to railroad everybody onto Internet-style services even if they aren't really suitable for the application.

I think GPRS will be with us for quite some time as that is part of GSM (also there are many embedded solutions that do use GPRS, so that might provoke some problems otherwise ;) ). It was only UMTS that the operators really got rid of.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8515
Re: "Smart" GPRS modem and IdTCPServer
« Reply #3 on: February 07, 2022, 02:16:06 pm »
I think GPRS will be with us for quite some time as that is part of GSM (also there are many embedded solutions that do use GPRS, so that might provoke some problems otherwise ;) ). It was only UMTS that the operators really got rid of.

That's my impression as well, and it's been pointed out that a very large number of units ("modems" etc.) has been integrated into e.g. personal alarms for the elderly. However I don't know where it fits into "5G".

I'm very wary of any proposed technology that forces an endpoint to have separate subscriptions for both communications (i.e. with a GSM service provider) and Internet (with an ISP). I've seen too many cases where somebody has said "what's this 'phone bill for... it's not making outgoing calls so let's cancel it" and adding another type of account will only multiply the risk.

(With apologies to OP for intruding on his thread, which is of interest to me as well.)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1566
    • Lebeau Software
Re: "Smart" GPRS modem and IdTCPServer
« Reply #4 on: February 07, 2022, 07:34:10 pm »
Can I create a multi-threaded chat server based on IdTCPServer and poll sensors at a specified interval?

Are the sensors acting as clients that connect to your server?  Do the sensors push data to the server at frequent intervals, or does the server have to actively poll them?  I'm not sure I understand what you are asking for exactly, or what "chat" has to do with sensors.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

shyub

  • Full Member
  • ***
  • Posts: 144
Re: "Smart" GPRS modem and IdTCPServer
« Reply #5 on: February 08, 2022, 05:58:18 am »
I'm more concerned not about who will be the client, who is the server, but the ability to use the Robustel m1000 pro v2 smart modem with a regular modem and the ability to use Indy or PascalSCADA components on the side of a regular modem.
Here is the description of the modem:
https://www.robustelanz.com/assets/files/ProductsPlatform/Product/M1000/UG/RT_UG_M1000%20Pro%20V2_v.2.1.1.pdf

af0815

  • Hero Member
  • *****
  • Posts: 1406
Re: "Smart" GPRS modem and IdTCPServer
« Reply #6 on: February 08, 2022, 07:20:01 am »
... but the ability to use the Robustel m1000 pro v2 smart modem with a regular modem and the ability to use Indy or PascalSCADA components on the side of a regular modem. ...
The m1000 is very multifunctional. But what kind of connection do you want to use ? Are you connection local over RS232/485 or over the phone modem with TCP (and there what kind of protocol) ?

Indy (maybe synapse too) will be a good choice for connection over tcp.
PascalSCADA (and other ModBus implementation) will be good if you want to use modbus over tcp or serial cable.

But you must decide what kind of communication you prefere.
regards
Andreas

ccrause

  • Hero Member
  • *****
  • Posts: 1082
Re: "Smart" GPRS modem and IdTCPServer
« Reply #7 on: February 08, 2022, 07:37:39 am »
I'm more concerned not about who will be the client, who is the server, but the ability to use the Robustel m1000 pro v2 smart modem with a regular modem
The user guide states that this modem can connect to a public IP address, or accept an tcp/ip connection. So I don't see a problem with using a regular modem on the "other" side of the tcp/ip connection.
Quote
and the ability to use Indy or PascalSCADA components on the side of a regular modem.
Here is the description of the modem:
https://www.robustelanz.com/assets/files/ProductsPlatform/Product/M1000/UG/RT_UG_M1000%20Pro%20V2_v.2.1.1.pdf
Both the m1000 and PascalSCADA supports Modbus TCP, so that combination should work (I haven't tested this).

ccrause

  • Hero Member
  • *****
  • Posts: 1082
Re: "Smart" GPRS modem and IdTCPServer
« Reply #8 on: February 08, 2022, 07:52:14 am »
However, these modems allow communication via the Modbus RTU protocol only between two points. And I have 13 sensors.
Just thinking out load here:
You can configure the m1000 as a modbus gateway (RTU <-> TCP). On the remote side, connect using modbus TCP protocol, the m1000 will handle the conversion to RTU on the sensors side.

Also note that modbus can address different devices, so if the sensors are physically close, you can connect multiple sensors to the same RTU bus and use a single m1000 modem.

Note that I'm no modbus expert  :-\

avra

  • Hero Member
  • *****
  • Posts: 2568
    • Additional info
Re: "Smart" GPRS modem and IdTCPServer
« Reply #9 on: February 08, 2022, 10:15:50 am »
It is necessary to organize communication with level meters using a GSM network based on "Robustel m1000 pro v2" modems. However, these modems allow communication via the Modbus RTU protocol only between two points. And I have 13 sensors.
Are you aware that MODBUS RTU is single master multi slave protocol, and that master can normally talk with up to 32 slaves on RS485, and only with one slave on RS322? That means that if you have 13 sensors with RS485 MODBUS RTU slave functionality - single master can read all of them if each has a unique address.

Quote
Robustel GoRugged M1000 Pro V2 is a rugged serial to cellular gateway
Are you aware that such a gateway can expose MODBUS RTU network in several ways, like TCP/UDP port (your app needs to talk MODBUS RTU protocol over TCP or UDP), like MODBUS TCP (you app needs to talk MODBUS TCP), or like virtual COM port (your app needs to talk MODBUS RTU over serial). This gives you many options to choose from, like using standard socket programming, some MODBUS TCP library, or some serial port or even better MODBUS RTU library. So you need to decide first which way to go.

Can I create a multi-threaded chat server based on IdTCPServer and poll sensors at a specified interval?
As an alternative, I consider the components TTCP_UDPPort, TModBusRTUDriver and TPLCTagNumber from the PascalSCADA library.
If I had to do it then I would make a communication thread with a loop that would poll sensors one by one over MODBUS TCP. Your mileage may vary...

Usefull MODBUS links:
https://forum.lazarus.freepascal.org/index.php/topic,57438.msg427071.html#msg427071
https://forum.lazarus.freepascal.org/index.php/topic,47289.msg338572.html#msg338572
https://sourceforge.net/projects/pascal-modbus/
https://www.pascalscada.com/modbus-rtu-and-tcp/
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1566
    • Lebeau Software
Re: "Smart" GPRS modem and IdTCPServer
« Reply #10 on: February 08, 2022, 08:02:11 pm »
Indy (maybe synapse too) will be a good choice for connection over tcp.
PascalSCADA (and other ModBus implementation) will be good if you want to use modbus over tcp or serial cable.

With some extra effort, Indy can be used with a non-IP transport, like a serial port.  You just need to write (or find) a custom TIdIOHandler-derived class that wraps the relevant APIs for opening the connections and reading/writing data.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018