Python using gattlib for BLE Scanning on Windows 10 - python

I want to create a BLE Connection between my Laptop (Windows 10) and a BLE Device which will be the Master.
I installed Bluez and I can detect Bluetooth devices like my Smartphone but no device that only supports BLE. I want to download gattlib with pip install gattlib but I got an OSError: Not supported OS which brings me to the conclusion that I can't do it this way on Windows 10. Is there any other possibility than installing Linux on my Laptop?

gattlib is controlling bluez via dbus, bluez is linux only, so gattlib can't be used on windows.
gattlib is basically wrapper for the dbus api of bluez in python.
use vm instead and mount your bt adapter to the vm in order to control it with bluez.
wsl isn't supporting bluez right now
Windows 11 and Android - BluetoothAdapter return null

The operating you are using is not compatible. Gattlib only work with linux due to it relying on bluez whcih work on linux only. What you can do is using WSL on windows.

As far as I know, gattlib is designed for linux and debian system so you can use another one. Another side, if you are using a Python version greater than 3.9, you can directly Bluetooth RFCOMM Support for Windows 10.

I think you can find a solution by using "vmware" or "virtualbox" programs.
Output that I tested for you:

Related

Send command to MacBook Terminal from Pycharm installed on virtual Windows

Background:
Through VMWare Fusion installed on my MacBook, I have Windows installed virtually in the VMWare Fusion environment. On the Windows, I have Pycharm IDE through which I run automated python program to control bench instruments from Keysight and Techroniks. No issues.
PS- The instrument drivers are available only for Windows, thats the reason I am using Windows virtually on MacBook
Question:
From Pycharm (installed on virtual Windows), I would like to send any command (say, print Hello World) to the Terminal of the MacBook.
How to do this and what would be the command syntax (or package needed)?
There is no single package to do this.
At a minimum, your Mac host would need to run a server process. Then the VM would need to be on a host network bridge such that it is remotely addressable. Then, you can write a client that sends RPC requests to the host's server process.
At a low-level, you can use socket library, but you may want something higher level like httpserver.
Related - VMWare fusion: connecting to host's web server from guest
The other option without external dependencies would be to communicate over a file-system share.
If you want to install external software, then you can introduce a remote message queue or database.

Can iOS device automation be performed on a Windows machine using the Robot Framework?

I have a requirement to Automate scripts on iOS devices using the Robot framework/Python on the Windows platform.
What are all things I required in order to achieve this task?
You can't set up everything you need on Windows for iOS device. Instead you need to use macOS.
Maybe the answers here would be helpful.
No you can't automate any iOS scripts from windows system . The main requirement for iOSDriver to communicate with appium scripts and to your iOS device requires xcode app . Which is not there onto windows .
Appium can automate iOS device tests via WebDriverAgent.
WebDriverAgent can be run through multiple open source multi-platform tools from Windows:
go-ios
tidevice
others...
You will need Xcode to first build WDA though before you can deploy it to a device. Once it is installed on the device ( until the signing expires at least ) you can run WDA from any OS ( Mac, Windows, Linux ) using the various tools.

USB Device/PyUSB on Windows and LInux behaving differently

I have a device with USB interface which I can connect to both my Ubuntu 18.04 machine and my Windows 10 machine. On Windows 10 I have to install the CP210x driver and manually attach it to the device (otherwise Windows tries to find the device manufacturer's driver - it's a CP210x serial chip), and in Linux write the vendorID and productID to the cp210x driver to allow it to attach to ttyUSB0. This works fine.
The Windows driver is from SiliconLabs - the manufacturer of the UART-USB chip in the device.
So on Windows it is attached to COM5 and Linux to ttyUSB0 (Ubuntu, Raspbian)
Using Wireshark I can snoop the usb bus successfully on both operating systems.
The USB device sends data regularly over the USB bus and on Windows using Wireshark I can see this communication as "URB_INTERRUPT in" messages with the final few bytes actually containing the data I require.
On Linux it seems that the device connects but using Wireshark this time I can only see URB_BULK packets. Examining the endpoints using pyusb I see that there is no URB_Interrupt endpoint only the URB_Bulk.
Using the pyusb libraries on Linux it appears that the only endpoints available are URB_BULK.
Question mainly is how do I tell Linux to get the device to send via the Interrupt transfer mechanism as Windows seems to do. I don't see a method in pyusb's set_configuration to do this (as no Interrupt transfer endpoints appear) and haven't found anything in the manufacturer's specification.
Failing that, of course, I could snoop the configuration messages on Windows, but there has to be something I'm missing here?
Disregard this, the answer was simple in the end: Windows was reassigning the device address on the bus to a different device.

USB-to-serial driver for Linux

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

Advice for running Linux Virtual Machine on Windows

I have a python application that I am currently operating in Windows (because I need to be able to send TCP commands to a 3rd party Windows application which is running on the same machine). However, I want to be able to use libgphoto2, which generally only runs on Linux machines. Is it possible to set up a virtual machine and run everything from a single computer? My Python scripts can currently be run from either Linux or Windows. An easy way to do this would be to have one computer with Windows which I control over TCP from a secondary computer running Linux...but this means that I will need 2 computers.
Any advice?
Light solutions, just a Linux compatibility layer:
latest Windows has native Linux support
for older Windows versions, cygwin
or mingw
If it doesn't work, you can resort to a real virtualization, e.g. VirtualBox.
Try VM Player.
Where you can setup linux over windows and communicate between virtual linux and windows host.
VM Player

Categories