• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    C++
  • License
    Other
  • Created over 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RadioHead Packet Radio library for embedded microprocessors

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

To avoid system hangs/instability starting with kernel 4.14, disable all GPIO kernel interrupts by adding this line to your /boot/config.txt:

dtoverlay=gpio-no-irq

This works around an issue with the design of the bcm2835 library and how it handles rising/falling edge detection events, but has some downsides as well. For more information, see this issue and this discussion.

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.

More Repositories

1

WeMos-Lora

ESP8266 WeMos Shield for HopeRF RFM95 RFM96 RFM98 Lora module
217
star
2

Mini-LoRa

Arduino Mini Lora Battery/Sensors Board
172
star
3

LoRasPI

Raspberry PI Lora Gateway/Node for HopeRF RFM95 RFM96 RFM98 Modules
124
star
4

WebSocketToSerial

TCP Network to Serial Proxy using WebSocket for ESP8266
HTML
118
star
5

NodeMCU-Gateway

NodeMCU ESP8266 RF Gateway and Display Board
113
star
6

ArduiPi_OLED

Common used OLED driver for Raspberry PI
C++
112
star
7

RAK831-Zero

Pi Zero RAK831 Adapter board
99
star
8

LibTeleinfo

Librairie Universelle Teleinformation (TIC)
C++
89
star
9

Battery-Voltage-Measure

Battery Voltage monitor with no current drain breakout board
68
star
10

RPI-Lora-Gateway

Raspberry PI Lora Gateway/Node for RFM92/95/96/98/69HCW Modules
Eagle
58
star
11

WeMos-TIC

WeMos ESP8266/ESP32 Teleinfo (TIC) Shield
48
star
12

Scan-I2C-WiFi

ESP8266 I2C Scanner with oled display, WS2812 RGB Led and OTA
C
42
star
13

teleinfo

Projets dédié à la téléinformation
Eagle
42
star
14

WeMos-RN2483

ESP8266 WeMos Shield for Microchip LORAWAN RN2483 or RN2903
Eagle
40
star
15

WeMos-Matrix-Shield

WeMos ESP32 ESP8266 RGB LED Matrix Shield
37
star
16

WeMos-Matrix-Shield-DMA

ESP32 DMA RGB LED Matrix Shield
35
star
17

Omega2-IO-Power

FTDI Power SPI I2C Shield for Onion Omega2
Eagle
34
star
18

LoRa-E5-Breakout

LoRa-E5 Breakout board
28
star
19

ArduiPi_SSD1306

ArduiPi Adafruit SSD1306 OLED Driver for Raspberry Pi and ArduiPi Board
C++
28
star
20

arduipi

ArduiPi is a shield for Raspberry Pi that brings Arduino low level extented I/O to Raspberry Pi
Arduino
24
star
21

WeMos-RFM69

WeMos RFM69 RF Gateway + IC2 Oled + ATSHA204
24
star
22

ULPNode

Ultra Low Power Arduino Wireless Sensor Node
Eagle
24
star
23

Pro-Mini-ICSP-FTDI

Arduino Pro Mini ICSP and FTDI Programming Board
Eagle
22
star
24

LoRa-E5-Tiny

LoRa-E5 Tiny cell coin STM32WL LoRaWAN board
20
star
25

LoLin32-Lora

ESP32 LoLin32 Lite Shield for RFM95 or RN2483 LoRa Modules
20
star
26

RAK3172-Breakout

STM32WL LoRaWAN Breakout board for RAK3172
19
star
27

WeMos-RFLink

ESP8266 WeMos Shield for RFLink + OLED
Eagle
18
star
28

remora_soft

Logiciel pour les cartes Fils Pilotes Wifi de type Remora
C++
18
star
29

LoLin32-Lite-Lora

ESP32 LoLin32 Lite Shield for RFM95 or RN2483 LoRa Modules
15
star
30

MAX31865-Breakout

MAX31865 PT100 PT1000 RTD temperature sensor breakout board
Eagle
15
star
31

WifInfo

Wifi Teleinfo Web Server
Eagle
15
star
32

LoraCHIP

C.H.I.P. Computer RN2483 or RFM95 Lora Shield
Eagle
14
star
33

WeMos-shield

Basic WeMos Shield with minimal features
Eagle
12
star
34

rgb-matrix-crypto-ticker

RGB Matrix Crypto Ticker
Python
12
star
35

cc2538-multi-connect

ZigBee CC2538 multiconnect PCB Breakout
10
star
36

Lora-Breakout

Hope RF Lora module RFM92 RFM95 RFM96 RFM98 Breakout Board to be used on NRF24L01 connector
Eagle
9
star
37

RFM69W-BreakOut

RFM69W with SD and Flash EEP Breakout Board
8
star
38

R-Divider-Breakout

Voltage divider breakout for 4 Channels ADS1015/ADS1115 ADC Board
Eagle
7
star
39

RFM12B-BreakOut

RFM12B with SD and Flash EEP Breakout Board
7
star
40

DAC-Shield

Arduino 0-10V DAC / ADC / RS485 / OLED Shield
Eagle
7
star
41

TH02

TH02 temperature and humidity sensor library
C++
6
star
42

ULPNode_Lib

Ultra Low Power Library
C++
5
star
43

RM1xx-Breakout

Laird LoRa/Bluetooth Low Energy Module breakout for RM1xx modules
Eagle
5
star
44

ULPNode_RF_Protocol

ULPNode RF protocol definition and utilities files
C++
5
star
45

DAC7565

TI DAC7565, DAC7564, DAC8164 and DAC8564 Arduino Library
C++
5
star
46

Arduino-Boards

Support for my Arduino compatible development boards
C
4
star
47

Particle2NodeMCU

Particle Spark or Photon to NodeMCU Adapter
Eagle
4
star
48

NRJMeter

Connected NRJ Metering device for Teleinfo and various counters
C++
4
star
49

Particle-Gateway

Particle (Spark) RF Gateway and Display Board
Eagle
4
star
50

Shelly-FTDI

Shelly FTDI programmer board
3
star
51

MicAmplifier

Universal Stereo MIC/Line amplifier for Audio processing with ADC
3
star
52

WeMos-rn2483-firmware

Wemos RN2483 Shield Firmware
HTML
3
star
53

RFPIGW

RFM12B RFM69 Raspberry Pi Gateway with OLED and OOK
2
star
54

NRF24-Breakout

NRF24L01 Breakout Board Socket
Eagle
2
star
55

1-Wire-Fil-Pilote

Carte 1-Wire Fil Pilote
2
star
56

teleinfo-test

Programme de test des modules téléinfo
Python
2
star
57

Denky-D4

Denky D4 WiFi Teleinfo
2
star
58

uTeleinfo

Micro Teleinfo USB Dongle
2
star
59

tinfo_replay

Script to replay teleinfo frames for testing
Python
1
star
60

ArduiLED

ArduiLED for driving addressable RGB LED Strip
1
star
61

Makerfabs-LvglWidgetsDemo

Makerfabs LvglWidgets Demo platformio
C
1
star