All Projects → majbthrd → Hidsensor

majbthrd / Hidsensor

USB HID Sensor implementation for PIC16F1454 and STM32F072

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Hidsensor

Glim
GRUB Live ISO Multiboot
Stars: ✭ 452 (+2278.95%)
Mutual labels:  usb
Digispark Scripts
USB Rubber Ducky type scripts written for the DigiSpark.
Stars: ✭ 629 (+3210.53%)
Mutual labels:  usb
Vigembus
Windows kernel-mode driver emulating well-known USB game controllers.
Stars: ✭ 721 (+3694.74%)
Mutual labels:  usb
Hidviz
A tool for in-depth analysis of USB HID devices communication
Stars: ✭ 505 (+2557.89%)
Mutual labels:  usb
Usb Canary
A Linux or OSX tool that uses psutil to monitor devices while your computer is locked. In the case it detects someone plugging in or unplugging devices it can be configured to send you an SMS or alert you via Slack or Pushover.
Stars: ✭ 561 (+2852.63%)
Mutual labels:  usb
Bootiso
A bash program to securely create a bootable USB device from one image file.
Stars: ✭ 645 (+3294.74%)
Mutual labels:  usb
Gimx
The GIMX software.
Stars: ✭ 421 (+2115.79%)
Mutual labels:  usb
Circle
A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)
Stars: ✭ 816 (+4194.74%)
Mutual labels:  usb
Androbd
Android OBD diagnostics with any ELM327 adapter
Stars: ✭ 573 (+2915.79%)
Mutual labels:  usb
Ns Usbloader
Awoo Installer/TinFoil/GoldLeaf NSPs (and other files) uploader and RCM tool. Also a tool for split files and merge them back.
Stars: ✭ 708 (+3626.32%)
Mutual labels:  usb
Hoodloader2
16u2 Bootloader to reprogram 16u2 + 328/2560 with Arduino IDE
Stars: ✭ 509 (+2578.95%)
Mutual labels:  usb
Helenos
A portable microkernel-based multiserver operating system written from scratch.
Stars: ✭ 553 (+2810.53%)
Mutual labels:  usb
Usbguard
USBGuard is a software framework for implementing USB device authorization policies (what kind of USB devices are authorized) as well as method of use policies (how a USB device may interact with the system)
Stars: ✭ 668 (+3415.79%)
Mutual labels:  usb
Hidapi
A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.
Stars: ✭ 465 (+2347.37%)
Mutual labels:  usb
Node Escpos
🖨️ ESC/POS Printer driver for node
Stars: ✭ 752 (+3857.89%)
Mutual labels:  usb
Flingos
An educational operating system written in C#. A great stepping stone from high to low level development.
Stars: ✭ 451 (+2273.68%)
Mutual labels:  usb
Libgphoto2
The libgphoto2 camera access and control library.
Stars: ✭ 637 (+3252.63%)
Mutual labels:  usb
Blink1
Official software for blink(1) USB RGB LED by ThingM
Stars: ✭ 888 (+4573.68%)
Mutual labels:  usb
Libaums
Open source library to access USB Mass Storage devices on Android without rooting your device
Stars: ✭ 769 (+3947.37%)
Mutual labels:  usb
Brutal
Payload for teensy like a rubber ducky but the syntax is different. this Human interfaes device ( HID attacks ). Penetration With Teensy . Brutal is a toolkit to quickly create various payload,powershell attack , virus attack and launch listener for a Human Interface Device ( Payload Teensy )
Stars: ✭ 678 (+3468.42%)
Mutual labels:  usb

USB HID Sensor implementation for PIC16F1454 and STM32F072

This project contains open-source firmware for an example USB HID Sensor implementation. Functionally equivalent source code is provided for two inexpensive USB microcontrollers:

Microchip PIC16F1454 / PIC16F1455 / PIC16F1459

ST Micro STM32F042 / STM32F072

What It Is

If you have arrived at this from a search engine, like me you probably encountered countless inapplicable search results of people doing Sensors that use the USB HID Protocol, rather than the desired search result of an implementation of the USB HID Sensor protocol HUTRR39b.

This project provides example code to demonstrate an implementation of the HID Sensor protocol; you must modify the code yourself to add your particular sensor's functionality.

Introduction to HID Sensor

Ostensibly, the appeal of the HID Sensor protocol is it that provides a driver-less mechanism to connect sensors to a PC. There is a very rich descriptive metadata defined in the HID Sensor protocol that tells PC software what type of sensor it is, what values it outputs, what units these values are in, and how often it sends updates.

This is also the Achilles Heel of the HID Sensor protocol; this descriptive metadata is so flexible that the OS driver writers may not have anticipated or tested the configuration of your particular sensor.

To my knowledge, the HID Sensor protocol is presently only supported in Windows 8 and Windows 10. (There are some bleeding edge Linux drivers under development.)

To make things more convoluted for the would-be developer, there are subtle differences in behavior between Windows 8 and Windows 10 with maddeningly cryptic or misleading error messages. For example, someone in Redmond crafted the misleading Windows 10 error message "Failed to get HID identification string from device". Only by trial and error did I discover this error happens when the HID Sensor device does not provide USB manufacturer and serial number strings. These strings are not mandated by the HID Sensor protocol nor by the USB specification documents. Furthermore, they have absolutely nothing to do with "HID", despite the "HID identification string" error message. Windows 8, in contrast to Windows 10, does not give this error message.

Similarly frustrating is that some of the example HID report descriptors in the HID Sensor protocol document will not work in Windows 8. It just gives up with a Feature Report error; one would have hoped that, at a minimum, these examples at least would have been tested. Thankfully, Windows 10 seems more adept at decoding these.

So, you must expect trial and error testing to see what will work. An implementation may be 100% compliant to the HID Sensor protocol but yet not work in Windows.

A further frustration for the would-be developer is that Microsoft has seemingly abandoned its Sensor Diagnostic Tool, the slightly clunky but indispensable software provided by the Windows WDK and needed by HID Sensor developers to check the incoming sensor data. Windows 10 seems to have broken this software, and Microsoft is either unwilling or unable to fix it. Instead, their website indicates that the tool is now deprecated and to use the SensorInfo app. Alas, this new software is positively useless.

Customizing

Like the USB HID specification on which the HID Sensors are based, the HID Report Descriptor for HID Sensors describes what the Input, Output, and Feature Reports will be. Of primary interest are Input and Feature Reports.

The Feature Report is retrieved from the USB device (via EP0) and provides much of the descriptive metadata (such as ranges, units, etc).

The Input Report is sent from the USB device and each message provides the current sensor data.

Read the HID Sensor protocol standard thoroughly to learn the specifics. The HID Report Descriptors in this firmware follow the conventions established in the standards document.

The firmware for each of the USB microcontrollers has its own README.md file to describe the structure and operation of the firmware.

Customize the HID Report Descriptor to suit your sensor, and then craft the Feature and Input Reports to exactly match, byte-for-byte, what has been described in the HID Report Descriptor.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].