6 years, 4 months ago.

Control mbed with python 2.7

I want to control the mBed controller with https:mindmajix.com/python-training I tried this code as start

from mbedrpc import *

serdev = '/dev/tty.usbmodemfa122'

mbed = SerialRPC("/dev/tty.usbmodemfa122", 9600)

x = DigitalOut(mbed, "LED1")

x.write(1)

It always shows me this error

File "/Users/Desktop/testRPC/mbedrpc.py", line 78, in __init__
   self.ser.setBaudrate(baud)
AttributeError: 'Serial' object has no attribute 'setBaudrate'

Could someone help me please ?

1 Answer

6 years, 4 months ago.

Hello Tejaswini,

Your pySerial may need to be updated. Could you take a look at this post and see if it solves your problem?

https://stackoverflow.com/questions/34602168/dronekit-failed-to-connect-to-dev-tty-usbmodem1411-serial-object-has-no-at

Hope this helps!

-Karen, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!