Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
JLu27

LORA SX1276 Arduino code/library

Recommended Posts

Posted · Original PosterOP

Does anyone know how to code this on an Arduino UNO?

https://www.dfrobot.com/product-1670.html

 

I got 2pcs. of the module but I can't make it work since I don't have a library for it.

The product site doesn't give much info and there are no examples that I can use.

I tried getting random sketches from the Arduino IDE but it's for specific boards/modules.

All I need to do is to send and receive data back and forth on the 2 modules which should be a simple task.

 

If I don't have a library, does that mean I can't use it on the Arduino?

But if I can use it with the Arduino, how do you set up the parameters of the module?

 

Anyone who can help is a godsend :)


Gaming Rig:

CPU: i7-7700  

GPU: Asus DUAL-GTX1060-O3G 

RAM: VENGEANCE LPX 16GB (2 x 8GB) DDR4 2400MHz 

MOBO: STRIX Z270H GAMING

HDD: 2TB Western Digital Blue, 1TB Western Digital Black   

SSD: 240GB Western Digital Green

Monitor: ZOWIE XL2411 144Hz

Link to post
Share on other sites

check out the radiohead library. It's recommended by Adafruit for their packet radio feathers, it might just work for this module. Also make sure you have antennas on your radios when you power them on or the transmitter will cook because there is nowhere for the energy to escape, so it builds up as heat.


I used to have guides here

CPU: 4670k 4.4ghz GPU: GTX 970 G.1 1534mhz

Link to post
Share on other sites
43 minutes ago, Hackentosher said:

check out the radiohead library. It's recommended by Adafruit for their packet radio feathers, it might just work for this module.

There's nothing special to the module, it's just an sx1276, so either the Radiohead-library or the one I linked to will work fine. I've got a good handful of various LoRa-sensors spread around the place myself.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
6 hours ago, WereCatf said:

There's nothing special to the module, it's just an sx1276, so either the Radiohead-library or the one I linked to will work fine. I've got a good handful of various LoRa-sensors spread around the place myself.

Just trying to provide more options to OP


I used to have guides here

CPU: 4670k 4.4ghz GPU: GTX 970 G.1 1534mhz

Link to post
Share on other sites
Posted · Original PosterOP
On 2/6/2019 at 11:44 PM, WereCatf said:

Here's an easy-to-use library for you: https://github.com/WereCatf/arduino-LoRa

Tried using this library but it gives does not start my LoRa module.

 

Serial output:

15:32:05.556 -> LoRa Sender
15:32:05.556 -> Starting LoRa failed!
 

Code:

#include <SPI.h>
#include <LoRa.h>

int counter = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("LoRa Sender");

  if (!LoRa.begin(915E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);

  // send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(5000);
}


Gaming Rig:

CPU: i7-7700  

GPU: Asus DUAL-GTX1060-O3G 

RAM: VENGEANCE LPX 16GB (2 x 8GB) DDR4 2400MHz 

MOBO: STRIX Z270H GAMING

HDD: 2TB Western Digital Blue, 1TB Western Digital Black   

SSD: 240GB Western Digital Green

Monitor: ZOWIE XL2411 144Hz

Link to post
Share on other sites
1 hour ago, JLu27 said:

Tried using this library but it gives does not start my LoRa module.

Of course not, you didn't specify any pins it's connected to! Also, the modules you linked to are 868MHz, not 915MHz.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
2 minutes ago, WereCatf said:

Of course not, you didn't specify any pins it's connected to! Also, the modules you linked to are 868MHz, not 915MHz.

ahk... ok I must have misread the Mhz as baudrate my bad...

what do you mean specify the pins it;s connected to?

do you have to set other pins aside from the TX and RX?


Gaming Rig:

CPU: i7-7700  

GPU: Asus DUAL-GTX1060-O3G 

RAM: VENGEANCE LPX 16GB (2 x 8GB) DDR4 2400MHz 

MOBO: STRIX Z270H GAMING

HDD: 2TB Western Digital Blue, 1TB Western Digital Black   

SSD: 240GB Western Digital Green

Monitor: ZOWIE XL2411 144Hz

Link to post
Share on other sites
4 minutes ago, JLu27 said:

ahk... ok I must have misread the Mhz as baudrate my bad...

what do you mean specify the pins it;s connected to?

do you have to set other pins aside from the TX and RX?

I took a better look at the module you linked to and it appears I was wrong: it's not a standard LoRa-module. That's some silly module with an STM8 in-between the LoRa-chip and your Uno and I ain't got any library for such. You need to write your own, the AT-commands are in the specsheet.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
3 minutes ago, WereCatf said:

I took a better look at the module you linked to and it appears I was wrong: it's not a standard LoRa-module. That's some silly module with an STM8 in-between the LoRa-chip and your Uno and I ain't got any library for such. You need to write your own, the AT-commands are in the specsheet.

So does that mean i'm out of luck then?

No packets, no encryption, no mesh, no anything?
All I can do is manually write code and its all on AT mode? LOL


Gaming Rig:

CPU: i7-7700  

GPU: Asus DUAL-GTX1060-O3G 

RAM: VENGEANCE LPX 16GB (2 x 8GB) DDR4 2400MHz 

MOBO: STRIX Z270H GAMING

HDD: 2TB Western Digital Blue, 1TB Western Digital Black   

SSD: 240GB Western Digital Green

Monitor: ZOWIE XL2411 144Hz

Link to post
Share on other sites
1 minute ago, JLu27 said:

So does that mean i'm out of luck then?

No packets, no encryption, no mesh, no anything?
All I can do is manually write code and its all on AT mode? LOL

Well, you'd have to do the encryption and mesh-stuff yourself anyways, but yeah, it looks like you'll have to write all your stuff yourself. At least I'm not aware of any libraries for that module, all the libraries I know of use the LoRa-chip directly.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
12 minutes ago, WereCatf said:

Well, you'd have to do the encryption and mesh-stuff yourself anyways, but yeah, it looks like you'll have to write all your stuff yourself. At least I'm not aware of any libraries for that module, all the libraries I know of use the LoRa-chip directly.

maaan.... sucks for me.. thanks for the help
will try looking for codes/building my own then.


Gaming Rig:

CPU: i7-7700  

GPU: Asus DUAL-GTX1060-O3G 

RAM: VENGEANCE LPX 16GB (2 x 8GB) DDR4 2400MHz 

MOBO: STRIX Z270H GAMING

HDD: 2TB Western Digital Blue, 1TB Western Digital Black   

SSD: 240GB Western Digital Green

Monitor: ZOWIE XL2411 144Hz

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×