On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > Thanks for the message > > What exactly is happening is that the return is "None" for the command > that I am sending. If I connect through Hyperterminal and execute the > 'sh nw enc' command, it returns 'WEP'
It looks to me like you're never reading from the serial port. All you're calling is write(). Also, are you sure that the device doesn't expect commands to be termined by carriage returns? >> > import serial >> > import time >> > >> > s = serial.Serial(port=1, timeout=None, baudrate=9600) >> > print s >> > time.sleep(5) >> > print "Enter CFG" >> > s.write('CFG') >> > print "Change baud" >> > s.baudrate=115200 >> > print s >> > time.sleep(5) >> > print "New line" >> > s.write('\n') >> > >> > >> > time.sleep(2) >> > print "Show Encryption Setting" >> > nw = s.write('sh nw enc') >> > time.sleep(1) Try changing that to s.write('sh nw enc') time.sleep(1) nw = s.read(1024) >> > print nw >> > s.close() There are plenty of example programs at: http://pyserial.svn.sourceforge.net/viewvc/pyserial/trunk/pyserial/examples/ -- Grant Edwards grante Yow! at BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI- visi.com -- http://mail.python.org/mailman/listinfo/python-list