10 years ago.

how to end python rpc properly

I am using Python mbed-rpc library as

from  mbedpcr import *
myled = DigitalOut(mbed, 'myled')

mbed = SerialRPC('my_com_port', 9600)

... ...

After the program is done, I'd like to close the COM port. So I did

mbed.ser.close()

I got SerialException('Attempting to use a port that is not open') ...

What is the proper way to end the RPC session in Python?

Question relating to:

Be the first to answer this question.