argilo / secplus

A software implementation of the Security+ system used by garage door openers
GNU General Public License v3.0
247 stars 32 forks source link

Any thoughts of porting to Arduino and testing with FS1000A? #15

Closed ksaye closed 1 year ago

ksaye commented 1 year ago

Based on the price of the HackRF and transmitters, I was considering if the code could be ported to Arduino and use a FS1000A (https://www.amazon.com/HiLetgo-Transmitter-Receiver-Arduino-Raspberry/dp/B00LNADJS6/)?

I have been looking at https://github.com/merbanan/rtl_433/blob/master/src/devices/secplus_v1.c and was wondering if you had some C sample code for transmitting.

argilo commented 1 year ago

The code is currently Python-only, but could certainly be translated to C for use in microcontrollers. I'll update this issue if I end up doing that.

ksaye commented 1 year ago

Thanks for the consideration.

argilo commented 1 year ago

I've added a C library (secplus.c and secplus.h). For now it only implements Security+ 2.0 encoding and decoding. I expect it would be possible to use it in an Arduino sketch together with a transmitter or receiver board.

argilo commented 1 year ago

I added a library.properties file and moved the C code into /src, so it should now be possible to use it directly as an Arduino library.

I also tested the encode & decode functions, and after one bug fix (861c74b25d1005176f795ddd07946ef0123635a6) they're working correctly on the Arduino.

argilo commented 1 year ago

The original Security+ is now supported in C as well. I've also added automated testing to verify that the C code works correctly on the AVR architecture.

dabeckham commented 1 year ago

You are awesome! Thanks!

argilo commented 1 year ago

I'll close this off, since Arduino-compatible C code is now included in secplus.