ook-gpio - A simple GPIO-based OOK modulation driver
This driver allows to send OOK (ON/OFF Keying) modulated signals to a GPIO. It's main purpose is to generate 433MHz OOK modulated frames by connecting a 1$ 433MHz transmitter to the GPIO, but it should work with any kind of transmitter.
In order to build this driver as an OpenWrt package and/or add it to an OpenWrt firmware build:
- checkout an OpenWrt build tree (only tested on Barrier Breaker 14.07 so far)
- move this folder to openwrt/package/kernel/ook-gpio
Now, if you run
$ make menuconfig from the openwrt root folder, you should see an ook-gpio entry in the Kernel modules/Other modules sub-menu.
Just select it as built-in or package, and launch a build.
Once registered, this driver adds two sysfs entries:
The first one is used to configure the OOK timings, while the second one will be used to send the actual frame. The timings sysfs expected format is Tbase or THstart, TLstart, THend, TLend, THbit0, TLbit0, THbit1, TLbit1, fmt, count with:
- Tbase : the duration of a state (Low for 0, High for 1) in Raw mode (fmt = 2)
- TH/TLstart : High and Low duration of the starting marker
- TH/TLend : High and Low duration of the ending marker
- TH/TLbit0 : High and Low duration of the logical bit 0
- TH/TLbit1 : High and Low duration of the logical bit 1
- fmt : the bit format (order of the High/Low transition) which is 0 for High/Low, 1 for Low/High, and 2 for Raw (no transition)
- count : the number of times the frame must be sent
The frame expected format is the number of bits in the frame followed by a ",", then the bytes of the frame, also separated by ",".
This driver is distributed under the GPLv2 license. See the LICENSE file for more information.
Fell free to visit my blog, and/or send me a mail !
Copyright (C) 2016 Jean-Christophe Rona