RadioHead Packet Radio library for embedded microprocessors
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
RHutil Added digitalRead and printbuffer Aug 17, 2016
STM32ArduinoCompat Original update to version V1.61 Jul 22, 2016
examples Merge branch 'master' into master Jan 20, 2017
tools Original update to version V1.61 Jul 22, 2016
.gitattributes 🎊 Added .gitattributes Jul 21, 2016
.gitignore Creation Aug 20, 2016
LICENSE Copy from original lib Version V1.46 Jul 21, 2016
MANIFEST Original update to version V1.61 Jul 22, 2016
README.md Version V1.67 Jan 20, 2017
RHCRC.cpp Copy from original lib Version V1.46 Jul 21, 2016
RHCRC.h Copy from original lib Version V1.46 Jul 21, 2016
RHDatagram.cpp Copy from original lib Version V1.46 Jul 21, 2016
RHDatagram.h Copy from original lib Version V1.46 Jul 21, 2016
RHGenericDriver.cpp Bump to V1.67 Jan 19, 2017
RHGenericDriver.h Correct dual declaration create by merge Jan 20, 2017
RHGenericSPI.cpp Copy from original lib Version V1.46 Jul 21, 2016
RHGenericSPI.h Copy from original lib Version V1.46 Jul 21, 2016
RHHardwareSPI.cpp Sync with v1.62 original version changes Aug 20, 2016
RHHardwareSPI.h Bump to V1.67 Jan 19, 2017
RHMesh.cpp Original update to version V1.61 Jul 22, 2016
RHMesh.h Original update to version V1.61 Jul 22, 2016
RHNRFSPIDriver.cpp Original update to version V1.61 Jul 22, 2016
RHNRFSPIDriver.h Original update to version V1.61 Jul 22, 2016
RHReliableDatagram.cpp Bump to V1.67 Jan 19, 2017
RHReliableDatagram.h Original update to version V1.61 Jul 22, 2016
RHRouter.cpp Original update to version V1.61 Jul 22, 2016
RHRouter.h Copy from original lib Version V1.46 Jul 21, 2016
RHSPIDriver.cpp Added CE0 CE1 return to ALT0 pin function pb Aug 17, 2016
RHSPIDriver.h Added CE0 CE1 return to ALT0 pin function pb Aug 17, 2016
RHSoftwareSPI.cpp Original update to version V1.61 Jul 22, 2016
RHSoftwareSPI.h Copy from original lib Version V1.46 Jul 21, 2016
RHTcpProtocol.h Copy from original lib Version V1.46 Jul 21, 2016
RH_ASK.cpp Bump to V1.67 Jan 19, 2017
RH_ASK.h Sync with v1.62 original version changes Aug 20, 2016
RH_CC110.cpp Bump to V1.67 Jan 19, 2017
RH_CC110.h Original update to version V1.61 Jul 22, 2016
RH_MRF89.cpp Bump to V1.67 Jan 19, 2017
RH_MRF89.h Original update to version V1.61 Jul 22, 2016
RH_NRF24.cpp Bump to V1.67 Jan 19, 2017
RH_NRF24.h Sync with v1.62 original version changes Aug 20, 2016
RH_NRF51.cpp Bump to V1.67 Jan 19, 2017
RH_NRF51.h Bump to V1.67 Jan 19, 2017
RH_NRF905.cpp Bump to V1.67 Jan 19, 2017
RH_NRF905.h Bump to V1.67 Jan 19, 2017
RH_RF22.cpp Bump to V1.67 Jan 19, 2017
RH_RF22.h Bump to V1.67 Jan 19, 2017
RH_RF24.cpp Bump to V1.67 Jan 19, 2017
RH_RF24.h Bump to V1.67 Jan 19, 2017
RH_RF69.cpp Merge branch 'master' into master Jan 20, 2017
RH_RF69.h Merge branch 'master' into master Jan 20, 2017
RH_RF95.cpp Merge branch 'master' into master Jan 20, 2017
RH_RF95.h Merge branch 'master' into master Jan 20, 2017
RH_Serial.cpp Bump to V1.67 Jan 19, 2017
RH_Serial.h Original update to version V1.61 Jul 22, 2016
RH_TCP.cpp Bump to V1.67 Jan 19, 2017
RH_TCP.h Original update to version V1.61 Jul 22, 2016
RadioHead.h Bump to V1.67 Jan 19, 2017
project.cfg Bump to V1.67 Jan 19, 2017
radio_config_Si4460.h Copy from original lib Version V1.46 Jul 21, 2016

README.md

RadioHead Packet Radio library for embedded microprocessors

###Version 1.67

This is a fork of the original RadioHead Packet Radio library for embedded microprocessors. It provides a complete object-oriented library for sending and receiving packetized messages via a variety of common data radios and other transports on a range of embedded microprocessors.

Please read the full documentation and licensing from the original author site

features added with this fork

=================================

Compatible with boards

LoRasPI, Raspberry PI Lora Gateway, Dragino Lora GPS HAT

LoRasPI  Raspberry PI Lora Gateway/Node  Raspberry PI Lora Gateway/Node

  • Added moteino modem setting on RF69 to be compatible with lowpowerlab RF69 configuration library
  • Added possibility to work with no IRQ connected for RF69 and RF95
    • for example to get one more GPIO free
    • on Raspberry Pi, we do not have attachInterrupt() like with bcm2835 library
  • Added samples for multiples Raspberry Pi boards with RF69 and RF95 modules such as
  • Added 2 samples test tools (for Raspberry PI) do detect RF69 and RF95 modules and check IRQ rising edge
    • spi_scan sample code, scan and try to detect connected modules
    • irq_test sample code, check a rising edge on a GPIO

Sample code for Raspberry PI is located under RadioHead/examples/raspi folder.

Installation on Raspberry PI

================================

Clone repository

git clone https://github.com/hallard/RadioHead

Connection and pins definition

Boards pins (Chip Select, IRQ line, Reset and LED) definition are set in the new RadioHead/examples/raspi/RasPiBoards.h file. In your code, you need to define board used and then, include the file definition like this

// LoRasPi board 
#define BOARD_LORASPI

// Now we include RasPi_Boards.h so this will expose defined 
// constants with CS/IRQ/RESET/on board LED pins definition
#include "../RasPiBoards.h"

// Your code start here
#ifdef RF_RST_PIN
// Blah blah do reset line
#endif

Then in your code you'll have exposed RF_CS_PIN, RF_IRQ_PIN, RF_RST_PIN and RF_LED_PIN and you'll be able to do some #ifdef RF_LED_LIN for example. See rf95_client sample code.

So you have 3 options to define the pins you want

  • The board you have is already defined so just need to define it your source code (as explained above)
  • You can add your board into RasPiBoards.h and then define it your source code as above
  • You can manually define pins in your code and remove the board definition and #include "../RasPiBoards.h"

To go further with examples :

go to example folder here spi_scan

cd RadioHead/examples/raspi/spi_scan

Build executable

root@pi03(rw):~/RadioHead/examples/raspi/spi_scan# make
g++ -DRASPBERRY_PI -DBCM2835_NO_DELAY_COMPATIBILITY -c -I../../.. spi_scan.c
g++ spi_scan.o -lbcm2835  -o spi_scan
root@pi03(rw):~/RadioHead/examples/raspi/spi_scan

And run

root@pi03(rw):~/RadioHead/examples/raspi/spi_scan# ./spi_scan
Checking register(0x42) with CS=GPIO06 => Nothing!
Checking register(0x10) with CS=GPIO06 => Nothing!
Checking register(0x42) with CS=GPIO08 => SX1276 RF95/96 (V=0x12)
Checking register(0x10) with CS=GPIO08 => Nothing!
Checking register(0x42) with CS=GPIO07 => Nothing!
Checking register(0x10) with CS=GPIO07 => Nothing!
Checking register(0x42) with CS=GPIO26 => Nothing!
Checking register(0x10) with CS=GPIO26 => Nothing!

And voila! with LoRasPi board RFM95 dedected on SPI with GPIO8 (CE0)

If I'm doing same test with PI Lora Gateway with 2 RFM95 (one 433MHz and one 868MHz) and one RFMHW69 433MHz on board like this

Raspberry PI Lora Gateway/Node

Here are the results when trying to detect the onboard modules:

root@pi01(rw):~/RadioHead/examples/raspi/spi_scan# ./spi_scan
Checking register(0x42) with CS=GPIO06 => Nothing!
Checking register(0x10) with CS=GPIO06 => Nothing!
Checking register(0x42) with CS=GPIO08 => SX1276 RF95/96 (V=0x12)
Checking register(0x10) with CS=GPIO08 => Nothing!
Checking register(0x42) with CS=GPIO07 => SX1276 RF95/96 (V=0x12)
Checking register(0x10) with CS=GPIO07 => Nothing!
Checking register(0x42) with CS=GPIO26 => Unknown (V=0x01)
Checking register(0x10) with CS=GPIO26 => SX1231 RFM69 (V=0x24)

Voila! 3 modules are seen, now let's try listenning packets with PI Lora Gateway.

My setup has another Raspberry Pi with RFM95 868MHZ LoRasPI shield running rf95_client sample and some ULPnode prototypes always running with on board RFM69 configured as Group ID 69 on 433MHz. I don't have a Lora 433MHz sender running so we won't receive anything on this one.

Here the results starting from scratch

Client side

RF95 client

multi server side

RF95 client

It works!

Difference with original Author repo

========================================

Due to easier maintenance to keep in sync with original author lib, I've got 2 repo:

Like this, I can do Pull Request from ch2i to hallard to add new features added by the author to my version. This mean that this one is just a github copy version of the latest original done by Mike, I don't do any change on this one. I know it's not the best way, but I didn't found a better solution for now, if you have better idea, just let me know.