Browse Source

[iot/main] Fix compilation errors

master
Starbeamrainbowlabs 2 years ago
parent
commit
18ba73c99b
  1. 1
      .gitignore
  2. 2
      iot/main/gps.h
  3. 4
      iot/main/radio.cpp
  4. 2
      iot/main/radio.h
  5. 13
      iot/main/settings.custom.h.example
  6. 20
      iot/main/settings.h

1
.gitignore

@ -1,4 +1,5 @@
config.custom.h
settings.custom.h
Reports/*.pdf

2
iot/main/gps.h

@ -22,7 +22,7 @@ void gps_fetch();
* Call gps_fetch() first.
* @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

4
iot/main/radio.cpp

@ -1,9 +1,9 @@
#pragma once
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include "settings.h"
// Global static variable that's used to detect when LMIC has finished doing it's thing
static bool is_sending_complete = false;

2
iot/main/radio.h

@ -10,4 +10,4 @@ void radio_init();
* @param data The message to send.
* @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

@ -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!

20
iot/main/settings.h

@ -1,6 +1,17 @@
#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 //////////////
@ -20,16 +31,17 @@
/// RFM95 ///
/////////////
// The SPI chip-select pin for the RFM 95
#define PIN_SPI_CS_RFM95 10
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.nss = PIN_SPI_CS_RFM95,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
};
// The SPI chip-select pin for the RFM 95
#define PIN_SPI_CS_RFM95 10
/////////////////////////////////
////////////// GPS //////////////

Loading…
Cancel
Save