You are not logged in.

Dear visitor, welcome to Round Solutions M2M and wireless Support Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, September 19th 2017, 11:26am

Running AT-interface AND Python, both doing GPRS at the same time?

Hi again forum. Long time, no see.

We have a GL-865 Dual and a JN3 in which we intend to run a lot of python positioning logic, reporting thrugh GPRS on a socket. It works great.

But this is to run simultaneously with the existing application, an embedded CPU that uses the GL-865 Dual's serial AT-interface to send data through GPRS (on another socket #).


Both applications work great, one at a time. But by using AT#STARTMODESCR=2 we try to run AT command interface (with GPRS) at the same time as we run python (with GPRS, same settings, different socket).


And here it gets dizzy.


AT interface "stops answering". Python connects to our server but doesn't transmit properly.


(Also: this way python has no debug output since serial 0 is used by the AT interface, and serial 1 is used by the gps.)



Does the forum know if there are issues with trying to make such a complicated setup? Should we forget it and put all the logic in the CPU?

2

Tuesday, September 26th 2017, 11:59am

OK, so I have found a few caveats:

Module and its subsystems is not fond of multitasking, there are bottlenecks.

Read chapter 7.2 in Telit_E_Script. It's short.

There are several AT commands that are unsuitable in a multi-party system (python plus AT interface), but you will have to sift through the whole AT Reference manual to find them!

Do not include SER, it will grab hold of the serial port ASC0 -> not CPU access to AT interface

Look out for unsolicited messages, they may appear on EVERY AT interface, in the middle of what you're doing. One such is positioning by the cellular network - the position ended up in pythons data as well.

Do NOT access SIM card simultaneously from python and from ASC0

You will need some semaphore function so that CPU and python don't access the same services. Note that CPU and python cannot talk to each other directly: Serial port 0 goes to AT interface, I2S and SPI are Master Only on the modem. What's left is IO-pins.

However I invented a semaphore by setting an unintrusive AT command, for example AT+CLVL (1..5)=CPU wants something, AT+CLVL (6..10)= python wants the same thing. AT+CLVL=0 = it's free. By regularly reading AT+CLVL? you see what the other party wants.

Typically GPRS is frail if both parties (CPU+python) talk (needs semaphore), but Your Mileage May Vary.

Regularly run EXECSCR from the CPU, it will keep python alive if it has crashed.

Python has a watchdog, but it only works if python works, i.e. if your program hasn't crashed.

Don't use different PDP settings in CPU and python. Be relaxed, i.e. check if PDP and socket setting are fine instead of just resetting modem on error.

Watch out for back currents between IOs if you turn off CPU and rely on Telits low power timer/wakeup

You will have to debuglog python to disk since it has no SER. In my case ASC1 (the other port) is occupied by a GPS!

Rate this thread