I am trying to communicate with a Bluetooth COM port, via Python on a Windows 7 machine. Since this Computer has no built-in Bluetooth, I use a USB stick which works with BlueSoleil (https://en.wikipedia.org/wiki/BlueSoleil).
My problem seems to be, that BlueSoleil, after a successfull pairing to a COM port, Python cannot open it (access denied). When I define a serial port with PySerial and try to write to it without opening it explicitly, I have no success and a few minutes later the computer crashes with a bluescreen.
When using a terminal (Kitty), I can read and write from and to the port.
My suspicion is, that PySerial tries to 'block' the port, which conflicts with BlueSoleil, but I am not sure.
Any Ideas?
Alright, it seems, that the Problem is bad drivers of the no-name Bluetooth Dongle under Win 7.
I am now using a Raspberry Pi with Raspbian and after installing the needed Packages and loading the needed modules, I have no Problems to connect my Bluetooth device to a serial port.
Related
I have used usb communication in renesas microcontroller, I am able to get USB CDC as com port in my device manager of laptop running on windows 10, I am trying to read and write on this port using pyserial python but I am not able to open port, every time it shows exception that no such device there or permission error. Please provide me the solution.
I'm trying to use Python on my Mac Catalina to communicate with my Arduino and keep getting "no such file or directory" when I input the Mac serial port /dev/cu.usbmodem1433301 (Arduino Uno) as indicated in the Arduino Tools/Port list and I run the script. If I can't get a workable port for Python, I might as well not use it.
I just discovered that the usb port on the opposite end of my mac's keyboard is the one that python can communicate with arduino through. The port I was using was 143301 and the one that works (on the caps lock end) is 143101. Made all the difference in the world. Problem solved. Life is good again.
I'm working with STM32 (NUCLEO-L476RG) - uploading code via Workbench, sometimes using ST-Link Utility to connect to it.
Additionally, I've some python code that listens to STM via serial port.
Till yesterday everything was working fine, but today (without changing anything connected to STM, drivers etc.) pyserial can't connect to the device, showing message:
File "C:\python37\lib\site-packages\serial\serialwin32.py", line 62, in open raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM7': FileNotFoundError(2, 'Nie można odnaleźć określonego pliku.', None, 2)
I can upload code using Workbench or connect to STM via ST-Link Utility without any problems. Port is not used by any other application.
When I list ports by serial.tools.list_ports.comports() it shows properly as STMicroelectronics STLink Virtual COM Port (COM7).
In 'Device Manager' there's a yellow triangle next to the COM, but I'm not sure if it were there earlier (probably yes) - it says that the device driver is not signed.
I tried to:
reinstall the drivers to these provided by STM
reinstall pyserial
use older python
use older pyserial
change COM to another
change cable to new one
connect the device to all possible USB ports
but any of that changed anything.
My setup:
Windows 7
python 3.7.1
pyserial 3.4
STM 32 NUCLEO-L476RG
System Workbench for STM32 & ST-Link Utility, which are working perfectly fine
This setup was working for half a year (!) and I didn't change anything connected to it in the last couple of days. Only thing I did yesterday was installing PostgreSQL, but it seems highly unbelievable that it could cause my current problem...
Thank you in advance for any help - I don't really have an idea what should I try next, so I appreciate any piece of advice.
I have a USB device that I need to control in Linux using Python and serial commands, it works with ASCII commands.
In Windows it works fine after I install the vendor driver and in Device Manager I see it as a COM3 port and I communicate using pyserial or pyvisa modules.
In Linux I see it as /dev/ttyUSB1 but I cannot communicate with it using pyserial or pyvisa. The problem is that the vendor doesn't provide Linux drivers.
How am I able to get the device behave as a serial port in Linux?
try python -m serial.tools.miniterm /dev/ttyUSB1 and read the issue on https://github.com/pyserial/pyserial/issues/67 especially the version of pyserial
if this issue is related to yours possibly this also works :
Managed to bypass this issue by passing dsrdtr=True and rtscts=True to
serial.Serial() ... as described here
your device is based on an FTDI chip, the inbuilt linux kernel module for this is ftdi_sio and usb_serial see http://www.ftdichip.com/Support/Documents/AppNotes/AN_220_FTDI_Drivers_Installation_Guide_for_Linux.pdf
I am really frustrated and have no idea where to search for an answer.
Currently I am working on a project to detect drowsiness with an ECG device (Zephyr Bioharness 3). The device works but I can't find it with windows (For example like this). I tried several things:
Find the device with my Smartphone -> works
Find the device with an Ubuntu on the same Laptop -> works
Connect directly on Win7 via Bluetooth with this Python Script: Gist -> connects and sends data
Find other Bluetooth devices with my Laptop on Win7 -> Bluetooth radio is dound
COM port for (virtual) serial connection to a bluetooth device (device manager)
What I am trying, is getting this script to work: ZephyrApp. Beside some compatibility problems with QT and serial (which I was able to fix), the programm hangs here protocol.py. I suspect the problems of not finding the device relates to the problems with the program. I know this is very special case, but hope anyone has an idea, how to fix this.
Regards,
paul
EDIT: Another PC with Win7 can't detect the device as well, it seems it is a Windows problem.
The device can't be detected with Win7, but I found a way to connect via bluetooth directly: https://gist.github.com/darkopetrovic/2127217