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
1,156 views 2 comments
by anonymous

Hi

I have multiple RUT240's and some do not receive an answer if I send a USSD to my mobile provider. We are using the same prepaid service and the same provider.

Command used on firmware RUT2XX_R_00.01.12.3

gsmctl -U '*130#'
cat /tmp/ussd

Command used on firmware RUT2XX_R_00.01.11.3:

gsmctl -A 'AT+CUSD=1,*130#,15'
microcom -t 5000 /dev/modem_data

Log from a device where it works:

root@Teltonika-RUT240:~# gsmctl -A 'AT+CUSD=1,*130#,15'
OK
root@Teltonika-RUT240:~# microcom -t 5000 /dev/modem_data
+CUSD: 0,"Ihr Restguthaben ist CHF 13.85",15


Do you know what's going on?

Kind regards,

Roland Rusch

by anonymous

Hello

I found out more about the mentioned issues.

1) The command gsmctl -U seems to generally not work on the RUT240 (at least until firmware 1.12.3)

2) You can get the response from a USSD if you send the AT+CUSD command like this:

By default, the Quectel EC25 chip sends the asynchronous response (=URC; unsolicited result code) back via command-channel. This means you send the USSD command and gsmctl disconnects from the channel before the answer is received. But it is possible to receive the answer via data-channel and fetch it by using microcom. To achieve this, you have to configure EC25 to send the URC to the data-channel: 

gsmctl -A 'AT+QURCCFG="urcport","usbmodem"'

The configuration is saved to NV immediately and stays there even after factory reset. You can then get the response by executing the following:

root@Teltonika-RUT240:~# gsmctl -A 'AT+CUSD=1,*130#,15'
OK
root@Teltonika-RUT240:~# microcom -t 5000 /dev/modem_data
+CUSD: 0,"Ihr Restguthaben ist CHF 13.85",15

Take care, as the microcom command just catches everything that is sent to the data-channel while the 5000ms. Your provider could also send sms and other network data at the same time. 

I have a few RUT240's working now with this modified config of the Quectel EC25. No problems found so far. But I'm not 100% comfortable with changing default config in NV. I'm not responsible if you brick your device or something even worse happens. It would be really cool if Teltonika implements a official and working way to get the USSD response.

Regards,

Roland

2 Answers

0 votes
by anonymous
Hello,

Are these test results were obtained using the same RUT240 device?
by anonymous
Hello,

the first 2 examples were on the same device, the last example is from a different device.
0 votes
by anonymous

Hello,

Correct, as you mentioned, when modem sends USSD command to network provider, it "disconnects from the channel before the answer is received". This is because answer from operator is not instantaneous and can take from couple of seconds to close to a minute to arrive (depending on multiple variables). Since router cannot perform any action while it is such "waiting state", if router would be waiting for answer, it would not have internet connectivity until answer is received (of course, this is not acceptable).

Because of this, different approach was used: instead of waiting to receive answer to USSD command from same connection, router terminates the connection and then periodically checks if answer arrived. If it has, router places answer to "/tmp/ussd" file (since after connection was terminated - there is no option to print it on command line interface)

Unfortunately, it seems that functionality is not working correctly with current latest RUT2 firmware. We will of course address this issue in upcoming firmware releases. Meanwhile, you can download testing firmware from here, in which issue is already resolved:

https://kaunas.teltonika.lt:444/d/f0f33db7bf06455d9551/files/?p=/RUT2XX_T_F1617_00.01.12.83_WEBUI.bin&dl=1

With new firmware, first send USSD command to the network:

  • gsmctl -U "*130#"

Then check "/tmp/ussd" file for response from the network. If answer is not displayed yet, simply check the file few moment latter, since it might take some time for it to arrive.

  •  cat /tmp/ussd