LowPowerLab Forum

Hardware support => RF - Range - Antennas - RFM69 library => Topic started by: i670 on February 20, 2016, 03:30:12 PM

Title: Mainline radiohead library vs LowLowerLab's customised version
Post by: i670 on February 20, 2016, 03:30:12 PM
Having just acquired two Motino Megas with LORA, I am starting with the basics.  Is it still required to use the customised library or will the mainline Radiohead lib suffice?  If the LowPowerLab version is still required, is there any chance to have the changes merged into the mainline package?

dave
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: Felix on February 20, 2016, 08:40:38 PM
Since there is no simple way to do a pull request (like on github), and there are only a few obsolete forks of RadioHead on github, I had to make the few customizations to make the RadioHead library work with Moteinos and keep it as a standalone version. If you need to integrate the changes into a more recent version I would just do a code diff, the changes are actually pretty minor. I was going to attempt my own version for RFM95/96 but never had the time to do it.
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: i670 on February 20, 2016, 11:44:31 PM
Thanks, Felix.
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: i670 on March 15, 2016, 06:16:43 AM
Felix,

I've now run into problems where your version of the library seems to cause issues.  I'm using both RH_SERIAL to communicate between two Arduinos, one of which is a moteino with the lora radio.  If I use your lib, lora works but I see quirks on the serial comms.  If I use Radiohead library proper, I don't seem to have the serial issues but the lora doesn't work.  To work through the process of elimination, it would help if you could point me in the right direction to find the tweaks you made to the library so I can integrate them into the current lib.  I believe there are now four revisions difference and I suspect therefore there will be a large number of deltas that have nothing to do with the moteino changes you needed to make. 

Forgive me if this is a silly question.  I'm not sure how to perform a diff on the entire lib so happy to take your advice, even just knowing which files were changed would be great.

btw I love the moteino with lora and have ordered a bunch. Thank you for these.  I've built a very basic lora/ethernet gateway using a moteino.  However, I have one complicated little beast of a sodaq arduino that runs a remote livestock watering pump (must be rock solid) and rather than port it to moteino and go through bug fix (thirsty cows or worse), I'm bolting a moteino onto it and the two talk with RH_SERIAL.  This should let me connect that pump controller relatively unchanged through the lora gateway to cellular and the "cloud".  Sounds kludgy but I want to avoid changes to the pump control arduino.
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: Felix on March 15, 2016, 08:11:09 AM
@i670684,
Basically my version has a few pin definitions changed to reflect the different LED wiring and to make it work with MoteinoMEGA. Otherwise there is no change. It could be that there is a newer version of RadioHead. However it was tested on all my LoRa boards, along with serial and I don't see any issue. I don't see how serial is influenced with the radio library. If you can show me a snippet of code specific to the radio and serial that somehow breaks but should otherwise work then I can have something to look at.
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: i670 on March 15, 2016, 11:59:54 AM
Thanks, Felix.  I'll continue to diagnose and if I get stuck will post some snippets.

dave
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: i670 on March 16, 2016, 03:22:04 AM
OK, Felix, now I'm ready for a snippet review.  This code compiles and executes as expected using the mainline Radiohead library but when using the Lowpowerlabs version of Radiohead it does not compile.  I have no reason to believe this is at the core of my issues but it its odd and I would like to understand why this is happening.  The code:

#include <RHReliableDatagram.h>
#include <RH_Serial.h>
#include <SPI.h>

#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2

RH_Serial sdriver(Serial1);

// Class to manage message delivery and receipt, using the driver declared above
RHReliableDatagram smanager(sdriver, SERVER_ADDRESS);

void setup()
{
  Serial.begin(57600);
  // Configure the port RH_Serial will use:
  sdriver.serial().begin(57600);
  if (!smanager.init())
    Serial.println("init failed");
}

Gives this error:

/Users/dw/sketchbook/serial_reliable_datagram_server/serial_reliable_datagram_server.ino: In function 'void setup()':
serial_reliable_datagram_server:32: error: 'class RH_Serial' has no member named 'serial'
   sdriver.serial().begin(57600);
           ^
exit status 1
'class RH_Serial' has no member named 'serial'

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Title: Re: Mainline radiohead library vs LowLowerLab's customised version
Post by: Felix on April 04, 2016, 10:52:47 AM
The libraries are equivalent with minor differences.
You should only keep 1 (one) of them installed not both at the same time.