Tapatalk

RadioHead library

RadioHead library

14

PostNov 06, 2017#1

Hi there

We just purchased 10 Whisper Node Lora modules a few weeks ago and we're just getting around to playing with them.

The documentation mentions that the talk2 library needs the radiohead and low-power libraries. I've gone ahead and installed them, and all seems okay. However, I see no reference to the radiohead library in the examples. Does the line:

#include <T2WhisperNode.h>

also pull in the radiohead library, or should I explicitly include it?

Also, I would appreciate some examples of Lora communication using radiohead.

While I'm at it, is there any documentation on the T2Message class anywhere:

Code: Select all

T2Message myMsg;
 // Send Node ID on start-up as Event
  myMsg.cmd = 0x00;
  myMsg.idx = 0x06;
  myMsg.sdx = 0x01;
  myMsg.src = clientAddr;
  myMsg.dst = testAddr;
  memcpy(myMsg.data, myFlash.uniqueId, 8);
  myMsg.len = 8; //Update length
  radioBufLen = 0;
  myMsg.getSerializedMessage(radioBuf, &radioBufLen);
  myRadio.send(radioBuf, radioBufLen);
  myRadio.waitPacketSent(1000);
Am I correct in thinking this is a wrapper around the RadioHead library?

Regards from the UK

Mark Wills

1885
1885

PostNov 06, 2017#2

Hi Mark,

Please make sure you're using the latest Talk2 Library (1.0.2 at the time this post).

The Radiohead library is included in the beginning of each file. Note there's a condition to determine if you're using the RFM95 (LoRa) or RFM69 Radio:

Code: Select all

#include <T2WhisperNode.h>

/* You need to configure the Whisper Node Version */
#define T2_WPN_BOARD T2_WPN_VER_RF69
//#define T2_WPN_BOARD T2_WPN_VER_LORA

#define RADIO_FREQUENCY 916.0
#define RADIO_TX_POWER 13
#define RADIO_ENCRYPTION_KEY { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Only used by RF69

#if T2_WPN_BOARD == T2_WPN_VER_RF69
#include <RH_RF69.h>
RH_RF69 myRadio;
#elif T2_WPN_BOARD == T2_WPN_VER_LORA
#include <RH_RF95.h>
RH_RF95 myRadio;
#endif
About the T2Message, you're correct, it's just a wrapper suggesting how to use initial payload data to create optimized headers to easily handle different messages.

For the LoRa example, all examples should work with LoRa (RFM95) and RFM69 radios, as the only difference is the physical layer. If you're after LoRaWAN example, this is not supported by RH Library and the LMIC library is the way to go.

If you prefer, you can use RadioHead libraries without the Talk2 Library. The examples from RH should work without modification.

14

PostNov 07, 2017#3

Talk2 wrote: Hi Mark,

Please make sure you're using the latest Talk2 Library (1.0.2 at the time this post).

The Radiohead library is included in the beginning of each file. Note there's a condition to determine if you're using the RFM95 (LoRa) or RFM69 Radio:

Code: Select all

#include <T2WhisperNode.h>

/* You need to configure the Whisper Node Version */
#define T2_WPN_BOARD T2_WPN_VER_RF69
//#define T2_WPN_BOARD T2_WPN_VER_LORA

#define RADIO_FREQUENCY 916.0
#define RADIO_TX_POWER 13
#define RADIO_ENCRYPTION_KEY { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Only used by RF69

#if T2_WPN_BOARD == T2_WPN_VER_RF69
#include <RH_RF69.h>
RH_RF69 myRadio;
#elif T2_WPN_BOARD == T2_WPN_VER_LORA
#include <RH_RF95.h>
RH_RF95 myRadio;
#endif
About the T2Message, you're correct, it's just a wrapper suggesting how to use initial payload data to create optimized headers to easily handle different messages.

For the LoRa example, all examples should work with LoRa (RFM95) and RFM69 radios, as the only difference is the physical layer. If you're after LoRaWAN example, this is not supported by RH Library and the LMIC library is the way to go.

If you prefer, you can use RadioHead libraries without the Talk2 Library. The examples from RH should work without modification.
Many thanks for the reply. This has given me something to go on/aim for!👍

Many thanks

Mark