FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
569 views 8 comments
by anonymous
Hi!

I have a few questions about Teltonikas modems and if they can be used in my older AT+CMGS command style SMS sending applications.

1. My servers is running in a virtualized environment, how can I access the AT command interface from there, does the modems offer a TCP port to that I can use for example to connect to as a virtual COM port from within the VM to which the application can send the AT+CMGS string? Or do I need a Teltonika modem with a true old fashion RS232 which I then must convert with a serial IP converter to a virtual COM port? Model suggestion? RUT956?

2. Can more than one server access the modem and send SMS through AT command? I.e. the modem can accept TCP connections from more than one server simultaneously (if any at all)?

3. And last, our cellphone provider is shutting down 2G+3G in a near future (like they all do). Can Teltonikas 4G modems send SMS over 4G? (SMS is normally a 2G service).

Kind regards

David

1 Answer

0 votes
by anonymous

Hello,

  

  1. Currently, Teltonika routers/gateways do not support sharing of the modem AT command port with other devices over TCP. In this case, TRM240 or TRM250 might be the best devices, as they offer AT commands and data connection ports over USB. These ports can then be virtualized by your server and shared with the VMs accordingly.
     
  2. This depends on how the virtual ports will be set up, however, by default this communication is meant to be operated by one device at a time, as multiple clients sending different commands at the same time to the same port can cause quite a few issues.
  3. Both TRM240 and TRM250 support packet-switched SMS (EDGE, LTE, etc.) and circuit-switched SMS (GSM), however, for guaranteed compatibility I'd recommend going with TRM240.
Hope this helps!
  
Best regards,
DaumantasG
by anonymous

Thank your for your answers :)

2. I do understand that it may cause problems if several clients try to reconfigure the modem in different ways but just accepting just a few of the more simple SMS or read only AT commands should not cause conflicts I guess. I'm thinking about using something like Tibbo Device Server Toolkit (TDST) and with "on the fly" commands turned off (since these commands is manufacturer specific to the serial IP device).

I guess such multi TCP port AT command interface which I'm looking for must be carefully used and it must be the responsibility of the person who implements the solution to make sure AT commands from different clients are not conflicting in any way. In my applications only AT+CMGS and AT+CSQ to check signal is used.

I'm thinking of maybe running a python script as a service which pipes the input to gsmctl -A 'AT_command_input' and the output back through the TCP port. Do you think that will work?

3. Do all 4G modem/routers support packet-switched SMS or is this feature limited to only TRM240+250? I can't find "packet-switched SMS" in any datasheets :( And this seems to be consistent through all manufacturers, this is simply never mentioned... Therefore I'm thinking maybe this support can be taken for given on all 4G/5G products and it is just me worrying about it?

by anonymous
Hello,

  

The Python script route should work, but it also depends on the implementation. The hardest part would most likely be determining which answer is supposed to go to which client. However, if the script contains a buffer when the command is received, the script could wait for the command to get executed and return an answer before starting to process the next command.

As for AT+CMGS and AT+CSQ commands, both are supported by TRM240 and TRM250. Command AT+CGSMS can be used to specify if circuit or packet switching should be used. I'll send you a link to AT commands manual via private messages.

As for SMS support, all of our devices should support both packet and circuit switching.

  

Best regards,
DaumantasG
by anonymous
Hello!

I bought a RUT956 and wrote a python script to handle multiple clients/TCP connections, I can now send simple one line AT commands, so far so good...

Now, the AT+CMGS is supposed to give you a "> " prompt to input to and I can see that but then gsmctl just exits before any user actions. How does gsmctl accept the input here?

Kind regards

David
by anonymous

Hello,

  

For sending SMS messages, there is a separate gsmctl command:

gsmctl -S -s "<number> <text>"

Is there a reason this command does not suit your needs?

There is also another option to pass the partial or full modem control over the RS232 or RS485 ports. Then the RS → USB cable could be used to create an AT command port on your PC (RS → RS cable could also be used if the hardware supports it). This can be configured in the Services → Serial Utilities → Modem Control menu. However, in full control mode, the router will not be able to utilize the modem.

  

Best regards,
DaumantasG

by anonymous
I didn't write those applications that is going to send the SMS so I can't change the syntax/commands they are sending, they want a (virtual) COM port with AT syntax for communication. To use gsmctl -S I would have to write a parser for the AT+CMGS syntax (and some other ones like AT+CSQ that is also sent sometimes) and execute a correctly formated gsmctl -S using some extracted data instead of the much easier way of just passing the whole AT syntax data to gsmctl -A like it was a true AT interface :(

I don't want a physical RS232 or 485 since my servers are in a virtualized environment. And I guess that would make it harder to share a modem between several servers since only can talk to the port at a time. But maybe adding a connection in there adds an interface in /dev/ too which I could send AT commands to instead of going through gsmctl?
by anonymous

AT command interface is accessible in the /dev directory. This varies from device to device, but at least on my RUTX50, it is mounted on /dev/ttyUSB4. This can be checked by using the microcom tool, which is pre-installed on our devices, and connection to the AT interface is possible using the command

microcom /dev/ttyUSB4

You can check if you connected to the correct port by typing ATE1. If an OK answer is received, you have connected to the correct port (echo will be disabled before and after sending the command, so you will not see what you are typing). Would this approach be suitable for you?

If not, there is also USB over IP software available, which could make the AT port accessible directly on the VM manager, however, this would introduce the same issue as simply using the RS cable.

I'm not sure how your application works exactly, so I'm not sure what other solution could I recommend. As I understand it now, you are receiving pure AT commands from another software, and are basically forwarding those commands to the RUT956 with the gsmctl layer attached, is that correct?

  

Best regards,
DaumantasG

by anonymous
Ah, found it, ttyUSB2 it is on RUT956. I was looking for it previously but must have missed it :(

This could make it a bit easier than using gsmctl -A :) But then I will face some new challenges since only one user can have write access to the tty so I must write some logic to make sure I only send the command from one server/TCP port at a time and send back the answer to the correct sender, other commands will have to wait a bit. A bit tricky but certainly not impossible :)

Correct. As I said the application expects a COM port just like any old fashion GSM modem would have been attached to but as the servers are virtualized the COM port have to be a virtual one too which I connect to a remote TCP port with the tibbo serial IP driver.
by anonymous
Hello,

I'm not sure if there is anything else I can help with here, but I presume the easiest way forward is for the Python application to connect to this TTY port and forward the AT commands received from all of the VMs.

If possible, we would really appreciate it if you shared a brief overview of your use case afterward, in case anyone else would like to set up something similar!

Best regards,
DaumantasG