Running a kinect on Raspberry Pi - Python - python

I am trying to run Vision Processing python code, through Raspberry Pi with the Microsoft Kinect camera.
I have perfectly working code running on Ubuntu but it fails to perform the same on the RPi.
I think I have all libraries installed on it...
I even tryied the following simple code:
import freenect
ir, data = freenect.sync_get_video(format=freenect.VIDEO_IR_8BIT)
print ir
It doesn't work, it gets stuck.
What could the reason?
Maybe the kinect and the raspberry Pi dont work together?
Note: When I try "freenect-glview" I get: "Number of devices found: 1"

Did you try using OpenNI SDK. I tried and it works with OpenNI Also do you have a powered USB hub as PI can't generate enough energy to power Kinect.

Kinect does not work on RPI due to an usb driver bug :
Linux Driver Issues
Shortly after the Raspberry Pi was released it was confirmed that there were a number of issues with the Linux USB driver for the
SMSC95xx chip.
These included problems with USB 1.x peripherals that use split transactions, a fixed number of channels (causing problems with
Kinect) and the way the ARM processor handles the SMSC95xx interrupts.
[2] [3] A large number of fixes were included in the
2012-08-19-Wheezy-raspbian Linux image.
source http://elinux.org/RPi_VerifiedPeripherals

Related

Access USB device on Mac in python using pyusb an libusb

I would like to read the signal from a USB keyboard that is attached to my MacBook Pro. I am using PyCharm to write my script and I installed pyusb and libusb for the backend. Really, I am at the very beginning so please excuse my little knowledge. The problems I am faced with is that I do [Errno 13] permission error when running the script in PyCharm or when saving it and running it with PyLauncher I get a "No backend available error".
The final aim of this project is to control the vlc-media player using the vlc module based on the input of a usb device.
The current code:
import usb
import libusb_package
backend = libusb_package.get_libusb1_backend()
# find device
keyboard = usb.core.find(idVendor=0x046d, idProduct=0xc318, backend = backend)
if keyboard is None:
raise ValueError('ADU Device not found. Please ensure it is connected.')
sys.exit(1)
usb.util.claim_interface(keyboard, 0)
I would really appreciate any hints or suggestions what packages to use, which tutorials to read for usb devices and python and how to improve in this project.
Thank you very much!
All the best,
ie

Send Sensor Data & Stream Video Over Bluetooth (Raspberry Pi to PC)

I would like to send sensor data (string) and live video from the Raspberry Pi camera over Bluetooth. I would like to do this with python. I would like to display the video on the PC in a tkinter window. Any ideas??
Raspberry Pi: Pi 3
PC: Windows 10 with Python 3.8.3 64 bit
Video might be a bit tricky. More details at: https://stackoverflow.com/a/64062680/7721752
Bluetooth on Windows with Python is not that well supported. However, with Python 3.9 there is support for Serial Port Profile (SPP). There is details of how to create the client at: https://stackoverflow.com/a/62815818/7721752
To create the Server on the Raspberry Pi (RPi) I would use the Bluedot library:
https://bluedot.readthedocs.io/en/latest/btcommapi.html#bluetoothserver
(Bluedot only works on RPi)
Developing both ends of a Bluetooth link at the same time is tricky if you are new to creating Bluetooth. My suggestion would be to create the Server on the RPi first and use an app like Serial Bluetooth Terminal on your phone to test it. Once that is working start on developing the client.

unable to flash micropython to esp 32: open serial error

issue: unable to flash micropython to esp 32: open serial error, please try again. hope to connect internet and try again.
pretty new to micropython - want to flash micropython to esp 32 ( resp 8266) board.
cf this docs: https://maker.pro/esp8266/tutorial/using-micropython-on-an-esp8266-with-upycraft
getting this errors all the time.
open serial error, please try again.
hope to connect internet and try again.
current version only open py txt json ini file.
hope to connect internet and try again.
hope to connect internet and try again.
i run Win 7
the hardware:
a. Joy-IT-Node MCU ESP8266
.. and besides that i also tried it with the following
b. ESP32-T Development Board CP2102 with Espressif ESP-WROOM-32 IoT WLAN & BLE Modul
yes: i have installed the > CP210x_Universal_Windows_Driver.zip
by the way: i could try to do all that on a linux machine. - on a MX-Linux-Sytem
any idea;
many thanks for any and all help in advance.
As of my opinion, You don't necessarily depend on the uPyCraft IDE. So there are several other ways to develop scripts and uploading them to Your board.
Some days ago I was facing problems with Python on the NodeMcu as well. Since I didn't like the tutorials around the web, I've set up one on GitHub, covering the end-to-end process (required software, drivers, firmware images, developing, flashing, uploading, etc.): python2nodemcu.
It depends on Mac and the NodeMcu board, but some of the topics may apply to other operating systems and boards as well.
And I think it covers the most relevant parts of the whole process, using the easiest tools around the web. Please have a look at it, but all in all it goes like this (short version of the linked documentation above):
Install Python 3
Verify with python --version
Or python3 --version
Install the correct SiLabs driver to enable serial USB-to-UART communication
See here
Find the device file (representing the interface to the physical device)
Try it using ls -la /dev/tty.*
Download the recent MicroPython firmware
You need the right one for Your board
Install the two Python-based libraries EspTool and PySerial
Try to erase the flash of Your device
Run python3 esptool.py --port /dev/tty.{device-file} erase_flash
Try to flash the original image or the MicroPython firmware to the board
Run python3 esptool.py --port /dev/tty.{device-file} write_flash 0x00000 {micropython-image-or-original-firmware}.bin
Try to connect to the board via the REPL prompt
Run screen /dev/tty.{device-file} 115200
You maybe need to try different baud rates (depending on Your driver, cable, etc.)
Connect to the board using Ampy
For example, try to list the files on Your device executing python3 ampy/cli.py --port /dev/tty.{device-file} --baud 115200 ls
Again, try other baud rates
Anyway, I've noticed that You do not necessarily need to push the physical flash button on the device.

nfcpy - detect a USB-serial connected PN532

I am trying to use a pn532 board connected using an Adafruit FTDI Friend to my MacBook Pro. It pops up in /dev as "tty.usbserial-XXXXXXXX" (where the Xs are the serial number). I have tried things such as "tagtool.py --device=tty:usbserial-XXXXXXXX:pn532" but no success. I also tried that same connection string straight in my code.
Nfcpy doesn't seem to be detecting the PN532, but it detects my ACR122U over USB just fine. I have already confirmed its not the PN532 board, as libnfc on my Mac detects it, and it works fine on my Raspberry Pi.
My code to connect:
with nfc.ContactlessFrontend('tty:usbserial-XXXXXXXX:pn532') as clf:
tag = clf.connect(rdwr=rdwr_options)
if tag == False:
raise KeyboardInterrupt
With nfcpy 0.13.0 (and earlier versions) it was not possible to use serial ports on Mac OS X. The /dev/ naming scheme for OS-X has been added in nfcpy 0.13.1 and those ports are now automatically discovered or specifically selectable with the device path of nfc.ContactlessFrontend.open().

How to establish serial connection with Bluetooth device on Win7

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

Categories