mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

279K
active users

#usbhid

0 posts0 participants0 posts today
Habr<p>[Перевод] Создаём альтернативный SDK устройства при помощи Wireshark</p><p>Почти четыре года назад я писал о реверс-инжиниринге Stream Deck с целью получения полного контроля над устройством и устранения зависимости от ПО Stream Deck. Мне по-прежнему нравится это «железо», но ПО стало только хуже — теперь оно даже требует входа в аккаунт пользователя для скачивания расширений. Я стремлюсь максимально уважать приватность и выбор пользователей, поэтому если уж я хочу использовать устройство без аккаунта, то вам лучше предоставить мне такую возможность. К счастью, развивая идеи моей предыдущей работы над DeckSurf , я наконец-то набрался решимости вложиться по полной и сделать мой проект приемлемой альтернативой проприетарному ПО для этого крайне гибкого и универсального устройства с кнопками. В этом посте мы рассмотрим работу Stream Deck Plus — устройства ценой $179,99, которым вы, дорогой читатель, теперь сможете пользоваться, даже если не хотите устанавливать ПО его производителя.</p><p><a href="https://habr.com/ru/companies/ruvds/articles/871698/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">habr.com/ru/companies/ruvds/ar</span><span class="invisible">ticles/871698/</span></a></p><p><a href="https://zhub.link/tags/wireshark" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wireshark</span></a> <a href="https://zhub.link/tags/tshark" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tshark</span></a> <a href="https://zhub.link/tags/usb%D1%83%D1%81%D1%82%D1%80%D0%BE%D0%B9%D1%81%D1%82%D0%B2%D0%B0" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbустройства</span></a> <a href="https://zhub.link/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://zhub.link/tags/sdk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sdk</span></a> <a href="https://zhub.link/tags/open_source" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>open_source</span></a> <a href="https://zhub.link/tags/%D0%BE%D0%B1%D1%80%D0%B0%D1%82%D0%BD%D0%B0%D1%8F_%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B0" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>обратная_разработка</span></a> <a href="https://zhub.link/tags/ruvds_%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ruvds_перевод</span></a></p>
Habr<p>Как я создал устройство, которое может удаленно эмулировать мышку и клавиатуру на stm32</p><p>Всем привет, совсем недавно я начал изучать протокол USB на STM32F103C8 , а именно HID-устройства . Я такой человек, который не сильно любит теорию, но обожает учиться всему на практике, поэтому я тут же начал думать над будущим проектом. И я вспомнил, что совсем недавно заказал себе wifi модуль - ESP8266 .</p><p><a href="https://habr.com/ru/articles/855750/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/855750/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/stm32" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>stm32</span></a> <a href="https://zhub.link/tags/embedded" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>embedded</span></a> <a href="https://zhub.link/tags/%D0%BC%D0%B8%D0%BA%D1%80%D0%BE%D0%BA%D0%BE%D0%BD%D1%82%D1%80%D0%BE%D0%BB%D0%BB%D0%B5%D1%80%D1%8B" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>микроконтроллеры</span></a> <a href="https://zhub.link/tags/esp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esp</span></a> <a href="https://zhub.link/tags/esp8266" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esp8266</span></a> <a href="https://zhub.link/tags/usb" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usb</span></a> <a href="https://zhub.link/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://zhub.link/tags/cubeide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cubeide</span></a></p>
Pete Prodoehl 🍕<p><span class="h-card" translate="no"><a href="https://mastodon.social/@paulrickards" class="u-url mention">@<span>paulrickards</span></a></span> Thanks for your comment! I found out it was specific to the core I was using... I switched cores (and libraries) and I can get a USB HID Raspberry Pi Pico to use 100ma instead of 250ma!</p><p><a href="https://mastodon.social/tags/raspberryPiPico" class="mention hashtag" rel="tag">#<span>raspberryPiPico</span></a> <a href="https://mastodon.social/tags/USB" class="mention hashtag" rel="tag">#<span>USB</span></a> <a href="https://mastodon.social/tags/USBHID" class="mention hashtag" rel="tag">#<span>USBHID</span></a></p>
Pete Prodoehl 🍕<p><span class="h-card" translate="no"><a href="https://mastodon.social/@paulrickards" class="u-url mention">@<span>paulrickards</span></a></span> Wow! Good call... That&#39;s it.</p><p>• USB HID Current Required: 250mA</p><p>• USB MIDI Current Required: 100mA</p><p>I wonder if there&#39;s a workaround...</p><p><a href="https://mastodon.social/tags/raspberrypipico" class="mention hashtag" rel="tag">#<span>raspberrypipico</span></a> <a href="https://mastodon.social/tags/usbhid" class="mention hashtag" rel="tag">#<span>usbhid</span></a> <a href="https://mastodon.social/tags/usbmidi" class="mention hashtag" rel="tag">#<span>usbmidi</span></a> <a href="https://mastodon.social/tags/microcontrollers" class="mention hashtag" rel="tag">#<span>microcontrollers</span></a></p>
Pete Prodoehl 🍕<p>I&#39;m a bit disappointed the Raspberry Pi Pico draws too much power to be used as a USB HID device with an iPad or iPhone. This is something I used to do with the Teensy LC quite easily. (Luckily I have a *ton* of LC boards on hand!)</p><p>It can work with a powered USB hub but that&#39;s a lot of faff. </p><p><a href="https://mastodon.social/tags/raspberryPiPico" class="mention hashtag" rel="tag">#<span>raspberryPiPico</span></a> <a href="https://mastodon.social/tags/teensy" class="mention hashtag" rel="tag">#<span>teensy</span></a> <a href="https://mastodon.social/tags/USBHID" class="mention hashtag" rel="tag">#<span>USBHID</span></a></p>
fwrret<p>This month I had an obsession with USB HID devices and I wrote a blog post about reverse engineering the Logitech CU0019 USB receiver.</p><p><a href="https://dev.to/endes/usb-hid-down-the-rabbit-hole-reverse-engineering-the-logitech-cu0019-usb-receiver-4d6a" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dev.to/endes/usb-hid-down-the-</span><span class="invisible">rabbit-hole-reverse-engineering-the-logitech-cu0019-usb-receiver-4d6a</span></a></p><p><a href="https://im-in.space/tags/reverseengineering" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>reverseengineering</span></a> <a href="https://im-in.space/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a></p>
Frank Abelbeck<p>Used this as an opportunity to move from GitHub.</p><p>The Abelbeck Aquila Central Console (A2C2) repository can be found at <a href="https://git.abelbeck.info/a2c2" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">git.abelbeck.info/a2c2</span><span class="invisible"></span></a></p><p>Yes, it's only a (non-bare) repo directory structure. Web frontend follows, when I have my client-side Javascript git rendering engine ready.</p><p>Use <a href="https://git.abelbeck.info/a2c2/.git" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">git.abelbeck.info/a2c2/.git</span><span class="invisible"></span></a> for cloning.</p><p><a href="https://troet.cafe/tags/aviation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>aviation</span></a> <a href="https://troet.cafe/tags/AquilaA210" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AquilaA210</span></a> <a href="https://troet.cafe/tags/xplane12" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xplane12</span></a> <a href="https://troet.cafe/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://troet.cafe/tags/circuitpython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>circuitpython</span></a> <a href="https://troet.cafe/tags/RaspberryPiPico" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RaspberryPiPico</span></a></p>
Frank Abelbeck<p>Finished. Less than a week from idea to product.</p><p>💪</p><p><a href="https://troet.cafe/tags/aviation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>aviation</span></a> <a href="https://troet.cafe/tags/xplane12" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xplane12</span></a> <a href="https://troet.cafe/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://troet.cafe/tags/RaspberryPiPico" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RaspberryPiPico</span></a></p>
Frank Abelbeck<p>Assembly check.<br>Spray-paint black check.<br>Function check.</p><p>Labels incoming (did I already mention that I like my plotter?)</p><p><a href="https://troet.cafe/tags/aviation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>aviation</span></a> <a href="https://troet.cafe/tags/xplane12" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xplane12</span></a> <a href="https://troet.cafe/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://troet.cafe/tags/RaspberryPiPico" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RaspberryPiPico</span></a></p>
Frank Abelbeck<p>Parts for the Aquila central console input device are cut, now for some glu... laminating.</p><p><a href="https://troet.cafe/tags/aviation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>aviation</span></a> <a href="https://troet.cafe/tags/xplane12" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xplane12</span></a> <a href="https://troet.cafe/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a></p>
Frank Abelbeck<p>Well, that was easier as expected. From idea to product in four days. Now I am able to control throttle, propeller, flaps, and the pitch trim of the virtual AT01 with my custom Raspberry Pi Pico-based USB joystick.</p><p>+1 on CircuitPython, USB HID dev</p><p>💪</p><p>Next: mount it in a nice cardboard case.</p><p><a href="https://troet.cafe/tags/aviationgeek" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>aviationgeek</span></a> <a href="https://troet.cafe/tags/AquilaA211" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AquilaA211</span></a> <a href="https://troet.cafe/tags/circuipython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>circuipython</span></a> <a href="https://troet.cafe/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://troet.cafe/tags/RaspberryPiPico" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RaspberryPiPico</span></a></p>
Gonçalo Ribeiro<p>Trying to reverse a bit of the USB configuration protocol for my <a href="https://infosec.exchange/tags/8bitdo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>8bitdo</span></a> <a href="https://infosec.exchange/tags/retro" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>retro</span></a> <a href="https://infosec.exchange/tags/keyboad" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>keyboad</span></a>, the bad boy in the picture. I want to configure some of its keys to something I can't with their <a href="https://infosec.exchange/tags/proprietary" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>proprietary</span></a> software, that's why.</p><p>The protocol is based on <a href="https://infosec.exchange/tags/USBHID" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>USBHID</span></a>. I've captured packets and think I understand the basics of what I would need to send it. Capturing these packets had to involve a Windows VM, since the configuration software is not available for <a href="https://infosec.exchange/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a>.</p><p>Now I want to replay some packets to test the protocol. Struggling a bit with that, on how to do it. Explored <a href="https://infosec.exchange/tags/usbrply" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbrply</span></a> as an option but it seems not to be looking at the HID data. A bit weird.</p><p>I think I'll try to write a simple thing in <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> for testing next.</p><p>And I hope not no brick the thing...</p>
Tod Kurt (todbot)<p>Anyone else knows HID “System Control” commands or USB keyboard sleep/wake magic? I think I implemented it correctly in CircuitPython and seems to function mostly correct on Windows but on MacOS, it brings a &quot;Are you sure you want to shutdown?” dialog. <a href="https://gist.github.com/todbot/5cd232e16c7a67bd2172d6719f8a8518" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">gist.github.com/todbot/5cd232e</span><span class="invisible">16c7a67bd2172d6719f8a8518</span></a><br /><a href="https://mastodon.social/tags/CircuitPython" class="mention hashtag" rel="tag">#<span>CircuitPython</span></a> <a href="https://mastodon.social/tags/USB" class="mention hashtag" rel="tag">#<span>USB</span></a> <a href="https://mastodon.social/tags/USBHID" class="mention hashtag" rel="tag">#<span>USBHID</span></a> <a href="https://mastodon.social/tags/HID" class="mention hashtag" rel="tag">#<span>HID</span></a> <a href="https://mastodon.social/tags/keyboard" class="mention hashtag" rel="tag">#<span>keyboard</span></a></p>
Pete Prodoehl 🍕<p>I forgot about this one! Back in 2019 a software company wanted something special for the release of a new version of their software, so I built this USB device for them.</p><p>➡️ <a href="https://rasterweb.net/raster/2019/10/17/software-release-button/" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">rasterweb.net/raster/2019/10/1</span><span class="invisible">7/software-release-button/</span></a></p><p><a href="https://mastodon.social/tags/USB" class="mention hashtag" rel="tag">#<span>USB</span></a> <a href="https://mastodon.social/tags/USBHID" class="mention hashtag" rel="tag">#<span>USBHID</span></a> <a href="https://mastodon.social/tags/maker" class="mention hashtag" rel="tag">#<span>maker</span></a></p>
GeekProjects News<p>Building Up Unicode Characters One Bit at a Time <a href="https://hackaday.com/2023/09/07/building-up-unicode-characters-one-bit-at-a-time/" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">hackaday.com/2023/09/07/buildi</span><span class="invisible">ng-up-unicode-characters-one-bit-at-a-time/</span></a> <a href="https://geekprojects.com/tags/PeripheralsHacks" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PeripheralsHacks</span></a> <a href="https://geekprojects.com/tags/truetypefont" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>truetypefont</span></a> <a href="https://geekprojects.com/tags/codepoint" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codepoint</span></a> <a href="https://geekprojects.com/tags/keyboard" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>keyboard</span></a> <a href="https://geekprojects.com/tags/unicode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>unicode</span></a> <a href="https://geekprojects.com/tags/binary" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>binary</span></a> <a href="https://geekprojects.com/tags/usbhid" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>usbhid</span></a> <a href="https://geekprojects.com/tags/glyph" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>glyph</span></a> <a href="https://geekprojects.com/tags/UTF" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>UTF</span></a>-8</p>
tobozotagada<p>M5Stack USB-HID Keyboard "soft host" using only two wires</p><p><a href="https://makertube.net/videos/watch/1b232231-91b2-4263-b164-9a341612f4bd" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">makertube.net/videos/watch/1b2</span><span class="invisible">32231-91b2-4263-b164-9a341612f4bd</span></a></p>
Gergely Imreh<p><strong>Making a USB Mute Button for Online Meetings</strong></p><p>I use Google Meet every day for (potentially hours of) online meetings at work, so it’s very easy to notice when things change and for example new features are available. Recently I’ve found a new “Call Control” section in the settings that promised a lot of fun, <a href="https://support.google.com/meet/answer/12562325?hl=en" rel="nofollow noopener" target="_blank">connecting USB devices to control my calls</a>.</p><p>Google Meet Settings menu during a call, witht the Call control section</p><p>As someone who enjoys (or drawn to, or sort-of obscessed with) <a href="https://gergely.imreh.net/blog/category/maker/" rel="nofollow noopener" target="_blank">hacking on hardware</a>, this was a nice call of action: let’s cobble together a custom USB button that can do some kind of call control1: say muting myself in the call, showing mute status, hanging up, etc.</p><p>This kicked off such a deep rabbit hole that I barely made it back up to the top, but one that seeded a crazy amount of future opportunities. </p><p></p><p>And as a shortcut, there’s a demo below to showcase where I got to.</p><p>Finding suitable hardware</p><p>This step was harder than I’ve expected, given that I have drawers and drawers of gadgets, but I’m likely a bit out of practice, and also out of date. What I was looking for is</p><ul><li>Being able to show up as a USB device (must)</li><li>Have built in button (optional) or easy connectivity of buttons without breadboard for now</li><li>Have built in LED (optional) or some other way of showing 1 bit of information</li></ul><p>This doesn’t sound hard, right?</p><p>ReSpeaker</p><p>The first option that came up was Seeed Studio’s <a href="https://wiki.seeedstudio.com/ReSpeaker_Core/" rel="nofollow noopener" target="_blank">ReSpeaker Core</a> that I had two of at hand: Arduino Leonardo compatibility, touch sensors for buttons, and an LED ring (the “Pixel Ring”). Turns out that they have been <em>discontinued</em> – which should be fine for now; but also my models are two different <em>pre-release prototypes</em> Seeed gave away for testers. Thus they are not quite like the final version, have different hardware on board here and there, so an experimental experience is expected.</p><p>ReSpeaker core samples to work with</p><p>The earlier prototype only has touch sensors on one side, the pixel ring lights up, but I couldn’t control it with <a href="https://github.com/respeaker/respeaker_arduino_library" rel="nofollow noopener" target="_blank">Seeed’s ReSpeaker Arduino library</a>. The later prototype has two sides of sensors (effectively two buttons), but the lights don’t seem to work2. Regardless this </p><p>Aside: alternatives considered</p><p>It was illuminating to see how much abandoned, obsolete, discontinued, or not quite useful hardware boards do I have.</p><p>One is RFDuino, that I got from <a href="https://www.kickstarter.com/projects/1608192864/rfduino-iphone-bluetooth-40-arduino-compatible-boa/" rel="nofollow noopener" target="_blank">Kickstarter</a>, I’m yet to use, and all the project’s websites have already disappeared – fortunately not the <a href="https://github.com/RFduino/RFduino" rel="nofollow noopener" target="_blank">code repo</a>. This would have been a more complex solution anyways, but wireless! Use one RFDuino to expose a USB Telephony device, and communicate wirelessly to another that operates the light and button on battery. Pretty cool. Also, it might not have worked if the chip used cannot do the cruicial “expose a USB [device]” part of the plan.</p><p>Other option that popped up was an <a href="https://store.arduino.cc/products/arduino-nano" rel="nofollow noopener" target="_blank">Arduino Nano</a> + my own made <a href="https://www.tindie.com/products/imrehg/grovehat-for-arduino-nano/" rel="nofollow noopener" target="_blank">GroveHat</a> + a <a href="https://wiki.seeedstudio.com/Grove-Button/" rel="nofollow noopener" target="_blank">Grove Button</a>. Except, the Nano definitely cannot be a custom USB device, so there goes nothing.</p><p>Besides these, I’ve found plenty of:</p><ul><li>single board computers (old or obsolete),</li><li>FPGAs (never used, and would be a whole different project to implement something on them), and </li><li>other microcontrollers that all have interesting specialties, but don’t tick the mandatory boxes…</li></ul><p>These boards might not be right for now, but definitely there are projects in store for them (if only thre’s time).</p><p>Back to ReSpeaker then…</p><p>Plugging in the USB</p><p>The next thing is to figure out what’s really happening when an USB device is plugged in and it shows the operating system that it can do certain things. That is, how does Meet know that there’s a compatible device to connect to?</p><p>The USB HID docs</p><p>This is answered by the <a href="https://www.usb.org/hid" rel="nofollow noopener" target="_blank">USB Human Interface Devices (HID)</a> specs — one that is pretty complicated, has a lot of legacy bits, and need a different kind of mindset. In a nutshell, though, with my current, partial understanding:</p><p>On connection the device sends a “report” to the OS that details on what can it do, including:</p><ul><li>what kind (or kinds!) of device it is?</li><li>what functionality of the kind is available in this particular implementation?</li><li>what’s the data layout to pass control information back-and-forth for this implementation?</li></ul><p>In our example, a very minimal setup would would be:</p><ul><li>I’m a Telephony Device (Usage page 0x0B)</li><li>I implement a generic “Phone” (Usage ID 0x01)</li><li>I have capability to do a “Phone Mute” (Usage ID 0x2F)</li><li>Here’s the 1 bit of a 1 byte payload that conveys that phone mute status</li></ul><p>Getting started with Telephony devices from the HID Usage Tables</p><p>This course does not take into account other functionality, e.g.</p><ul><li>I can also hang up – Hook Switch, Usage ID 0x20;</li><li>I have status LEDs – that’s a whole fun of redefining functions on the LED Page 0x08;</li></ul><p>and so on. But for the time being this should be enough.</p><p>Call Control functionality for Telefony devicesDevice implementation</p><p>Fortunately we can stand on the shoulders of giants, that is the <a href="https://github.com/NicoHood/HID" rel="nofollow noopener" target="_blank">Arduino HID Project</a> which implemented a bunch of different devices. And even though a “phone” like this is not among them, we can make some reasonable guesses how it would work.</p><p>Having said that, from a forum post that was also trying to do something similar (but based on the TinyUSB library):</p><blockquote><p>HID report descriptor is very difficult thing to come up by oneself. You should google around, or dump report descriptor from existing device to copy/follow it.</p><p><a href="https://github.com/hathach/tinyusb/discussions/667#discussioncomment-392454" rel="nofollow noopener" target="_blank">hathach @ TinyUSB discussion 667</a></p></blockquote><p>Okay, then do not come up with this stuff, instead let’s look for tools. The USB HID homepage links to the <a href="https://github.com/microsoft/hidtools" rel="nofollow noopener" target="_blank">Microsoft HID Tools</a> to generate HID reports from a TOML-like language. Except it needs C# and I just wasn’t ready to dive in a side-quest to install &amp; learn a new toolchain.</p><p>So being lazy this way, a bit more sleuthing turned up <a href="https://web.archive.org/web/20210614160735/https://blog.noser.com/first-steps-with-an-usb-hid-report/" rel="nofollow noopener" target="_blank">someone’s example HID report</a> for a device very close to what I’m trying to do, hurray!</p><p>I took this and started to poke around the HID project to see how other devices are implemented. Troubleshooting by using the ReSpeaker’s touch to adjust screen brightness up / down (as a “Consumer Device”) was also pretty neat! In the end I took the system buttons example and run with that one.</p><p>Having said that, the HID report is really just the interface. The devil is in how to implement actually creating the data packages that passes data according to the report definition. And this is the case when I wish I knew more C++ but copy-paste and some guesswork will have to do.</p><p>Our minimal viable mute button’s HID report (<a href="https://github.com/imrehg/HID/blob/1851b68b008111734287f6ce4f894173ad21bb3f/src/MultiReport/Phone.cpp#L26C1-L41C1" rel="nofollow noopener" target="_blank">source</a>)</p><p>The current result lives in the “<a href="https://github.com/imrehg/HID/tree/phone" rel="nofollow noopener" target="_blank">phone” branch of my HID Project fork</a>, check for the “Phone” bits in “src/HID-APIs” and “MultiReport” folders, if interested.</p><p>Minimal viable mute</p><p>The implementation from this point on was pretty straightforward – since we cut back the scope so much…</p><p>The code to run on the ReSpeaker then just has to do the following:</p><ul><li>when touching one side, send a report with “Phone Mute” on</li><li>when touching the other, send a report with “Phone Mute” off</li></ul><p>And this is sort of simple3 :</p><p>Sending data on touch events in the simplest way</p><p>For the full use case there would be a lot more complexity for both reading and writing data from the host, controlling multiple peripherals (LEDs and buttons) and the whole logic around it. But for now, it’s good enough for a demo:</p> <p>A very quick demo</p><p>The code repository is available on Github at <a href="https://github.com/imrehg/arduino-usb-phone-hid" rel="nofollow noopener" target="_blank">imrehg/arduino-usb-phone-hid</a>.</p><p>Notes and Future workThe specs</p><p>It’s great that stuff from 20+ years ago still works mostly the same way. The <a href="https://www.usb.org/sites/default/files/hut1_4.pdf" rel="nofollow noopener" target="_blank">latest 1.4 version</a> of the HID Tables is nicely formatted, has a lot more device typed defined, but has much less support text. Originally I’ve read the <a href="https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf" rel="nofollow noopener" target="_blank">1.12v2 version</a> as that showed up in my search. Back then in 2004 they had an “examples” section (see the Telephone at Appendix 10!) which is useful to grok more of the fundamentals. </p><p>The newer version also has some devices types that looked suitable, but weren’t really: Generic Desktop Page (0x01) and 0xE0-E2 Usage IDs for Call Active LED, Call Mute Toggle, and Call Mute LED respectively. These didn’t seem to work with Meet, so it might be interesting to try implementing a device that does both and try other online call software.</p><p>I should also have read the spec more before diving into hacking on the HID implementation fork, as there’s a lot more information in the <a href="https://www.usb.org/document-library/device-class-definition-hid-111" rel="nofollow noopener" target="_blank">HID Device Class Definition</a>, including how to construct the values for many of the fields (I’m looking at you “INPUT (Cnst,Var,Abs)“). RTFM is and remains a solid advice – and not just when one thinks there’s time.</p><p>Also regarding the specs: some of them I only find in the Internet Archive’s <a href="https://web.archive.org/" rel="nofollow noopener" target="_blank">Wayback Machine</a>. If you encounter a good source that should be kept, always add it to the Wayback Machine and preserve it for your future selves and others!</p><p>This exploration of USB HID pulled on so many threads, and left so much unfinished, that it’s a fertile ground for the future, even more than most previous projects.</p><p>More call functionality</p><p>The most obvious thing is to implement the whole setup with the buttons. I’ve tried Hook Switch to hang up a call, that works too. Could add status lights, maybe throw in some “Active Call” LEDs, or so on. This requires better understanding how data is sent over the wire for USB and how to handle incoming data. The Arduino examples rarely seem to use the “Output” fields (ie. incoming data, output from the host’s point of view, but maybe <a href="https://github.com/hathach/tinyusb" rel="nofollow noopener" target="_blank">TinyUSB</a> does ?</p><p>For this, it would be nice to find a different hardware platform that would make this more seamless (so I can concentrate on the software side more). If that platform would lend itself to be reproduced or made stand alone, that would be even nicer: imaging brining my little call control box that can be used with other computers easily as well…</p><p>Implement more USB HID devices</p><p>The <a href="https://github.com/NicoHood/HID" rel="nofollow noopener" target="_blank">Arduino HID project</a> has a bunch of devices implemented, but there are an infinite numbers that could be added. Unfortunately for Arduino it is harder to add more device types as an add-on to this library versus the current “forked” approach4, so new decices should be in the main project, eventually.</p><p>So far there’s no Telephony device implemented there and it would be nice to find the right level of abstraction that works. The library doesn’t implement specific HID table pages, but specific usages or a subset of a usage. Thus like always, the hardest part would likely be setting the right interface (the right specs and “API”) for a new device to implement both the HID reports and the functions that manipulate what’s being sent and when.</p><p>On the other hand, that does sound like a fun experiment, and I’d look forward to adding 3D Game Controllers (Game Controls Page 0x05), Environmental Sensors (Sensors Page 0x20, Usage ID 0x30-3B), … or even a Submarine Simulation Device (Simulation Device page 0x02, usage id 0x05). These are stuff I go to Hackerspaces for…</p><p>WebHID for internet plus USB</p><p>While debugging this HID device behaviour, I found also <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebHID_API" rel="nofollow noopener" target="_blank">WebHID</a> that brings such devices to the web. This feature seems to be behind Meet’s and other phone systems like <a href="https://www.3cx.com/blog/docs/webhid-headset-integration/" rel="nofollow noopener" target="_blank">3CX</a> expanding USB support outside of the OS and into the browser. And no, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1835412" rel="nofollow noopener" target="_blank">Firefox does not support it</a>, furthermore <a href="https://mozilla.github.io/standards-positions/#webhid" rel="nofollow noopener" target="_blank">declined supporting it</a>.</p><p>Nonetheless it’s very cool that (if I upskill a bit), I can create a web page that would help me debug such HID development:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/HID/requestDevice" rel="nofollow noopener" target="_blank">request devices</a> that are filtered in various ways (vendor, product is standard, but usage page and explicit usage is the main key). This is likely what Meet does as well, “just gimme devices with Telephony usage page (or Phone usage? Need to check exactly) </li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/collections" rel="nofollow noopener" target="_blank">read the HID report collections</a> sent by the device, so the results can be debugged, and</li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/HIDInputReportEvent" rel="nofollow noopener" target="_blank">read device input events</a> that we can then either log for debugging or in an application react to to it</li></ul><p>This opens a lot more mashup opportunities by the dozen.</p><p>Finally</p><p>Unlike most other projects I had where I’m focused on one specific outcome, this turned out to be more focusing on getting a new toolkit (custom USB devices) up and running, so I can think about a wider <em>types</em> of projects to do. In that sense, this feels a big success, even if I know how little I know about programming outside of my day-to-day environment. But ignorance is not a bliss.</p><p>And now, going on mute.</p><ol><li>Many moons past I used to use a Jabra Evolve 80, that has <a href="https://www.manualslib.com/manual/1021017/Jabra-Evolve-80.html?page=16#manual" rel="nofollow noopener" target="_blank">a USB accessory</a> controlling call features, so I did have first hand example of what sort of experience I’d like. ↩︎</li><li>I’ve tried reviewing the <a href="https://github.com/respeaker/get_started_with_respeaker/blob/master/files/RespeakerCorev1.0_Schematic.pdf" rel="nofollow noopener" target="_blank">hardware schematics</a>, looking into the <a href="https://github.com/respeaker/respeaker_arduino_library/blob/4e04f8c72fa53beeb27dacd8d729a90f79202db7/pixels.cpp" rel="nofollow noopener" target="_blank">pixel ring control functions</a>, and given that the LEDs seems standard I’ve also attempted to use the <a href="http://fastled.io/" rel="nofollow noopener" target="_blank">FastLED library</a> to drive them instead, so far nothing. I still bet on hardware differences from final schematic + my inability to debug it, but it can be faulty hardware just as well. Needs more effort – in the future. ↩︎</li><li>The Arduino code became more “simple” once I realised that things set up this way do not need debouncing for the touch sensors. In other cases that would be essential, there’s sooo much flaky signal to use those terminals as momentary switches or similar. ↩︎</li><li>At least I don’t know how nicely extend a library for C++, if that’s even possible. Keen to learn, though. ↩︎</li></ol><p><a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/tag/arduino/" target="_blank">#arduino</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/tag/c/" target="_blank">#c</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/tag/seeed-studio/" target="_blank">#seeed-studio</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/tag/usb/" target="_blank">#usb</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/tag/usb-hid/" target="_blank">#usb-hid</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/category/maker/" target="_blank">#maker</a> <a rel="nofollow noopener" class="u-tag u-category" href="https://gergely.imreh.net/blog/category/comp/prog/" target="_blank">#prog</a></p><p>Original post: <a href="https://gergely.imreh.net/blog/2023/08/making-a-usb-mute-button-for-online-meetings/" rel="nofollow noopener" target="_blank">https://gergely.imreh.net/blog/2023/08/making-a-usb-mute-button-for-online-meetings/</a></p>
Joe Gaffey<p>I made an Arduino adapter to connect an RC transmitter to a USB HID host like a PC so I can use it for portable/couch friendly sim racing. <br /><a href="https://youtu.be/lPexd2mvKew" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="">youtu.be/lPexd2mvKew</span><span class="invisible"></span></a><br />Works pretty well despite the terrible one handed driving in the video.<br /><a href="https://mastodon.social/tags/arduino" class="mention hashtag" rel="tag">#<span>arduino</span></a> <a href="https://mastodon.social/tags/usbhid" class="mention hashtag" rel="tag">#<span>usbhid</span></a> <a href="https://mastodon.social/tags/simracing" class="mention hashtag" rel="tag">#<span>simracing</span></a> <a href="https://mastodon.social/tags/rctransmitter" class="mention hashtag" rel="tag">#<span>rctransmitter</span></a></p>
JdeBP<p><span class="h-card"><a href="https://3v.is/users/qaz" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>qaz</span></a></span> <span class="h-card"><a href="https://mastodonapp.uk/@bytebro" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>bytebro</span></a></span> </p><p>Ideally, I'd get an ABNT2 "teclado multimidia" so that I could test most functions with one keyboard. But no-one is selling from Brazil to the U.K..</p><p>And I'd still need a Japanese and Korean keyboard in parallel as well. I actually have some HP ABNT2, Japanese, and Korean keyboards, but it's a lot of desk space to have them all connected up; and they don't have all of the "multimidia" keys, so that's a _fourth_ keyboard to get them ... (-:</p><p><span class="h-card"><a href="https://mastodonapp.uk/@chloeraccoon" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>chloeraccoon</span></a></span> <a href="https://mastodonapp.uk/tags/keyboards" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>keyboards</span></a> <a href="https://mastodonapp.uk/tags/USBHID" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>USBHID</span></a></p>
JdeBP<p><span class="h-card"><a href="https://3v.is/users/qaz" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>qaz</span></a></span> </p><p>The problem with the programmable add-on keypads is that they're programmable, and don't send the standard USB HID usage codes down the wire. For my purposes, I want something that sends the vanilla USB HID usages for the consumer/system keys; which no-one seems to do as a mass-market item.</p><p>Ideally, it would have the various language keys from the Japanese and Korean keyboards, too. But I suspect that I am a one-person market here. (-:</p><p><span class="h-card"><a href="https://mastodonapp.uk/@bytebro" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>bytebro</span></a></span> <span class="h-card"><a href="https://mastodonapp.uk/@chloeraccoon" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>chloeraccoon</span></a></span> <a href="https://mastodonapp.uk/tags/keyboards" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>keyboards</span></a> <a href="https://mastodonapp.uk/tags/USBHID" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>USBHID</span></a></p>