Antal Attila
Published © GPL3+

RAK811 WisNode LoRa as Shield

I saw different approaches of using WisNode LoRa. I found all of them complicated so I'll present a simple one.

IntermediateFull instructions provided2 hours2,235
RAK811 WisNode LoRa as Shield

Things used in this project

Hardware components

RAKwireless RAK811 WisNode Lora
×1
Espressif Wemos D1 R1
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long

Story

Read more

Code

No debug version

Arduino
This variant is about no debugging option
void setup() {
  Serial.begin(115200);
     
  // waiting to WisNode to join to the network
  delay(20000);
}


void loop() {
  sendData(1,"1234"); 
  delay(10000);
}

void sendData(int port, String data){ 
  String command = "at+send=lora:" + (String)port + ":" + data; 
  sendCommand(command); 
} 

void sendCommand(String atComm){ 
  Serial.println(atComm); 
  readLora();
}

String readLora() { 
  String response = ""; 
  while(Serial.available()){ 
    char ch = Serial.read(); 
    response += ch; 
  }
  return response;
}

Advanced Variant

Arduino
Using Software Serial
#include <SoftwareSerial.h>

SoftwareSerial lora(D6, D7); // RX, TX

void setup() {
  Serial.begin(115200);
  lora.begin(115200);
   
  // waiting to WisNode to join to the network
  delay(20000);
}


void loop() {
  
  sendData(1,"1234"); 
  
  delay(10000);
}

void sendData(int port, String data){ 
  String command = "at+send=lora:" + (String)port + ":" + data; 
  sendCommand(command); 
} 

void sendCommand(String atComm){ 
  Serial.println(atComm); 
  lora.println(atComm); 
  readLora();
}

String readLora() { 
  String response = ""; 
  while(lora.available()){ 
    char ch = lora.read(); 
    response += ch; 
  }
  Serial.println(response); 
  return response;
}

Credits

Antal Attila

Antal Attila

2 projects • 5 followers

Comments