Comments (6)
Hi @geologic
Can you show us your code?
from beelan-lorawan.
Sure.
It is pretty much the same code of the example:
#include <lorawan.h>
//ABP Credentials
const char *devAddr = "26015D3F";
const char *nwkSKey = "F67BB976CE405DC19F3FC0C4C6AB4CC9";
const char *appSKey = "CCF9DE27B57151410DC78AEF0B3FB089";
const unsigned long interval = 30000; // 30 s interval to send message
unsigned long previousMillis = 0; // will store last time message sent
unsigned int counter = 0; // message counter
char myStr[50];
char outStr[255];
byte recvStatus = 0;
#define DEBUG_LED 7 // D7 - led
#define EN_LORA 2 // D2 - enable LDO @ 3V3
const sRFM_pins RFM_pins = {
.CS = 10, // RST - D9; CS - D10; MOSI - D11; MISO - D12; SCK - D13; DIO0 - D3; DIO1 - D4; DIO2 - D5; DIO5 - D6;
.RST = 9,
.DIO0 = 3,
.DIO1 = 4,
.DIO2 = 5,
.DIO5 = 6,
};
void setup() {
// Setup loraid access
Serial.begin(57600);
while(!Serial);
pinMode(EN_LORA,OUTPUT);
digitalWrite(EN_LORA,HIGH);
pinMode(DEBUG_LED,OUTPUT);
digitalWrite(DEBUG_LED,LOW);
if(!lora.init()){
Serial.println("LoRa module not found!");
while (1) {}
} else {
Serial.println("LoRa module found.");
}
// Set LoRaWAN Class change CLASS_A or CLASS_C
lora.setDeviceClass(CLASS_A);
// Set Data Rate
//lora.setDataRate(SF9BW125);
lora.setDataRate(SF7BW125);
// set channel to random
lora.setChannel(MULTI);
// Put ABP Key and DevAddress here
lora.setNwkSKey(nwkSKey);
lora.setAppSKey(appSKey);
lora.setDevAddr(devAddr);
}
void loop() {
// Check interval overflow
if(millis() - previousMillis > interval) {
digitalWrite(DEBUG_LED,HIGH);
previousMillis = millis();
sprintf(myStr, "Counter-%d", counter);
Serial.print("Sending: ");
Serial.println(myStr);
lora.sendUplink(myStr, strlen(myStr), 0, 1);
counter++;
digitalWrite(DEBUG_LED,LOW);
}
recvStatus = lora.readData(outStr);
if(recvStatus) {
Serial.println(outStr);
}
// Check Lora RX
lora.update();
}
from beelan-lorawan.
Hi @geologic
Which branch and region are you using?
from beelan-lorawan.
I'm using the master branch and region EU-868
from beelan-lorawan.
I tried the same code and everything seems to work fine. The only part of your code I can't test is all related to EN_LORA pin.
It sends and un link every 30 seconds incrementing the count as expected.
from beelan-lorawan.
Closing cause not activity
from beelan-lorawan.
Related Issues (20)
- Communication p2p HOT 1
- Soft WDT Reset on lora.sendUpLink() HOT 7
- Hello guy, I'm not able to send lora through SF12? Are there any errors here? HOT 12
- Stuck on joining network HOT 4
- .setChannel(<int>) doesn't appear to do anything HOT 17
- ElectronicCats HOT 4
- unable to join using OTAA HOT 5
- Can not send/receive data using OTAA Class-C HOT 35
- Getting ACK message for uplink message HOT 12
- Join procedure EU HOT 13
- Issue setting up correct pins for ESP8266 HOT 11
- Method to get DevAddr, NwkSKey and AppSKey HOT 3
- IN865 band HOT 7
- Poor ESP8266 support since 2.0.0 and up HOT 2
- What is What , RFM_pins? HOT 4
- how to downlink class c? HOT 2
- Periodically repeated downlink HOT 13
- DevNonce issue HOT 1
- How to send an keep time as short as possible? HOT 7
- Correct LoRaWAN version (TTN) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beelan-lorawan.