diff --git a/README.md b/README.md index 1d1e845..df59cae 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # DigiLivolo -Firmware & software to control Livolo RF 433 Mhz light switches +Firmware (for Digispark Arduino compatible module) & software to control Livolo RF 433 Mhz light switches. + +# Usage +Compile & upload firmware to Digispark. Connect DATA pin of 433 Mhz transmitter module (SYN115 based modules +were used & confirmed to work by me) to P5 of Digispark module (this pin can be changed in main sketch code). +Also connect VCC & GND of the module. + +Once plugged to USB, the device should be recognized as USB HID device, not requiring any driver as every +modern OS have this standard USB class driver built-in. + +To send codes to Livolo switches you can use [hidapitester](https://github.com/todbot/hidapitester) for now. +Work on the dedicated PC control software are in progress. + +USB protocol are simple 8 bytes. First are HID REPORT ID, which are hardcoded to 76 (0x4C). 2nd are CMD ID, +which is only 0x01 (send code) for now. Next 2 bytes are Livolo Remote ID, little-endian (means you have to +reverse byte order from "normal" representation). 5th byte are Livolo Key ID. Remaining 3 bytes are reserved +and not used. They can be left as zeroes. + +Example usage: + +```hidapitester.exe --vidpid 16c0:05df -l 8 --open --send-feature 76,1,77,33,16``` \ No newline at end of file diff --git a/firmware/lib/DLUSB/DLUSB.cpp b/firmware/lib/DLUSB/DLUSB.cpp index 762c2cb..28f7b74 100644 --- a/firmware/lib/DLUSB/DLUSB.cpp +++ b/firmware/lib/DLUSB/DLUSB.cpp @@ -48,8 +48,7 @@ inline bool store_packet(dlusb_packet_t* packet, ring_buffer* the_buffer) return false; } -DLUSBDevice::DLUSBDevice(ring_buffer* rx_buffer, - ring_buffer* tx_buffer) { +DLUSBDevice::DLUSBDevice(ring_buffer* rx_buffer, ring_buffer* tx_buffer) { _rx_buffer = rx_buffer; _tx_buffer = tx_buffer; }