Added client config file

This commit is contained in:
Filip Znachor 2022-12-14 17:14:20 +01:00
parent 62e842433d
commit 33b6eaa641
2 changed files with 25 additions and 5 deletions

View file

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <time.h>
#include "Ubuntu_24px.h"
#include "config.h"
@ -28,10 +29,10 @@ void setupLoRaWAN() {
LoRaWAN.writeCMD("AT+IREBOOT=0\r\n");
delay(1000);
LoRaWAN.configOTTA(
"00bdea85badeedf1", // Device EUI
"00bdea85badeed01", // APP EUI
"00bdea85badeed0100bdea85badeed01", // APP KEY
"2" // Upload Download Mode
DEVICE_EUI,
APP_EUI,
APP_KEY,
UPLOAD_DOWNLOAD_MODE
);
LoRaWAN.waitMsg(1000);
@ -371,7 +372,7 @@ void addDeparture(String s) {
void loop() {
seconds = time(NULL);
if(seconds - lastMessage > 60) {
if(seconds - lastMessage > INACTIVITY_TIME) {
setupLoRaWAN();
}
if(seconds / 6 > lastUpdate) {

19
client/config.h Normal file
View file

@ -0,0 +1,19 @@
// NASTAVENÍ LORAWAN MODULU
// EUI zařízení
#define DEVICE_EUI "00bdea85badeedf1"
// EUI aplikace
#define APP_EUI "00bdea85badeed01"
// Klíč aplikace
#define APP_KEY "00bdea85badeed0100bdea85badeed01"
// Upload download mód
#define UPLOAD_DOWNLOAD_MODE "2"
// NASTAVENÍ MIKROKONTTROLÉRU
// Maximální neaktivita před spuštěním znovu připojení (ve vteřinách)
#define INACTIVITY_TIME 600