[iot/main] Fix compilation errors
This commit is contained in:
parent
b9122f99f0
commit
18ba73c99b
6 changed files with 34 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
config.custom.h
|
config.custom.h
|
||||||
|
settings.custom.h
|
||||||
|
|
||||||
Reports/*.pdf
|
Reports/*.pdf
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ void gps_fetch();
|
||||||
* Call gps_fetch() first.
|
* Call gps_fetch() first.
|
||||||
* @return TinyGPSLocation The current location.
|
* @return TinyGPSLocation The current location.
|
||||||
*/
|
*/
|
||||||
TinyGPSLocation gps_info();
|
TinyGPSPlus gps_info();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ends the connection to the GPS device and puts it to sleep in order to save
|
* Ends the connection to the GPS device and puts it to sleep in order to save
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <lmic.h>
|
#include <lmic.h>
|
||||||
#include <hal/hal.h>
|
#include <hal/hal.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
// Global static variable that's used to detect when LMIC has finished doing it's thing
|
// Global static variable that's used to detect when LMIC has finished doing it's thing
|
||||||
static bool is_sending_complete = false;
|
static bool is_sending_complete = false;
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,4 @@ void radio_init();
|
||||||
* @param data The message to send.
|
* @param data The message to send.
|
||||||
* @param length The length of the given message.
|
* @param length The length of the given message.
|
||||||
*/
|
*/
|
||||||
void radio_send(byte* data, int length);
|
bool radio_send(byte* data, int length);
|
||||||
|
|
13
iot/main/settings.custom.h.example
Normal file
13
iot/main/settings.custom.h.example
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
// LoRaWAN NwkSKey, network session key
|
||||||
|
// This is the default Semtech key, which is used by the early prototype TTN
|
||||||
|
// network.
|
||||||
|
static const PROGMEM u1_t NWKSKEY[16] = { .... };
|
||||||
|
|
||||||
|
// LoRaWAN AppSKey, application session key
|
||||||
|
// This is the default Semtech key, which is used by the early prototype TTN
|
||||||
|
// network.
|
||||||
|
static const u1_t PROGMEM APPSKEY[16] = { ..... };
|
||||||
|
|
||||||
|
// LoRaWAN end-device address (DevAddr)
|
||||||
|
static const u4_t DEVADDR = 0x....; // <-- Change this address for every node!
|
|
@ -1,6 +1,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <arduino-lmic/src/hal/hal.h>
|
#include <lmic.h>
|
||||||
|
#include <hal/hal.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
|
||||||
|
#include "settings.custom.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the main settings file - customise it to match your setup.
|
||||||
|
* Don't forget that you need to take a copy of settings.custom.h.example as
|
||||||
|
* settings.custom.h, and fill in the private keys the program needs to talk
|
||||||
|
* over LORaWAN.
|
||||||
|
*/
|
||||||
|
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
////////////// Main //////////////
|
////////////// Main //////////////
|
||||||
|
@ -20,16 +31,17 @@
|
||||||
/// RFM95 ///
|
/// RFM95 ///
|
||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
|
// The SPI chip-select pin for the RFM 95
|
||||||
|
#define PIN_SPI_CS_RFM95 10
|
||||||
|
|
||||||
// Pin mapping
|
// Pin mapping
|
||||||
const lmic_pinmap lmic_pins = {
|
const lmic_pinmap lmic_pins = {
|
||||||
.nss = 10,
|
.nss = PIN_SPI_CS_RFM95,
|
||||||
.rxtx = LMIC_UNUSED_PIN,
|
.rxtx = LMIC_UNUSED_PIN,
|
||||||
.rst = 9,
|
.rst = 9,
|
||||||
.dio = {2, 6, 7},
|
.dio = {2, 6, 7},
|
||||||
};
|
};
|
||||||
|
|
||||||
// The SPI chip-select pin for the RFM 95
|
|
||||||
#define PIN_SPI_CS_RFM95 10
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
////////////// GPS //////////////
|
////////////// GPS //////////////
|
||||||
|
|
Loading…
Reference in a new issue