linux - Python could not open port -


i want communicate serial port in python. installed pyserial linux:

import thread import serial port = '/dev/rfcomm0' baudrate = 921600 timeout = 1   port = serial.serial(port=port, baudrate=baudrate, timeout=timeout) port.open() ... port.close() 

it gives following error:

traceback (most recent call last):   file "/home/dnaphone/pycharmprojects/test/bluetoothclient.py", line 12, in <module>     port = serial.serial(port=port, baudrate=baudrate, timeout=timeout)   file "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 182, in __init__     self.open()   file "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 247, in open     raise serialexception(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.serialexception: [errno 2] not open port /dev/rfcomm0: [errno 2] no such file or directory: '/dev/rfcomm0' 

/dev/rfcomm0 seems bluez registered virtual device port. can list device on system? , did bluetooth starts well?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -