Using the LoRa XL1276-D01 (XS1278)

I've searched and searched, but for the life of me, I cannot find any Arduino code for this product. While I should have checked if there was easy documentation for it before purchasing, the purported range was not something to bat an eye at, for my project. I'm useless when it comes to reading and understanding datasheets to communicate with devices like this. I'm alright once coding, but fighting with compatibilities and interfacing isn't my kinda thing :/ I like having the template to do these things, then learning backwards, if that makes sense...

But, yes, the core of my question is where to find some working Arduino code for this module, or perhaps even a tutorial, because my searching about just isn't working. Thank you for your time and understanding.

Go to the Adafruit website and search for : lora Buy something from Adafruit, and use the code they give. They also give schematics and support.

Buying an unknow module is very easy, everyone can do that.

I don't think that it is this one, but it could be compatible : http://www.hoperf.com/rf_transceiver/lora/RFM98W.html This LoRa module has 1276 in its name : http://www.nicerf.com/product_view.aspx?id=99 This the chip they used : http://www.semtech.com/wireless-rf/rf-transceivers/sx1276/ What is this ? Do they have Arduino code ? https://www.tindie.com/products/NiceRF/2pcs-868mhz915mhz-lora1276-wireless-rf-module-/

Manufacturer : Semtech Chip : SX1276 / SX1278 Arduino code : Search this forum and Github. For example this one : https://github.com/matthijskooijman/arduino-lmic But there are more libraries.

I think they use the name XL... and XS... because it could be a clone or fake or counterfeit.

ADDED: After reading this : https://www.adafruit.com/products/3079 The RFM9x LoRa seems to be compatible with SX1276 (search for "SX1276" on that page). I suppose it is not a protocol definition, but hardware compatible, but I'm not sure.

Thank you for your reply. It's amazing I didn't manage to find that library (LMIC). However, now it's simply not working. I'm using my Arduino Due, with the example sketch they have, and upon its initialisation it just breaks (Serial just returns "St" from trying to output "Starting"; I know it's the initialising, as I comment out everything else). I don't know what to look for. The only thing I can think of is that my SPI wires are longer in length than the rest of the wires, due to my M-F wires being longer than my M-M. Would that affect it? Other than that, every single pin is accounted for - all the pins on one side of the transceiver are completely filled, and I've checked the pinouts! It's a real shame, because these transceivers have a purported very long range.

Add a one second delay after the Serial.begin(xx) statement to give the port time to connect.

Arctic_Eddie: Add a one second delay after the Serial.begin(xx) statement to give the port time to connect.

This hasn't worked, unfortunately :/ This is the code I'm using with a Due R3, and this product exactly, with this config.

Try it again without the F() macro. I've seen strange things in the past when forcing string data into PROGMEM. Here's an explanation of how the macro performs.

F() Macro

This product might also be of interest. It uses the RadioHead library.

Arctic_Eddie: Try it again without the F() macro. I've seen strange things in the past when forcing string data into PROGMEM. Here's an explanation of how the macro performs.

F() Macro

Still only ends up as "St" - it really will be the init not working, from what I can see... the os_init(); function. (it is odd how the F() macro isn't in the references - I'm glad I'm not the only one noticing)

Arctic_Eddie: This product might also be of interest. It uses the RadioHead library.

That is of interest, thank you! The module I'm using is only due to its purported 5km range. I have big dreams :P I suppose it's the antenna which is more important.

The Adafruit product makes the same claim. And yes, a directional antenna at each end is a far better solution that more power.

As a ham radio operator, I still hold the world record for miles per watt on the 1296MHz band. In the late 80's I communicated two-way over a 346 mile path using 150 microwatts or 2.3 million miles per watt. It was possible in April using coastal sea fog ducting, mores code, and 15 element long Yagi antennas.

Arctic_Eddie: The Adafruit product makes the same claim. And yes, a directional antenna at each end is a far better solution that more power.

As a ham radio operator, I still hold the world record for miles per watt on the 1296MHz band. In the late 80's I communicated two-way over a 346 mile path using 150 microwatts or 2.3 million miles per watt. It was possible in April using coastal sea fog ducting, mores code, and 15 element long Yagi antennas.

That's remarkable! :) I want to put these into a small rover I've been wanting to create. The idea is there, but getting all the components to work is turning out to be an absolute nightmare. This is, as you can appreciate, a very important component. It would be good if I could have these two working, as I couldn't return them, now. Plus, I'd really like for one of these things to work, for once...

Look at the Adafruit documentation, mainly schematics. If you can get your modules to act like their product then you can use the RadioHead libraries and examples. Once you get two modules talking, you're over the big hurdle.

I used their RFM69HCW breakouts and had immediate success. The project was to collect temperature, humidity, battery voltage, and mAh of battery consumption on a remote aircraft and send it to a ground station.

You can find many antenna choices by looking on RC model sites and eBay for components used in control and video links from aircraft to ground stations. I use a program called Nec2Go to design my own antennas and for Yagis I wrote my own antenna design program. It is a pattern optimizer and handles up 16 antennas of 40 elements each. The larger systems are used for moon-bounce communication.

Arctic_Eddie:
Look at the Adafruit documentation, mainly schematics. If you can get your modules to act like their product then you can use the RadioHead libraries and examples. Once you get two modules talking, you’re over the big hurdle.

I wouldn’t be able to do that. I’m useless when it comes to that stuff. I may just give up on that hurdle, and shave the dream down to a couple km :confused:

Take a little break and try again.

Good luck.

phunanon: I've searched and searched, but for the life of me, I cannot find any Arduino code for this product.

That device looks like a clone of the Hope RFM96 or RFM98.

All the LoRa devices are based on the Semtec SX127X, these are SPI based and as long as you match the hardware pins for the SPI interface, SCK, MOSI, MISO, NSS (chip select) and Reset then any Arduino code should work. The exception is if the code has been written to feed LoRa status conditions out to the devices DIO pins, these then also need to be matched to Arduino I\O pins.

My own approach to writing code for LoRa is to keep it as simple and clear as possible, for me a good idea as my coding abilty for Arduino is at Novice level.

If you want an overview of what LoRa can do, take a look at;

"Long Distance Tracking and Monitoring with LoRa - Introduction - April 2016"

Which you will find here;

https://goo.gl/IeEiC1

More info here;

http://www.loratracker.uk/

And to go back to the device you linked to, which says;

"13. Ultra-long-distance transmission farthest open up 5KM."

Add a couple of zeroes to the 5KM and your getting close the the capability of LoRa in good line of sight situations.