GL865-DUAL using it to transport MODBUS

10 thoughts on “GL865-DUAL using it to transport MODBUS”

I have several years coding for this modules, but are some step that I can never perform.

How I can detect silence at the serial/s ports? I need to detects when the serial don’t hace more information (silence) and dispatch the serial’s buffer content.

Modbus don’t have EOF character or stream to detect, so what is the way to perform silence detect and dispatch or send the data. All this issues is done using the module running python script, in transparent mode the modem have his own internal timmer, but how I can use that if I’m running python code?

I don’t need to decode the MODBUS data, only fordward it the my server.

The problem with MODBUS and with all binary protocols are they don’t have EOF char.

So we must detect then the streams ends. The only way is using a timeout.

For this, at py manual from telit:

SER.receive(timeout)

This command receives a string from the serial port TXD/RXD waiting for it until the timeout is expired. The return value will be the first string received no matter of how long the timeout is. The input parameter timeout is a Python integer, which is measured in 1/10s, and represents the max time to wait for the string from the serial port ASC0. The timeout range is (0 ÷ 32767).

The return value is a Python string which is an empty string if timeout expired without any data received, otherwise it is the string consisting in the data received.

Example:

a = SER.receive(15)

Coding:

while (1):

read= SER.receive(15)

if (read != ”):

SER.read(”data: ‘)

SER.send(read)

SER.send(‘rn’)

For example I send "HELOOOOOOOOOOOOO". At this stream we don’t have any inter-char delay is a complete TX.

It give me back:

data: HELOO

data: OOOOOOOOOOOOOOOOO

So, I don’t know any way to implement this function, for me my conclusion is that SER.receive don’t work properly. I test this in GM862-GPS, GM862-PY and GL865.

I understand the phyton low priority. But for this reason is used an UART controller. This is the controller that must store the data and let you know when you can use it.

This hardware part it runs with minimal control from the main CPU, and you can operate it in any moment in a unattended way (a hw-serial). If you want to implement this in a CPU that don’t have UART you can do it well if you setup correctly the cpu’s hardware interrupts (a software-serial).

I always have the same response from telit partners about priorities, but the py is operating via the UART, I mean we read and write the UART not the directly the serial ports so the priority will be not an issue.

My conclusion is that the UART control is wrong implemented, some staus register is not used or implemented in a wrong way.

This is easy to test. send data to the SER2 and then runs a py script, it will read the stored data and print it.

We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE