Sending SMS through USB interfaced GSM Modem in PHP - php

I have searched on Google and found that I have to use AT commands to send SMS here is the link,
http://gonzalo123.wordpress.com/2011/03/21/howto-sendread-smss-using-a-gsm-modem-at-commands-and-php/
But in this tutorial he is using serial interfaced GSM modem, is it possible to send SMS via USB interfaced GMS modem. Please guide me.

A USB interfaced GSM modem will be presenting a USB serial interface, usually / hopefully conforming to the USB CDC specification. In other words you can treat it as a virtual COM port and the tutorial you linked to will still be relevant for you.

In Unix systems you can read/write from USB and Serial port reading data from /dev/ttyS0 or /dev/ttyUSB0. You also can use a usb/serial converter. They are cheap devices. But my experience with those usb converters is very bad. Because of that I prefer to use serial/ethernet convertes. They also allow me to place the serial device in any place and not necesary close to the server. OK maybe with a GSM device is not a problem. We can place it wherever we want, but if we are using the same technique to read/write from another device (like sensors, scales, ...), this may be a problem.

Related

How to read SMS from GSM Modem using AT and AT+ commands in php?

I want to read SMS received on a SIM.
SIM is inserted into GSM modem, modem is connected to my local machine using USB port.
I am using wamp on windows
After reading SMS I wan't to check whether SMS content has specific word, if yes I want to call one API. I can achieve this once I am able to read the SMS.
Also I will be scheduling this script, as I have to keep reading SMS 24X7.
Is there any library or script available for this?
You can install and make a simple config for Kannel Then use it's API or db to read incoming SMS
But it's not an easy job

How to read GSM device from USB port using PHP Script ?

I have a USB GSM device which I use for Internet connection as well as for Sending SMS through the software provided by the device itself. I would like to know if is it possible to read this device from USB port using PHP server side script ?
If it is possible, how we can do it & process some actions on it like Send SMS or receive SMS ?
Currently I am using Wamp on my Windows Machine. I would also like to do this on Linux machine too but that is in the very later stage so that is not part of this question at the moment.
Thanks in advance.
There are several libraries and tutorials about how to control serial ports with PHP.
Example: https://gist.github.com/51342
Article about this http://www.communitymx.com/content/article.cfm?cid=8658A
An article about exactly what you need is here (thanks to Mathew Hall)

PHP Commands to USB Modem

Please what is the AT commands in PHP compatible with Huawei USB Modem ?
i need to use these commands in script then i can send sms using the Huawei USB Modem.
thanks
The first thing you need to do is to open up the serial port with PHP. There is a class for doing this: http://code.google.com/p/php-serial/
Once open, it is as simple as this:
$serial->sendMessage("AT+CMGS=\"+1231231234\"\nHello");
Obviously, the AT commands can vary from device to device, so you will need to find out the commands for your specific device.
A saner approach would be to delegate SMS management to a specialized software, because in my experience there's more to do to manage SMS sends than just throwing a couple of bytes to a modem
network availability checks and the corresponding retries to optimize your delivery rate
capability to receive SMS'es
multipart messages
routing
...
I suggest the most excellent SMSTools it's a server software compatible with Linux and Windows, it talks with your application via regular ASCII files in specific directories (in, out, failed, ...) and has a host of other advanced functions.
To send a basic sms with default options you just have to create a text file like this one
To: 155512345
Hello, this is the text of the SMS
in the out-spool directory, on Linux that's /var/spool/sms/outgoing unless you reconfigure that path.
Best of all it's free and open source.

How to make Android and Arduino communicate without a wireless module

I have developed an Arduino application in which I can control LED 13 via a serial monitor.
That is,
if I type 0 in a serial monitor LED at pin 13 lights up and
if I type 1 in a serial monitor the LED lights off.
Now I want to do all this with my Android phone.
The issues I have are:
How to, first of all, create a PHP server for getting all this worked out
How to open up the localhost on my Android device so that it acts like a local server
How to make the server interact with the serial port
I am not asking for all the code and project but just show me the way, and I will be all right.
Most Android and Arduino devices cannot talk to each other when straight "out of the box" - add on hardware and/or system software modifications are required.
You have a variety of choices
0) Bluetooth is fairly clean and now in the $20 range, so it's both one of the most cost effective choices and one of the least likely to risk damaging the phone hardware - but you said you don't want that.
1) Some phones such as the G1 have low-voltage serial ports which can be enabled by [rooting and] installing a customized kernel. You will need level translation circuitry as the output voltage of the arduino while low is still too high for the phone to handle. You will also need to source a special HTCUSB connector, either by modifying the full headset adapter or getting it from someplace like sparkfun.
2) Some phones can function as usb hosts by [rooting and] installing a customized kernel. They do not supply usb bus power, but with an arduino you have everything out in the open so cabling up a separate supply should be fairly simple. A few recent tablets have usb host mode out of the box. Edit: with later Android versions, a non-root USB host API and USB bus power may be available, but this varies by model and has been inconsistent.
3) You can use a USB host shield on the arduino, and if the device runs Android 2.3.4 or later use Gooogle's official ADK protocol to talk to software on the android device; if the android version is earlier, there are unofficial projects which talk the ADB protocol and should work with most devices (perhaps with small modifications). Both are designed to remain within unprivileged userspace on the android device - no rooting, no kernel modifications.
4) You could build a low-baud-rate modem and talk to the android device through its headset jack, using a software modem on the android side.
5) You could put a wireless ethernet shield on the arduino
I have no experience with Arduino personally. But the guys over at Cellbots have many projects that use Android phones as the brain for small robots and they use Arduino in most of them. Everything is open sourced, and you might be able to find examples that will help you out there.

What do I need to send text messages with Kannel?

I want to be able to send text messages from Linux with PHP. I've read about and installed Kannel, a free SMS gateway. When I try to use the HTTP interface, it won't send a message. Do I need something else to send text messages via kannel, like a modem?
Yes, you need a GSM modem and a SIM card from your local mobile network provider.
To setup your GSM modem, you can auto-detect its settings using wvdialconf. The output contains pertinent information such as Baud rate, which serial port is used, and the modem's initialization string.
To test that your modem works properly, you can use minicom. Minicom acts as a terminal to any serial device (in this case, a GSM modem) and, with it, you can send AT commands to your modem.
I dont know if this is a solution, but Clickatell provides a very easy to use HTML api for sending sms messages anywhere in the world. I'v been using them for several years. You only pay for the sms messages you send.

Categories