Helpfor Lora Transmission

Hi everybody,

I need help to send a data in Lora...

here is my arduino program :

#include <SoftwareSerial.h>
#include <RH_RF95.h>

SoftwareSerial lora(5, 6);
RH_RF95 rf95(lora);

int val;
String tabl[2];
int current_battery = A0; // give a value between 0 and 5
int current_motor = A1;   // give a value between 0 and 5

void setup() 
{
  Serial.begin(9600);
  pinMode(current_battery, INPUT);
  pinMode(current_motor, INPUT);

      if (!rf95.init())
    {
        Serial.println("init failed");
        while(1);
    }

    rf95.setFrequency(434.0);
}

void loop() 
{
  tabl[0]="A";  // identifier for the receiver
  tabl[1] = current_battery;  // value I want to send
  Serial.println(tabl[0]);    // print on the Serial monitor of the transmitter
  Serial.println(tabl[1]);    // print on the Serial monitor of the transmitter

  __________________________________;   //   And now I don't know how to send 
  __________________________________;


}

At the beginning, all is good, I have the good value in my array but after I don't know...
If i want to see on the Serial monitor the value of tabl like this : Serial.println(tabl), it doesn't work and I've got an error...

After that, I want to sent the full value of the array "tabl" using lora transmission and at this moment... it's the drama... I don't know how to do :confused:

Can you help me please ?

Sorry if I do not explain my problem very well but if you want more information ask me :wink:

Thanks for your help and your answer :wink:

Start with the examples that come with the RadioHead library (which you appear to use, RH_RF95 is one of the drivers of that library).

The ReliableDatagram is a very useful manager.

Starting with the examples that came with the library is absolutly essential, you need to prove your hardware is working.

In the process those examples also show how data is transmitted and received (in this case the message is an array of byte).

Hi,
What model Arduino are you using?

What model Lora module, link to spec/data?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

How do you know your analog input values will be between 0 and 5?

Where in your code are you reading the two analog inputs A0 and A1?

Thanks.. Tom... :slight_smile:

Hi,
Looking at my Lora codes, and examples. SPI is used, not serial comms to work with the Lora module.

Tom... :slight_smile: