kiwisigi, I am using a Sparkfun FTDI Basic with the GE865, and use SER2 to debug code, so I haven’t done more that the SER2.send. I’m using Teraterm and the port setup is 115200, 8, N, 1, no flow control. I have the RX_aux to FTDI TXO and TX_aux to FTDI RXI connected as well as GND. Attached is simple code that send GPIO 5 and 10 low and high, and if GPIO 4 is held high, they switch faster. If GPIO is held high, the GE865 is shut down.
import GPIO
import MOD
import MDM
import SER2
SER2.set_speed('115200')
SER2.send('\r\n')
SER2.send('test\r\n')
SER2.sendbyte(0x0d)
SER2.receive(10)
GPIO.setIOdir(4,0,0)
GPIO.setIOdir(5,1,0)
GPIO.setIOdir(10,1,1)
b = 0
res=0
while(1):
s=GPIO.setIOvalue(10,0) #GPIO 10 OFF
t=GPIO.setIOvalue(5,1) #GPIOI 5 ON
MOD.sleep(20)
SER2.send(' switch LED states ')
s=GPIO.setIOvalue(10,1) #GPIO 10 ON
t=GPIO.setIOvalue(5,0) #GPIOI 5 OFF
MOD.sleep(20)
b = GPIO.getIOvalue(4)
while b == 1:
SER2.send(' Blink Faster! ')
s=GPIO.setIOvalue(10,1) #GPIO 10 ON
t=GPIO.setIOvalue(5,0) #GPIOI 5 OFF
MOD.sleep(2)
s=GPIO.setIOvalue(10,0) #GPIO 10 OFF
t=GPIO.setIOvalue(5,1) #GPIOI 5 ON
MOD.sleep(2)
b = GPIO.getIOvalue(4)
ioval_3 = GPIO.getIOvalue(3) # Use status of GPIO3 to end program and shut down
if (ioval_3 == 1):
a = SER2.send('Done\r\n')
a = MDM.send('AT#SHDN\r',0) #Turn off GE865
The teraterm session imonitoring SER2 returns the following:
‘import exceptions’ failed; traceback:
ImportError: No module named exceptions
Warning! Falling back to string-based exceptions
Python 1.5.2+ (#0, Jan 24 2008, 14:55:00)
on
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import GPIO # builtin
import MOD # builtin
import SER2 # builtin
test
switch LED states switch LED states Blink Faster! Blink Faster! Blink Faster! Blink Faster! Blink Faster! Blink Faster! Blink Faster! switch LED states Done
Good luck.