usb

Unable to find the right port to connect PySerial to USB device on Windows 11

Unable to find the right port to connect PySerial to USB device on Windows 11 Question: I’m trying to use the PySerial library on Windows 11 to connect to a USB device so I can communicate with it. However, I’m having trouble finding the right "address" to connect it too. I’m trying to run the …

Total answers: 1

Run Powershell script from Python?

Run Powershell script from Python? Question: At the end of some processing in Python in Windows I am trying to eject an USB SD card. Researching here it seems there are two ways in which to do it; call a PowerShell program or run PowerShell within Python. Can anyone offer me any guidance. Please keep …

Total answers: 2

Python – Unusual "Index Out of Range" while reading from USB

Python – Unusual "Index Out of Range" while reading from USB Question: Happy new Year together, normaly, i try to solve everything myself, to keep my grey Mushroom alive. But in this case im really stuck… My Task: Read from an USB Device Create an Animation based in Data of an analog Axis Problem: It …

Total answers: 1

unique identifier for USB device

unique identifier for USB device Question: i want to add a security feature to my python executable, its a portable program which can be installed on a usb drive, how can i make it so it only starts from the usb on which it was installed, when copied or moved to different usb or PC …

Total answers: 1

ModuleNotFoundError: No module named 'usb' in python

ModuleNotFoundError: No module named 'usb' in python Question: To read a file from usb device used ‘usb’ package but im not able to import that package. **But in my python and virtual environment there is usb module installed and it present there but still im getting this error ** Im trying to read file from …

Total answers: 2

Control the power of a usb port in Python

Control the power of a usb port in Python Question: I was wondering if it could be possible to control the power of usb ports in Python, using vendor ids and product ids. It should be controlling powers instead of just enabling and disabling the ports. It would be appreciated if you could provide some …

Total answers: 2

PyUSB: reading from a USB device

PyUSB: SCPI communication with OWON Oscilloscope Question: This is an updated and shortened question. Communicating with a USB-device should be easy via PyUSB. So, I’m trying to read from a USB-device (oscilloscope) using PyUSB under Win10. Apparently, the USB-driver (libusb-win32 v1.2.6.0) is installed correctly since the device is found and I get some response from …

Total answers: 5

How to monitor usb devices insertion?

How to monitor usb devices insertion? Question: I am trying to monitor for USB devices when they get plugged in. A couple of test scripts fail that I am pretty sure should have worked. import pyudev context = pyudev.Context() monitor = pyudev.Monitor.from_netlink(context) monitor.filter_by(subsystem=’usb’) for device in iter(monitor.poll, None): if device.action == ‘add’: print(‘{} connected’.format(device)) ^^Does …

Total answers: 2

USBError: [Errno 13] Access denied (insufficient permissions)

USBError: [Errno 13] Access denied (insufficient permissions) Question: This problem is old as the world. There are discussions and solutions available. It all boils down to update the rules file and give permissions. So I have followed the recipe. But I still have the same problem. here are screenshots showing I follow instructions. Versions: Python …

Total answers: 6

TypeError when trying to open /dev/hidraw0 from python script

TypeError when trying to open /dev/hidraw0 from python script Question: I’m trying to read some data from a USB HID device with some basic python code, on a Raspberry Pi, but keep getting the following error: Traceback (most recent call last): File “gnome1.py”, line 2, in <module> fd = open(“/dev/hidraw0”, os.O_RDWR|os.O_NONBLOCK) TypeError: file() argument 2 …

Total answers: 1