-->
Page 1 of 1

cp2102 and python

PostPosted: Thu Oct 02, 2014 10:45 am
by pirks
Code: Select allimport serial

sp="/dev/ttyUSB0"

port = serial.Serial(sp)

while True:
    port.write("AT+RST")
    rcv = port.read(10)
    print rcv


dont work, please help!

Re: cp2102 and python

PostPosted: Fri Oct 03, 2014 5:25 am
by Bert
What exactly doesn't work?

Also, you are missing a CR+LF (i.e. \r\n) at the end of your command.

Re: cp2102 and python

PostPosted: Tue Oct 07, 2014 6:28 pm
by wlinux
Hey,
The default baud rate for python is 19200, while the default baud rate for the ESP8266 is either 115200 or 57600. Try both of these lines, one of them should work.

Code: Select allport = serial.Serial(sp, 115200)


Or for version one

Code: Select allport = serial.Serial(sp, 57600)