I am trying to Read SMS through HSDPA Modem. I Tried
AT+CMGR=1
AT+CMGR=123
AT+CMGR="ALL'
AT+CMGR="REC ALL"
AT+CMGL="ALL"
Commands but No Sucess. Is Any problem with serialport configuration or something else Any other possible solution please help me
Baud Rate:9600
Data bits:8
Parity:None
Stop bit:1
Once you have connected your terminal emulator to your modem (typically /dev/ttyUSB0 on Linux), try AT. If you get an OK or ERROR that means you have no problem with serial port configuration because the modem is responding to you. If you get nothing (ei, no reply from the modem), then you probably have a serial connection or modem hardware issue. Personnaly I'm using miniterm.py (on Linux) and the configuration is
maurice#mickey> sudo miniterm.py -e /dev/ttyUSB0`
--- Miniterm on /dev/ttyUSB0: 9600,8,N,1 ---
Just as yours.
Regarding reading the SMSes, at+cmgl=? should reply either ERROR or a list of statuses. If you get ERROR, this means your modem doesn't accept SMS. Otherwise you should get something like +cmgl: ("REC UNREAD","REC READ","STO UNSENT","STO SENT","ALL")
Now, if you issue at+cmgr, the answer should look like
+CMGL: 8,"REC UNREAD","+XXXXXXXXXXXX",,"16/02/19,19:52:07+12"
Test 1
+CMGL: 9,"REC UNREAD","+XXXXXXXXXXXX",,"16/02/19,19:52:16+12"
Test 2
where +XXXXXXXXXXXX is the sender MSISDN and "Test 1" is the message sent in the SMS (its content). Again, if you get ERROR, that means your modem doesn't accept SMSes. If you have sent some SMSes but the list is empty, maybe SMS are blocked on the HLR for this specific SIM.
To read the 8th SMS, issue at+cmgr=8 and you should get
+CMGR: "REC READ","+XXXXXXXXXXXX",,"16/02/19,19:52:07+12"
Test 1
OK
Related
I'm attempting to write a script to connect to a DLNA audio renderer.
There are a few articles on the web giving information on how to do this using UDP and curl, however in my particular scenario I'm having some difficulties.
The first step is to send a UDP multicast announcement over the network to discover DLNA devices on the network.
The message sent to discover devices is:
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MX: 5
Man: "ssdp:discover"
ST: urn:schemas-upnp-org:device:MediaRenderer:1
All lines in this message sent over UDP should have crlf line endings and the last line should have an extra crlf according to this article
That all seems fine. And if the message above is in a file devicediscovery.txt supposedly it's possible to use netcat to send out this message:
cat devicediscovery.txt | nc -u -4 239.255.255.250 1900
239.255.255.250:1900 is the multicast address and port over which DLNA devices communicate.
This all seems fine too, however, as is pointed out in the linked article netcat ignores the response from the dlna media renderer because there is a mismatch in IP addresses the message is sent out over the dlna multicast address, though the response comes from the router. The article suggests using tcpdump to capture the response, however I'm on Windows and using Bash on Windows WSL so tcpdump is not available and such a technique would possibly be complicated when developing a script to automate the dlna connection.
Would it be possible to use two seperate instances of netcat? One instance sending the message over the dlna multicast address and the other listening for the response from the router?
I have tried to get this working, however I'm unsure which port netcat should be listening on to hear the incomming response. Is there a standard port that netcat should listen on?
I've tried commands such as: nc -luv 192.168.0.1, however I get an error Servname not supported for ai_socktype. I've tried to remedy this by playing around with /etc/services but had no luck.
What command can I use and how must I configure the system to listen for the response from the search for dlna devices? I'd like to parse the response in a script so that the dlna connection can be automated.
Although you mention issues with DLNA it looks that you are really asking for how to best troubleshoot this.
Network cards don't allow access to incoming traffic unless set in promiscuous mode. Netcat won't be able to do what you need because of this. But, you can use Wireshark to read the traffic on the interface. TCPdump and Wireshark have close ties and almost interchangeable.
https://www.wireshark.org/
I would recommend to use it to troubleshoot further. Ppost the capture (not just a picture) and show where it failed.
I want to send SMS ideally using PHP in a Linux Environment. I have a GSM modem which I want to use to send SMS.
Can anybody please tell me an easy way to send SMS from Linux using a USB GSM modem?
Thank you
Your GSM modem will almost certainly support AT commands - you can see some history of AT, or Hayes, commands here: https://en.wikipedia.org/wiki/Hayes_command_set
The commands supported can vary from device to device but the simplest command sequence to send an SMS message is fairly standard - an example, showing the communication over the serial port, is:
AT+CMGF=1. [you send this]
OK [Modem responds]
AT+CMGS="+31628870634". [you send this]
> Yourtextmessage.→. [Modem responds with > and you send text followed by return at end]
+CMGS: 198 [Modem responds after a few moments when message is sent]
You should be able to find many more examples with a quick search including using PHP - e.g. (at the time of writing): https://gonzalo123.com/2011/03/21/howto-sendread-smss-using-a-gsm-modem-at-commands-and-php/
Its worth being aware that different modems may work differently - you will need to experiment to ensure you have a relabel solution.
I can finally make a phone call, receive, and answer it. But if I try to send an SMS I receive CMS ERROR: 500. The GSM modem I am using is Telit GL865-Quad module. Since the Call function is working, what's preventing the SMS to work? please enlightenment me. The Sim Card works fine on my phone to rule out some of the problems. I am using a hyperterminal to type the commands at 19200 speed. This is the user guide with commands for your own convenience.
To send an SMS:
AT+CMGF=1 // Select Text Mode
OK
AT+CMGW=”+xxxxxxxxxxxx” // my number
> Hi
>
+CMGW: 8
OK
AT+CMSS=8
Error: +CMS ERROR: 500
Any ideas to what the error means, since its unknown error? What are some commands to type out to pinpoint the problem?
I would appreciate your help, thanks!
+CMS ERROR: 500 is unfortunately a very generic error message.
I have a few suspicions which may solve your problem:
1) Timing problem
Writing an SMS to the SIM card will take a "significant" amount of time. Between writing the SMS to SIM and sending the SMS wait a couple of seconds.
2) Check that the SMS really did get written to SIM
Using the CMGR command you can verify if the SMS is written to SIM and it's current status.
For example:
AT+CMGR=8
Alternatives:
You can always send an SMS directly without storing on the SIM. This is generally a more favored approach for multiple reasons including SMS sending is quicker and SIM lifetime is extended due to reduced read/writes.
This can be achieved by using:
AT+CMGS=<destination address>
>Hi
You can additionally use the CNMI command to prevent incoming messages being stored on the SIM and being output directly to the console/telnet connection.
Replying on a 7 year old thread - sorry.
Make sure you terminate your message "Hello" with ASCII SUB (0x1A)
I'm programming an app to send SMS through a GSM modem with the serial port. I've been able to send SMS for a couple of days using the MessagingToolkit library but suddennly I'm not being able to send SMS anymore.
According to the logs this is due to a Network error. I found out that the "standard" error that I'm facing is:
CMS ERROR: 512 User abort
I found a list of error codes here http://www.smssolutions.net/tutorials/gsm/gsmerrorcodes/ but I can't find any further explanation on the error.
Does anyone that's familiar with GSM knows what's this error about?
When I'm initializing the modem I also get this error message from the starting configurations, it might be related to the 512 error:
2011.04.11-09.23.16: Sending: AT+COPS=0,2
2011.04.11-09.23.17: Error in command AT+COPS=0,2 : ERROR
Thanks!
Have you verified that you are registered with your operator properly? You can do this by sending a AT+CREG?
Regarding the AT+COPS error message. It seems like you aren't sending enough parameters.
AT+COPS=<mode>,[<format>,<oper>[,<AcT>]]
Are you trying to manually select an operator rather than letting the modem take the default operator setup with the SIM card?
I am trying to set up an SMS gateway on my computer
here's some code I found:
AT
OK
AT+CMGF=1
OK
AT+CMGL="ALL"
+CMGL: 1,"REC READ","+85291234567",,"06/11/11,00:30:29+32"
Hello, welcome to our SMS tutorial.
+CMGL: 2,"REC READ","+85291234567",,"06/11/11,00:32:20+32"
A simple demo of SMS text messaging.
OK
can this be done in windows?
what steps do I have to take in order to set this up?
what is the compiler?
how do I get started?
These are AT commands, which are used with modems (or cell phones) who support that interface.
If you cell phone is connected to your computer by serial, you can open a HyperTerminal/Telnet/etc and communicate with it via AT commands.
There is no compiler or such, as this is merely a protocol for communicating with supporting devices.