Weave LMIC into the main sketch, but its now made it too big :-/
This commit is contained in:
parent
6c6d210ed1
commit
b779d16690
4 changed files with 22 additions and 3 deletions
14
README.md
14
README.md
|
@ -15,6 +15,20 @@
|
||||||
- [Project box](https://smile.amazon.co.uk/waterproof-plastic-Enclosure-Power-junction-Grey/dp/B01JHBHNMA/) - if we can't 3D print one
|
- [Project box](https://smile.amazon.co.uk/waterproof-plastic-Enclosure-Power-junction-Grey/dp/B01JHBHNMA/) - if we can't 3D print one
|
||||||
- [TPL-5111](https://www.adafruit.com/product/3573) - also available from Pimoroni
|
- [TPL-5111](https://www.adafruit.com/product/3573) - also available from Pimoroni
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
Run `bash ./build setup` from the command line at the root of this repository.
|
||||||
|
|
||||||
|
### IoT Device
|
||||||
|
- Copy `settings.custom.cpp.example` to `settings.custom.cpp` and fill in the fields there
|
||||||
|
- Review `settings.h` to make sure it matches your setup
|
||||||
|
- Edit `iot/libraries/arduino-lmic/src/lmic/config.h`, and add the following to the bottom:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
#define DISABLE_PING
|
||||||
|
#define DISABLE_BEACONS
|
||||||
|
```
|
||||||
|
|
||||||
|
- Copy the folders in `iot/libraries` to your Arduino IDE libraries folder
|
||||||
|
|
||||||
## Useful Links
|
## Useful Links
|
||||||
- Entropy extraction from the watchdog timer vs the internal clock: https://github.com/taoyuan/Entropy
|
- Entropy extraction from the watchdog timer vs the internal clock: https://github.com/taoyuan/Entropy
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
#include "settings.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <TinyGPS++.h>
|
#include <TinyGPS++.h>
|
||||||
#include <SD.h>
|
#include <SD.h>
|
||||||
|
|
||||||
#include "settings.h"
|
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
// BAD PRACTICE: For some extremely strange reason, the Arduino IDE doesn't pick up random.cpp like it does our other source files - so we've got to explicitly include it here. If we had control over the build process (which we don't), we've use a Makefile here that handled this better.
|
// BAD PRACTICE: For some extremely strange reason, the Arduino IDE doesn't pick up random.cpp like it does our other source files - so we've got to explicitly include it here. If we had control over the build process (which we don't), we've use a Makefile here that handled this better.
|
||||||
#include "random.cpp"
|
#include "random.cpp"
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
#include "peripheral.h"
|
#include "peripheral.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
#include "transmission.h"
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
@ -55,8 +56,12 @@ void setup() {
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
// Activate the RFM95
|
// Activate the RFM95
|
||||||
peripheral_unsilence(PIN_SPI_CS_RFM95);
|
peripheral_switch(PIN_SPI_CS_SD, PIN_SPI_CS_RFM95);
|
||||||
|
|
||||||
|
uint8_t message[] = "testing";
|
||||||
|
|
||||||
|
transmit_init();
|
||||||
|
transmit_send(message, 7);
|
||||||
|
|
||||||
|
|
||||||
power_off(); // Doesn't return
|
power_off(); // Doesn't return
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
|
|
||||||
// Pin mapping - see settings.custom.cpp
|
// Pin mapping - see settings.custom.cpp
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
////////////// GPS //////////////
|
////////////// GPS //////////////
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|
|
@ -11,6 +11,7 @@ static bool is_sending_complete = false;
|
||||||
static osjob_t sendjob;
|
static osjob_t sendjob;
|
||||||
|
|
||||||
void transmit_init() {
|
void transmit_init() {
|
||||||
|
Serial.println(F("Initialising LMIC"));
|
||||||
// LMIC init
|
// LMIC init
|
||||||
os_init();
|
os_init();
|
||||||
// Reset the MAC state. Session and pending data transfers will be discarded.
|
// Reset the MAC state. Session and pending data transfers will be discarded.
|
||||||
|
|
Loading…
Reference in a new issue