How To Get RAW USB Input from wireless Keyboard - usb

I'm Using Ubuntu and have purchased a Logitech K750 Wireless Keyboard that runs on solar power. I would like to use this device not just as a keyboard but also as a light sensor for my office. The keyboard (this I know from the windows tool available for it, that shows the light-level in lux) transmits the current light to the computer thus it should be possible to use it as a sensor.
My question is how to get the data transmitted from the keyboard. I have tried to identify the USB-Port with the help of dmesg, resulting in (these are just the last lines, after I put the usb-receiver in)
[ 379.352041] usb 5-1: new full speed USB device using uhci_hcd and address 4
[ 379.556188] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input12
[ 379.556345] generic-usb 0003:046D:C52B.0005: input,hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:00:1d.3-1/input0
[ 379.563530] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1/input/input13
[ 379.563794] generic-usb 0003:046D:C52B.0006: input,hiddev0,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.3-1/input1
[ 379.571558] generic-usb 0003:046D:C52B.0007: hiddev0,hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.3-1/input2
lsusb gives me
Bus 005 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 005 Device 003: ID 046a:0106 Cherry GmbH
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I am nut sure what this means however.
I have tried sudo cat /dev/usb/hiddev0, which seemed like a likely solution but no data is displayed. (A while ago I could get the data from my mouse with that command, but now that does not work either)
Does anybody know how to get the data from the device?
Edit sudo cat /dev/tty0 works however I do not seem to get symbols that I can display... the terminal shows "9�9�9�9�� � ��� �� ��".
Edit2 I'm not sure that this signal is even from my keyboard. When I press "aaabbbcccabcd" and then resolve the unreadable text using od -x I get
0000000 1e9e b030 b030 2eae ae2e 9e1e 2030 00a0
0000017
I can't see the pattern...

I did a search on Google recently and I found this website: https://github.com/aheadley/logitech-solar-k750-linux
It might be helpful to you and the Linux world. I'm more of a Windows user, so I can't advise much to you with Ubuntu/Linux and Python coding. The source code is in Python language. Hope this helps you get somewhere.

I recently bought this keyboard, and subsequently ran into a blog post by Debian developer Julian Danjou on using upower with Logitech unifying devices and the solar K750 in particular. The post mentions that his work for a lumincance property might land in the next version of upower,v0.9.19. Until that is there, I intend to try out the version in their repository (see the upower page on freedesktop.org).
If you intend to dive into it yourself, that blog (and a previous entry on the K750) note that it uses the HID++ protocol to connect, and links to a draft specification. Yesterday I saw a tweet by Julian Danjou that his work with this is progressing - you might want to contact him directly.
edit - Update: this work is now (partly?) integrated into the gnome power manager (via upower).
Also, this work has been continued and developed into an application for controlling the Logitech Unifying adapter (pairing,unpairing), as well as checking the luminance, called 'Solaar': https://github.com/pwr/Solaar
It is a great help :)

Related

STM32 Virtual COM Port appears as Device in DFU Mode on Windows 10

So, my knowladge in embedded development is quite bad and now I am trying to receive some data from PC inside my MCu STM32F429IGT6 which is on WaveShare Core4X9I dev-board and send it back via USB Virtual COM Port.
I realized how to set up connection from MCu part and I even see connected device from Windows 10 Device Manager but... it appears as STM Device in DFU Mode
I have tryed already to install drivers from ST for such things but they are useless and official documentation says that they are not needed for Windows 10.
I have been following tutorials where guys just clicked several times inside Cube MX, generated code and VCP worked out of the box.
The question is what am I doing wrong? I don`t even know what information you might ask for thats why I created GitHub repo: https://github.com/dessy4oko/stm32f429-vcp-appears-as-dfu
And this is events from Device Manager of Windows 10 (translation from ru lang):
Device USB\VID_0483&PID_DF11\305233703237 is running. code 410
Device USB\VID_0483&PID_DF11\305233703237 is configured. code 400
Device USB\VID_0483&PID_DF11\305233703237 have not been moved due to partial or ambiguous matching. code 442
Device USB\VID_0483&PID_DF11\305233703237 requires further installation. code 430
Thank you for any information about my mistakes.
STM32 starts in DFU mode if BOOT-pins are pulled accordingly:
"System memory" means embedded bootloader, DFU in this case. You need "Main Flash" to run your app.
Check jumpers and switches on your board. Refer also to the AN2606 app note for complete information.

Starting video failed when using webcam in Big Blue Button ubuntu 18.04

When trying to give access to my webcam (VGA Single Chip via USB) in BBB, an error appears.
But the camera is OK e. g. it works in GUVCView and the command
lsusb
gives
Bus 002 Device 011: ID 093a:2603 Pixart Imaging, Inc. PAC7312 Camera
Bus 002 Device 010: ID 046d:c52f Logitech, Inc. Unifying Receiver
[...]
When choosing the integrated Cam in BBB, this works.

Convert RTSP stream to virtual web camera

I am trying to use a RTSP stream from an IP camera as video input source for various applications on Windows (eg. Skype, Zoom, Microsoft Teams, etc.).
The only solution I have found so far is using "webcam 7", an application that fetches an RTSP stream and creates a virtual webcam driver that registers in system as webcam and that any application can then use. Unfortunately, this application often becomes unstable and might crash randomly.
Are there any alternative/better ways for achieving this?
Create your own DirectShow video capture filter (there are lots of examples - this is a great one) and handle the RTSP stream inside it. This way you can implement the stability yourself.
I know this is a bit old question.
But you can also have look at vlc2vcam, looks promising.
Try Moonware Universal Source Filter from http://netcamstudio.com. The only drawback is that it creates only video "composite" device that sends both video + audio and Skype can only see the video (I think most of applications does the same).
If I find an easy way to split that stream will post it here.
You can easily do it on Ubuntu, Debian, Raspian, and Ubuntu Linux for Windows subsystems using the following method,
Installing required libraries, v4l2loopback-dkms and ffmpeg:
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
Emulate a video device:
sudo modprobe v4l2loopback card_label="Webcam Stream Name" exclusive_caps=1
Streaming from RTSP uri to the created virtual device:
ffmpeg -stream_loop -1 -re -i rtsp://uri -vcodec rawvideo -threads 0 -f v4l2 /dev/video0
You can replace the '0' at the end of /dev/video0 with the number of the available and playable video device.

Raspberry Pi is not recording from USB Microphone

I've an USB hub (Plugabble) with a usb Daffodil sound card.
The Speakers are working great, but the microphone is not working. I don't know what to do anymore to get it working.
The usb sound card is set as default
The arecord command records but no sound is recorded.
The aplay play sounds nicely.
Here are some of my settings:
pi#raspberrypi ~ $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
sysdefault:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
front:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
Front speakers
surround40:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
IEC958 (S/PDIF) Digital Audio Output
pi#raspberrypi ~ $ sudo lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
pi#raspberrypi ~ $ sudo amixer set Capture cap 8
amixer: Unable to find simple control 'Capture',0
pi#raspberrypi ~ $ amixer
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch pswitch-joined penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 151
Mono:
Front Left: Playback 44 [29%] [-20.13dB] [on]
Front Right: Playback 44 [29%] [-20.13dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: Playback 0 - 32 Capture 0 - 16
Mono: Playback 23 [72%] [34.36dB] [on] Capture 9 [56%] [13.39dB] [on]
Simple mixer control 'Auto Gain Control',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Thanks!
This depends on you distribution, since different distributions handle the devices differently.
So i think you are running a raspian jessy but tried to configure it like you where on a wheezy.
So if I am right you should go into the file alsa.conf with the command
sudo nano /usr/share/alsa/alsa.conf and edit the lines
defaults.ctl.card 0
defaults.pcm.card 0
to
defaults.ctl.card 1
defaults.pcm.card 1
then go to the file .asoundrc with the command sudo nano /home/pi/.asoundrc and edit it so it looks like following:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
do an reboot and hopefully it will work.
If i was wrong with my guess please comment under the answer and i will update it :) hope it helped.

CRTMP Server RTSP play to Symbian RealPlayer

CRTMP Server is great tool... Nat Traversal when client is behind router working great.
...
Tested Android 2.2, 2.3, 4.1, RTSP streaming ok (rtmp flash also ok).
But RTSP on RealPlayer (Helix DNA 10.0 onS60) always shows 'can not play media; or 'can not connect' (connection is surely established - checked with wireshark).
...
(it is programming related problem, because i am willing to explore CRTMP code to accomplish solution)
BBC RTSP channel (wowza is behind) is showed well in symbian realPlayer, but streaming source:
ffmpeg -i rtsp://[bbc_channel_address] -c copy -f rtsp rtsp://[crtmp_server_addr]:8554/ch
... is ok for android, but not working for realPlayerS60.
Does anybody have a clue about reason?
Having RTSP working is not enough. Different phones have different requirements in terms of A/V codecs quality. The content you want to deliver may be too high quality for that device. This assumption fits well with what you said (working on android, but not on realPlayer)
You can ask this questions over the crtmpserver's mailing list. Consult http://rtmpd.com/resources/ for details about the mailing list
Edit:
Or the codecs you try to push from crtmpserver towards the phone are not even supported, let alone hitting the quality max limit