Node RAK811+Arduino


(Internet Of Things) #1

Hello,

I’m trying to communicate with the rak811 using serial communication with the arduino mega via serial2 but I couldn’t, I troubleshoot the system and everything was fine, I follow up the tutorials but got no result at the end, hope anybody can help me with this.

note: I’m trying the below code, it’s simple just ask the node to send the version to the arduino, but it keep printing the same command in the monitor “at+version” and I can’t see the Rx or Tx on the node blinking, there is something wrong here.

*********************************THE CODE
#include “RAK811.h”

RAK811 RAKLoRa(Serial2);
String var;

//SETUP*******************
void setup() {
Serial.begin(9600);
Serial2.begin(115200);

while(Serial.read()>= 0) {}
while(!Serial);
Serial.println("*StartUP");

}
//LOOP*******************
void loop() {

       Serial.println(RAKLoRa.rk_getVersion());
       String ver = Serial2.readStringUntil('\n');
       Serial.println(ver);
       Serial2.setTimeout(2000);

}


#2

missing #define ?

#define RAK811 RAKLoRa(Serial2);

did you connect it to to right UART on the RAK811… there are 2


(Internet Of Things) #3

I tried but it give me the following error “‘RAKLoRa’ was not declared in this scope” , it’s work fine without it.
for the connection, you can see it below:


Note: I just changed the mega serial port to serial2


#4

if you want to send AT commands from your arduino ide monitor via arduino mega, have a look here
https://www.arduino.cc/en/Tutorial/MultiSerialMega


(Internet Of Things) #5

I will go through your link, but I don’t know yet why my system not working? did you check the code and the connection? Am sure it’s correct


#6

often the mistake is made when connecting UART’s is, that people forget that Tx (arduino) is connected to Rx (module) and Rx (arduino) to Tx (module)…

also the voltage levels… the mega is 5V

don’t give up… you find it :wink:


(Internet Of Things) #8

I couldn’t, I spend a lot on the node, more than 6 days try to figure out what is going on, the connections are correct and I’m sure, I followed the tutorial, I changed the microcontroller with UNO, I made a loopback test for the serial communication, everything were fine except the node itself, even the rx,tx leds on the node does not blinking


#9


! do you have power on the RAK chip ?

  • did you read about the jumpers and the power testpin
  • try only connect rx/tx and ground and power the board over USB
  • bad dupont wire

(Internet Of Things) #10

It’s work now, but without using the library, do you have any advice to use the library because it keep giving me no result with it, but without the library I get a result


#11

No not at this moment… I ordered a RAK811 module so in a couple of weeks I know more :wink:

Maybe you can explain (code?) what you did to make it work without that library ?


(Internet Of Things) #12

here is the code {
#include “RAK811.h”

RAK811 RAKLoRa(Serial1);

//SETUP
void setup() {
Serial.begin(115200);
Serial1.begin(115200);

while(Serial.read()>= 0) {}
while(!Serial);
Serial.println("*StartUP");

}
//***LOOP
void loop() {

       Serial.println(RAKLoRa.rk_getVersion());
       String Version = Serial1.readStringUntil('\n');
       Serial.println(Version);
       Serial1.setTimeout(500);

}
}
just to get the version, I don’t know why but I get a lot of “ERROR-1” before I get the version and the errors come again, it’s work but with errors, and even when I tried to set the mode, lot of errors at the beginning then it sent “OK”


#13

and what version do you have ? … there are some firmware updates

I have the PCB… waiting for the chip :wink:


(Dikkepret) #14

Hi

Where did you buy that pcb?

Gr.
Richard


#15

(Hanmant) #16

@InternetOfThings,BoRRoZ i tried by this way but still getting me nothing on serial terminal like at+version continuously.i’m trying to know the version by firing AT commands on Arduino serial as well as Serial Terminal.


(Jezd) #17

There are two ways to use these RAK811 boards it seems, someone tell me if I am wrong.

  1. simple AT commands from your own MCU board - not sure on the benefits of doing this given SX1276 solutions already in play, are the AT commands sent via the ST32L151? unsure
  2. programming the STM32L151 directly - this seems to be the pro approach but is technically more of a challenge as at present there are no ardiono cores working for the ST32L151 - unless someone knows better

(Chace) #18

Hi, try to set the RAK811 baud rate to 9600, and then through Arduino to control.


#19

yes the 811N has a uart interface and can be controlled by AT commands


(Timaru Dc) #20

Hot tip for anyone else having trouble with the RAK811/serial interface - I was trying to connect a RAK811 with an Arduino Uno on the hardware serial port, and for the life of me couldn’t get them to talk. Note that I’m using the simple RAK811 breakout board, not the ‘shield’ board.

I was receiving the ‘Welcome to RAK811’ message, but any time I tried to send commands, I simply got ERROR-1.

I ended up scoping it out and could see that the transmitted signal bits looked fine, but the TX timing from the Arduino appeared to be just a fraction faster then that of the return messages from the RAK811. I haven’t investigated that much further, but in the end I simply set my baud rate to 110000 instead of the standard 115200, and I was able to communicate successfully.

Once you have active comms, you can use the at+uart command to adjust the baud rate to suit, in my case I wanted it lower to free up the hardware serial.


#21

softserial and 115200 :thinking: that’s normally not possible