开源软件名称(OpenSource Name):gkaindl/rfm12b-linux开源软件地址(OpenSource Url):https://github.com/gkaindl/rfm12b-linux开源编程语言(OpenSource Language):C 83.0%开源软件介绍(OpenSource Introduction):rfm12b-linuxA Linux kernel driver for the RFM12B and RFM69CW digital RF modules manufactured by HopeRF. It targets embedded Linux boards that provide a SPI interface. Currently, Raspberry Pi, Raspberry Pi 2, Beaglebone and Beaglebone Black are supported, but it should be easy to support additional boards by adding the necessary setup code (e.g. setting up pinmuxing, etc…). The driver can be used to communicate with JeeLib on the Arduino platform. Its interaction with the RFM12B and RFM69 boards is based heavily on the fantastic work in JeeLib! A demo video is available on YouTube. Overall FunctionalityThe driver does enables you to connect an RFM12B or RFM69CW module directly to a Linux board without requiring additional parts like an external MCU. The radio module type (RFM12 or RFM69) will be detected automatically when the kernel module is initialized. The radio module will be exported as a character device in /dev/, from which packets can be read or to which packets can be written. Multiple bytes written in a single call to write() will be sent as a single packet, while a call to read() will return all the bytes of a packet in the receive buffer. The module provides various settings that can be specified at compile-time, via module-load parameters or via ioctl(). Differences between RFM12 and RFM69While the driver treats both boards equivalently and also affords for data transfer between the two, it strives to be compatible with the protocol devised in Jeelib, rather than export too many module-specific features. Currently, reporting of RSSI levels is supported on RFM69, whereas on RFM12, you can read out the low-battery voltage indicator. If you are interested in accessing advanced features of either board, it should be easy to adapt the kernel driver. Hardware-wise, the RFM69 is more modern, supports faster SPI communication, has better receiver sensitivity and transmitter power, as well as a 66-byte FIFO buffer, rather than the RFM12B's single-byte buffer. Thus, the RFM69 is much more reliable. Both boards are pin-compatible, so they are perfectly interchangeable and identical to hook up. Hardware SetupYou will only need some wires to connect the RFM12B/RFM69CW module to your Linux board. The RFM12B data sheet with a visual description of the pinout is available at http://www.hoperf.com/upload/rf/RFM12B.pdf. Similarly, the datasheet for the RFM69CW is available at http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf. For the pinouts of the Linux boards, either check the silkscreen or their respective technical manuals. Be sure to double-check that your connections are correct, since wrong connections might harm your board or RFM12B/RFM69CW module. Also, be sure to add an antenna to your RFM12B/RFM69CW board (ANT pin), or the range and reliability will be severely hampered. Raspberry Pi & Raspberry Pi 2
Beaglebone & Beaglebone Black
InstallationGenerally, you only need to clone the repository and run I've included more detailed steps below for the actual Linux distributions I am using on my boards. I compile the module directly on the board. Raspberry Pi (2) — Raspbian
Beaglebone (Black) — Ubuntu 13.04, 3.8+ kernel
DocumentationThe relevant bits of the driver and user-space interface are all documented at the top of the source files, so I'd recommend to look in there. If you intend to configure your board settings on-the-fly in your user-space programs, you should especially check out the documentation in There are also a couple of example programs in the Finally, there are some Arduino examples meant to be run on a JeeNode, which can work together with the Linux examples. JeeLib CompatibilityThe driver uses a packet format that is compatible with JeeLib, e.g. a header byte and a length byte at the beginning of each packet and a trailing CRC16. During normal operation, the driver will not populate the header byte (it remains at zero), nor will the header be inspected when a packet is received. Also, only the packet payload, but not the two extra bytes or the CRC16 will be exposed to user-space via read(). Thus, the format is entirely compatible with the JeeLib format, but does not interpret its protocol. There is also a Jee-compatible mode that can be enabled by specifying a non-zero Jee identifier in the driver. This can be done as a compile-time option in Details about Jee-compatible mode are available in Basically, Jee-compatible mode introduces the following differences from normal operation:
Tested EnvironmentsI've tested the driver on the following setups, usually running it for a couple of days ping-ponging with the rfm12b_echo.c example and a JeeNode running the rfm12b_echo_client sketch.
Future WorkThere are some areas of future work that would make sense.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论