Reservoir module for Nano. More...
#include "Arduino.h"
#include "avr/wdt.h"
#include "avr/boot.h"
#include "printf.h"
#include "Thread.h"
#include "StaticThreadController.h"
#include "SPI.h"
#include "RF24.h"
#include "SerialLog.h"
#include "Settings.h"
#include "src/Modules/ReservoirModule.h"
#include "src/WirelessCommands_Reservoir.h"
Go to the source code of this file.
Functions | |
RF24 | Wireless (WirelessCEPin, WirelessCSNPin) |
void | setup () |
void | InitializeWireless () |
void | loop () |
void | run1sec () |
void | run5sec () |
void | run1min () |
void | getWirelessData () |
void | getWirelessStatus () |
time_t | updateTime () |
Variables | |
bool & | Debug = *new bool |
bool & | Metric = *new bool |
char | LongMessage [MaxLongTextLength] = "" |
Temp storage for assembling long messages (REST API, MQTT reporting) | |
char | ShortMessage [MaxShotTextLength] = "" |
Temp storage for assembling short text messages (Log entries, Error messages,etc) | |
char | CurrentTime [MaxWordLength] = "" |
Buffer for storing current time in text format. | |
void * | ReceivedMessage = malloc(WirelessPayloadSize) |
uint32_t | ReceivedMessageTimestamp = millis() |
HardwareSerial & | ArduinoSerial = Serial |
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Console) | |
Settings * | ModuleSettings |
ReservoirModule * | ReservoirMod1 |
Thread | OneSecThread = Thread() |
Thread | FiveSecThread = Thread() |
Thread | MinuteThread = Thread() |
Reservoir module for Nano.
To change the default pin layout / startup settings navigate to: Settings.h
Runs autonomously on an Arduino RF-Nano or Arduino Nano with an nRF24L01+ wireless transceiver.
Supports wireless data exchange with the Main module
Definition in file Gbox420_Nano_Reservoir.ino.
void getWirelessData | ( | ) |
Definition at line 133 of file Gbox420_Nano_Reservoir.ino.
void getWirelessStatus | ( | ) |
Definition at line 153 of file Gbox420_Nano_Reservoir.ino.
void InitializeWireless | ( | ) |
< Set the speed to slow - has longer range + No need for faster transmission, Other options: RF24_2MBPS, RF24_1MBPS
< RF24_CRC_8 for 8-bit or RF24_CRC_16 for 16-bit
< RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm, RF24_PA_HIGH=-6dBm, and RF24_PA_MAX=0dBm.
< The number of bytes in the payload. This implementation uses a fixed payload size for all transmissions
< Not necessary, startListening should switch back to normal power mode
< Dump all previously cached but unsent ACK messages from the TX FIFO buffer (Max 3 are saved)
< Dump all previously received messages from the RX FIFO buffer (Max 3 are saved)
< Reset timeout counter
Definition at line 79 of file Gbox420_Nano_Reservoir.ino.
void loop | ( | ) |
Definition at line 103 of file Gbox420_Nano_Reservoir.ino.
void run1min | ( | ) |
Definition at line 124 of file Gbox420_Nano_Reservoir.ino.
void run1sec | ( | ) |
Definition at line 112 of file Gbox420_Nano_Reservoir.ino.
void run5sec | ( | ) |
Definition at line 118 of file Gbox420_Nano_Reservoir.ino.
void setup | ( | ) |
time_t updateTime | ( | ) |
Definition at line 163 of file Gbox420_Nano_Reservoir.ino.
RF24 Wireless | ( | WirelessCEPin | , |
WirelessCSNPin | |||
) |
HardwareSerial& ArduinoSerial = Serial |
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Console)
Printing serial messages to the Arduino Serial output.
Uses templating to handle logging multiple variable types (int,float,char,bool..)
Functions implemented in header file due to: https://stackoverflow.com/questions/10632251/undefined-reference-to-template-function
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Console)
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Console)
Reference to the Arduino Serial
Definition at line 33 of file Gbox420_Nano_Reservoir.ino.
char CurrentTime[MaxWordLength] = "" |
Buffer for storing current time in text format.
Definition at line 28 of file Gbox420_Nano_Reservoir.ino.
bool& Debug = *new bool |
Definition at line 24 of file Gbox420_Nano_Reservoir.ino.
Thread FiveSecThread = Thread() |
Definition at line 40 of file Gbox420_Nano_Reservoir.ino.
char LongMessage[MaxLongTextLength] = "" |
Temp storage for assembling long messages (REST API, MQTT reporting)
Definition at line 26 of file Gbox420_Nano_Reservoir.ino.
bool& Metric = *new bool |
Definition at line 25 of file Gbox420_Nano_Reservoir.ino.
Thread MinuteThread = Thread() |
Definition at line 41 of file Gbox420_Nano_Reservoir.ino.
Settings* ModuleSettings |
Definition at line 34 of file Gbox420_Nano_Reservoir.ino.
StaticThreadController<3> ThreadControl& OneSecThread = Thread() |
Definition at line 39 of file Gbox420_Nano_Reservoir.ino.
void* ReceivedMessage = malloc(WirelessPayloadSize) |
Definition at line 29 of file Gbox420_Nano_Reservoir.ino.
uint32_t ReceivedMessageTimestamp = millis() |
Definition at line 30 of file Gbox420_Nano_Reservoir.ino.
ReservoirModule* ReservoirMod1 |
Definition at line 35 of file Gbox420_Nano_Reservoir.ino.
char ShortMessage[MaxShotTextLength] = "" |
Temp storage for assembling short text messages (Log entries, Error messages,etc)
Definition at line 27 of file Gbox420_Nano_Reservoir.ino.