ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS-GSM1 send SMS

To:
Subject: Re: [ts-7000] Re: TS-GSM1 send SMS
From: fais faiz <>
Date: Wed, 10 Mar 2010 09:00:25 +0800


Hi Fauzi,

This command that u give very useful


yes, you can install minicom inside TS-7800 if you wanna use it. but that isn't necessary if you only wanna send SMS via bash/python from your TS-7800.

this is how you can send SMS using bash:

root# echo -e -n "AT+CMGF=1 \015" > /dev/ttyS2 
root# echo -e -n "AT+CMGS=\"+60191234567\" \015" > /dev/ttyS2
root# echo -e -n "Hello Malaysia, this is my message \032" > /dev/ttyS2


this command work... thanks a lots Fauzi...


Regards,

Faiz

 

On Tue, Mar 9, 2010 at 11:31 AM, ApOgEE <> wrote:
 

Hi Faiz,

On Tue, Mar 9, 2010 at 10:53 AM, fais faiz <> wrote:


Hi Fauzi,

Kindly,thanks for the replying  the message and give the example program to send SMS ...


I normally use minicom or screen to connect to the GSM modem from my TS7260. If you use Debian, you can install it using this command:

apt-get install minicom
apt-get install screen


Yes, I used Debian.  Do u mean I need to Install minicom inside the TS-7800..?


yes, you can install minicom inside TS-7800 if you wanna use it. but that isn't necessary if you only wanna send SMS via bash/python from your TS-7800.

this is how you can send SMS using bash:

root# echo -e -n "AT+CMGF=1 \015" > /dev/ttyS2 
root# echo -e -n "AT+CMGS=\"+60191234567\" \015" > /dev/ttyS2
root# echo -e -n "Hello Malaysia, this is my message \032" > /dev/ttyS2




On Mon, Mar 8, 2010 at 12:36 PM, ApOgEE <> wrote:
 

Hi haiqal,

> 1) Is that correct command I used "/ # cat < /dev/ttyS2 &"  to get virtual terminal ..??
>

I normally use minicom or screen to connect to the GSM modem from my TS7260. If you use Debian, you can install it using this command:

apt-get install minicom
apt-get install screen


 
> 2)Kindly I appreciate  any idea in this group to help me how to I send SMS /MMS/ dialing....
> I'm worried that is the simple mistake from the command that I miss looking...
>

I use python to create a program that can send SMS using TS-GSM1.

here is some snippet if you like to try:
# ----------------------- begin snippet --------------------
#!/usr/bin/python

"""
Developer: Muhammad Fauzilkamil Zainuddin
Started: 04 Aug 2008
Purpose: Send SMS using Python
Requires:   Python
            configobj.py
            pySerial
"""
import sys, os
import subprocess
import string
import time
from configobj import ConfigObj
import serial

# function to send data to GSM modem - by M. Fauzilkamil Zainuddin
def sendmdm(ser,commands):
    mreply=[]
    if ser.isOpen():
        ser.write(commands)
        time.sleep(0.5)
        norepcount = 0

        while 1:
            out = ser.readline()
            if out.strip()=='OK':
                mreply.append(out.strip())
                break
            if out.strip()=='>':
                mreply.append(out.strip())
                break
            if out.strip()!='':
                mreply.append(out.strip())
            if out.strip() == 'ERROR':
                mreply.append(out.strip())
                break
            if not out:
                if norepcount > 10:
                    break
                norepcount = norepcount + 1
                time.sleep(0.5)
    return mreply
# end of sendmdm function

# function sendsmsdata - by M. Fauzilkamil Zainuddin
def sendsmsdata(sphone,smsdata):
    smodem="/dev/ttyTS0"
    sbaud="9600"
    ser = serial.Serial(smodem,sbaud,timeout=0.2)
    fret = 0
    ser.open()
    if ser.isOpen():
        mrep = sendmdm(ser,'at+cmgs="' + sphone  + '"\r')
        if len(mrep) > 0:
            if mrep[len(mrep)-1] == '>':
                mrep = sendmdm(ser,smsdata + '\x1A')

                if len(mrep) > 0:
                    if mrep[len(mrep)-1] == 'OK':
                        fret = 1
        ser.close()
    return fret
# end sendsmsdata function

# example of sending SMS
if sendsmsdata("60193701234","This is the SMS message from Malaysia") == 1:
    print "Message Sent"
else:
    print "send data via sms Failed"

# --------------------------------------------------------------------- end snippet -----------


--
Best Wishes,

M. Fauzilkamil Zainuddin
Software Engineer
Persiasys Sdn. Bhd.
----------------------------------------------------
ApOgEE a.k.a JeRuNgKuN
----------------------------------------------------
https://edge.launchpad.net/~apogee - ApOgEE on LaunchPad
http://artofapogee.blogspot.com - Art Of ApOgEE
http://coderstalk.blogspot.com - Coder's Talk
----------------------------------------------------



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU