SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By galed
#93027
Sparkfun's been sold out for weeks. Where else can you get the Telit GM862? Or Telit modules in general?
User avatar
By leon_heller
#93032
Try a Telit distributor, like Round Solutions.
By khaledkhal
#93082
mikroelektronika sells it as well, with a lower price.
By galed
#93225
i ended up getting it at janus-rc. They gave me a discounted price since it's a slightly older firmware version
By john_melbourne
#94840
Hi,

As per an earlier poster, MikroElectronica not only have it at under $80 but it also comes with all antennas and cables.

I got my board from SFE and the module etc from MikroE; even with 2 lots of postage - still got a great saving.

I am currently falling in love with Telit Python. I did a GPS-SMS application using a PIC micro connected to the GM862. Took a couple of days to code up and debug. Then I did it in Python, took a couple of HOURS to code up and debug!!!
Last edited by john_melbourne on Sun Feb 28, 2010 7:49 pm, edited 1 time in total.
By john_melbourne
#94931
Hi Ryan,


I found the example at:-

http://www.bernardotti.it/portal/showthread.php?t=17537

to be very helpfull.

I modified it (below) to detect a phone in "RING". My GM862 then does a "hang up" (hence no phone cost). The GM862 then reads the GPS and sends an SMS to a fixed phone number (sub. in yours at the correct position in the code).


I use SER.send commands to debug and watch what is going on in the roundsolutions "rsterm" hyperterminal.
I compile the script in rsterm to get the .pyo which I then upload, enable and run. It works great.

Gotta give credit to Flavio Bernardotti (what a name..sounds good enough to eat!); without his example I would have got nowhere.


######################### Cut and Paste from here #################################
#phone_loc2 - phone locater version 2

#Phone in and get an SMS of GPS location sent to a fixed phone number

#Adapted by John from work by Flavio Bernardotti
#http://www.bernardotti.it/portal/showthread.php?t=17537

#Improved structure from my phone_loc1 version using simpler main and larger functions

#Tested with GPS fix, yet to test for GPS no fix - 28/02/2010

##### Put Your Number Here ######
SMSTO = 'XXXXXXXXXXXX' # recipient number for the SMS
##########################

##### Import Modules ############

import SER
import MOD
import MDM
import GPS


###### General Functions ######

#Get the GPS position, check for a fix and format the message
def get_gps():
gpspos = GPS.getActualPosition() #Read GPS position
gpspos_parts = gpspos.split(',') #Break into parts on the commas

if ((gpspos_parts[5] == '2') or (gpspos_parts[5] == '3')): #2D or 3D fix
SER.send('GPS fix\n\r') #For Hyperterminal
SER.send('Position is: lat and lon \r\n') #For Hyperterminal

#extract lat and lon
lat = gpspos_parts[1] #Lat is field[1]
lon = gpspos_parts[2] #Lon is field[2]

#Format the text lines
line1 = lat[0:2] + ' ' + lat[2:10]
line2 = lon[0:3] + ' ' + lon[3:11]

#Form the sms message body
text = line1 + '\n\r' + line2 +'\n\r'

#Print it on the hyperterminal
SER.send(text)
return text

else:
text = 'GPS No Fix \r\n'
SER.send(text + '\r\n') #For Hyperterminal
return text


#Setup Module - Text Mode, verbose error report
def sms_setup():
MDM.send('AT+CMEE=2\r', 0) #Set verbose error reporting for GSM module
MDM.receive(50) #5 sec max for response
MOD.sleep(1) #wait 0.1sec
SER.send('Set text mode\r\n') #For Hyperterminal
a = MDM.send('AT+CMGF=1\r', 2) #Set text mode
res = MDM.receive(5) #Get the response
SER.send(res + '\r\n') #For Hyperterminal
MOD.sleep(1) #Some delay


#SMS Send - Fixed phone number, message is passed in variable 'text'
def sms_send(text):
SER.send('Sending SMS\r\n') #For Hyperterminal
a = MDM.send('AT+CMGS="' + SMSTO + '"\r', 2) #Send the number
res = MDM.receive(10) #Get the response
MOD.sleep(1) #Some delay

if(res.find('>') != -1): #Test the response
a = MDM.send(text, 20) #Good response - send the text
a = MDM.sendbyte(0x1A, 20) #Send the terminator
SER.send('SMS Sent\r\n') #For Hyperterminal
MOD.sleep(1) #Some delay

else:
SER.send('Did not get > \r\n') #Handle the error case
#Abort SMS (just in case)
MDM.sendbyte(0x1B, 0)
MOD.sleep(1)#wait 0.1sec


##################
###### Main ######
##################


#Setup USART
SER.set_speed('115200','8N1') #Baud, 8-bit data, 1 stop bit

#Setup Module for SMS etc
sms_setup()

#Everloop
while 1:

#Now check for RING
SER.send('Checking RING \n\r') #For Hyperterminal
res = MDM.receive(20) #Get the string to check for ring in
a = res.find('RING') #Test for Ring
if(a != -1): #Found a RING

SER.send('Found Ring \r\n') #For Hyperterminal
MDM.send('ATH\r', 10) #Hang up, no charge
res = MDM.receive(10)
#Read GPS
text = get_gps()
#Send the sms
sms_send(text) #Send the message
else:
SER.send('No RING Detected \r\n') #Did not find RING

################## End Cut andPaste ####################





Regards John
Melbourne Australia
Last edited by john_melbourne on Sun Feb 28, 2010 7:44 pm, edited 1 time in total.
By john_melbourne
#94933
Hi again Ryan,

The forum software removed the indentation from the Python script that I listed in my earlier mail.

You will need to re-indent the function bodies, if and while statements. See Flavio's original source if your not sure how.

John
Melbourne Australia
By mjhasson
#97949
Hey y'all,

I tried the example below and corrected the indentions and when I call the SIM, RING RING RING is outputted in Hyperterminal, but then I never receive a text message.

Any clues/hints are much appreciated!
By mjhasson
#97954
ok. Here is my code: http://dpaste.com/180539/

I added in a spot in the sms_setup() fo setting the at#bnd=1 (as I am in America)

I upload via hyperterminal.

Then I execute the script and run at#execscr.

I then call in and get RING RING RING RING..

any help is much appreciated. John, thank you for making your code so available. I tried the guy's code from the link you sent, but found yours more easy to read and understand.

- MJ
By Vovik
#99870
I read this topik and got impression you can run the telit gm862 without a connection it to a microprocessor, did I get it right?

How a one write a py script into the gm862 and save it so it does not get erased on power disconnect? Could somebody publish a link on an instructions on this?

I am working with gm862 by sending AT commands from propeller much but it would work for me and would be much better if I could save py script into the gm862 and let it run by itself.

Thanks.
By john_melbourne
#99875
Hi,

The GM862-GPS contains a Python Script interpreter. It is OK for low speed applications and does not support interrupts or floating point variables. Once loaded onto the module and enabled, the script is stored in EPROM on the module and will run on power up.

Python is a widely used scripting language, apparantly even Google use it. Telit have produced a library of functions to control the operation of their GSM/GPRS modules. If you have programmed in C then Python is easy to learn.

You will find a .pdf file called:- Telit_Easy_Script_Python_r10 at the URL below.

http://www.telit.com/en/products/gsm-gp ... c=show&p=7

The .pdf decribes the library of function calls along with the script downloading process.
By Vovik
#99931
That would make the hardware part of my project much simpler, would not need propeller mcu, cristal, memory ets! Thanks a lot.

Just quick question: I am reading the Telit_GM862-QUAD/PY_Hardware_User_Guide_r1 at the link you gave me. But still could not figure out if does the telit module I have support python or it does not, the module I have bought is http://www.sparkfun.com/commerce/produc ... ts_id=7917 but I guess the one I have to buy to be able program python script should GM862-QUAD-PY, is it right?
How could one check if does the module CEL-07917 GM862 Cellular Quad Band Module with GPS supports python?

I guess it is all in documentation but somehow I could not figure out :(

Thanks a lot.