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
Related
So I was trying to code with my raspberry pi pico. I loaded up thonny (with micropython) and I get this error.
Unable to connect to COM3: port not found
Backend terminated or disconnected. Use 'Stop/Restart' to restart.
The only reason I think this would happen was I tested the pi on a battery pack (using it somewhere not near my computer, or another computer, so it was necessary.) How do I fix it?
If you are using a battery pack, that tells me you don't have the Pico connected to the computer with the USB cable. (If so, it is dangerous to have 2 power sources without protection, like a diode.) Is that correct? If so, there is no COM port for Thonny to connect to.
if I'm planning to use raspberry pi taking the picture , and send to NVIDIA Jetson TX2 to analize, how can I do so?
environment: raspberry pi 4 , openCV, cv2, Jetson TX2 Ubuntu 18.04, Python
from now I know how to take the picture using usb camera (connected with raspberry pi 4) and save the pic on desktop
also analyze the pic by NVIDIA Jetson TX2
both can use network, my question is how to send picture bewteen two device automatically with python script? or other alternatives app can do so
now i'm sending pic manually by gmail (´-ι_-`)
You could use scp.
scp path/to/image.png username#192.168.179.100:/your/folder/
Replace the username and ip address with these of the jetson or raspi press enter and enter the Passwort of the user that you want to connect.
This question is very broad. You have multiple solutions at hand:
Configure a webserver on the recieving end and send the picture via HTTP (requests module). Have a look at Flask or FastAPI.
Configure a FTP on the recieving end, and send the picture via a FTP module (seems like there is a native lib for that
Others ?
I have a pair of Bluetooth earbuds that have touch capabilities to pause and play music and it works fine on my win 10 pc. So, I am trying to make a small python script that triggers an event on receiving signals from the earbuds as I had heard that python 3.9 now supports Bluetooth for windows 10. So is there any way to receive those signals in python? I have tried wire shark but it does not detect any Bluetooth devices at all .
What I have tried:
pybluez (doesn't work for win 10)
sockets (it requires a client program installed on the other device which is not possible)
I would like to build a camera trigger for my phone by simulating a BLE keyboard that sends the Volume Up key to the phone connected by Bluetooth. I want this because I want to trigger the native Camera app, and not an embedded camera view.
I'm agnostic about technology used but ideally for simplicity I'd like it to be a command line utility in my Macbook, with something like Go or Node.js.
I've looked into Noble for Node.js, which doesn't seem to be oriented at emitting, and found projects for arduino, and found a couple of StackOverflow questions asking the same, but nothing definitive yet.
Apparently the Bleno project for Node.js could be better suited, but apparently it's very outdated.
Would someone please point me in the right direction?
Thank you
Edit
I was able to use Bleno to emit 0xEA and 0xE9 (Volume Up and Volume Down apparently), and using the LightBlue app I'm able to inspect that receive those messages, however, connecting to the MacBook through the phone's bluetooth does not increase/decrease volume.
Edit
Found this outdated project written in Swift 3 for reference
Edit Apparently the pybluez project looks like it could be a good option
You should be able to use the terminal for that. Eg. in Windows, you can start the camera app using start microsoft.windows:camera
Something similar should be available even in Mac. Try that out. Otherwise, go to the root directory where the camera app is stored. And then trigger that from code.
You need to create a Bluetooth HID (or HID over GATT) peripheral that your phone can connect to and will receive the key commands from.
There is a project here that did it with a Raspberry Pi:
https://gist.github.com/ukBaz/a47e71e7b87fbc851b27cde7d1c0fcf0#gistcomment-2997623
Unfornately the underlaying Bluetooth library will not move across to your Mac Book.
The HID protocol is documented here: https://github.com/jpbrucker/BLE_HID/blob/master/doc/HID.md
In summary, I think what your saying is that you want to make an cli application which is on your laptop/desktop connect to your phone via Bluetooth and simulate a volume key from your laptop/desktop keyboard.
Android:
To do this you will need:
Python 3.5 or above
PyBluez
Keyboard(Python module/API)
Android Studio
Java Development Kit 8 (preferably 11 or 14)
Android BLE
So in order to do this I would create a cli application with python3 and I would record the key presses on the laptop/desktop machine by using the keyboard module this then gets transmitted(bluetooth) via the PyBluez module to your phone. Your phone then accepts the bluetooth data via Android BLE and then simulates the volume button press.
DISCLAIMER:
This only works when the phone is already paired to your pc and only work on android phones 4.4.4 and above.
Some Links That Could Help You:
Bluetooth lib for python 3 ,
detect key press in python? ,
Create a socket for 4.0 bluetooth transmission
IOS:
To do this you will need:
Python 3.5 or above
PyBluez
Keyboard(Python module/API)
XCode
Swift
Core Bluetooth Module
So in order to do this I would create a cli application with python3 and I would record the key presses on the laptop/desktop machine by using the keyboard module this then gets transmitted(bluetooth) via the PyBluez module to your phone. Your phone then accepts the bluetooth data via Core Blutooth Module in swift and then simulates the volume button press.
DISCLAIMER:
The phone and laptop/desktop must be paired before it runs this might sound obvious but some people might ignore this.
Some Links That Could Help You:
iOS use the volume buttons as input ,
https://developer.apple.com/documentation/corebluetooth/transferring_data_between_bluetooth_low_energy_devices
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.