What's new

Asus Busybox missing "microcom" command - read/send SMS from shell using 3G/4G USB stick

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Look at the included "modem_at.sh" script for an alternative. This is what the firmware uses to configure the modem.
 
OK thanks, I am looking how to send AT commands using /usr/sbin/modem_at.sh
unfortunately there is no feedback :(

/usr/sbin/modem_at.sh +X3
/usr/sbin/modem_at.sh '+X3' 2>&1

there is no "OK" response

https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/at-cmgf/
https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/at-cmgl-text-mode/

@RMelin - do you remember if this ever worked?
https://github.com/RMerl/asuswrt-me...elease/src/router/comgt-0.32/scripts/send_sms

/sbin/send_sms
/sbin/read_sms
 
Last edited:
OK thanks, I am looking how to send AT commands using /usr/sbin/modem_at.sh
unfortunately there is no feedback :(

/usr/sbin/modem_at.sh +X3
/usr/sbin/modem_at.sh '+X3' 2>&1

there is no "OK" response

https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/at-cmgf/
https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/at-cmgl-text-mode/

@RMelin - do you remember if this ever worked?
https://github.com/RMerl/asuswrt-me...elease/src/router/comgt-0.32/scripts/send_sms

/sbin/send_sms
/sbin/read_sms

No idea. I have no 3G/4G modem, so I never even looked at that code.
 
For anyone finding this post in the future (as I did), I was able to send SMS messages from the shell using the following commands

Code:
/usr/sbin/modem_at.sh +CSCS=\"IRA\"
/usr/sbin/modem_at.sh +CMGF=1
/usr/sbin/modem_at.sh +CMGS=\"+4712345678\"\\rTestMessage\^Z

For Multiple lines / lines with spaces I used:
Code:
/usr/sbin/modem_at.sh +CMGS=\"+4712345678\"\\rTest\ Message\\nLine\ 2\^Z
 
@Jings - thank you very much, I have tested this and it WORKS :)

Do you have idea how to read sms messages from shell, and maybe how to delete them ?
 
@Jings - thank you very much, I have tested this and it WORKS :)

Do you have idea how to read sms messages from shell, and maybe how to delete them ?

I've configured the router to send me SMS messages when the WAN changes from primary/secondary, and used a syslog-ng server to capture messages from my UPS, and SMS alert me of any power failures.

I have not had any need to receive SMS messages, but I assume it might have some use cases.

Some commands listed here: https://www.developershome.com/sms/readSmsByAtCommands.asp

A quick test shows me that
Code:
/usr/sbin/modem_at.sh +CMGR=0
gives me
Code:
+CMGR: "REC READ","+4712345678",,"19/02/03,23:46:15+04"
Test
OK

But some of the other commands, like list messages does not work (based on the 5 minutes i spent testing it...)

You can shutup the "noise" status messages from the modem (aka RSSI, LTERSRP) with
Code:
#/usr/sbin/modem_at.sh \\^CURC=0
 
One more thing... the usr/sbin/modem_at.sh command is extremly picky about formatting! Especially spaces is a problem. When writing bash scripts, I ended up replacing all the spaces with "No-Break Space" U+00A0 Alt-0160, as I wasn't able to get things to work with just escaping them. Ends up looking like a normal space in the SMS.

Another tip is to start and stop the sending of SMS' with the command
Code:
/usr/sbin/modem_at.sh \^Z
Running the command by itself will give an error, but If any garbage is stuck in the queue, it will clear the queue, and send the SMS
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top