Giter VIP home page Giter VIP logo

arduino-lora-ra01s's People

Contributors

cyraxx avatar johnpiker avatar nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arduino-lora-ra01s's Issues

Running on Arduino UNO

Hi,
When I compile it for Arduino UNO,
I got this error

21:35:24.546 -> begin
21:35:24.546 -> debugPrint=1
21:35:24.546 -> SX126x_SPI_SELECT=10
21:35:24.546 -> SX126x_RESET=9
21:35:24.546 -> SX126x_BUSY=2
21:35:24.546 -> SX126x_TXEN=-1
21:35:24.546 -> SX126x_RXEN=-1
21:35:24.581 -> Reset
21:35:24.581 -> ReadRegister:  REG=0x740  DataIn: 0 84 
21:35:24.581 -> syncWord=0x84
21:35:24.581 -> SX126x error, maybe no SPI connection

0x84 is SX126X_CMD_SET_SLEEP.

I use the following PIN configs:

SX126x  lora(10,               //Port-Pin Output: SPI select
             0xff,               //Port-Pin Output: Reset 
             2               //Port-Pin Input:  Busy
             );

RA01-SH network join

Hi,

Thank you for sharing this library.

I am trying to join a node to a local network with a ra-01sh,

This is the log level 2 output. Can you point me to a successful join log?

7365 Radio Init
7391 NSS:27, RST:23, DIO0:25, DIO1:26
7794 Reg< 740
7816 Config synch word 14==14
7824 Config synch word 24==24
7833 Status 22 mode : 2, status 1
7841 Set Radio to sleep
7848 Cmd> 84
8498 Set Radio to sleep
8504 Cmd> 84
55409 Packet queued
56163 EV_JOINING
showState(): rssi -139
showState(): state: Joining
56203 Uplink join pending
56851 Airtime available at 486091 (previously determined)
56860 Uplink delayed until 486091
485973 Uplink join pending
485987 Airtime available at 486091 (previously determined)
485996 Ready for uplink
486032 Time on air : 61 ms
486046 Updating global duty avail to 979613
486709 Cmd> 80
486729 Cmd> 96
486738 Cmd> 98
486748 Cmd> 97
486758 Cmd> 89
486766 Cmd> 80
487412 Cmd> 8a
487420 Reg> 740
487429 Init Configure done
487438 Cmd> 86
487447 Cmd> 8b
487456 Cmd> 8c
487465 Cmd> 95
487473 Cmd> 8e
488123 Cmd> 8f
488137 Cmd> 2
488145 Cmd> 8
488155 Cmd> 83
488165 Status b2 mode : 3, status 1
488173 TXMODE, freq=902300000, len=23, SF=7, BW=125, CR=4/5
492060 Not using interupt trigger 0
492076 Cmd> 8
492091 Cmd> 2
492099 Set Radio to sleep
492105 Cmd> 84
492113 End TX 492059
492124 SchedRx RX1/2
492773 Rx delay : 4968 ms
492790 Cmd> 80
492801 Cmd> 96
492810 Cmd> 98
492819 Cmd> 97
492828 Cmd> 89
492836 Cmd> 80
493481 Cmd> 8a
493489 Reg> 740
493498 Init Configure done
493505 Cmd> 86
493514 Cmd> 8b
493522 Cmd> 8c
493531 Cmd> 8
493540 Cmd> 2
494187 Cmd> ffffffc1
494196 Cmd> 82
800100 Cmd> 80
800114 Cmd> 96
800123 Cmd> 98
800131 Cmd> 97
800140 Cmd> 89
800148 Cmd> 80
800156 Cmd> 8a
800164 Reg> 740
800173 Init Configure done
800818 Cmd> 86
800828 Cmd> 8b
800836 Cmd> 8c
800845 Cmd> a0
800854 Cmd> 8
800863 Cmd> 2
800871 Cmd> ffffffc1
802572 Cmd> 82

No more output...

Migration to Attiny

Hi,
I can run your code on ESP32 successfully. But I want to use this library with Attiny84 to build low cost LORA sensor. Is it hard to do? I have little knowledge on this low level programming.
As far as I know, attiny84 required tinySPI or softSPI.

I try to compile your code on Attiny84. its size is too big

Sketch uses 7066 bytes (86%) of program storage space. Maximum is 8192 bytes.
Global variables use 692 bytes (135%) of dynamic memory, leaving -180 bytes for local variables. Maximum is 512 bytes.

Thanks;

Unstable Behavior in EBYTE E220-400M22S Setup with ATTINY804

I am seeking assistance in the library GitHub to address an issue I'm encountering.

My challenge involves establishing communication between the Ebyte LoRa E220-400M22S and the MCU ATTINY804 IC. Below is the code snippet I'm utilizing:

#include <Ra01S.h>

#define RF_FREQUENCY                                433000000 // Hz  center frequency
//#define RF_FREQUENCY                                866000000 // Hz  center frequency
//#define RF_FREQUENCY                                915000000 // Hz  center frequency
#define TX_OUTPUT_POWER                             22        // dBm tx output power
#define LORA_BANDWIDTH                              4         // bandwidth
                                                              // 2: 31.25Khz
                                                              // 3: 62.5Khz
                                                              // 4: 125Khz
                                                              // 5: 250KHZ
                                                              // 6: 500Khz                                                               
#define LORA_SPREADING_FACTOR                       7         // spreading factor [SF5..SF12]
#define LORA_CODINGRATE                             1         // [1: 4/5,
                                                              //  2: 4/6,
                                                              //  3: 4/7,
                                                              //  4: 4/8]

#define LORA_PREAMBLE_LENGTH                        8         // Same for Tx and Rx
#define LORA_PAYLOADLENGTH                          0         // 0: Variable length packet (explicit header)
                                                              // 1..255  Fixed length packet (implicit header)
#if 1

SX126x  lora(0,               //Port-Pin Output: SPI select
             1,               //Port-Pin Output: Reset 
             2                //Port-Pin Input:  Busy
             );
#endif // ATmega328/2560

#if 0

SX126x  lora(0,                 //Port-Pin Output: SPI select
             1,                 //Port-Pin Output: Reset 
             2                 //Port-Pin Input:  Busy
             );
#endif // ESP8266

void setup() 
{
  delay(1000);
  Serial.begin(9600);

  lora.DebugPrint(true);

 /*
  int16_t ret = lora.begin(RF_FREQUENCY,              //frequency in Hz
                           TX_OUTPUT_POWER);          //tx power in dBm
*/

// UPDATED BELOW CODE AS PER INSTRUCTION ON LIBRARY PAGE

  int16_t ret = lora.begin(RF_FREQUENCY,              //frequency in Hz
                           TX_OUTPUT_POWER,           //tx power in dBm
                           3.3,                       //use TCXO
                           true);                     //use TCXO



                           
  if (ret != ERR_NONE) while(1) {delay(1);}

  lora.LoRaConfig(LORA_SPREADING_FACTOR, 
                  LORA_BANDWIDTH, 
                  LORA_CODINGRATE, 
                  LORA_PREAMBLE_LENGTH, 
                  LORA_PAYLOADLENGTH, 
                  true,               //crcOn  
                  false);             //invertIrq

}

void loop() 
{
  uint8_t txData[255];
  sprintf((char *)txData, "Hello World %lu", millis());
  uint8_t len = strlen((char *)txData);

  // Wait for transmission to complete
  if (lora.Send(txData, len, SX126x_TXMODE_SYNC)) {
    //Serial.println("Send success");
  } else {
    Serial.println("Send fail");
  }

  // Do not wait for the transmission to be completed
  //lora.Send(txData, len, SX126x_TXMODE_ASYNC );

  delay(1000);
}

I used above code from the library Example: example/Ra01S-TX/Ra01S-TX.ino and changes are done by me :

  1. Uncomment the 433MHz Line and Comment the 915MHz line.
#define RF_FREQUENCY                                433000000 // Hz  center frequency
//#define RF_FREQUENCY                                866000000 // Hz  center frequency
//#define RF_FREQUENCY                                915000000 // Hz  center frequency
  1. Updated below as per my connections I am using ATTINY804 connections details are in the below.
#if 1

SX126x  lora(0,               //Port-Pin Output: SPI select
             1,               //Port-Pin Output: Reset 
             2                //Port-Pin Input:  Busy
             );
#endif // ATmega328/2560

#if 0

SX126x  lora(0,                 //Port-Pin Output: SPI select
             1,                 //Port-Pin Output: Reset 
             2                 //Port-Pin Input:  Busy
             );
#endif // ESP8266
  1. Below Line for serial monitor
    Serial.begin(9600);
  2. Uncomment below line for debugging.
    lora.DebugPrint(true);
  3. As per instruction given on the library page I am using Ebyte module So I updated below code:
/*
 int16_t ret = lora.begin(RF_FREQUENCY,              //frequency in Hz
                          TX_OUTPUT_POWER);          //tx power in dBm
*/

// UPDATED BELOW CODE AS PER INSTRUCTION ON LIBRARY PAGE

 int16_t ret = lora.begin(RF_FREQUENCY,              //frequency in Hz
                          TX_OUTPUT_POWER,           //tx power in dBm
                          3.3,                       //use TCXO
                          true);                     //use TCXO

During the initial startup, the Serial Monitor output is as follows:

21:25:27.203 -> begin
21:25:27.203 -> debugPrint=1
21:25:27.203 -> SX126x_SPI_SELECT=0
21:25:27.250 -> SX126x_RESET=1
21:25:27.250 -> SX126
21:25:27.250 -> 
21:25:27.250 -> 
21:25:28.187 -> ut: 7-->A2 0-->A2 1-->A2 40-->A2 
21:25:28.234 -> WriteCommand:  CMD=0x89  DatD
21:25:28.282 -> 
21:25:28.282 -> 
21:25:29.219 -> =0x8  DataOut: 3-->A2 FF-->A2 0-->A2 0-->A2 0-->A2 0-->A2 0-->A
21:25:29.266 -> 
21:25:29.266 ->

However, subsequent startups after a power restore yield different results, suggesting an inconsistency issue:

21:26:56.403 -> ⸮
21:26:56.403 -> 
21:26:56.403 -> 
21:26:57.402 -> begin
21:26:57.402 -> debugPrint=1
21:26:57.449 -> SX126x_SPI_SELECT=0
21:26:57.449 -> SX126x_RESET=1
21:26:57.496 -> SX126
21:26:57.496 -> 
21:26:57.496 -> 
21:26:58.402 -> 0x1424
21:26:58.449 -> SX126x installed
21:26:58.449 -> WriteCommand:  CMD=0x80  DataOut: 0--
21:26:58.496 -> 
21:26:58.496 ->

These inconsistencies occur with subsequent startups, implying a problem with the setup.

The connections between ATTINY804 and E220-400M22S are as follows:

  • SCK <> SCK
  • MOSI <> MOSI
  • MISO <> MISO
  • 0 <> NSS
  • 1 <> NRST
  • 2 <> BUSY

For power supply, I'm using the AMS1117 3.3V Power Supply Module, drawing input from Arduino 5V and GND, then supplying it to the circuit via the AMS1117 3.3V Power supply.

For ATTINY804 programming, I'm utilizing the megaTinyCore Library and referring to the ATTINY804 pinout details.

I'm reaching out to the library developer and the community for assistance in resolving this issue. Any guidance or suggestions would be greatly appreciated. Thank you in advance.

Interrupt request

Hi,
How to add interrupt to this library?

I want to sleep the MCU and wakeup it when there's incoming data.

I use PY32F002 chip.

Regards;

standby/sleep to reduce power

Hi,
I am designing remote control using Atmega16 and LLCC68(Ra-01SC)
My flow is when a user press a button, it will send a message and wait for response from the receiver and then it'll go to deep sleep. it'll run on 9v battery thus power consumption is very important. Can you advice me on the step in your library code?

I see you have standby function and there're several sleep mode constant which doesn't seem to related with each other.

Without doing anything(idle), this Ra-01sc consumes around 2ma which is very large.

Thanks;

Communicate with RadioLib

Hi,
I am unable to communicate between your lib and RadioLib. Here's both config. I recheck several times and it should be correct. Both side work normally with their own respective receiver/sender

#define RF_FREQUENCY                                433000000 // Hz  center frequency
#define TX_OUTPUT_POWER                             22        // dBm tx output power
#define LORA_BANDWIDTH                              4         // bandwidth
                                                              // 2: 31.25Khz
                                                              // 3: 62.5Khz
                                                              // 4: 125Khz
                                                              // 5: 250KHZ
                                                              // 6: 500Khz 
#define LORA_SPREADING_FACTOR                       9         // spreading factor [SF5..SF12]
#define LORA_CODINGRATE                             1         // [1: 4/5,
                                                              //  2: 4/6,
                                                              //  3: 4/7,
                                                              //  4: 4/8]

#define LORA_PREAMBLE_LENGTH                        8         // Same for Tx and Rx
#define LORA_PAYLOADLENGTH                          0         // 0: Variable length packet (explicit header)

Radiolib config:

#define frequency 433.0
#define bw 125.0
#define sf 9
#define cr 5
#define syncword 0x12
#define dbm 22
#define preamble 8
 int state = radio.begin(frequency,bw,sf,cr,syncword,dbm,preamble, 0, false);

add delay suggestion in WriteCommand()

Hi,

With Atmega16, If debugPrint is false, I need to add a delay(10), otherwise sending will be successful but the other side will not receive it.

void SX126x::WriteCommand(uint8_t cmd, uint8_t* data, uint8_t numBytes, bool waitForBusy) {
  // ensure BUSY is low (state meachine ready)
  WaitForIdle();

  // start transfer
  digitalWrite(SX126x_SPI_SELECT, LOW);
  SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));

  // send command byte
  if(debugPrint) {
    Serial.print("WriteCommand:  CMD=0x");
    Serial.print(cmd, HEX);
    Serial.print(" ");
    Serial.print(" DataOut: ");
  }
**delay(10)**
  SPI.transfer(cmd);

SetTx Illegal Status Arduino Uno

Hi, I am trying to implement your code on this module which has sx1262 chip. When I upload the code, I'm getting the following error.
Can you please help.

begin
debugPrint=0
SX126x_SPI_SELECT=5
SX126x_RESET=6
SX126x_BUSY=7
SX126x_TXEN=-1
SX126x_RXEN=-1
Reset
syncWord=0x1424
SX126x installed
tcxoVoltage=0.00
useRegulatorLDO=0
SetTx Illegal Status

Using SF12 with BW lower the 125khz

I am not able to use SF12 with any BW less than 500khz
I am not able to use SF11 with any BW less than 250khz
I am not able to use SF10 with any BW less than 125khz
I am not able to use SF9 with any BW less than 62.5khz...
and so on.
I was hoping to use SF12 with BW 31.25 of less
any thoughts.
Thanks for the great work on this project!

Question on SPI migration from Arduino to ESP8266

Hi,
I see you mentioned in your description that this library is migrated from Arduino.

I want to migrate a SPI LORA from Arduino to ESP8266 too. It compile successfully but it failed to read from the LORA registry. I think there must be some change to make.

Do you have some suggetion?
Thanks;

Missing license for RadioLib code

Hello!

I'm the maintainer of the RadioLib project (https://github.com/jgromes/RadioLib), an open-source radio driver library. It seems like you have used a not-insignificant amount of code from that project - for example most of the register definitions in the Ra01S.h header (in RadioLib found in https://github.com/jgromes/RadioLib/blob/master/src/modules/SX126x/SX126x.h), as well as most low-level SPI access commands and SX126x commands (in RadioLib found in https://github.com/jgromes/RadioLib/blob/master/src/modules/SX126x/SX126x.cpp).

RadioLib uses MIT license, which allows to freely reuse any portion of the software for any purpose, however, the original license has to be stated. Therefore, to comply with RadioLib license, I would like to ask you to add the original RadioLib license (found here: https://github.com/jgromes/RadioLib/blob/master/license.txt) to this project.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.