Quote:
Originally Posted by eltonyeo
hi everyone.. i am new here.. can everyone in the forum guide me along.. thanks..
i am currently doing a project on telit gm862-gps..
i have to use PYTHON to write a software program.
kindly anyone teach me or show me how to start off the program..
i need to get started off by writing a program of GPIO1 pin and a program on sending SMSes..
i would really appericate if anyone in the forum can show me or guide me how to write it..
THANK YOU..
I have a LOT of experience in this area:
configure the GPIO pin 1 direction (input or output)
MDM.send('AT#GPIO=1,1\n',0) # pin 1 set high as output
zx = MDM.receive(5)
#now reset it so LED is off
MDM.send('AT#GPIO=1,2\n',0) #ask module for pin status
zx = MDM.recieve(5) # and capture the reply
Check that your hardware is correct - I strongly advise using opto-isolators for debug and hobby use, save a lof of components and hassles.
Please double check with the software user manual about GPIO1, i know it has a special function , or it can only work in one direction. Its a long time since I had to change any hardware with my hobby server...
If you simply want to signal a new SMS arrival by turning on an LED, then try::
(dont forget to configure the format to text and storage into SIM first)
MDM.send('AT+CMGL=ALL\n',0) #ask for a list of ALL sms
zx = MDM.recieve(5) # and capture the reply
zx.split(",") # break up the reply by commas
for zxlines in zx: # step through the split string
if (zxlines.find("UNREAD")!p -1): # if there are any new sms then
MDM.send("AT#GPIO=1,1,1\n",0) # set the pin high
ab= MDM.receive(5)
MOD.sleep(10) #wait a bit
MDM.send("AT#GPIO=1,0,1\n",0)
ab= MDM.receive(5)
Hope this helps.