How to send data from Windows to embedded linux over USB - python

My setup looks like this: A 64-bit box running Windows 7 Professional is connected to a Beaglebone running Angstrom Linux.
I'm currently controlling the beaglebone via a putty command line on the windows box.
What I'd like to do is run an OpenCV script to pull some vision information, process it on the windows box, and send some lightweight data (e.g a True or False, a triplet, etc.) over the (or another) USB connection to the beaglebone.
My OpenCV program is running using Python bindings, so any piping I can do with python would be preferable. I've played around with pyserial to receive data on a windows box via a COM port, so it seems like I could use that on the windows side... at a total loss though on the embedded linux front

Normally on the linux front, if the usb dongle is of the right type, you will see something like /dev/usbserial or similar device. Maybe check dmesg after plugging the cable.
(on linux you can run find /dev | grep usb to list all usb related devices)
Just a side note, I've seen the beaglebone has an ethernet port, why not just using a network socket? It's all easier than reinventing a protocol on usb.

If you want to use python, take a look o PyUSB, as you can see for example in Sending data via USB using PyUSB. A related post is PyUSB for the Raspberry Pi.

Related

Executing code.py on Raspberry PI, from computer via ethernet connection

How could I launch code.py that only exists on a raspberry, from a python command line on a computer connected by an Ethernet cable. Machine A and the raspberry are connected to each other by a simple ethernet cable, and none of those two endpoints are connected to the internet. They only have the latest version of python installed and can't have anything more installed on them.
It looks like subprocess.Popen() could be a way to tackle it. But with the little knowledge I have I can't understand and know for sure if using this method is suitable !
Thank you for your time :)

How Do You Find What Serial Port a Device Is Connected To?

I have a device that I want to be able to communicate with serially. On Linux, I can see that when I plug in the device to my computer, I see that /dev/ttyUSB0 pops up, which I know to be the device; however, what I am not sure about is how would I go about finding out what port my device is connected to in the general sense? Say if I were to go to another machine and plug it in, or if I had multiple serial devices already plugged in to this computer; I wouldn't be able to rely on it always being /dev/ttyUSB0.
I plan on using PySerial to be communicate with the device (I couldn't find any other officially supported method with python to communicate with a serial device), and when you open a serial connection, you of course must specify the path to the device. On Windows it would be COM something, and Linux /dev/tty something. I want to be able to automatically find this out through the program. What is the best method to go about this?

How to know if my connected microphone is being used by any user? (Python OR Linux x84-64)

I'm writing a program and I need to be notified if the microphone connected to my system is used by any program.
Is there a way to do this in Linux or Python?
By the way, my microphone is connected via a USB cable and it is basically a webcam that has a microphone in it.
If your microphone is some /dev/media0 on Linux, you could use lsof from https://github.com/lsof-org/lsof to find the processes using it. See also proc(5) and lsusb(8)
On Debian, see also hwinfo.

FTDI 232H: USB Port 'Locked' to a physical port under Windows

Working with an Adafruit FTDI 232H Breakout assembly. I've already asked at Adafruit and FTDI and I'm still clueless. Writing in Python using the Adafruit-provided libraries and the FTDI libraries. Very new to Python and the FTDI 232H device...
Using Windows 10 Pro
I am able to successfully install the 'drivers' for the Adafruit based on this tutorial (specifically the Windows portion):
https://learn.adafruit.com/adafruit-ft232h-breakout?view=all
In the end, the interface will work, but what happens is that the device seems to be locked to a physical USB port. If I move the device to another USB port on the same machine, it is not recognized.
Based on some reading I've done, it seems like the driver, although installed in Windows, can only associate with the device on one port. Some say that Windows uses the serial number to keep track of what device uses what driver.
I have observed, using USBDView, that this device is not displaying a S/N. I have other devices that do not display a serial number and they can move from port to port without issue. This leads me to believe that the S/N tracking may not be 100% true in Windows. The Adafruit board does have a S/N in the EEPROM, but for some reason that information is not being provided to Windows / USBDView. I've not been able to successfully access the EEPROM via the FTProg utility.
I suspect that this might have something to to with the libusbK library that is installed via Zadig tool (again in the instructions) but I am not sure. FTDI says that there should not be any issue using the libusbK library.
Can anyone out there give me some pointers on:
Is it accurate that Windows uses the S/N to keep track of what driver goes with what device?
If so, how to get the FTDI device to display the S/N?
Is there some other setting in Windows that needs to be changed to allow this device to be used on other physical ports?
Is there any other utility like FTProg that could be used to work with the EEPROM?
Am I just missing something simple, Noob-style?
Thank you in advance,
I seem to recall a similar case related to COM port enumeration and Windows where the COM port enumeration is a hash of assorted variables including the PCI bus #, device #, etc. We witnessed this through the Microsoft devcon utility which is priceless and is a command line version of Device Manager.
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
https://blogs.technet.microsoft.com/deploymentguys/2009/12/16/where-to-find-devcon-exe/
If you google around, you can find the compiled version of this invaluable tool. With confidence, believe this tool will assist you to debug your USB port mystery. Good luck.

Getting inputs from USB TV remote

I'm running a Linux Debian port on a Raspberry Pi named Debian, and it has Python 3 and 4 installed, I believe. I have an USB remote that looks like a TV remote that I'm trying to receive input from for a program, preferably in python, but have no idea how to get an input from a pressed button on a USB device to relay to instructions.
I need a way to index any USB input presses, so I can map them to inputs to be sent over I2C. It doesn't have to be Python, but I already have other instructions in it and would like to know how to import those controls.
Edit: The controller is an ATI RF remote where the sensor plugs into USB.
http://www.emtcompany.com/ati-100712001-remote-control/101317958.html?gclid=CjwKEAiAhIejBRCKm_fTxIWyyXcSJABXY0XYp_oZmm7_2YdlKFysTH7jS-BXk0ngqoS68crxrrjKAhoCQw_w_wcB

Categories

Resources