Documentazione del codice

The C++ API documentation is also available as doxgen documentation.

union addr16_t

Public Members

uint8_t *bptr
uint16_t *wptr
uint16_t word
uint8_t bytes[2]
struct bin_value_t

Public Members

uint16_t sample

last sample

uint16_t med

average values of observations

uint16_t sigma

standard deviation of observations

class BitBangedSPI

Public Functions

inline void begin()
inline void beginTransaction(SPISettings settings)
inline void end()
inline uint8_t transfer(uint8_t b)

Private Members

unsigned long pulseWidth
struct configuration_t
#include <i2c-leaf.h>

EEPROM saved configuration.

Public Members

uint8_t module_main_version

module main version

uint8_t module_configuration_version

module configuration version

uint8_t module_type

module type

uint8_t i2c_address

i2c address

bool is_oneshot

enable or disable oneshot mode

uint16_t leaf_calibration_threshold
uint8_t module_version

module version

bool is_continuous

enable or disable continuous mode

NOT USED enable or disable continuous mode.

uint16_t adc_voltage_max_panel
uint16_t adc_voltage_max_battery
float adc_voltage_offset_1
float adc_voltage_offset_2
float adc_voltage_min
float adc_voltage_max
float adc_calibration_offset[ADS1115_CHANNEL_COUNT]
float adc_calibration_gain[ADS1115_CHANNEL_COUNT]
float sensor_rad_max[ADS1115_CHANNEL_COUNT]
float sensor_voltage_max[ADS1115_CHANNEL_COUNT]
uint16_t tipping_bucket_time_ms

Tipping bucket time in milliseconds.

uint8_t rain_for_tip

How much mm of rain for one tip of tipping bucket rain gauge.

sensor_conf_t sensors[2]

sensors configurations

SensorDriver buffer for storing sensors parameter.

sensor_t sensors[SENSORS_MAX]

SensorDriver buffer for storing sensors parameter.

uint8_t sensors_count

configured sensors number

uint16_t report_seconds

seconds for report values

constantdata_t constantdata[USE_CONSTANTDATA_COUNT]

Constantdata buffer for storing constant station data parameter.

uint8_t constantdata_count

configured constantdata number

bool is_dhcp_enable

dhcp status

uint8_t ethernet_mac[ETHERNET_MAC_LENGTH]

ethernet mac

uint8_t ip[ETHERNET_IP_LENGTH]

ip address

uint8_t netmask[ETHERNET_IP_LENGTH]

netmask

uint8_t gateway[ETHERNET_IP_LENGTH]

gateway

uint8_t primary_dns[ETHERNET_IP_LENGTH]

primary dns

struct constantdata_t

Public Members

char btable[CONSTANTDATA_BTABLE_LENGTH]

table B code for constant station data

char value[CONSTANTDATA_VALUE_LENGTH]

value of constant station data

struct data_t

Public Members

int16_t sample_panel
int16_t sample_battery
int16_t avg_panel
int16_t avg_battery
int16_t sample
int16_t avg
struct db_data_t

Public Members

int id
frtosLogging *logger
Queue *dbqueue
Queue *mqttqueue
BinarySemaphore *recoverysemaphore
BinaryQueue *recoveryqueue
dbStatus_t *status
station_t *station
struct dbStatus_t

Public Members

status_e database

stato di funzionamento del DataBase

class dbThread : public Thread

Public Functions

dbThread(db_data_t *db_data)

Constructor to create a DB thread.

Parameters
  • db_data: data used by thread.

~dbThread()
virtual void Cleanup()

Protected Functions

virtual void Run()

Private Functions

bool doDb(const mqttMessage_t&)
int db_exec(const char*)
bool db_obsolete(bool &obsolete)
bool db_remove()
void db_setup()
bool data_purge(const bool flush, int messages)
bool data_recovery()
bool data_set_recovery()
bool db_restart()

Private Members

db_data_t *data
sqlite3 *db
uint8_t sqlite_memory[SQLITE_MEMORY]
bool sqlite_status
rpcRecovery_t rpcrecovery
File archiveFile

File for archive on SD-Card.

struct DIR

Public Members

WORD index
BYTE *fn
CLUST sclust
CLUST clust
DWORD sect
struct FatFileDesc

Public Members

uint32_t firstFatBlock
uint32_t dataBlock
uint8_t blocksPerCluster
struct FATFS

Public Members

BYTE fs_type
BYTE flag
BYTE csize
BYTE pad1
WORD n_rootdir
CLUST n_fatent
DWORD fatbase
DWORD dirbase
DWORD database
DWORD fptr
DWORD fsize
CLUST org_clust
CLUST curr_clust
DWORD dsect
struct FILINFO

Public Members

DWORD fsize
WORD fdate
WORD ftime
BYTE fattrib
char fname[13]
struct float_observation_t

Public Members

float med[OBSERVATION_COUNT]

buffer containing the mean values calculated on a one sample buffer respectively

uint16_t count

number of observations

float *read_ptr

reader pointer to buffer (read observations for calculate report value)

float *write_ptr

writer pointer to buffer (add new observation)

struct georef_t

Public Members

char lon[11]

longitudine in sessadecimale 5 decimali rappresentazione intera

char lat[11]

latitudine in sessadecimale 5 decimali rappresentazione intera

time_t timestamp

timestamp delle coordinate

cpp_freertos::MutexStandard *mutex

mutex per l'accesso ai dati

struct gps_data_t

Public Members

int id
frtosLogging *logger
gpsStatus_t *status
georef_t *georef
struct gpsStatus_t

Public Members

status_e receive

stato della ricezione dei dati per georeferenziazione

class gpsThread : public Thread

Public Functions

gpsThread(gps_data_t *gps_data)

Constructor to create a GPS thread.

Parameters
  • gps_data: data used by thread.

~gpsThread()
virtual void Cleanup()

Protected Functions

virtual void Run()

Private Functions

void GPS_SerialInit()
void doSerialNmea()

Private Members

gps_data_t *data
struct ihex_state

Public Members

ihex_address_t address
ihex_segment_t segment
ihex_flags_t flags
uint8_t line_length
uint8_t length
uint8_t data[IHEX_LINE_MAX_LENGTH + 1]
struct leaf_wetness_t
#include <i2c-leaf.h>

Leaf wetness data.

Public Members

uint32_t time

time in seconds that indicates wet leaf

struct measure_data_t

Public Members

int id
frtosLogging *logger
Queue *mqttqueue
Queue *dbqueue
measureStatus_t *status
station_t *station
summarydata_t *summarydata
MutexStandard *i2cmutex
georef_t *georef
sensor_t sensors[SENSORS_MAX]
uint8_t sensors_count
struct measureStatus_t

Public Members

status_e novalue

stato delle misurazioni

status_e sensor

stato dei sensori

status_e geodef

stato dei dati di georefenzazione per la pubblicazione

class measureThread : public Thread

Public Functions

measureThread(measure_data_t *measure_data)
~measureThread()
virtual void Cleanup()
void Begin()

Protected Functions

virtual void Run()

Private Functions

void reset_summary_data_in_progress()
void update_summary_data()
void doMeasure()
void enqueueMqttMessage(uint8_t i)
void get_summary_data_in_progress(uint8_t i)

Private Members

measure_data_t *data
summarydata_t summarydata_in_progress
SensorDriver *sd[SENSORS_MAX]
sensorManage sensorm[SENSORS_MAX]
uint8_t sensors_count
struct mqttMessage_t

Public Members

uint8_t sent
char topic[MQTT_ROOT_TOPIC_LENGTH + MQTT_SENSOR_TOPIC_LENGTH]
char payload[MQTT_MESSAGE_LENGTH]
struct observation_t
#include <i2c-opc.h>

Observations values for opc.

Observations values for temperature and humidity NOT USED / typedef struct { int32_t values[OBSERVATION_COUNT]; //!< buffer containing the mean values calculated on a one sample buffer respectively uint16_t count; //!< number of observations uint32_t *read_ptr; //!< reader pointer to buffer (read observations for calculate report value) uint32_t *write_ptr; //!< writer pointer to buffer (add new observation) } observation_t;.

/********************************************************************* TYPEDEF for Finite State Machine

struct param

Public Members

uint8_t devicecode
uint8_t revision
uint8_t progtype
uint8_t parmode
uint8_t polling
uint8_t selftimed
uint8_t lockbytes
uint8_t fusebytes
uint8_t flashpoll
uint16_t eeprompoll
uint16_t pagesize
uint16_t eepromsize
uint32_t flashsize
struct pm_value_t

Public Members

float sample

last sample

float med

average values of observations

float sigma

standard deviation of observations

struct publish_data_t

Public Members

int id
frtosLogging *logger
Queue *mqttqueue
Queue *dbqueue
BinaryQueue *recoveryqueue
publishStatus_t *status
station_t *station
WiFiClient *networkClient
struct publishStatus_t

Public Members

status_e connect

stato della connessione MQTT

status_e publish

stato della pubblicazione dati MQTT

class publishThread : public Thread

Public Functions

publishThread(publish_data_t *publish_data)
~publishThread()
virtual void Cleanup()

Protected Functions

virtual void Run()
bool mqttSubscribeRpc(char *comtopic)

Private Functions

bool mqttDisconnect()
bool mqttConnect(const bool cleanSession = true)
bool mqttPublish(const mqttMessage_t &mqtt_message, const bool retained)
bool publish_maint()
bool publish_constantdata()
void archive()
bool doPublish(mqttMessage_t &mqtt_message)

Private Members

publish_data_t *data
IPStack ipstack
MQTT::Client<IPStack, Countdown, MQTT_PACKET_SIZE, 1> mqttclient
uint8_t errorcount
struct readable_data_t
#include <i2c-leaf.h>

Readable data through i2c bus.

Public Members

uint8_t module_type

module type

module version

uint8_t module_main_version

module main version

uint8_t module_minor_version

module minor version

leaf_wetness_t leaf_wetness

leaf wetness data for report

uint8_t module_version

module type

float pm_sample[OPCXX_PM_LENGTH]
float pm_med[OPCXX_PM_LENGTH]
float pm_sigma[OPCXX_PM_LENGTH]
uint16_t bins_med[OPCN3_BINS_LENGTH]
uint16_t bins_sigma[OPCN3_BINS_LENGTH]
pm_value_t pm1

pm1 data for report

pm_value_t pm25

pm25 data for report

pm_value_t pm10

pm10 data for report

bin_value_t bins[OPC_BINS_LENGTH]

bins array data for report

data_t power
data_t solar_radiation
rain_t rain

rain data

value_t temperature

temperature data for report

value_t humidity

humidity data for report

report_t thr
report_t wind
struct report_t
#include <i2c-power.h>

report data.

Public Members

float rain_tips
float rain
float sample_temperature
float sample_humidity
float ist_temperature
float ist_humidity
float min_temperature
float min_humidity
float avg_temperature
float avg_humidity
float max_temperature
float max_humidity
float sigma_temperature
float sigma_humidity
uint16_t sample_speed
uint16_t sample_direction
uint16_t vavg10_speed
uint16_t vavg10_direction
uint16_t vavg_speed
uint16_t vavg_direction
uint16_t peak_gust_speed
uint16_t long_gust_speed
uint16_t avg_speed
uint8_t class_1
uint8_t class_2
uint8_t class_3
uint8_t class_4
uint8_t class_5
uint8_t class_6
uint16_t peak_gust_direction
uint16_t long_gust_direction
struct rpcRecovery_t

Public Members

char dtstart[20]
char dtend[20]
struct sample_t
#include <i2c-opc.h>

Samples values for measured opc data.

samples data

Public Members

float values

buffer containing the measured samples

samples buffer

uint8_t count

number of good samples

samples counter

uint8_t error_count

number of bad samples

int32_t values[SAMPLES_COUNT_MAX]

samples buffer

uint16_t count

samples counter

int32_t *read_ptr

reader pointer

int32_t *write_ptr

writer pointer

float value[SAMPLES_COUNT]

samples buffer

float *read_ptr

reader pointer

float *write_ptr

writer pointer

struct sensor_conf_t

Public Members

char type[4]

sensor type

uint8_t i2c_address

i2c address of sensor

struct sensor_t
#include <i2c-th.h>

sensors configuration.

Public Functions

inline sensor_t()

Public Members

char driver[SENSORDRIVER_DRIVER_LEN]
int node
char type[SENSORDRIVER_TYPE_LEN]
int address
char timerange[SENSORDRIVER_META_LEN]
char level[SENSORDRIVER_META_LEN]
struct sensordata_t
#include <sensor_config.h>

constant station data (station name, station height ...) parameters.

class SPISettings

Public Functions

inline SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)
inline uint32_t getClockFreq() const

Private Members

uint32_t clockFreq
struct station_t

Public Functions

inline station_t()

Public Members

char longitude[11]

longitudine in sessadecimale 5 decimali rappresentazione intera

char latitude[11]

latitudine in sessadecimale 5 decimali rappresentazione intera

char network[31]

rete osservativa della stazione

char ident[10]

identificativo per stazioni mobili

char server[41]

server RMAP

char ntp_server[41]

server NTP

char mqtt_server[41]

broker MQTT

int sampletime

intervallo tra le misurazioni in secondi

char user[10]

utente

char password[31]

password

char stationslug[31]

nome sintetico della stazione

char boardslug[31]

nome sintetico della board

char mqttrootpath[10]

radice del topic MQTT per i dati

char mqttmaintpath[10]

radice del topic MQTT per i dati amministrativi

constantdata_t constantdata[MAX_CONSTANTDATA_COUNT]

Constantdata buffer for storing constant station data parameter (metadati)

uint8_t constantdata_count

configured constantdata number

struct stimawifiStatus_t

Public Members

measureStatus_t measure

Stati relativi al thread di misura.

publishStatus_t publish

Stati relativi al thread di pubblicazione.

udpStatus_t udp

Stati relativi al thread di ricezione UDP dei dati di georeferenziazione.

gpsStatus_t gps

Stati relativi al thread di ricezione GPS (porta seriale) dei dati di georeferenziazione.

dbStatus_t db

Stati relativi al thread di gestione del DataBase.

struct summarydata_t

Public Functions

inline summarydata_t()

Public Members

float temperature
int humidity
int pm2
int pm10
int co2
struct udp_data_t

Public Members

int id
frtosLogging *logger
udpStatus_t *status
georef_t *georef
struct udpStatus_t

Public Members

status_e receive

stato della ricezione dei dati per georeferenziazione

class udpThread : public Thread

Public Functions

udpThread(udp_data_t *udp_data)

Constructor to create a UDP thread.

Parameters
  • udp_data: data used by thread.

~udpThread()
virtual void Cleanup()

Protected Functions

virtual void Run()

Private Functions

void doUdp()

Private Members

udp_data_t *data
struct uint16_observation_t

Public Members

uint16_t med[OBSERVATION_COUNT]

buffer containing the mean values calculated on a one sample buffer respectively

uint16_t count

number of observations

uint16_t *read_ptr

reader pointer to buffer (read observations for calculate report value)

uint16_t *write_ptr

writer pointer to buffer (add new observation)

struct writable_data_t
#include <i2c-leaf.h>

Writable data through i2c bus.

Public Members

uint8_t i2c_address

i2c address

bool is_oneshot

enable or disable oneshot mode

uint16_t leaf_calibration_threshold
bool is_continuous

enable or disable continuous mode

uint16_t adc_voltage_max_panel
uint16_t adc_voltage_max_battery
float adc_calibration_offset[ADS1115_CHANNEL_COUNT]
float adc_calibration_gain[ADS1115_CHANNEL_COUNT]
float sensor_voltage_max[ADS1115_CHANNEL_COUNT]
float sensor_rad_max[ADS1115_CHANNEL_COUNT]
uint16_t tipping_bucket_time_ms

Tipping bucket time in milliseconds.

uint8_t rain_for_tip

How much mm of rain for one tip of tipping bucket rain gauge.

sensor_conf_t sensors[2]

sensors configurations

float adc_voltage_offset_1
float adc_voltage_offset_2
float adc_voltage_min
float adc_voltage_max
namespace cpp_freertos
file index.md
file ArduinoISP.ino
#include "Arduino.h"

Defines

PROG_FLICKER
SPI_CLOCK
RESET
LED_HB
LED_ERR
LED_PMODE
PIN_MOSI
PIN_MISO
PIN_SCK
SERIAL
BAUDRATE
HWVER
SWMAJ
SWMIN
STK_OK
STK_FAILED
STK_UNKNOWN
STK_INSYNC
STK_NOSYNC
CRC_EOP
SPI_MODE0
beget16(addr)
PTIME
EECHUNK

Typedefs

typedef struct param parameter

Functions

void pulse(int pin, int times)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void heartbeat()
void reset_target(bool reset)
void loop(void)

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

uint8_t getch()
void fill(int n)
void prog_lamp(int state)
uint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
void empty_reply()
void breply(uint8_t b)
void get_version(uint8_t c)
void set_parameters()
void start_pmode()
void end_pmode()
void universal()
void flash(uint8_t hilo, unsigned int addr, uint8_t data)
void commit(unsigned int addr)
unsigned int current_page()
void write_flash(int length)
uint8_t write_flash_pages(int length)
uint8_t write_eeprom(unsigned int length)
uint8_t write_eeprom_chunk(unsigned int start, unsigned int length)
void program_page()
uint8_t flash_read(uint8_t hilo, unsigned int addr)
char flash_read_page(int length)
char eeprom_read_page(int length)
void read_page()
void read_signature()
void avrisp()

Variables

static BitBangedSPI SPI
int ISPError = 0
int pmode = 0
unsigned int here
uint8_t buff[256]
parameter param
uint8_t hbval = 128
int8_t hbdelta = 8
static bool rst_active_high
file baudcheck.c

Variables

bpsx =BAUD_RATEbps=${bpsx/L/}bps=${bps/U/}fcpux=F_CPUfcpu=${fcpux/L/}fcpu=${fcpu/U/}BAUD_SETTING=$(( ( ($fcpu + $bps * 4) / (($bps * 8))) - 1 ))BAUD_ACTUAL=$(( ($fcpu/(8 * (($BAUD_SETTING)+1))) ))BAUD_ERROR=$(( (( 100*($BAUD_ACTUAL - $bps) ) / $bps) ))ERR_TS=$(( ((( 1000*($BAUD_ACTUAL - $bps) ) / $bps) - $BAUD_ERROR * 10) ))ERR_TENTHS=$(( ERR_TS > 0 ? ERR_TS: -ERR_TS ))echo BAUD RATE CHECK: Desired: $bps
Real __pad0__
Real UBRRL = $BAUD_SETTING
file baudcheck.c

Variables

bpsx =BAUD_RATEbps=${bpsx/L/}bps=${bps/U/}fcpux=F_CPUfcpu=${fcpux/L/}fcpu=${fcpu/U/}BAUD_SETTING=$(( ( ($fcpu + $bps * 4) / (($bps * 8))) - 1 ))BAUD_ACTUAL=$(( ($fcpu/(8 * (($BAUD_SETTING)+1))) ))BAUD_ERROR=$(( (( 100*($BAUD_ACTUAL - $bps) ) / $bps) ))ERR_TS=$(( ((( 1000*($BAUD_ACTUAL - $bps) ) / $bps) - $BAUD_ERROR * 10) ))ERR_TENTHS=$(( ERR_TS > 0 ? ERR_TS: -ERR_TS ))echo BAUD RATE CHECK: Desired: $bps
Real __pad0__
Real UBRRL = $BAUD_SETTING
file boot.h
#include <avr/eeprom.h>#include <avr/io.h>#include <inttypes.h>#include <limits.h>

Defines

BOOTLOADER_SECTION

Used to declare a function or variable to be placed into a new section called .bootloader. This section and its contents can then be relocated to any address (such as the bootloader NRWW area) at link-time.

__COMMON_ASB
__COMMON_ASRE
BLB12
BLB11
BLB02
BLB01
boot_spm_interrupt_enable()

Enable the SPM interrupt.

boot_spm_interrupt_disable()

Disable the SPM interrupt.

boot_is_spm_interrupt()

Check if the SPM interrupt is enabled.

boot_rww_busy()

Check if the RWW section is busy.

boot_spm_busy()

Check if the SPM instruction is busy.

boot_spm_busy_wait()

Wait while the SPM instruction is busy.

__BOOT_PAGE_ERASE
__BOOT_PAGE_WRITE
__BOOT_PAGE_FILL
__BOOT_RWW_ENABLE
__BOOT_LOCK_BITS_SET
__boot_page_fill_short(address, data)
__boot_page_fill_normal(address, data)
__boot_page_fill_alternate(address, data)
__boot_page_fill_extended(address, data)
__boot_page_fill_extended_short(address, data)
__boot_page_erase_short(address)
__boot_page_erase_normal(address)
__boot_page_erase_alternate(address)
__boot_page_erase_extended(address)
__boot_page_erase_extended_short(address)
__boot_page_write_short(address)
__boot_page_write_normal(address)
__boot_page_write_alternate(address)
__boot_page_write_extended(address)
__boot_page_write_extended_short(address)
__boot_rww_enable_short()
__boot_rww_enable()
__boot_rww_enable_alternate()
__boot_lock_bits_set_short(lock_bits)
__boot_lock_bits_set(lock_bits)
__boot_lock_bits_set_alternate(lock_bits)
GET_LOW_FUSE_BITS

address to read the low fuse bits, using boot_lock_fuse_bits_get

GET_LOCK_BITS

address to read the lock bits, using boot_lock_fuse_bits_get

GET_EXTENDED_FUSE_BITS

address to read the extended fuse bits, using boot_lock_fuse_bits_get

GET_HIGH_FUSE_BITS

address to read the high fuse bits, using boot_lock_fuse_bits_get

boot_lock_fuse_bits_get_short(address)
boot_lock_fuse_bits_get(address)

Read the lock or fuse bits at address.

Parameter address can be any of GET_LOW_FUSE_BITS, GET_LOCK_BITS, GET_EXTENDED_FUSE_BITS, or GET_HIGH_FUSE_BITS.

Note

The lock and fuse bits returned are the physical values, i.e. a bit returned as 0 means the corresponding fuse or lock bit is programmed.

__BOOT_SIGROW_READ
boot_signature_byte_get_short(addr)
boot_signature_byte_get(addr)

Read the Signature Row byte at address. For some MCU types, this function can also retrieve the factory-stored oscillator calibration bytes.

Parameter address can be 0-0x1f as documented by the datasheet.

Note

The values are MCU type dependent.

boot_page_fill(address, data)

Fill the bootloader temporary page buffer for flash address with data word.

Note

The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address.

boot_page_erase(address)

Erase the flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_page_write(address)

Write the bootloader temporary page buffer to flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_rww_enable()

Enable the Read-While-Write memory section.

boot_lock_bits_set(lock_bits)

Set the bootloader lock bits.

For example, to disallow the SPM instruction from writing to the Boot Loader memory section of flash, you would use this macro as such:

Note

In this context, a 'set bit' will be written to a zero value. Note also that only BLBxx bits can be programmed by this command.

Parameters
  • lock_bits: A mask of which Boot Loader Lock Bits to set.

boot_lock_bits_set (_BV (BLB11));

Note

Like any lock bits, the Boot Loader Lock Bits, once set, cannot be cleared again except by a chip erase which will in turn also erase the boot loader itself.

boot_page_fill_safe(address, data)

Same as boot_page_fill() except it waits for eeprom and spm operations to complete before filling the page.

boot_page_erase_safe(address)

Same as boot_page_erase() except it waits for eeprom and spm operations to complete before erasing the page.

boot_page_write_safe(address)

Same as boot_page_write() except it waits for eeprom and spm operations to complete before writing the page.

boot_rww_enable_safe()

Same as boot_rww_enable() except waits for eeprom and spm operations to complete before enabling the RWW mameory.

boot_lock_bits_set_safe(lock_bits)

Same as boot_lock_bits_set() except waits for eeprom and spm operations to complete before setting the lock bits.

file boot.h
#include <avr/eeprom.h>#include <avr/io.h>#include <inttypes.h>#include <limits.h>

Defines

BOOTLOADER_SECTION

Used to declare a function or variable to be placed into a new section called .bootloader. This section and its contents can then be relocated to any address (such as the bootloader NRWW area) at link-time.

__COMMON_ASB
__COMMON_ASRE
BLB12
BLB11
BLB02
BLB01
boot_spm_interrupt_enable()

Enable the SPM interrupt.

boot_spm_interrupt_disable()

Disable the SPM interrupt.

boot_is_spm_interrupt()

Check if the SPM interrupt is enabled.

boot_rww_busy()

Check if the RWW section is busy.

boot_spm_busy()

Check if the SPM instruction is busy.

boot_spm_busy_wait()

Wait while the SPM instruction is busy.

__BOOT_PAGE_ERASE
__BOOT_PAGE_WRITE
__BOOT_PAGE_FILL
__BOOT_RWW_ENABLE
__BOOT_LOCK_BITS_SET
__boot_page_fill_short(address, data)
__boot_page_fill_normal(address, data)
__boot_page_fill_alternate(address, data)
__boot_page_fill_extended(address, data)
__boot_page_fill_extended_short(address, data)
__boot_page_erase_short(address)
__boot_page_erase_normal(address)
__boot_page_erase_alternate(address)
__boot_page_erase_extended(address)
__boot_page_erase_extended_short(address)
__boot_page_write_short(address)
__boot_page_write_normal(address)
__boot_page_write_alternate(address)
__boot_page_write_extended(address)
__boot_page_write_extended_short(address)
__boot_rww_enable_short()
__boot_rww_enable()
__boot_rww_enable_alternate()
__boot_lock_bits_set_short(lock_bits)
__boot_lock_bits_set(lock_bits)
__boot_lock_bits_set_alternate(lock_bits)
GET_LOW_FUSE_BITS

address to read the low fuse bits, using boot_lock_fuse_bits_get

GET_LOCK_BITS

address to read the lock bits, using boot_lock_fuse_bits_get

GET_EXTENDED_FUSE_BITS

address to read the extended fuse bits, using boot_lock_fuse_bits_get

GET_HIGH_FUSE_BITS

address to read the high fuse bits, using boot_lock_fuse_bits_get

boot_lock_fuse_bits_get_short(address)
boot_lock_fuse_bits_get(address)

Read the lock or fuse bits at address.

Parameter address can be any of GET_LOW_FUSE_BITS, GET_LOCK_BITS, GET_EXTENDED_FUSE_BITS, or GET_HIGH_FUSE_BITS.

Note

The lock and fuse bits returned are the physical values, i.e. a bit returned as 0 means the corresponding fuse or lock bit is programmed.

__BOOT_SIGROW_READ
boot_signature_byte_get_short(addr)
boot_signature_byte_get(addr)

Read the Signature Row byte at address. For some MCU types, this function can also retrieve the factory-stored oscillator calibration bytes.

Parameter address can be 0-0x1f as documented by the datasheet.

Note

The values are MCU type dependent.

boot_page_fill(address, data)

Fill the bootloader temporary page buffer for flash address with data word.

Note

The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address.

boot_page_erase(address)

Erase the flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_page_write(address)

Write the bootloader temporary page buffer to flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_rww_enable()

Enable the Read-While-Write memory section.

boot_lock_bits_set(lock_bits)

Set the bootloader lock bits.

For example, to disallow the SPM instruction from writing to the Boot Loader memory section of flash, you would use this macro as such:

Note

In this context, a 'set bit' will be written to a zero value. Note also that only BLBxx bits can be programmed by this command.

Parameters
  • lock_bits: A mask of which Boot Loader Lock Bits to set.

boot_lock_bits_set (_BV (BLB11));

Note

Like any lock bits, the Boot Loader Lock Bits, once set, cannot be cleared again except by a chip erase which will in turn also erase the boot loader itself.

boot_page_fill_safe(address, data)

Same as boot_page_fill() except it waits for eeprom and spm operations to complete before filling the page.

boot_page_erase_safe(address)

Same as boot_page_erase() except it waits for eeprom and spm operations to complete before erasing the page.

boot_page_write_safe(address)

Same as boot_page_write() except it waits for eeprom and spm operations to complete before writing the page.

boot_rww_enable_safe()

Same as boot_rww_enable() except waits for eeprom and spm operations to complete before enabling the RWW mameory.

boot_lock_bits_set_safe(lock_bits)

Same as boot_lock_bits_set() except waits for eeprom and spm operations to complete before setting the lock bits.

file diskio.c
#include "pff/src/pff.h"#include "pff/src/diskio.h"

Defines

CMD0
CMD1
ACMD41
CMD8
CMD16
CMD17
CMD24
CMD55
CMD58
CT_MMC
CT_SD1
CT_SD2
CT_BLOCK

Functions

void init_spi(void)

Init SPI library.

Return

void.

void deselect(void)
void select(void)
void xmit_spi(BYTE d)
BYTE rcv_spi(void)
void dly_100us(void)
static BYTE send_cmd(BYTE cmd, DWORD arg)
DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offset, UINT count)

Variables

static BYTE CardType
file diskio.c
#include "diskio.h"

Functions

DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offset, UINT count)
DRESULT disk_writep(BYTE *buff, DWORD sc)
file diskio.c
#include "pff/src/pff.h"#include "pff/src/diskio.h"

Defines

CMD0
CMD1
ACMD41
CMD8
CMD16
CMD17
CMD24
CMD55
CMD58
CT_MMC
CT_SD1
CT_SD2
CT_BLOCK

Functions

void init_spi(void)

Init SPI library.

Return

void.

void deselect(void)
void select(void)
void xmit_spi(BYTE d)
BYTE rcv_spi(void)
void dly_100us(void)
static BYTE send_cmd(BYTE cmd, DWORD arg)
DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offset, UINT count)

Variables

static BYTE CardType
file diskio.c
#include "diskio.h"

Functions

DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offset, UINT count)
DRESULT disk_writep(BYTE *buff, DWORD sc)
file optiboot.c
#include <inttypes.h>#include <avr/io.h>#include <avr/pgmspace.h>#include <avr/eeprom.h>#include <string.h>#include "pff/src/pff.h"#include "boot.h"#include "pin_defs.h"#include "stk500.h"

Defines

FUNC_READ
FUNC_WRITE
OPTIBOOT_MAJVER
OPTIBOOT_MINVER
OPTIBOOT_CUSTOMVER
PGM_READ_BYTE(x)
UART_REPORT
LED_START_FLASHES
BAUD_RATE
UART
BAUD_SETTING
BAUD_ACTUAL
BAUD_ERROR
WATCHDOG_OFF
WATCHDOG_16MS
WATCHDOG_32MS
WATCHDOG_64MS
WATCHDOG_125MS
WATCHDOG_250MS
WATCHDOG_500MS
WATCHDOG_1S
WATCHDOG_2S
WATCHDOG_4S
WATCHDOG_8S
GETLENGTH(len)
RAMSTART
buff
appstart_vec

Functions

unsigned const int __attribute__ ((section(".version")))
static uint8_t pagecmp()
uint8_t doFlash()
void checkFile()
void UART_puts(const char *str)
void UART_newline(void)
void UART_putnibble(uint8_t c)
void UART_puthex(uint8_t c)
void UART_puthex16(uint16_t n)
void UART_puthex32(uint32_t n)
void UART_putsP(const char *str, uint16_t n)
int main(void)
void putch(char ch)
uint8_t getch(void)
void getNch(uint8_t count)
void verifySpace()
void watchdogReset()
void watchdogConfig(uint8_t x)
void appStart(uint8_t rstFlags)
static inline void writebuffer(int8_t memtype, uint8_t *mybuff, uint16_t address, pagelen_t len)
static inline void read_mem(uint8_t memtype, uint16_t address, pagelen_t length)

Variables

const char filename[13] = "FIRMWARE.BIN\0"
file optiboot.c
#include <inttypes.h>#include <avr/io.h>#include <avr/pgmspace.h>#include <avr/eeprom.h>#include <string.h>#include "pff/src/pff.h"#include "ihex/kk_ihex_read.h"#include "boot.h"#include "pin_defs.h"#include "stk500.h"

Defines

FUNC_READ
FUNC_WRITE
OPTIBOOT_MAJVER
OPTIBOOT_MINVER
OPTIBOOT_CUSTOMVER
PGM_READ_BYTE(x)
UART_REPORT
LED_START_FLASHES
BAUD_RATE
UART
BAUD_SETTING
BAUD_ACTUAL
BAUD_ERROR
WATCHDOG_OFF
WATCHDOG_16MS
WATCHDOG_32MS
WATCHDOG_64MS
WATCHDOG_125MS
WATCHDOG_250MS
WATCHDOG_500MS
WATCHDOG_1S
WATCHDOG_2S
WATCHDOG_4S
WATCHDOG_8S
GETLENGTH(len)
RAMSTART
buff
appstart_vec

Functions

unsigned const int __attribute__ ((section(".version")))
void write_flash_page()
static uint8_t pagecmp()
uint8_t doFlash()
void checkFile()
void UART_puts(const char *str)
void UART_newline(void)
void UART_putnibble(uint8_t c)
void UART_puthex(uint8_t c)
void UART_puthex16(uint16_t n)
void UART_puthex32(uint32_t n)
void UART_putsP(const char *str, uint16_t n)
int main(void)
void putch(char ch)
uint8_t getch(void)
void getNch(uint8_t count)
void verifySpace()
void watchdogReset()
void watchdogConfig(uint8_t x)
void appStart(uint8_t rstFlags)
static inline void writebuffer(int8_t memtype, uint8_t *mybuff, uint16_t address, pagelen_t len)
static inline void read_mem(uint8_t memtype, uint16_t address, pagelen_t length)

Variables

const char filename[13] = "FIRMWARE.BIN\0"
file diskio.h
#include "integer.h"

Defines

STA_NOINIT
STA_NODISK

Typedefs

typedef BYTE DSTATUS

Enums

enum DRESULT

Values:

enumerator RES_OK
enumerator RES_ERROR
enumerator RES_NOTRDY
enumerator RES_PARERR
enumerator RES_OK
enumerator RES_ERROR
enumerator RES_NOTRDY
enumerator RES_PARERR

Functions

DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offser, UINT count)
DRESULT disk_writep(const BYTE *buff, DWORD sc)
file diskio.h
#include "integer.h"

Defines

STA_NOINIT
STA_NODISK

Typedefs

typedef BYTE DSTATUS

Enums

enum DRESULT

Values:

enumerator RES_OK
enumerator RES_ERROR
enumerator RES_NOTRDY
enumerator RES_PARERR
enumerator RES_OK
enumerator RES_ERROR
enumerator RES_NOTRDY
enumerator RES_PARERR

Functions

DSTATUS disk_initialize(void)
DRESULT disk_readp(BYTE *buff, DWORD sector, UINT offser, UINT count)
DRESULT disk_writep(const BYTE *buff, DWORD sc)
file integer.h

Typedefs

typedef unsigned char BYTE
typedef short SHORT
typedef unsigned short WORD
typedef unsigned short WCHAR
typedef int INT
typedef unsigned int UINT
typedef long LONG
typedef unsigned long DWORD
file integer.h

Typedefs

typedef unsigned char BYTE
typedef short SHORT
typedef unsigned short WORD
typedef unsigned short WCHAR
typedef int INT
typedef unsigned int UINT
typedef long LONG
typedef unsigned long DWORD
file pff.c
#include "pff.h"#include "diskio.h"

Defines

_FS_32ONLY
ABORT(err)
_EXCVT
IsUpper(c)
IsLower(c)
IsDBCS1(c)
IsDBCS2(c)
BS_jmpBoot
BS_OEMName
BPB_BytsPerSec
BPB_SecPerClus
BPB_RsvdSecCnt
BPB_NumFATs
BPB_RootEntCnt
BPB_TotSec16
BPB_Media
BPB_FATSz16
BPB_SecPerTrk
BPB_NumHeads
BPB_HiddSec
BPB_TotSec32
BS_55AA
BS_DrvNum
BS_BootSig
BS_VolID
BS_VolLab
BS_FilSysType
BPB_FATSz32
BPB_ExtFlags
BPB_FSVer
BPB_RootClus
BPB_FSInfo
BPB_BkBootSec
BS_DrvNum32
BS_BootSig32
BS_VolID32
BS_VolLab32
BS_FilSysType32
MBR_Table
DIR_Name
DIR_Attr
DIR_NTres
DIR_CrtTime
DIR_CrtDate
DIR_FstClusHI
DIR_WrtTime
DIR_WrtDate
DIR_FstClusLO
DIR_FileSize

Functions

static void mem_set(void *dst, int val, int cnt)
static int mem_cmp(const void *dst, const void *src, int cnt)
static CLUST get_fat(CLUST clst)
static DWORD clust2sect(CLUST clst)
static CLUST get_clust(BYTE *dir)
static FRESULT dir_rewind(DIR *dj)
static FRESULT dir_next(DIR *dj)
static FRESULT dir_find(DIR *dj, BYTE *dir)
static FRESULT create_name(DIR *dj, const char **path)
static FRESULT follow_path(DIR *dj, BYTE *dir, const char *path)
static BYTE check_fs(BYTE *buf, DWORD sect)
FRESULT pf_mount(FATFS *fs)
FRESULT pf_open(const char *path)
FRESULT pf_read(void *buff, UINT btr)

Variables

static FATFS *FatFs
file pff.c
#include "pff.h"#include "diskio.h"

Defines

_FS_32ONLY
ABORT(err)
_EXCVT
IsUpper(c)
IsLower(c)
IsDBCS1(c)
IsDBCS2(c)
BS_jmpBoot
BS_OEMName
BPB_BytsPerSec
BPB_SecPerClus
BPB_RsvdSecCnt
BPB_NumFATs
BPB_RootEntCnt
BPB_TotSec16
BPB_Media
BPB_FATSz16
BPB_SecPerTrk
BPB_NumHeads
BPB_HiddSec
BPB_TotSec32
BS_55AA
BS_DrvNum
BS_BootSig
BS_VolID
BS_VolLab
BS_FilSysType
BPB_FATSz32
BPB_ExtFlags
BPB_FSVer
BPB_RootClus
BPB_FSInfo
BPB_BkBootSec
BS_DrvNum32
BS_BootSig32
BS_VolID32
BS_VolLab32
BS_FilSysType32
MBR_Table
DIR_Name
DIR_Attr
DIR_NTres
DIR_CrtTime
DIR_CrtDate
DIR_FstClusHI
DIR_WrtTime
DIR_WrtDate
DIR_FstClusLO
DIR_FileSize

Functions

static void mem_set(void *dst, int val, int cnt)
static int mem_cmp(const void *dst, const void *src, int cnt)
static CLUST get_fat(CLUST clst)
static DWORD clust2sect(CLUST clst)
static CLUST get_clust(BYTE *dir)
static FRESULT dir_rewind(DIR *dj)
static FRESULT dir_next(DIR *dj)
static FRESULT dir_find(DIR *dj, BYTE *dir)
static FRESULT create_name(DIR *dj, const char **path)
static FRESULT follow_path(DIR *dj, BYTE *dir, const char *path)
static BYTE check_fs(BYTE *buf, DWORD sect)
FRESULT pf_mount(FATFS *fs)
FRESULT pf_open(const char *path)
FRESULT pf_read(void *buff, UINT btr)

Variables

static FATFS *FatFs
file pff.h
#include "integer.h"#include "pffconf.h"

Defines

_PFATFS
CLUST
FA_OPENED
FA_WPRT
FA__WIP
FS_FAT12
FS_FAT16
FS_FAT32
AM_RDO
AM_HID
AM_SYS
AM_VOL
AM_LFN
AM_DIR
AM_ARC
AM_MASK
LD_WORD(ptr)
LD_DWORD(ptr)
ST_WORD(ptr, val)
ST_DWORD(ptr, val)

Enums

enum FRESULT

Values:

enumerator FR_OK
enumerator FR_DISK_ERR
enumerator FR_NOT_READY
enumerator FR_NO_FILE
enumerator FR_NOT_OPENED
enumerator FR_NOT_ENABLED
enumerator FR_NO_FILESYSTEM
enumerator FR_OK
enumerator FR_DISK_ERR
enumerator FR_NOT_READY
enumerator FR_NO_FILE
enumerator FR_NOT_OPENED
enumerator FR_NOT_ENABLED
enumerator FR_NO_FILESYSTEM

Functions

FRESULT pf_mount(FATFS *fs)
FRESULT pf_open(const char *path)
FRESULT pf_read(void *buff, UINT btr)
FRESULT pf_write(const void *buff, UINT btw, UINT *bw)
FRESULT pf_lseek(DWORD ofs)
FRESULT pf_opendir(DIR *dj, const char *path)
FRESULT pf_readdir(DIR *dj, FILINFO *fno)
file pff.h
#include "integer.h"#include "pffconf.h"

Defines

_PFATFS
CLUST
FA_OPENED
FA_WPRT
FA__WIP
FS_FAT12
FS_FAT16
FS_FAT32
AM_RDO
AM_HID
AM_SYS
AM_VOL
AM_LFN
AM_DIR
AM_ARC
AM_MASK
LD_WORD(ptr)
LD_DWORD(ptr)
ST_WORD(ptr, val)
ST_DWORD(ptr, val)

Enums

enum FRESULT

Values:

enumerator FR_OK
enumerator FR_DISK_ERR
enumerator FR_NOT_READY
enumerator FR_NO_FILE
enumerator FR_NOT_OPENED
enumerator FR_NOT_ENABLED
enumerator FR_NO_FILESYSTEM
enumerator FR_OK
enumerator FR_DISK_ERR
enumerator FR_NOT_READY
enumerator FR_NO_FILE
enumerator FR_NOT_OPENED
enumerator FR_NOT_ENABLED
enumerator FR_NO_FILESYSTEM

Functions

FRESULT pf_mount(FATFS *fs)
FRESULT pf_open(const char *path)
FRESULT pf_read(void *buff, UINT btr)
FRESULT pf_write(const void *buff, UINT btw, UINT *bw)
FRESULT pf_lseek(DWORD ofs)
FRESULT pf_opendir(DIR *dj, const char *path)
FRESULT pf_readdir(DIR *dj, FILINFO *fno)
file pffconf.h

Defines

_PFFCONF
_USE_MINIMALISTIC_PFF
_USE_READ
_USE_DIR
_USE_LSEEK
_USE_WRITE
_FS_FAT12
_FS_FAT16
_FS_FAT32
_USE_LCC
_CODE_PAGE
_WORD_ACCESS
file pffconf.h

Defines

_PFFCONF
_USE_MINIMALISTIC_PFF
_USE_READ
_USE_DIR
_USE_LSEEK
_USE_WRITE
_FS_FAT12
_FS_FAT16
_FS_FAT32
_USE_LCC
_CODE_PAGE
_WORD_ACCESS
file pin_defs.h

Defines

UART_SRA
UART_SRB
UART_SRC
UART_SRL
UART_UDR
A0
A1
A2
A3
A4
A5
A6
A7
B0
B1
B2
B3
B4
B5
B6
B7
C0
C1
C2
C3
C4
C5
C6
C7
D0
D1
D2
D3
D4
D5
D6
D7
E0
E1
E2
E3
E4
E5
E6
E7
F0
F1
F2
F3
F4
F5
F6
F7
G0
G1
G2
G3
G4
G5
G6
G7
H0
H1
H2
H3
H4
H5
H6
H7
J0
J1
J2
J3
J4
J5
J6
J7
K0
K1
K2
K3
K4
K5
K6
K7
L0
L1
L2
L3
L4
L5
L6
L7
file pin_defs.h

Defines

UART_SRA
UART_SRB
UART_SRC
UART_SRL
UART_UDR
A0
A1
A2
A3
A4
A5
A6
A7
B0
B1
B2
B3
B4
B5
B6
B7
C0
C1
C2
C3
C4
C5
C6
C7
D0
D1
D2
D3
D4
D5
D6
D7
E0
E1
E2
E3
E4
E5
E6
E7
F0
F1
F2
F3
F4
F5
F6
F7
G0
G1
G2
G3
G4
G5
G6
G7
H0
H1
H2
H3
H4
H5
H6
H7
J0
J1
J2
J3
J4
J5
J6
J7
K0
K1
K2
K3
K4
K5
K6
K7
L0
L1
L2
L3
L4
L5
L6
L7
file spi_pins.h
file spi_pins.h
file stk500.h

Defines

STK_OK
STK_FAILED
STK_UNKNOWN
STK_NODEVICE
STK_INSYNC
STK_NOSYNC
ADC_CHANNEL_ERROR
ADC_MEASURE_OK
PWM_CHANNEL_ERROR
PWM_ADJUST_OK
CRC_EOP
STK_GET_SYNC
STK_GET_SIGN_ON
STK_SET_PARAMETER
STK_GET_PARAMETER
STK_SET_DEVICE
STK_SET_DEVICE_EXT
STK_ENTER_PROGMODE
STK_LEAVE_PROGMODE
STK_CHIP_ERASE
STK_CHECK_AUTOINC
STK_LOAD_ADDRESS
STK_UNIVERSAL
STK_PROG_FLASH
STK_PROG_DATA
STK_PROG_FUSE
STK_PROG_LOCK
STK_PROG_PAGE
STK_PROG_FUSE_EXT
STK_READ_FLASH
STK_READ_DATA
STK_READ_FUSE
STK_READ_LOCK
STK_READ_PAGE
STK_READ_SIGN
STK_READ_OSCCAL
STK_READ_FUSE_EXT
STK_READ_OSCCAL_EXT
STK_SW_MAJOR
STK_SW_MINOR
file stk500.h

Defines

STK_OK
STK_FAILED
STK_UNKNOWN
STK_NODEVICE
STK_INSYNC
STK_NOSYNC
ADC_CHANNEL_ERROR
ADC_MEASURE_OK
PWM_CHANNEL_ERROR
PWM_ADJUST_OK
CRC_EOP
STK_GET_SYNC
STK_GET_SIGN_ON
STK_SET_PARAMETER
STK_GET_PARAMETER
STK_SET_DEVICE
STK_SET_DEVICE_EXT
STK_ENTER_PROGMODE
STK_LEAVE_PROGMODE
STK_CHIP_ERASE
STK_CHECK_AUTOINC
STK_LOAD_ADDRESS
STK_UNIVERSAL
STK_PROG_FLASH
STK_PROG_DATA
STK_PROG_FUSE
STK_PROG_LOCK
STK_PROG_PAGE
STK_PROG_FUSE_EXT
STK_READ_FLASH
STK_READ_DATA
STK_READ_FUSE
STK_READ_LOCK
STK_READ_PAGE
STK_READ_SIGN
STK_READ_OSCCAL
STK_READ_FUSE_EXT
STK_READ_OSCCAL_EXT
STK_SW_MAJOR
STK_SW_MINOR
file kk_ihex.h
#include <stdint.h>

Defines

KK_IHEX_VERSION
IHEX_LINE_MAX_LENGTH
IHEX_LINEAR_ADDRESS(ihex)
IHEX_BYTE_ADDRESS(ihex, byte_index)
IHEX_NEWLINE_STRING

Typedefs

typedef uint_fast8_t ihex_bool_t
typedef uint_least32_t ihex_address_t
typedef uint_least16_t ihex_segment_t
typedef int ihex_count_t
typedef uint8_t ihex_flags_t
typedef struct ihex_state kk_ihex_t
typedef uint8_t ihex_record_type_t

Enums

enum ihex_flags

Values:

enumerator IHEX_FLAG_ADDRESS_OVERFLOW
enum ihex_record_type

Values:

enumerator IHEX_DATA_RECORD
enumerator IHEX_END_OF_FILE_RECORD
enumerator IHEX_EXTENDED_SEGMENT_ADDRESS_RECORD
enumerator IHEX_START_SEGMENT_ADDRESS_RECORD
enumerator IHEX_EXTENDED_LINEAR_ADDRESS_RECORD
enumerator IHEX_START_LINEAR_ADDRESS_RECORD
file kk_ihex_read.c
#include "kk_ihex_read.h"

Defines

IHEX_START
ADDRESS_HIGH_MASK
IHEX_READ_RECORD_TYPE_MASK
IHEX_READ_STATE_MASK
IHEX_READ_STATE_OFFSET

Enums

enum ihex_read_state

Values:

enumerator READ_WAIT_FOR_START
enumerator READ_COUNT_HIGH
enumerator READ_COUNT_LOW
enumerator READ_ADDRESS_MSB_HIGH
enumerator READ_ADDRESS_MSB_LOW
enumerator READ_ADDRESS_LSB_HIGH
enumerator READ_ADDRESS_LSB_LOW
enumerator READ_RECORD_TYPE_HIGH
enumerator READ_RECORD_TYPE_LOW
enumerator READ_DATA_HIGH
enumerator READ_DATA_LOW

Functions

void ihex_begin_read(struct ihex_state *const ihex)
void ihex_read_at_address(struct ihex_state *const ihex, ihex_address_t address)
void ihex_read_at_segment(struct ihex_state *const ihex, ihex_segment_t segment)
void ihex_end_read(struct ihex_state *const ihex)
void ihex_read_byte(struct ihex_state *const ihex, const char byte)
void ihex_read_bytes (struct ihex_state *restrict ihex, const char *restrict data, ihex_count_t count)
file kk_ihex_read.h
#include "kk_ihex.h"

Functions

void ihex_begin_read(struct ihex_state *ihex)
void ihex_read_at_address(struct ihex_state *ihex, ihex_address_t address)
void ihex_read_byte(struct ihex_state *ihex, char chr)
void ihex_read_bytes (struct ihex_state *restrict ihex, const char *restrict data, ihex_count_t count)
void ihex_end_read(struct ihex_state *ihex)
ihex_bool_t ihex_data_read(struct ihex_state *ihex, ihex_record_type_t type, ihex_bool_t checksum_mismatch)
void ihex_read_at_segment(struct ihex_state *ihex, ihex_segment_t segment)
file README.md
file README.md
file PetitFS.ino
#include "PetitFS.h"#include "kk_ihex_read.h"

Functions

ihex_bool_t ihex_data_read(struct ihex_state *ihex, ihex_record_type_t type, ihex_bool_t checksum_error)
void ihex_read()
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

FATFS fs
file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SERIAL_TRACE_LEVEL_OFF

Debug level for disable debug on serial interface.

SERIAL_TRACE_LEVEL_ERROR

Debug level for print error message on serial interface.

SERIAL_TRACE_LEVEL_WARNING

Debug level for print warning message on serial interface.

SERIAL_TRACE_LEVEL_INFO

Debug level for print informations message on serial interface.

SERIAL_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on serial interface.

SERIAL_TRACE_LEVEL_TRACE

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

SENSOR_DRIVER_SERIAL_TRACE_LEVEL

Serial trace level debug for SensorDriver library.

SIM800_SERIAL_TRACE_LEVEL

Serial trace level debug for Sim800 library.

OPC_SERIAL_TRACE_LEVEL

Serial trace level debug for Opcxx library.

I2C_TH_SERIAL_TRACE_LEVEL

Serial trace level debug for i2c-th sketch.

I2C_RAIN_SERIAL_TRACE_LEVEL

Serial trace level debug for i2c-rain sketch.

I2C_OPC_SERIAL_TRACE_LEVEL

Serial trace level debug for i2c-opc sketch.

STIMA_SERIAL_TRACE_LEVEL

Serial trace level debug for stima sketch.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

SDCARD_LOGGING_FILE_NAME

File name for logging on SD-Card.

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file debug_config.h

Defines

ENABLE_SDCARD_LOGGING

Enable logging on SDcard define to 1 the macro to enable logging on a file on SDcard.

LOG_LEVEL

logging level at compile time Available levels are: LOG_LEVEL_SILENT LOG_LEVEL_FATAL LOG_LEVEL_ERROR LOG_LEVEL_WARNING LOG_LEVEL_NOTICE LOG_LEVEL_TRACE LOG_LEVEL_VERBOSE

DEBUG_MEMORY

Activate debug of memory use and stack heap collision on serial interface.

LCD_TRACE_LEVEL_OFF

Debug level for print error message on lcd interface.

LCD_TRACE_LEVEL_ERROR

Debug level for print error message on lcd.

LCD_TRACE_LEVEL_WARNING

Debug level for print detailed informations message on serial interface.

LCD_TRACE_LEVEL_INFO

Debug level for print informations message on lcd.

LCD_TRACE_LEVEL_DEBUG

Debug level for print verbose informations message on lcd.

OK_STRING

"OK" string message.

ERROR_STRING

"ERROR" string message.

FAIL_STRING

"FAIL" string message.

YES_STRING

"YES" string message.

NO_STRING

"NO" string message.

ON_STRING

"ON" string message.

OFF_STRING

"OFF" string message.

SAVE_STRING

"SAVE" string message.

STIMA_LCD_TRACE_LEVEL

Lcd trace level debug for stima sketch.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

I2C_SET_ERROR_COUNT

I2C error count for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

I2C_SET_ERROR_COUNT

I2C error count for bus restart.

file i2c_config.h

Defines

I2C_HOW_MANY_BUSY_CHECKS_AFTER_STOP
TWI_TIMEOUT
I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

I2C_SET_ERROR_COUNT

I2C error count for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz. 30418,25 Hz : minimum freq with prescaler set to 1 and CPU clock to 16MHz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file i2c_config.h

Defines

I2C_BUS_CLOCK

I2C bus clock in Hertz.

I2C_MAX_DATA_LENGTH

Max length in bytes for i2c bus data buffer.

I2C_MAX_ERROR_COUNT

Max i2c error for bus restart.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file json_config.h

Defines

JSON_BUFFER_LENGTH

Length in bytes for JSON data buffer.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_RPC_TOPIC_LENGTH

Length in bytes for mqtt rpc topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_RPC_COMMAND_LENGTH

Length in bytes for mqtt rpc command message.

MQTT_RPC_RESPONSE_LENGTH

Length in bytes for mqtt rpc response message.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_RPC_TOPIC
MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_RPC_TOPIC_LENGTH

Length in bytes for mqtt rpc topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_RPC_COMMAND_LENGTH

Length in bytes for mqtt rpc command message.

MQTT_RPC_RESPONSE_LENGTH

Length in bytes for mqtt rpc response message.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_RPC_TOPIC
MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_RPC_TOPIC_LENGTH

Length in bytes for mqtt rpc topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_RPC_COMMAND_LENGTH

Length in bytes for mqtt rpc command message.

MQTT_RPC_RESPONSE_LENGTH

Length in bytes for mqtt rpc response message.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

STATIONSLUG_LENGTH

Length in bytes for station slug.

BOARDSLUG_LENGTH

Length in bytes for board slug.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_RPC_TOPIC
MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

DEFAULT_STATIONSLUG

Default station slug.

DEFAULT_BOARDSLUG

Default board slug.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_RPC_TOPIC_LENGTH

Length in bytes for mqtt rpc topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_RPC_COMMAND_LENGTH

Length in bytes for mqtt rpc command message.

MQTT_RPC_RESPONSE_LENGTH

Length in bytes for mqtt rpc response message.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

STATIONSLUG_LENGTH

Length in bytes for station slug.

BOARDSLUG_LENGTH

Length in bytes for board slug.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_RPC_TOPIC
MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

DEFAULT_STATIONSLUG

Default station slug.

DEFAULT_BOARDSLUG

Default board slug.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_RPC_TOPIC_LENGTH

Length in bytes for mqtt rpc topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_RPC_COMMAND_LENGTH

Length in bytes for mqtt rpc command message.

MQTT_RPC_RESPONSE_LENGTH

Length in bytes for mqtt rpc response message.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_RPC_TOPIC
MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file mqtt_config.h

Defines

MQTT_ROOT_TOPIC_LENGTH

Length in bytes for mqtt root topic.

MQTT_MAINT_TOPIC_LENGTH

Length in bytes for mqtt maint topic.

MQTT_SUBSCRIBE_TOPIC_LENGTH

Length in bytes for mqtt subscibe topic.

MQTT_SENSOR_TOPIC_LENGTH

Length in bytes for mqtt sensor topic.

MQTT_CLIENT_ID_LENGTH

Length in bytes for mqtt client id.

MQTT_MESSAGE_LENGTH

Length in bytes for mqtt message.

MQTT_SERVER_LENGTH

Length in bytes for mqtt server.

MQTT_USERNAME_LENGTH

Length in bytes for mqtt username.

MQTT_PASSWORD_LENGTH

Length in bytes for mqtt password.

MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

MQTT_DEFAULT_SERVER

Default MQTT server.

MQTT_DEFAULT_PORT

Default MQTT server port.

MQTT_DEFAULT_ROOT_TOPIC

Default MQTT root topic.

MQTT_DEFAULT_MAINT_TOPIC

Default MQTT maint topic.

MQTT_DEFAULT_SUBSCRIBE_TOPIC

Default MQTT subscibe topic.

MQTT_DEFAULT_USERNAME

Default MQTT username.

MQTT_DEFAULT_PASSWORD

Default MQTT password.

MQTT_STATUS_TOPIC

Default MQTT status topic for printing on connect/disconnect message.

MQTT_ON_CONNECT_MESSAGE

MQTT on connect message.

MQTT_ON_DISCONNECT_MESSAGE

MQTT on disconnect message.

MQTT_ON_ERROR_MESSAGE

MQTT on error message.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SPI_DRIVER_SELECT
USE_SD_CRC
SDFAT_FILE_TYPE
USE_LONG_FILE_NAMES
USE_SEPARATE_FAT_CACHE
USE_EXFAT_BITMAP_CACHE
USE_UTF8_LONG_NAMES
USE_FAT_FILE_FLAG_CONTIGUOUS
ENABLE_DEDICATED_SPI
SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sdcard_config.h

Defines

SDCARD_FILES_NAME_MAX_LENGTH

Length in bytes for sdcard file name data buffer.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-2.5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_PWR

Enable if you want use power (solar panel and battery) sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10'.

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust Wind Speed and Direction over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want class Wind Speed over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-2.5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10'.

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust Wind Speed and Direction over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want class Wind Speed over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_THR

Enable if you want use one module for TH and RAIN. Disable if you want use one module for TH and one for RAIN.

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

USE_TH_SENSORS
USE_RAIN_SENSORS
USE_MODULE_THR
USE_MODULE_TH
USE_MODULE_RAIN
file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10'.

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust Wind Speed and Direction over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want class Wind Speed over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10'.

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust Wind Speed and Direction over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want maximum wind gust speed and direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

SENSORS_MAX
SENSORS_UNIQUE_MAX
USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_SPS

Enable if you want use Sensirion SPS30 PM sensor.

USE_SENSOR_SCD

Enable if you want use Sensiorion SCD30 CO2 sensor.

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_SHT
USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_POW

Enable if you want use Power panel and battery sensor.

USE_SENSOR_DES

Enable if you want use DigitEco Wind Speed sensor.

USE_SENSOR_DED

Enable if you want use DigitEco Wind Direction sensor.

USE_SENSOR_DSR

Enable if you want use DigitEco Global Solar Radiation sensor.

USE_SENSOR_VSR

Enable if you want use 0-5V High Resolution Global Solar Radiation sensor.

USE_SENSOR_DSA

Enable if you want average Global Solar Radiation sensor.

USE_SENSOR_DWA

Enable if you want vectorial average Wind Speed and Direction over 10' (WMO).

USE_SENSOR_DWB

Enable if you want vectorial average Wind Speed and Direction over report time.

USE_SENSOR_DWC

Enable if you want gust and long gust Wind Speed over report time.

USE_SENSOR_DWD

Enable if you want average Wind Speed over report time.

USE_SENSOR_DWE

Enable if you want frequency class Wind Speed over report time.

USE_SENSOR_DWF

Enable if you want gust and long gust Wind Direction over report time.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
file sensors_config.h

Defines

USE_JSON

Enable if you want use json library for json response (getJson function in SensorDriver).

USE_SENSOR_ADT

Enable if you want use ADT7420 sensor.

USE_SENSOR_HIH

Enable if you want use HIH6100 sensor.

USE_SENSOR_HYT

Enable if you want use HYT271 or HYT221 sensor.

USE_SENSOR_DEP

Enable if you want use DigitEco Power sensor.

USE_SENSOR_OA2

Enable if you want use OPC PM1, PM2.5, PM10 continuous average value.

USE_SENSOR_OA3
USE_SENSOR_OB2

Enable if you want use OPC PM1, PM2.5, PM10 continuous standard deviation value.

USE_SENSOR_OB3
USE_SENSOR_OC2

Enable if you want use OPC BINS continuous average value.

USE_SENSOR_OC3
USE_SENSOR_OD2

Enable if you want use OPC BINS continuous standard deviation value.

USE_SENSOR_OD3
USE_SENSOR_OE3
USE_SENSOR_LWT

Enable if you want use leaf wetness time continuous value.

USE_SENSOR_HI7

Enable if you want use SI7021 sensor.

USE_SENSOR_BMP

Enable if you want use Bmp085 sensor.

USE_SENSOR_DW1

Enable if you want use DW1 sensor.

USE_SENSOR_TBR

Enable if you want use Tipping bucket rain gauge sensor.

USE_SENSOR_STH

Enable if you want use Temperature and humidity oneshot sensor.

USE_SENSOR_ITH

Enable if you want use Temperature and humidity continuous istantaneous sensor.

USE_SENSOR_NTH

Enable if you want use Temperature and humidity continuous minium sensor.

USE_SENSOR_MTH

Enable if you want use Temperature and humidity continuous average sensor.

USE_SENSOR_XTH

Enable if you want use Temperature and humidity continuous maximum sensor.

USE_SENSOR_SSD

Enable if you want use SSD011 oneshot sensor.

USE_SENSOR_ISD

Enable if you want use SSD011 report istantaneous sensor.

USE_SENSOR_NSD

Enable if you want use SSD011 report minium sensor.

USE_SENSOR_MSD

Enable if you want use SSD011 report average sensor.

USE_SENSOR_XSD

Enable if you want use SSD011 report maximum sensor.

USE_SENSOR_SMI

Enable if you want use MICS4514 oneshot sensor.

USE_SENSOR_IMI

Enable if you want use MICS4514 report istantaneous sensor.

USE_SENSOR_NMI

Enable if you want use MICS4514 report minium sensor.

USE_SENSOR_MMI

Enable if you want use MICS4514 report average sensor.

USE_SENSOR_GWS

Enable if you want use Gill Windsonic sensor.

USE_SENSOR_XMI

Enable if you want use MICS4514 report maximum sensor.

USE_SENSOR_RF24

Enable if you want use Radio RF24 sensor.

RAIN_FOR_TIP

How much mm of rain for one tip of tipping bucket rain gauge.

VALUES_TO_READ_FROM_SENSOR_COUNT

Maximum number of values to be read by the sensors.

JSONS_TO_READ_FROM_SENSOR_COUNT
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

STATISTICAL_DATA_COUNT

How much observations are needed for generating a report.

OBSERVATION_COUNT

Observations buffer length.

OBSERVATION_COUNT_TOLLERANCE

Tolerance of observations for generating a valid report.

file i2c-leaf-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module major version.

MODULE_MINOR_VERSION

Module major version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_IS_CONTINUOUS

Continuous mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_DEFAULT_LEAF_CALIBRATION_THRESHOLD

Default threshold for ADC wet/dry (0-1023).

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

LEAF_POWER_PIN

Output pin for power on and power off leaf sensor.

LEAF_ANALOG_PIN

Input pin for reading leaf sensor value.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

I2C_MAX_TIME

Max i2c time in seconds before i2c restart.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

USE_LEAF_POWER_DOWN

Enable or disable power down for leaf sensor.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 1000 - 60000 [ms] must be integer multiple of TIMER1_INTERRUPT_TIME_MS !!!

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: 100 - 8000 [ms].

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 8 MHz.

TIMER_COUNTER_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

LEAF_VALUES_READ_DELAY_MS

Reading delay from measure to get one data.

LEAF_READ_COUNT

Maximum number of leaf reading to get one data.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-leaf.h
#include "i2c-leaf-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <registers-leaf.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum leaf_reading_state_t

Values:

enumerator LEAF_READING_INIT

init task variables

enumerator LEAF_READING_READ
enumerator LEAF_READING_END

performs end operations and deactivate task

enumerator LEAF_READING_WAIT_STATE

non-blocking waiting time

Functions

void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void reset_report_buffer(void)
void reset_buffer(void)

Reset sample and observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

template<typename sample_g, typename observation_g, typename value_v>
void addSample(sample_g *sample, observation_g *observation, value_v value)
template<typename observation_g, typename value_v>
value_v readCurrentObservation(observation_g *buffer)
template<typename observation_g, typename value_v>
void writeCurrentObservation(observation_g *buffer, value_v value)
template<typename observation_g, typename length_v>
void resetObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void resetBackPmObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void incrementObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v, typename value_v>
void addObservation(observation_g *buffer, length_v length, value_v value)
template<typename observation_g, typename length_v, typename value_v>
value_v readBackObservation(observation_g *buffer, length_v length)
void samples_processing(bool is_force_processing)

Main routine for processing the samples to calculate an observation.

Return

void.

Parameters
  • is_force_processing: if is true, force the calculation of the observation provided there is a minimum number of samples.

void leaf_reading_task(void)

Sensors reading Task. Read data from sensors.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

I2C receive interrupt handler.

Return

void.

Variables

configuration_t configuration

Configuration data.

readable_data_t readable_data_1

First readable i2c register.

readable_data_t readable_data_2

Second readable i2c register.

readable_data_t *readable_data_read_ptr

Pointer for read data in i2c readable register.

readable_data_t *readable_data_write_ptr

Pointer for write data in i2c readable register.

readable_data_t *readable_data_temp_ptr

Temporary pointer for exchange read and write pointer for i2c readable register.

writable_data_t writable_data

Writable i2c register.

writable_data_t *writable_data_ptr

Pointer for read and write data in i2c writable register.

uint8_t readable_data_address

Address of readable i2c register.

uint8_t readable_data_length

Number of bytes to read at readable_data_address.

uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]

Buffer for i2c received data.

uint8_t lastcommand

last command received.

command to be executed.

uint8_t i2c_error

Number of i2c error.

uint8_t i2c_time

Time in seconds from last I2C reset.

uint8_t ready_tasks_count

Number of tasks ready to execute.

uint32_t awakened_event_occurred_time_ms

System time (in millisecond) when the system has awakened from power down.

bool is_start

Execute start command.

bool is_stop

Execute stop command.

bool is_test_read

Received command is in continuous mode.

bool is_leaf_init
bool is_leaf_wet
uint8_t samples_count

Number of samples to be acquired for make one observation.

bool do_buffers_reset

Force a buffers reset.

uint16_t timer_counter_ms

Timer counter variable for execute timed task with time multiple of base Timer1 time.

state_t state

Current main loop state.

leaf_reading_state_t leaf_reading_state
bool inside_transaction

Status of command transaction.

uint16_t transaction_time

Timer counter variable for compute command transaction timeout.

bool is_event_leaf_reading

Enable or disable the Sensors reading task.

bool is_event_command_task

Enable or disable the Command task.

file i2c-leaf.ino
#include "i2c-leaf.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

ISR(TIMER1_OVF_vect)

Timer1 overflow interrupts routine.

Return

void.

void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void leaf_reading_task()

Sensors reading Task. Read data from sensors.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_report_buffer()
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void copy_buffers()
void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-opc-config.h
#include <sensors_config.h>

Defines

MODULE_VERSION

Module version.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_IS_CONTINUOUS

Continuous mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

OPC_POWER_PIN

Output pin for power on and power off opc sensor.

OPC_SPI_POWER_PIN
OPC_CHIP_SELECT

Output pin for spi chip select opc sensor.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

USE_OPC_POWER_DOWN

Enable or disable power down for opc sensor.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 100 - 60000 [ms] must be integer multiple of TIMER1_INTERRUPT_TIME_MS !!!

SENSORS_SAMPLE_COUNT_MIN

Sample count minimum in OBSERVATIONS_MINUTES minutes.

SENSORS_SAMPLE_COUNT_MAX

Sample count maximum in OBSERVATIONS_MINUTES minutes.

SENSORS_SAMPLE_COUNT_TOLERANCE

Maximum invalid sample count for generate a valid observations.

USE_SENSORS_COUNT

Sensors count.

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: 100 - 8000 [ms].

TIMER1_OVERFLOW_TIME_MS

Timer1 timer overflow with 1024 prescaler at 8 or 16 MHz.

Timer1 timer overflow with 1024 prescaler at 8 MHz.

Timer1 timer overflow with 1024 prescaler at 16 MHz.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 8 MHz.

TIMER1_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

OPC_RETRY_COUNT_MAX

Maximum number of retry for opc reading.

file i2c-opc.h
#include "i2c-opc-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <registers-opc.h>#include <opcxx.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum opc_state_t

OPC setup and reading task finite state machine.

Values:

enumerator OPC_INIT
enumerator OPC_SWITCH_ON
enumerator OPC_SEND_COMMAND_FAN_DAC
enumerator OPC_WAIT_RESULT_FAN_DAC
enumerator OPC_SEND_COMMAND_FAN_ON
enumerator OPC_WAIT_RESULT_FAN_ON
enumerator OPC_SEND_COMMAND_LASER_ON
enumerator OPC_WAIT_RESULT_LASER_ON
enumerator OPC_SEND_COMMAND_READ_HISTOGRAM
enumerator OPC_WAIT_RESULT_READ_HISTOGRAM
enumerator OPC_READ_HISTOGRAM
enumerator OPC_END

performs end operations and deactivate task

enumerator OPC_WAIT_STATE

non-blocking waiting time

Functions

void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

template<typename sample_g, typename observation_g, typename values_v, typename value_v>
void addSample(sample_g *sample, observation_g *observation, values_v *values, value_v value)
template<typename observation_g, typename value_v>
value_v readCurrentObservation(observation_g *buffer)
template<typename observation_g, typename value_v>
void writeCurrentObservation(observation_g *buffer, value_v value)
template<typename observation_g, typename length_v>
void resetObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void resetBackPmObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void incrementObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v, typename value_v>
void addObservation(observation_g *buffer, length_v length, value_v value)
template<typename observation_g, typename length_v, typename value_v>
value_v readBackObservation(observation_g *buffer, length_v length)
void samples_processing(bool is_force_processing)

Main routine for processing the samples to calculate an observation.

Return

void.

Parameters
  • is_force_processing: if is true, force the calculation of the observation provided there is a minimum number of samples.

bool observations_processing(void)

Main routine for processing the observations to calculate a value for report.

Return

void.

template<typename sample_g, typename observation_g>
bool make_observation_from_samples(bool is_force_processing, sample_g *sample, observation_g *observation)
template<typename sample_g, typename observation_g, typename value_v, typename val_v>
bool make_value_from_samples_and_observations(sample_g *sample, observation_g *observation, value_v *value)
void opc_task(void)

Opc setup and reading Task. Read data from OPC.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t i2c_error
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool is_start
bool is_stop
bool is_oneshot

Received command is in oneshot mode.

bool is_continuous

Received command is in continuous mode.

sample_t pm1_samples
sample_t pm25_samples
sample_t pm10_samples
sample_t bins_samples[OPC_BINS_LENGTH]
float_observation_t pm1_observations
float_observation_t pm25_observations
float_observation_t pm10_observations
uint16_observation_t bins_observations[OPC_BINS_LENGTH]
uint8_t samples_count
bool do_buffers_reset
uint16_t timer_counter

Timer counter variable for execute timed task with time multiple of base Timer1 time.

state_t state
opc_state_t opc_state

Current sensors reading task state.

bool is_opc_setted
bool is_opc_first_read
uint8_t histogram_error_count
bool is_event_opc_task

Enable or disable the OPC task.

bool is_event_command_task
file i2c-opc.ino
#include "i2c-opc.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

ISR(TIMER1_OVF_vect)
void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

template<typename sample_g, typename observation_g, typename values_v, typename value_v>
void addSample(sample_g *sample, observation_g *observation, values_v *values, value_v value)
template<typename observation_g, typename value_v>
value_v readCurrentObservation(observation_g *buffer)
template<typename observation_g, typename value_v>
void writeCurrentObservation(observation_g *buffer, value_v value)
template<typename observation_g, typename length_v>
void resetObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void resetBackObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v>
void incrementObservation(observation_g *buffer, length_v length)
template<typename observation_g, typename length_v, typename value_v>
void addObservation(observation_g *buffer, length_v length, value_v value)
template<typename observation_g, typename length_v, typename value_v>
value_v readBackObservation(observation_g *buffer, length_v length)
void samples_processing(bool is_force_processing)

Main routine for processing the samples to calculate an observation.

Return

void.

Parameters
  • is_force_processing: if is true, force the calculation of the observation provided there is a minimum number of samples.

template<typename sample_g, typename observation_g>
bool make_observation_from_samples(bool is_force_processing, sample_g *sample, observation_g *observation)
bool observations_processing()

Main routine for processing the observations to calculate a value for report.

Return

void.

template<typename sample_g, typename observation_g, typename value_v, typename val_v>
bool make_value_from_samples_and_observations(sample_g *sample, observation_g *observation, value_v *value)
void opc_task()

Opc setup and reading Task. Read data from OPC.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_observations_buffer()

Reset observations buffers to default value.

Return

void.

void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void tests()

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-power-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in stima_module.h.

CONFIGURATION_DEFAULT_ONESHOT
CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

POWER_ADC_CHANNEL_INPUT_PANEL

Input channel for panel.

POWER_ADC_CHANNEL_INPUT_BATTERY

Input channel for battery.

ADC_GND_I2C_ADDRESS
ADC_VDD_I2C_ADDRESS
ADC_SCL_I2C_ADDRESS
ADC_SDA_I2C_ADDRESS
ADC_I2C_ADDRESS
CONFIGURATION_DEFAULT_ADC_VOLTAGE_MAX_PANEL
CONFIGURATION_DEFAULT_ADC_VOLTAGE_MAX_BATTERY
SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 100 - 60000 [ms] must be integer multiple of TIMER1_INTERRUPT_TIME_MS !!!

RMAP_REPORT_SAMPLE_ERROR_MAX_PERC

Sample maximum error in percent for one observation.

RMAP_REPORT_SAMPLE_MIN_TIME

Sample minimun time for elaborate one observation (seconds).

USE_SENSORS_COUNT

Sensors count.

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: 100 - 8000 [ms].

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 16 MHz.

TIMER_COUNTER_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

TIMER_COUNTER_VALUE_MAX_S
TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-power.h
#include "i2c-power-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <ADS1115.h>#include <registers-power.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum power_state_t

POWER setup and reading task finite state machine.

Values:

enumerator POWER_INIT
enumerator POWER_READING_PANEL
enumerator POWER_READING_BATTERY
enumerator POWER_ELABORATE
enumerator POWER_END

performs end operations and deactivate task

enumerator POWER_WAIT_STATE

non-blocking waiting time

enum power_hr_state_t

Values:

enumerator POWER_HR_INIT
enumerator POWER_HR_READ
enumerator POWER_HR_EVALUATE
enumerator POWER_HR_PROCESS
enumerator POWER_HR_END

performs end operations and deactivate task

enumerator POWER_HR_WAIT_STATE

non-blocking waiting time

Functions

ADS1115 adc1(ADC_I2C_ADDRESS)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_adc(void)

Init ADC converter.

Init ADC hardware.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void tests(void)

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void reset_buffer(void)

Reset sample and observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void make_report(bool init = false)

Main routine for processing the samples to calculate an observation.

Return

void.

void power_task(void)

Setup and reading Task. Read voltage from panel and battery.

Return

void.

void power_task_hr(void)

Setup and reading Task. Read voltage from panel and battery Higt resolution.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t i2c_error
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
uint8_t lastcommand
bool is_start
bool is_stop
bool is_test_read
bool is_oneshot
bool is_continuous
bool is_test

Received command is in test mode.

If true, reading value from sensors for testing purpose.

Execute stop command in test mode.

int16_t sample_panel
int16_t sample_battery
int16_t average_panel
int16_t average_battery
uint16_t samples_count_panel

Number of samples to be acquired for make one panel observation.

uint16_t samples_error_count_panel

Number of error while acquire samples for make one panel observation.

uint16_t samples_count_battery

Number of samples to be acquired for make one battery observation.

uint16_t samples_error_count_battery

Number of error while acquire samples for make one battery observation.

uint16_t timer_counter_ms
uint16_t timer_counter_s
state_t state
power_state_t power_state

Current sensors reading task state.

bool is_event_power_task

Enable or disable the POWER task.

bool is_event_command_task
file i2c-power.ino
#include "i2c-power.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_adc()

Init ADC converter.

Init ADC hardware.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void make_report(bool init)

Main routine for processing the samples to calculate an observation.

Return

void.

void power_task()

Setup and reading Task. Read voltage from panel and battery.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_data(volatile readable_data_t *ptr)
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void copy_buffers()
void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-radiation-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_ONESHOT
CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

ADC_GND_I2C_ADDRESS
ADC_VDD_I2C_ADDRESS
ADC_SCL_I2C_ADDRESS
ADC_SDA_I2C_ADDRESS
ADC_I2C_ADDRESS
CONFIGURATION_DEFAULT_ADC_VOLTAGE_OFFSET_1
CONFIGURATION_DEFAULT_ADC_VOLTAGE_OFFSET_2
CONFIGURATION_DEFAULT_ADC_VOLTAGE_GAIN_1
CONFIGURATION_DEFAULT_ADC_VOLTAGE_GAIN_2
CONFIGURATION_DEFAULT_ADC_VOLTAGE_MIN
CONFIGURATION_DEFAULT_ADC_VOLTAGE_MAX
CONFIGURATION_DEFAULT_ADC_VOLTAGE_OFFSET
CONFIGURATION_DEFAULT_ADC_VOLTAGE_GAIN
CONFIGURATION_DEFAULT_SENSOR_VOLTAGE_MAX
CONFIGURATION_DEFAULT_SENSOR_RADIATION_MAX
ACQUISITION_COUNT_FOR_POWER_RESET
SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 100 - 60000 [ms] must be integer multiple of TIMER1_INTERRUPT_TIME_MS !!!

RMAP_REPORT_SAMPLE_ERROR_MAX_PERC

Sample maximum error in percent for one observation.

RMAP_REPORT_SAMPLE_MIN_TIME

Sample minimun time for elaborate one observation (seconds).

USE_SENSORS_COUNT

Sensors count.

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: 100 - 8000 [ms].

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 16 MHz.

TIMER_COUNTER_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

TIMER_COUNTER_VALUE_MAX_S
SOLAR_RADIATION_READ_DELAY_MS

Reading delay.

SOLAR_RADIATION_VALUES_READ_DELAY_MS

Reading delay.

SOLAR_RADIATION_READ_COUNT

number of read.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-radiation.h
#include "i2c-radiation-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <ADS1115.h>#include <registers-radiation.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum solar_radiation_state_t

RADIATION setup and reading task finite state machine.

Values:

enumerator SOLAR_RADIATION_INIT
enumerator SOLAR_RADIATION_READING
enumerator SOLAR_RADIATION_ELABORATE
enumerator SOLAR_RADIATION_END

performs end operations and deactivate task

enumerator SOLAR_RADIATION_WAIT_STATE

non-blocking waiting time

enum solar_radiation_hr_state_t

Values:

enumerator SOLAR_RADIATION_HR_INIT
enumerator SOLAR_RADIATION_HR_READ
enumerator SOLAR_RADIATION_HR_EVALUATE
enumerator SOLAR_RADIATION_HR_PROCESS
enumerator SOLAR_RADIATION_HR_END

performs end operations and deactivate task

enumerator SOLAR_RADIATION_HR_WAIT_STATE

non-blocking waiting time

Functions

void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_adc(void)

Init ADC converter.

Init ADC hardware.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void tests(void)

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void reset_buffer(void)

Reset sample and observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void make_report(bool init = false)

Main routine for processing the samples to calculate an observation.

Return

void.

void solar_radiation_task(void)

Wind setup and reading Task. Read data from RADIATION.

Return

void.

void solar_radiation_task_hr(void)

Wind setup and reading Task. Read data from RADIATION.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t i2c_error
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
uint8_t lastcommand
bool is_start
bool is_stop
bool is_test_read
bool is_oneshot
bool is_continuous
bool is_test
int16_t sample
int16_t average
uint8_t solar_radiation_acquisition_count
uint16_t samples_count
uint16_t samples_error_count

Number of error while acquire samples for make one observation.

uint16_t timer_counter_ms
uint16_t timer_counter_s
state_t state
solar_radiation_state_t solar_radiation_state

Current sensors reading task state.

solar_radiation_hr_state_t solar_radiation_hr_state
bool is_event_solar_radiation_task

Enable or disable the RADIATION task.

bool is_event_command_task
file i2c-radiation.ino
#include "i2c-radiation.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_adc()

Init ADC converter.

Init ADC hardware.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void make_report(bool init)

Main routine for processing the samples to calculate an observation.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_data(volatile readable_data_t *ptr)
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void copy_buffers()
void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-rain-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

TIPPING_BUCKET_PIN

Interrupt pin for tipping bucket rain gauge.

CONFIGURATION_DEFAULT_TIPPING_BUCKET_TIME_MS

Tipping bucket time in milliseconds.

CONFIGURATION_DEFAULT_RAIN_FOR_TIP

brief How much mm/10 of rain for one tip of tipping bucket rain gauge.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_IS_CONTINUOUS

Continuous mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

I2C_MAX_TIME

Max i2c time in seconds before i2c restart.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: 100 - 8000 [ms].

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-rain.h
#include "i2c-rain-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <typedef.h>#include <registers-rain.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum tipping_bucket_state_t

Tipping bucket task finite state machine.

Values:

enumerator TIPPING_BUCKET_INIT

init task variables and wait half debounce time

enumerator TIPPING_BUCKET_READ

read rain tips from variable shared with tipping bucket interrupt, validate it for spike re-reading tipping bucket signal and wait double debounce time

enumerator TIPPING_BUCKET_COUNT

validate re-reading tipping bucket signal and increment total tips

enumerator TIPPING_BUCKET_END

wait for the tipping bucket switch return open and performs end operations and deactivate task

enumerator TIPPING_BUCKET_WAIT_STATE

non-blocking waiting time

Functions

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void tests(void)

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void reset_buffers(void)

Reset buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void init_logging()

Init logging system.

Return

void.

void tipping_bucket_task(void)

Tipping bucket task.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void tipping_bucket_interrupt_handler(void)

Tipping bucket interrupt handler.

Return

void.

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t lastcommand
uint8_t i2c_error
uint8_t i2c_time
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
bool is_start
bool is_stop
bool is_test
bool is_started

Start command is active and measure is active.

rain_t rain

Rain data.

state_t state
tipping_bucket_state_t tipping_bucket_state

Current tipping bucket task state.

bool is_event_tipping_bucket

Enable or disable the Tipping Bucket task.

bool is_event_command_task
file i2c-rain.ino
#include "i2c-rain.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

void init_tipping_bucket_interrupt()
void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void tipping_bucket_interrupt_handler()

Tipping bucket interrupt handler.

Return

void.

void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void tipping_bucket_task()

Tipping bucket task.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_buffers()

Reset buffers to default value.

Return

void.

void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-th-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

TH_POWER_PIN

Output pin for power on and power off th sensor.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSOR_ERROR_COUNT_MAX
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 2000 - 8000 [ms] setting it to 3980 ms we gain 20 ms every sample, 300 ms every observation, 4500 every report (15minutes)

SAMPLES_COUNT_MAX
OBSERVATION_SAMPLES_COUNT

Sample count in OBSERVATIONS_MINUTES minutes.

OBSERVATION_SAMPLE_ERROR_MAX

Maximum invalid sample count for generate a valid observations.

RMAP_REPORT_ERROR_MAX
RMAP_REPORT_VALID_MIN
TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler.

TIMER1_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

SENSORS_RETRY_COUNT_MAX

Maximum number of retry for sensors reading.

SENSORS_RETRY_DELAY_MS

Waiting for reading between two attempts.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-th-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

TH_POWER_PIN

Output pin for power on and power off th sensor.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

SENSOR_ERROR_COUNT_MAX
OBSERVATIONS_MINUTES

How much minutes for calculate an observations by processing sampling. Tipically 1-10 minutes.

SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 2000 - 8000 [ms] setting it to 3980 ms we gain 20 ms every sample, 300 ms every observation, 4500 every report (15minutes)

SAMPLES_COUNT_MAX
OBSERVATION_SAMPLES_COUNT

Sample count in OBSERVATIONS_MINUTES minutes.

OBSERVATION_SAMPLE_ERROR_MAX

Maximum invalid sample count for generate a valid observations.

RMAP_REPORT_ERROR_MAX
RMAP_REPORT_VALID_MIN
TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler.

TIMER1_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

SENSORS_RETRY_COUNT_MAX

Maximum number of retry for sensors reading.

SENSORS_RETRY_DELAY_MS

Waiting for reading between two attempts.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-th.h
#include "i2c-th-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <registers-th.h>#include <SensorDriver.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum sensors_reading_state_t

Sensors reading task finite state machine.

Values:

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_SETUP_CHECK

check errors and if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT
enumerator SENSORS_READING_PREPARE
enumerator SENSORS_READING_IS_PREPARED
enumerator SENSORS_READING_GET
enumerator SENSORS_READING_IS_GETTED
enumerator SENSORS_READING_READ
enumerator SENSORS_READING_NEXT
enumerator SENSORS_READING_END
enumerator SENSORS_READING_WAIT_STATE

Functions

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void reset_observations_buffer(void)

Reset observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void samples_processing(bool is_force_processing)

Main routine for processing the samples to calculate an observation.

Return

void.

Parameters
  • is_force_processing: if is true, force the calculation of the observation provided there is a minimum number of samples.

void init_logging()

Init logging system.

Return

void.

void sensors_reading_task(void)

Sensors reading Task. Read data from sensors.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t lastcommand
uint8_t i2c_error
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
bool is_start
bool is_stop
bool is_test_read
SensorDriver *sensors[SENSORS_MAX]

SensorDriver buffer for storing sensors parameter.

SensorDriver array structure.

uint8_t sensors_count

Configured sensors number.

number of created sensors drivers.

sample_t temperature_samples

Temperature samples.

sample_t humidity_samples

Humidity samples.

uint16_t timer_counter
state_t state
sensors_reading_state_t sensors_reading_state

Current sensors reading task state.

Sensors reading task state.

bool is_event_sensors_reading

Enable or disable the Sensors reading task.

bool is_event_command_task
file i2c-th.h
#include "i2c-th-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <registers-th.h>#include <SensorDriver.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum sensors_reading_state_t

Sensors reading task finite state machine.

Values:

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_SETUP_CHECK

check errors and if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT
enumerator SENSORS_READING_PREPARE
enumerator SENSORS_READING_IS_PREPARED
enumerator SENSORS_READING_GET
enumerator SENSORS_READING_IS_GETTED
enumerator SENSORS_READING_READ
enumerator SENSORS_READING_NEXT
enumerator SENSORS_READING_END
enumerator SENSORS_READING_WAIT_STATE

Functions

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void reset_observations_buffer(void)

Reset observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void samples_processing(bool is_force_processing)

Main routine for processing the samples to calculate an observation.

Return

void.

Parameters
  • is_force_processing: if is true, force the calculation of the observation provided there is a minimum number of samples.

void init_logging()

Init logging system.

Return

void.

void sensors_reading_task(void)

Sensors reading Task. Read data from sensors.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t lastcommand
uint8_t i2c_error
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
bool is_start
bool is_stop
bool is_test_read
SensorDriver *sensors[SENSORS_MAX]
uint8_t sensors_count
sample_t temperature_samples
sample_t humidity_samples
uint16_t timer_counter
state_t state
sensors_reading_state_t sensors_reading_state
bool is_event_sensors_reading
bool is_event_command_task
file i2c-th.ino
#include "i2c-th.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void thPowerOff()
void thPowerOn()
void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

ISR(TIMER1_OVF_vect)
void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void sensors_reading_task()

Sensors reading Task. Read data from sensors.

Return

void.

template<typename buffer_g, typename length_v, typename value_v>
value_v bufferRead(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
value_v bufferReadBack(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v>
void bufferPtrResetBack(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
void bufferReset(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v>
void incrementBuffer(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
void addValue(buffer_g *buffer, length_v length, value_v value)
void make_report(bool init = false)

Main routine for processing the samples to calculate an observation.

Return

void.

void samples_processing()

Main routine for processing the samples to calculate an observation.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_data(volatile readable_data_t *ptr)
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void copy_buffers()
void commands()

Performs specific operations based on the received command.

Return

void.

file i2c-th.ino
#include "i2c-th.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_pins()

Init hardware pins.

Return

void.

void thPowerOff()
void thPowerOn()
file i2c-thr-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

CONFIGURATION_DEFAULT_TEMPERATURE_ADDRESS

Default i2c temperature address.

CONFIGURATION_DEFAULT_HUMIDITY_ADDRESS

Default i2c humidity address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

I2C_MAX_TIME

Max i2c time in seconds before i2c restart.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt: from 100 to TIMER1_OVERFLOW_TIME_MS.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 8 MHz.

TIMER_COUNTER_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

SENSOR_ERROR_COUNT_MAX
SENSORS_SAMPLE_TIME_MS

Milliseconds for sampling sensors: 100 - 60000 [ms] must be integer multiple of TIMER1_INTERRUPT_TIME_MS !!!

OBSERVATION_SAMPLES_COUNT_MIN

Sample count minimum in OBSERVATIONS_MINUTES minutes.

OBSERVATION_SAMPLES_COUNT_MAX

Sample count maximum in OBSERVATIONS_MINUTES minutes.

RMAP_REPORT_SAMPLE_VALID
RMAP_REPORT_SAMPLES_COUNT
OBSERVATION_SAMPLE_ERROR_MAX

Maximum invalid sample count for generate a valid observations.

OBSERVATION_SAMPLE_VALID_MIN
RMAP_REPORT_SAMPLE_ERROR_MAX
RMAP_REPORT_SAMPLE_VALID_MIN
RMAP_REPORT_ERROR_MAX
RMAP_REPORT_VALID_MIN
SAMPLES_COUNT
RMAP_REPORT_INTERVAL_S
USE_SENSORS_COUNT

Sensors count.

USE_SENSOR_DRIVER_COUNT
SENSORS_RETRY_COUNT_MAX

Maximum number of retry for sensors reading.

SENSORS_RETRY_DELAY_MS

Waiting for reading between two attempts.

file i2c-thr.h
#include "i2c-thr-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <SensorDriver.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

Functions

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void tests(void)

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void reset_report_buffer(void)
void reset_buffer(void)

Reset sample and observations buffers to default value.

Return

void.

void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

template<typename buffer_g, typename length_v, typename value_v>
value_v bufferRead(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
value_v bufferReadBack(buffer_g *buffer, length_v length)
template<typename buffer_g, typename value_v>
void bufferWrite(buffer_g *buffer, value_v value)
template<typename buffer_g>
void bufferPtrReset(buffer_g *buffer)
template<typename buffer_g, typename length_v>
void bufferPtrResetBack(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v>
void incrementBuffer(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
void bufferReset(buffer_g *buffer, length_v length)
template<typename buffer_g, typename length_v, typename value_v>
void addValue(buffer_g *buffer, length_v length, value_v value)
void samples_processing()

Main routine for processing the samples to calculate an observation.

Return

void.

void make_report()
void copy_oneshot_data()
void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t i2c_error
uint8_t i2c_time
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool is_start
bool is_stop
bool is_oneshot
bool is_continuous
uint16_t timer_counter_ms
SensorDriver *sensors[SENSORS_MAX]
uint8_t sensors_count
state_t state
bool is_event_command_task
file i2c-thr.ino
#include "i2c-thr.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

ISR(TIMER1_OVF_vect)
void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

copy_oneshot_data()
void samples_processing()

Main routine for processing the samples to calculate an observation.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_buffer()

Reset sample and observations buffers to default value.

Return

void.

void reset_report_buffer()
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void commands()

Performs specific operations based on the received command.

Return

void.

void tests()

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

file i2c-wind-config.h
#include <sensors_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

CONFIGURATION_DEFAULT_IS_ONESHOT

Oneshot mode for default.

CONFIGURATION_DEFAULT_I2C_ADDRESS

Default i2c address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

SDCARD_CHIP_SELECT_PIN

Chip select for SDcard SPI.

SPI_SPEED

Clock speed for SPI and SDcard.

I2C_MAX_TIME

Max i2c time in seconds before i2c restart.

USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

USE_TIMER_1

Enable or disable timer1.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

WMO_REPORT_SAMPLES_TIME

Sample time for generate WMO standard wind (verctorial mean) (minutes).

WMO_REPORT_SAMPLES_COUNT

Sample count for generate WMO standard wind (verctorial mean).

RMAP_REPORT_SAMPLE_ERROR_MAX_PERC

Sample maximum error in percent for one observation.

LONG_GUST_SAMPLES_TIME

Sample time for elaborate long gust (seconds).

LONG_GUST_SAMPLES_COUNT

Sample count for generate long gust.

GWS_ERROR_COUNT_MAX

Maximum error readeng GWS sensor before sensor reset and configuration.

WIND_CLASS_1_MAX
WIND_CLASS_2_MAX
WIND_CLASS_3_MAX
WIND_CLASS_4_MAX
WIND_CLASS_5_MAX
USE_SENSORS_COUNT

Sensors count.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler at 16 MHz.

TIMER_COUNTER_VALUE_MAX_MS

Maximum timer1 counter value for timed tasks.

WIND_SETUP_DELAY_MS

Reading delay.

WIND_POWER_ON_DELAY_MS
WIND_POWER_RESPONSE_DELAY_MS

windsonic poll mode delay for response (millisec). \from User Manual: \When in polled mode the system will respond to the data command within 130mS \with the last valid data sample as calculated by the Output rate (P Mode Setting). \ is not TRUE !

WIND_READ_DELAY_MS

Reading delay.

WIND_READ_COUNT

number of read.

TRANSACTION_TIMEOUT_MS

Timeout for command transaction.

file i2c-wind.h
#include "i2c-wind-config.h"#include <debug.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <i2c_utility.h>#include <rmap_utility.h>#include <sdcard_utility.h>#include <eeprom_utility.h>#include <Wire.h>#include <TimeLib.h>#include <typedef.h>#include <registers-wind.h>#include <debug_config.h>#include <SdFat.h>#include <StreamUtils.h>#include <ArduinoLog.h>#include <CircularBuffer.h>

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum wind_state_t

WIND setup and reading task finite state machine.

Values:

enumerator WIND_INIT
enumerator WIND_READING
enumerator WIND_ELABORATE
enumerator WIND_END

performs end operations and deactivate task

enumerator WIND_WAIT_STATE

non-blocking waiting time

Functions

void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void commands(void)

Performs specific operations based on the received command.

Return

void.

void tests(void)

Performs specific operations based on the received command.

Performs tests operations based on the received command.

Return

void.

void reset_samples_buffer(void)

Reset samples buffers to default value.

Return

void.

void reset_report_buffer(void)
void exchange_buffers(void)

Exchange reader and writer pointer to buffer.

Return

void.

void make_report(bool init = false)

Main routine for processing the samples to calculate an observation.

Return

void.

void elaborate_circular_buffer(void)

Main routine for processing the samples in circular buffer to calculate an observation.

Return

void.

void getSDFromUV(float, float, float*, float*)
void wind_task(void)

Wind setup and reading Task. Read data from WIND.

Return

void.

void command_task(void)

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void i2c_request_interrupt_handler(void)

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(void)

Variables

configuration_t configuration
readable_data_t readable_data_1
readable_data_t readable_data_2
readable_data_t *readable_data_read_ptr
readable_data_t *readable_data_write_ptr
readable_data_t *readable_data_temp_ptr
writable_data_t writable_data
writable_data_t *writable_data_ptr
uint8_t readable_data_address
uint8_t readable_data_length
uint8_t i2c_rx_data[I2C_MAX_DATA_LENGTH]
uint8_t lastcommand
uint8_t i2c_error
uint8_t i2c_time
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool inside_transaction
uint16_t transaction_time
uint16_t timer_counter_ms
state_t state
wind_state_t wind_state

Current sensors reading task state.

bool is_event_activate_wind_task

Enable or disable activation of WIND task by timer.

bool is_event_wind_task

Enable or disable the WIND task.

bool is_event_command_task
file i2c-wind.ino
#include "i2c-wind.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi()

Init SPI library.

Return

void.

void init_rtc()

Init RTC module.

Return

void.

void init_system()

Init system.

Return

void.

void print_configuration()

Print current configuration.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

ISR(TIMER1_OVF_vect)
void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void getSDFromUV(float u, float v, uint16_t *speed, uint16_t *direction)
void print_registers(void)
void make_report(bool init)

Main routine for processing the samples to calculate an observation.

Return

void.

void elaborate_circular_buffer(void)

Main routine for processing the samples in circular buffer to calculate an observation.

Return

void.

void exchange_buffers()

Exchange reader and writer pointer to buffer.

Return

void.

void reset_samples_buffer()

Reset samples buffers to default value.

Return

void.

void reset_data(volatile readable_data_t *ptr)
void command_task()

Command Task. Execute the command received on i2c bus by reading i2c received data buffer.

Execute the command received on i2c bus by reading i2c received data buffer.

Return

void.

void copy_buffers()
file SdFormatter.ino
#include "SdFat.h"#include "sdios.h"

Defines

SDCARD_SS_PIN
SPI_CLOCK
SD_CONFIG
sdError(msg)

Functions

ArduinoOutStream cout(Serial)
void sdErrorHalt()
void clearSerialInput()
void eraseCard()
void formatCard()
void printConfig(SdSpiConfig config)
bool cidDmp()
bool csdDmp()
void errorPrint()
bool mbrDmp()
void dmpVol()
void printCardType()
void printConfig(SdioConfig config)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

const int8_t DISABLE_CS_PIN = -1
const uint8_t SD_CS_PIN = SDCARD_SS_PIN
uint32_t cardSectorCount = 0
uint8_t sectorBuffer[512]
SdCardFactory cardFactory
SdCard *m_card = nullptr
SdFs sd
cid_t m_cid
csd_t m_csd
uint32_t m_eraseSize
uint32_t m_ocr
uint32_t const ERASE_SIZE = 262144L
file sensor_config.ino
#include "Wire.h"#include <Arduino.h>#include "registers-radiation.h"#include "registers-wind.h"#include "registers-th.h"#include "registers-rain.h"#include "registers-power.h"#include <i2c_utility.h>

Defines

WIND_POWER_ON_DELAY_MS
WIND_POWER_PIN
GWS_SERIAL_BAUD
GWS_SERIAL_TIMEOUT_MS
UART_RX_BUFFER_LENGTH
CONFMSG
SAFEMSG

Functions

HardwareSerial Serial1(D0, D1)
void scanI2CBus(byte from_addr, byte to_addr, void (*callback)(byte address, byte result))
void scanFunc(byte addr, byte result)
void windsonicSerialReset()
void windsonicReceiveTerminatedMessage(const char terminator)
void windsonicReceiveMessage(const char terminator)
void windsonicPowerOff()
void windsonicPowerOn()
void windsonicFlush(void)
bool windsonicEnterConfigMode(void)
bool windsonicEnterConfigModeAllBaudrate()
bool windsonicInitSafeMode()
void windsonicConfigure(void)
void windsonicSconfigure(void)
char getCommand()
void displayHelp()
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

byte start_address = 1
byte end_address = 127
uint16_t uart_rx_buffer_length
char uart_rx_buffer[UART_RX_BUFFER_LENGTH]
const char version[] = "2.0"
file sensor_config.ino
#include "Wire.h"#include <Arduino.h>#include "registers-radiation.h"#include "registers-wind.h"#include "registers-th.h"#include "registers-rain.h"#include "registers-power.h"#include <i2c_utility.h>#include <menu.h>#include <menuIO/hd44780_I2CexpOut.h>#include <menuIO/RotaryIn.h>#include <menuIO/IRremoteIn.h>#include <menuIO/keyIn.h>#include <menuIO/chainStream.h>#include <menuIO/serialOut.h>#include <menuIO/serialIn.h>#include <hd44780.h>#include <hd44780ioClass/hd44780_I2Cexp.h>

Defines

WIND_POWER_ON_DELAY_MS
WIND_POWER_PIN
GWS_SERIAL_BAUD
GWS_SERIAL_TIMEOUT_MS
UART_RX_BUFFER_LENGTH
encA
encB
encBtn
IR_PIN
MAX_DEPTH
CONFMSG
SAFEMSG

Functions

HardwareSerial Serial1(D0, D1)
void scanI2CBus(byte from_addr, byte to_addr, void (*callback)(byte address, byte result))
result scan_i2c_bus()
result i2c_solar_radiation_address(eventMask e, prompt &item)
result i2c_solar_radiation_oneshot(eventMask e, prompt &item)
result i2c_solar_radiation_offset(eventMask e, prompt &item)
result i2c_solar_radiation_gain(eventMask e, prompt &item)
result i2c_solar_radiation_sensor_voltage(eventMask e, prompt &item)
result i2c_solar_radiation_sensor_radiation(eventMask e, prompt &item)
result i2c_solar_radiation_save_all(eventMask e, prompt &item)
result i2c_th_address(eventMask e, prompt &item)
result i2c_th_oneshot(eventMask e, prompt &item)
result i2c_th_sensor_type1(eventMask e, prompt &item)
result i2c_th_sensor_address1(eventMask e, prompt &item)
result i2c_th_sensor_type2(eventMask e, prompt &item)
result i2c_th_sensor_address2(eventMask e, prompt &item)
result i2c_th_save_all(eventMask e, prompt &item)
result i2c_rain_address(eventMask e, prompt &item)
result i2c_rain_oneshot(eventMask e, prompt &item)
result i2c_rain_tipping_bucket_time(eventMask e, prompt &item)
result i2c_rain_rain_for_tip(eventMask e, prompt &item)
result i2c_rain_save_all(eventMask e, prompt &item)
result i2c_power_address(eventMask e, prompt &item)
result i2c_power_oneshot(eventMask e, prompt &item)
result i2c_power_voltage_max_panel(eventMask e, prompt &item)
result i2c_power_voltage_max_battery(eventMask e, prompt &item)
result i2c_power_save_all(eventMask e, prompt &item)
result i2c_wind_address(eventMask e, prompt &item)
result i2c_wind_oneshot(eventMask e, prompt &item)
result i2c_wind_save_all(eventMask e, prompt &item)
result windsonic_sconfigurator(eventMask e, prompt &item)
result windsonic_configurator(eventMask e, prompt &item)
TOGGLE (radiationOneshot, subMenuRadiationOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_solar_radiation_oneshot, exitEvent), VALUE("False", false, i2c_solar_radiation_oneshot, exitEvent)) MENU(subMenuRadiationSave
Save OP ("Yes", i2c_solar_radiation_save_all, enterEvent)
Save EXIT ("<Back"))
MENU (subMenuRadiation,"i2c_radiation", doNothing, noEvent, noStyle, FIELD(radiationAddress,"I2C address","", 0, 127, 1, 0, i2c_solar_radiation_address, exitEvent, noStyle), SUBMENU(subMenuRadiationOneshot), FIELD(radiationOffset,"ADC offset","",-127.0, 127.0, 1.0, 0, i2c_solar_radiation_offset, exitEvent, noStyle), altFIELD(decPlaces< 3 >::menuField, radiationGain,"ADC gain","", 0., 2., 0.1, 0.001, i2c_solar_radiation_gain, exitEvent, noStyle), altFIELD(decPlaces< 0 >::menuField, radiationSensorVoltage,"Volt MAX"," mV", 0.0, 10000.0, 100.0, 1.0, i2c_solar_radiation_sensor_voltage, exitEvent, noStyle), altFIELD(decPlaces< 0 >::menuField, radiationSensorRadiation,"Radi MAX"," w/m^2", 0.0, 10000.0, 100.0, 1.0, i2c_solar_radiation_sensor_radiation, exitEvent, noStyle), SUBMENU(subMenuRadiationSave), EXIT("<Back"))
TOGGLE (thOneshot, subMenuThOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_th_oneshot, exitEvent), VALUE("False", false, i2c_th_oneshot, exitEvent)) MENU(subMenuThSave
Save OP ("Yes", i2c_th_save_all, enterEvent)
MENU (subMenuTh,"i2c_th", doNothing, noEvent, noStyle, FIELD(thAddress,"I2C address","", 0, 127, 1, 0, i2c_th_address, exitEvent, noStyle), SUBMENU(subMenuThOneshot), EDIT("sensor1 type", thSensorType1, alpha, i2c_th_sensor_type1, exitEvent, noStyle), FIELD(thSensorAddress1,"sensor1 address","", 0, 127, 1, 0, i2c_th_sensor_address1, exitEvent, noStyle), EDIT("sensor2 type", thSensorType2, alpha, i2c_th_sensor_type2, exitEvent, noStyle), FIELD(thSensorAddress2,"sensor2 address","", 0, 127, 1, 0, i2c_th_sensor_address2, exitEvent, noStyle), SUBMENU(subMenuThSave), EXIT("<Back"))
TOGGLE (rainOneshot, subMenuRainOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_rain_oneshot, exitEvent), VALUE("False", false, i2c_rain_oneshot, exitEvent)) MENU(subMenuRainSave
Save OP ("Yes", i2c_rain_save_all, enterEvent)
MENU (subMenuRain,"i2c_rain", doNothing, noEvent, noStyle, FIELD(rainAddress,"I2C address","", 0, 127, 1, 0, i2c_rain_address, exitEvent, noStyle), SUBMENU(subMenuRainOneshot), FIELD(rainTippingBucketTime,"Tip time","ms", 0, 1000, 10, 1, i2c_rain_tipping_bucket_time, exitEvent, noStyle), FIELD(rainRainForTip,"Tip value","mm/10", 1, 20, 1, 0, i2c_rain_rain_for_tip, exitEvent, noStyle), SUBMENU(subMenuRainSave), EXIT("<Back"))
TOGGLE (powerOneshot, subMenuPowerOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_power_oneshot, exitEvent), VALUE("False", false, i2c_power_oneshot, exitEvent)) MENU(subMenuPowerSave
Save OP ("Yes", i2c_power_save_all, enterEvent)
MENU (subMenuPower,"i2c_power", doNothing, noEvent, noStyle, FIELD(powerAddress,"I2C address","", 0, 127, 1, 0, i2c_power_address, exitEvent, noStyle), SUBMENU(subMenuPowerOneshot), FIELD(powerVoltageMaxPanel,"Panel max","mV", 1, 50000, 100, 1, i2c_power_voltage_max_panel, exitEvent, noStyle), FIELD(powerVoltageMaxBattery,"Battery max","mV", 1, 30000, 100, 1, i2c_power_voltage_max_battery, exitEvent, noStyle), SUBMENU(subMenuPowerSave), EXIT("<Back"))
TOGGLE (windOneshot, subMenuWindOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_wind_oneshot, exitEvent), VALUE("False", false, i2c_wind_oneshot, exitEvent)) MENU(subMenuWindSave
Save OP ("Yes", i2c_wind_save_all, enterEvent)
MENU (subMenuWind,"i2c_wind", doNothing, noEvent, noStyle, FIELD(windAddress,"I2C address","", 0, 127, 1, 0, i2c_wind_address, exitEvent, noStyle), SUBMENU(subMenuWindOneshot), SUBMENU(subMenuWindSave), EXIT("<Back"))
MENU (mainMenu,"Configuration", doNothing, noEvent, noStyle, SUBMENU(subMenuRadiation), SUBMENU(subMenuTh), SUBMENU(subMenuRain), SUBMENU(subMenuPower), SUBMENU(subMenuWind), OP("configure windsonic", windsonic_configurator, enterEvent), OP("sconfigure windsonic", windsonic_sconfigurator, enterEvent), OP("Scan i2c bus", scan_i2c_bus, enterEvent), EXIT("<Exit go to serial port"))
encoderInStream<encA, encB> encStream(encoder)
irInStream<IR_PIN> irStream(ir)
keyIn<1> encButton(encBtn_map)
serialIn serial(Serial)
MENU_INPUTS (in,&irStream,&encStream,&encButton,&serial)
panelsList pList (panels, nodes, 1)
serialOut outSerial(Serial, serialTops)
liquidCrystalOut outLcd(lcd, lcdTops, pList)
outputsList out (outputs, sizeof(outputs)/sizeof(menuOut *))
NAVROOT(nav, mainMenu, MAX_DEPTH, in, out)
result display_status(menuOut &o, idleEvent e)
result display_nostatus(menuOut &o, idleEvent e)
result idle(menuOut &o, idleEvent e)
result look_at_serial_message(menuOut &o, idleEvent e)
void encoderprocess()
void scanFunc(byte addr, byte result)
void windsonicSerialReset()
void windsonicReceiveTerminatedMessage(const char terminator)
void windsonicReceiveMessage(const char terminator)
void windsonicPowerOff()
void windsonicPowerOn()
void windsonicFlush(void)
bool windsonicEnterConfigMode(void)
bool windsonicEnterConfigModeAllBaudrate()
bool windsonicInitSafeMode()
void windsonicConfigure(void)
void windsonicSconfigure(void)
char getCommand()
void displayHelp()
bool do_i2c_solar_radiation_address(void)
bool do_i2c_solar_radiation_oneshot(void)
bool do_i2c_solar_radiation_offset(void)
bool do_i2c_solar_radiation_gain(void)
bool do_i2c_solar_radiation_sensor_voltage(void)
bool do_i2c_solar_radiation_sensor_radiation(void)
bool do_i2c_solar_radiation_save(void)
bool do_i2c_th_address(void)
bool do_i2c_th_oneshot(void)
bool do_i2c_th_sensor_type1(void)
bool do_i2c_th_sensor_address1(void)
bool do_i2c_th_sensor_type2(void)
bool do_i2c_th_sensor_address2(void)
bool do_i2c_th_save(void)
bool do_i2c_rain_address(void)
bool do_i2c_rain_oneshot(void)
bool do_i2c_rain_rain_for_tip(void)
bool do_i2c_rain_tipping_bucket_time(void)
bool do_i2c_rain_save(void)
bool do_i2c_power_address(void)
bool do_i2c_power_oneshot(void)
bool do_i2c_power_voltage_max_panel(void)
bool do_i2c_power_voltage_max_battery(void)
bool do_i2c_power_save(void)
bool do_i2c_wind_address(void)
bool do_i2c_wind_oneshot(void)
void do_windsonic_sconfigurator(void)
void do_windsonic_configurator(void)
bool do_i2c_wind_save(void)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void loop_menu()
void loop_serial()

Variables

uint16_t uart_rx_buffer_length
char uart_rx_buffer[UART_RX_BUFFER_LENGTH]
const char version[] = "4.0"
hd44780_I2Cexp lcd
bool last_status
bool true_idle_status = false
uint8_t radiationAddress = I2C_SOLAR_RADIATION_DEFAULT_ADDRESS
bool radiationOneshot = false
float radiationOffset = 0.0
float radiationGain = 1.0
float radiationSensorVoltage = 5000.0
float radiationSensorRadiation = 2000.0
uint8_t thAddress = I2C_TH_DEFAULT_ADDRESS
bool thOneshot = false
char thSensorType1[] = "HYT"
uint8_t thSensorAddress1 = 40
char thSensorType2[] = " "
uint8_t thSensorAddress2 = 0
uint8_t rainAddress = I2C_RAIN_DEFAULT_ADDRESS
bool rainOneshot = true
uint16_t rainTippingBucketTime = 50
uint8_t rainRainForTip = 1
uint8_t powerAddress = I2C_POWER_DEFAULT_ADDRESS
bool powerOneshot = false
uint16_t powerVoltageMaxPanel = 30000
uint16_t powerVoltageMaxBattery = 15000
uint8_t windAddress = I2C_WIND_DEFAULT_ADDRESS
bool windOneshot = false
uint8_t windType = 1
Save configuration
Save doNothing
Save noEvent
Save noStyle
const char *const alpha[] MEMMODE = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}
encoderIn<encA, encB> encoder
irIn<IR_PIN> ir
keyMap encBtn_map[] = {{-encBtn, defaultNavCodes[enterCmd].ch}}
menuIn *inputsList[] = {&encButton}
navNode *nodes[sizeof(panels) / sizeof(panel)]
idx_t serialTops[MAX_DEPTH]
idx_t lcdTops[MAX_DEPTH]
file sensor_config.ino
#include "Wire.h"#include <Arduino.h>#include <ArduinoLog.h>#include "registers-master.h"#include "registers-radiation.h"#include "registers-wind.h"#include "registers-th.h"#include "registers-rain.h"#include "registers-power.h"#include <i2c_utility.h>#include <stima-config.h>#include <sensors_config.h>#include <ethernet_config.h>#include "sensor_config.h"#include "lcd_config.h"#include <EEPROM.h>#include <menu.h>#include <menuIO/hd44780_I2CexpOut.h>#include <menuIO/RotaryIn.h>#include <menuIO/IRremoteIn.h>#include <menuIO/keyIn.h>#include <menuIO/chainStream.h>#include <menuIO/serialOut.h>#include <menuIO/serialIn.h>#include <SPI.h>#include <SdFat.h>#include "sdios.h"#include <plugin/SdFatMenu.h>#include <hd44780.h>#include <hd44780ioClass/hd44780_I2Cexp.h>

Defines

encA
encB
encBtn
IR_PIN
WIND_POWER_PIN
LOG_LEVEL
WIND_POWER_ON_DELAY_MS
GWS_SERIAL_BAUD
GWS_SERIAL_TIMEOUT_MS
UART_RX_BUFFER_LENGTH
SDCARD_SS
SD_CONFIG
MAX_DEPTH
CONFMSG
SAFEMSG
CHUNK

Functions

HardwareSerial Serial1(D0, D1)
result filePick(eventMask event, navNode &nav, prompt &item)
void scanI2CBus(byte from_addr, byte to_addr, void (*callback)(byte address, byte result))
result scan_i2c_bus()
result i2c_master_save_i2c_all(eventMask e, prompt &item)
result i2c_master_save_eeprom_all(eventMask e, prompt &item)
result i2c_solar_radiation_address(eventMask e, prompt &item)
result i2c_solar_radiation_oneshot(eventMask e, prompt &item)
result i2c_solar_radiation_offset(eventMask e, prompt &item)
result i2c_solar_radiation_gain(eventMask e, prompt &item)
result i2c_solar_radiation_sensor_voltage(eventMask e, prompt &item)
result i2c_solar_radiation_sensor_radiation(eventMask e, prompt &item)
result i2c_solar_radiation_save_all(eventMask e, prompt &item)
result i2c_th_address(eventMask e, prompt &item)
result i2c_th_oneshot(eventMask e, prompt &item)
result i2c_th_sensor_type1(eventMask e, prompt &item)
result i2c_th_sensor_address1(eventMask e, prompt &item)
result i2c_th_sensor_type2(eventMask e, prompt &item)
result i2c_th_sensor_address2(eventMask e, prompt &item)
result i2c_th_save_all(eventMask e, prompt &item)
result i2c_rain_address(eventMask e, prompt &item)
result i2c_rain_oneshot(eventMask e, prompt &item)
result i2c_rain_tipping_bucket_time(eventMask e, prompt &item)
result i2c_rain_rain_for_tip(eventMask e, prompt &item)
result i2c_rain_save_all(eventMask e, prompt &item)
result i2c_power_address(eventMask e, prompt &item)
result i2c_power_oneshot(eventMask e, prompt &item)
result i2c_power_voltage_max_panel(eventMask e, prompt &item)
result i2c_power_voltage_max_battery(eventMask e, prompt &item)
result i2c_power_save_all(eventMask e, prompt &item)
result i2c_wind_address(eventMask e, prompt &item)
result i2c_wind_oneshot(eventMask e, prompt &item)
result i2c_wind_save_all(eventMask e, prompt &item)
result sdcardFormat(eventMask e, prompt &item)
result windsonic_sconfigurator(eventMask e, prompt &item)
result windsonic_configurator(eventMask e, prompt &item)
SDMenuT< CachedFSO< SdFat, 32 > > filePickMenu (sd,"Select conf file","/", filePick, enterEvent)
MENU (subMenuMasterEepromSave,"EE save conf", doNothing, noEvent, noStyle, OP("Yes write on EEPROM", i2c_master_save_eeprom_all, enterEvent), EXIT("<Back"))
MENU (subMenuMasterI2cSave,"I2C save conf", doNothing, noEvent, noStyle, OP("Yes write on I2C", i2c_master_save_i2c_all, enterEvent), EXIT("<Back"))
MENU (subMenuMaster,"Master", doNothing, noEvent, noStyle, SUBMENU(filePickMenu), SUBMENU(subMenuMasterEepromSave), SUBMENU(subMenuMasterI2cSave), EXIT("<Back"))
TOGGLE (radiationOneshot, subMenuRadiationOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_solar_radiation_oneshot, exitEvent), VALUE("False", false, i2c_solar_radiation_oneshot, exitEvent)) MENU(subMenuRadiationSave
Save OP ("Yes", i2c_solar_radiation_save_all, enterEvent)
Save EXIT ("<Back"))
MENU (subMenuRadiation,"i2c_radiation", doNothing, noEvent, noStyle, FIELD(radiationAddress,"I2C address","", 0, 127, 1, 0, i2c_solar_radiation_address, exitEvent, noStyle), SUBMENU(subMenuRadiationOneshot), FIELD(radiationOffset,"ADC offset","",-127.0, 127.0, 1.0, 0, i2c_solar_radiation_offset, exitEvent, noStyle), altFIELD(decPlaces< 3 >::menuField, radiationGain,"ADC gain","", 0., 2., 0.1, 0.001, i2c_solar_radiation_gain, exitEvent, noStyle), altFIELD(decPlaces< 0 >::menuField, radiationSensorVoltage,"Volt MAX"," mV", 0.0, 10000.0, 100.0, 1.0, i2c_solar_radiation_sensor_voltage, exitEvent, noStyle), altFIELD(decPlaces< 0 >::menuField, radiationSensorRadiation,"Radi MAX"," w/m^2", 0.0, 10000.0, 100.0, 1.0, i2c_solar_radiation_sensor_radiation, exitEvent, noStyle), SUBMENU(subMenuRadiationSave), EXIT("<Back"))
TOGGLE (thOneshot, subMenuThOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_th_oneshot, exitEvent), VALUE("False", false, i2c_th_oneshot, exitEvent)) MENU(subMenuThSave
Save OP ("Yes", i2c_th_save_all, enterEvent)
MENU (subMenuTh,"i2c_th", doNothing, noEvent, noStyle, FIELD(thAddress,"I2C address","", 0, 127, 1, 0, i2c_th_address, exitEvent, noStyle), SUBMENU(subMenuThOneshot), EDIT("sensor1 type", thSensorType1, alpha, i2c_th_sensor_type1, exitEvent, noStyle), FIELD(thSensorAddress1,"sensor1 address","", 0, 127, 1, 0, i2c_th_sensor_address1, exitEvent, noStyle), EDIT("sensor2 type", thSensorType2, alpha, i2c_th_sensor_type2, exitEvent, noStyle), FIELD(thSensorAddress2,"sensor2 address","", 0, 127, 1, 0, i2c_th_sensor_address2, exitEvent, noStyle), SUBMENU(subMenuThSave), EXIT("<Back"))
TOGGLE (rainOneshot, subMenuRainOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_rain_oneshot, exitEvent), VALUE("False", false, i2c_rain_oneshot, exitEvent)) MENU(subMenuRainSave
Save OP ("Yes", i2c_rain_save_all, enterEvent)
MENU (subMenuRain,"i2c_rain", doNothing, noEvent, noStyle, FIELD(rainAddress,"I2C address","", 0, 127, 1, 0, i2c_rain_address, exitEvent, noStyle), SUBMENU(subMenuRainOneshot), FIELD(rainTippingBucketTime,"Tip time","ms", 0, 1000, 10, 1, i2c_rain_tipping_bucket_time, exitEvent, noStyle), FIELD(rainRainForTip,"Tip value","mm/10", 1, 20, 1, 0, i2c_rain_rain_for_tip, exitEvent, noStyle), SUBMENU(subMenuRainSave), EXIT("<Back"))
TOGGLE (powerOneshot, subMenuPowerOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_power_oneshot, exitEvent), VALUE("False", false, i2c_power_oneshot, exitEvent)) MENU(subMenuPowerSave
Save OP ("Yes", i2c_power_save_all, enterEvent)
MENU (subMenuPower,"i2c_power", doNothing, noEvent, noStyle, FIELD(powerAddress,"I2C address","", 0, 127, 1, 0, i2c_power_address, exitEvent, noStyle), SUBMENU(subMenuPowerOneshot), FIELD(powerVoltageMaxPanel,"Panel max","mV", 1, 50000, 100, 1, i2c_power_voltage_max_panel, exitEvent, noStyle), FIELD(powerVoltageMaxBattery,"Battery max","mV", 1, 30000, 100, 1, i2c_power_voltage_max_battery, exitEvent, noStyle), SUBMENU(subMenuPowerSave), EXIT("<Back"))
TOGGLE (windOneshot, subMenuWindOneshot,"Oneshot: ", doNothing, noEvent, noStyle, VALUE("True", true, i2c_wind_oneshot, exitEvent), VALUE("False", false, i2c_wind_oneshot, exitEvent)) MENU(subMenuWindSave
Save OP ("Yes", i2c_wind_save_all, enterEvent)
MENU (subMenuWind,"i2c_wind", doNothing, noEvent, noStyle, FIELD(windAddress,"I2C address","", 0, 127, 1, 0, i2c_wind_address, exitEvent, noStyle), SUBMENU(subMenuWindOneshot), SUBMENU(subMenuWindSave), EXIT("<Back"))
MENU (subMenuSdformat,"SD format", doNothing, noEvent, noStyle, OP("Yes erase all data", sdcardFormat, enterEvent), EXIT("<Back"))
MENU (mainMenu,"Configuration", doNothing, noEvent, noStyle, SUBMENU(subMenuMaster), SUBMENU(subMenuRadiation), SUBMENU(subMenuTh), SUBMENU(subMenuRain), SUBMENU(subMenuPower), SUBMENU(subMenuWind), SUBMENU(subMenuSdformat), OP("configure windsonic", windsonic_configurator, enterEvent), OP("sconfigure windsonic", windsonic_sconfigurator, enterEvent), OP("Scan i2c bus", scan_i2c_bus, enterEvent), EXIT("<Exit go to serial port"))
encoderInStream<encA, encB> encStream(encoder)
irInStream<IR_PIN> irStream(ir)
keyIn<1> encButton(encBtn_map)
serialIn serial(Serial)
MENU_INPUTS (in,&irStream,&encStream,&encButton,&serial)
panelsList pList (panels, nodes, 1)
serialOut outSerial(Serial, serialTops)
liquidCrystalOut outLcd(lcd, lcdTops, pList)
outputsList out (outputs, sizeof(outputs)/sizeof(menuOut *))
NAVROOT(nav, mainMenu, MAX_DEPTH, in, out)
result display_status(menuOut &o, idleEvent e)
result display_nostatus(menuOut &o, idleEvent e)
result idle(menuOut &o, idleEvent e)
result look_at_serial_message(menuOut &o, idleEvent e)
void encoderprocess()
void scanFunc(byte addr, byte result)
void windsonicSerialReset()
void windsonicReceiveTerminatedMessage(const char terminator)
void windsonicReceiveMessage(const char terminator)
void windsonicPowerOff()
void windsonicPowerOn()
void windsonicFlush(void)
bool windsonicEnterConfigMode(void)
bool windsonicEnterConfigModeAllBaudrate()
bool windsonicInitSafeMode()
void windsonicConfigure(void)
void windsonicSconfigure(void)
bool cidDmp()
bool csdDmp()
void errorPrint()
bool mbrDmp()
void dmpVol()
void printCardType()
char getCommand()
void displayHelp()
void print_configuration()

Print current configuration.

Return

void.

bool do_i2c_master_config(uint16_t index, uint8_t *conf, uint8_t conflength)
bool do_i2c_master_save(void)
bool do_i2c_solar_radiation_address(void)
bool do_i2c_solar_radiation_oneshot(void)
bool do_i2c_solar_radiation_offset(void)
bool do_i2c_solar_radiation_gain(void)
bool do_i2c_solar_radiation_sensor_voltage(void)
bool do_i2c_solar_radiation_sensor_radiation(void)
bool do_i2c_solar_radiation_save(void)
bool do_i2c_th_address(void)
bool do_i2c_th_oneshot(void)
bool do_i2c_th_sensor_type1(void)
bool do_i2c_th_sensor_address1(void)
bool do_i2c_th_sensor_type2(void)
bool do_i2c_th_sensor_address2(void)
bool do_i2c_th_save(void)
bool do_i2c_rain_address(void)
bool do_i2c_rain_oneshot(void)
bool do_i2c_rain_rain_for_tip(void)
bool do_i2c_rain_tipping_bucket_time(void)
bool do_i2c_rain_save(void)
bool do_i2c_power_address(void)
bool do_i2c_power_oneshot(void)
bool do_i2c_power_voltage_max_panel(void)
bool do_i2c_power_voltage_max_battery(void)
bool do_i2c_power_save(void)
bool do_i2c_wind_address(void)
bool do_i2c_wind_oneshot(void)
void do_windsonic_sconfigurator(void)
void do_windsonic_configurator(void)
bool do_i2c_wind_save(void)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void loop_menu()
void loop_serial()

Variables

uint16_t uart_rx_buffer_length
char uart_rx_buffer[UART_RX_BUFFER_LENGTH]
const char version[] = "4.0"
SdFs sd
SdCardFactory cardFactory
SdCard *m_card = nullptr
cid_t m_cid
csd_t m_csd
uint32_t m_eraseSize
uint32_t m_ocr
hd44780_I2Cexp lcd
bool last_status
bool true_idle_status = false
uint8_t radiationAddress = I2C_SOLAR_RADIATION_DEFAULT_ADDRESS
bool radiationOneshot = false
float radiationOffset = 0.0
float radiationGain = 1.0
float radiationSensorVoltage = 5000.0
float radiationSensorRadiation = 2000.0
uint8_t thAddress = I2C_TH_DEFAULT_ADDRESS
bool thOneshot = false
char thSensorType1[] = "HYT"
uint8_t thSensorAddress1 = 40
char thSensorType2[] = " "
uint8_t thSensorAddress2 = 0
uint8_t rainAddress = I2C_RAIN_DEFAULT_ADDRESS
bool rainOneshot = true
uint16_t rainTippingBucketTime = 50
uint8_t rainRainForTip = 1
uint8_t powerAddress = I2C_POWER_DEFAULT_ADDRESS
bool powerOneshot = false
uint16_t powerVoltageMaxPanel = 30000
uint16_t powerVoltageMaxBattery = 15000
uint8_t windAddress = I2C_WIND_DEFAULT_ADDRESS
bool windOneshot = false
uint8_t windType = 1
char filename[100]
char path[100]
Save configuration
Save doNothing
Save noEvent
Save noStyle
const char *const alpha[] MEMMODE = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}
encoderIn<encA, encB> encoder
irIn<IR_PIN> ir
keyMap encBtn_map[] = {{-encBtn, defaultNavCodes[enterCmd].ch}}
menuIn *inputsList[] = {&encButton}
navNode *nodes[sizeof(panels) / sizeof(panel)]
idx_t serialTops[MAX_DEPTH]
idx_t lcdTops[MAX_DEPTH]
file constantdata_config.h

Defines

CONSTANTDATA_BTABLE_LENGTH

Maximum lenght of btable code plus terminator that describe one constant data.

CONSTANTDATA_VALUE_LENGTH

Maximum lenght of value plus terminator for one constant data.

file constantdata_config.h

Defines

CONSTANTDATA_BTABLE_LENGTH

Maximum lenght of btable code plus terminator that describe one constant data.

CONSTANTDATA_VALUE_LENGTH

Maximum lenght of value plus terminator for one constant data.

file ethernet_config.h

Defines

ETHERNET_DEFAULT_DHCP_ENABLE

Default option for enable or disable DHCP protocol with ethernet.

ETHERNET_DEFAULT_MAC

Default mac address for ethernet device.

ETHERNET_DEFAULT_IP

Default ip address for ethernet device.

ETHERNET_DEFAULT_NETMASK

Default netmask for ethernet device.

ETHERNET_DEFAULT_GATEWAY

Default gateway for ethernet device.

ETHERNET_DEFAULT_PRIMARY_DNS

Default primary dns for ethernet device.

ETHERNET_DEFAULT_LOCAL_UDP_PORT

Default local udp port for ethernet device.

ETHERNET_ATTEMPT_MS

Set next ethernet library attempt delay in milliseconds after a failure.

ETHERNET_RETRY_TIME_MS

Set next ethernet task attempt delay in milliseconds after a failure.

ETHERNET_RETRY_COUNT

Maximum number of retry for ethernet task.

ETHERNET_MQTT_TIMEOUT_MS

MQTT timeout in milliseconds for ethernet device.

ETHERNET_MAC_LENGTH

Length in bytes for mac address.

ETHERNET_IP_LENGTH

Length in bytes for ip address.

file ethernet_config.h

Defines

ETHERNET_DEFAULT_DHCP_ENABLE

Default option for enable or disable DHCP protocol with ethernet.

ETHERNET_DEFAULT_MAC

Default mac address for ethernet device.

ETHERNET_DEFAULT_IP

Default ip address for ethernet device.

ETHERNET_DEFAULT_NETMASK

Default netmask for ethernet device.

ETHERNET_DEFAULT_GATEWAY

Default gateway for ethernet device.

ETHERNET_DEFAULT_PRIMARY_DNS

Default primary dns for ethernet device.

ETHERNET_DEFAULT_LOCAL_UDP_PORT

Default local udp port for ethernet device.

ETHERNET_ATTEMPT_MS

Set next ethernet library attempt delay in milliseconds after a failure.

ETHERNET_RETRY_TIME_MS

Set next ethernet task attempt delay in milliseconds after a failure.

ETHERNET_RETRY_COUNT

Maximum number of retry for ethernet task.

ETHERNET_MQTT_TIMEOUT_MS

MQTT timeout in milliseconds for ethernet device.

ETHERNET_MAC_LENGTH

Length in bytes for mac address.

ETHERNET_IP_LENGTH

Length in bytes for ip address.

file ethernet_config.h

Defines

ETHERNET_DEFAULT_DHCP_ENABLE

Default option for enable or disable DHCP protocol with ethernet.

ETHERNET_DEFAULT_MAC

Default mac address for ethernet device.

ETHERNET_DEFAULT_IP

Default ip address for ethernet device.

ETHERNET_DEFAULT_NETMASK

Default netmask for ethernet device.

ETHERNET_DEFAULT_GATEWAY

Default gateway for ethernet device.

ETHERNET_DEFAULT_PRIMARY_DNS

Default primary dns for ethernet device.

ETHERNET_DEFAULT_LOCAL_UDP_PORT

Default local udp port for ethernet device.

ETHERNET_ATTEMPT_MS

Set next ethernet library attempt delay in milliseconds after a failure.

ETHERNET_RETRY_TIME_MS

Set next ethernet task attempt delay in milliseconds after a failure.

ETHERNET_RETRY_COUNT

Maximum number of retry for ethernet task.

ETHERNET_MQTT_TIMEOUT_MS

MQTT timeout in milliseconds for ethernet device.

ETHERNET_MAC_LENGTH

Length in bytes for mac address.

ETHERNET_IP_LENGTH

Length in bytes for ip address.

file gsm_config.h

Defines

GSM_APN_TIM

APN for TIM.

GSM_APN_WIND

APN for WIND.

GSM_APN_VODAFONE

APN for VODAFONE.

GSM_DEFAULT_APN

Default GSM APN.

GSM_DEFAULT_USERNAME

Default GSM username.

GSM_DEFAULT_PASSWORD

Default GSM password.

GSM_APN_LENGTH

Length in bytes for apn.

GSM_USERNAME_LENGTH

Length in bytes for username.

GSM_PASSWORD_LENGTH

Length in bytes for password.

USE_SIM_800C

Enable if you want to use SIM800C.

USE_SIM_800L

Enable if you want to use SIM800L.

file gsm_config.h

Defines

GSM_APN_TIM

APN for TIM.

GSM_APN_WIND

APN for WIND.

GSM_APN_VODAFONE

APN for VODAFONE.

GSM_DEFAULT_APN

Default GSM APN.

GSM_DEFAULT_USERNAME

Default GSM username.

GSM_DEFAULT_PASSWORD

Default GSM password.

GSM_APN_LENGTH

Length in bytes for apn.

GSM_USERNAME_LENGTH

Length in bytes for username.

GSM_PASSWORD_LENGTH

Length in bytes for password.

USE_SIM_800C

Enable if you want to use SIM800C.

USE_SIM_800L

Enable if you want to use SIM800L.

file gsm_config.h

Defines

GSM_APN_TIM

APN for TIM.

GSM_APN_WIND

APN for WIND.

GSM_APN_VODAFONE

APN for VODAFONE.

GSM_DEFAULT_APN

Default GSM APN.

GSM_DEFAULT_USERNAME

Default GSM username.

GSM_DEFAULT_PASSWORD

Default GSM password.

GSM_APN_LENGTH

Length in bytes for apn.

GSM_USERNAME_LENGTH

Length in bytes for username.

GSM_PASSWORD_LENGTH

Length in bytes for password.

USE_SIM_800C

Enable if you want to use SIM800C.

USE_SIM_800L

Enable if you want to use SIM800L.

file lcd_config.h

Defines

LCD_I2C_ADDRESS

LCD i2c address.

LCD_I2C_SECONDARY_ADDRESS

Try this I2C address for LCD if LCD_I2C_ADDRESS fail.

LCD_COLUMNS

Default LCD columns number.

LCD_ROWS

Default LCD rows number.

file lcd_config.h

Defines

LCD_I2C_ADDRESS

LCD i2c address.

LCD_I2C_SECONDARY_ADDRESS

Try this I2C address for LCD if LCD_I2C_ADDRESS fail.

LCD_COLUMNS

Default LCD columns number.

LCD_ROWS

Default LCD rows number.

file lcd_config.h

Defines

LCD_I2C_ADDRESS

Default LCD i2c address.

LCD_COLUMNS

Default LCD columns number.

LCD_ROWS

Default LCD rows number.

file ntp_config.h

Defines

NTP_SERVER_LENGTH

Length in bytes for ntp server data buffer.

NTP_DEFAULT_SERVER

Default NTP server.

file ntp_config.h

Defines

NTP_SERVER_LENGTH

Length in bytes for ntp server data buffer.

NTP_DEFAULT_SERVER

Default NTP server.

file ntp_config.h

Defines

NTP_SERVER_LENGTH

Length in bytes for ntp server data buffer.

NTP_DEFAULT_SERVER

Default NTP server.

file stima-config.h
#include <sensors_config.h>#include <constantdata_config.h>#include <stima_module.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

USE_MQTT

MQTT support.

USE_LCD

LCD support.

USE_SDCARD

SD-Card support.

USE_RTC

RTC support.

USE_TIMER_1

Timer 1 support instead of RTC.

USE_RPC_METHOD_CONFIGURE

RPC method for station configuration.

USE_RPC_METHOD_PREPARE

RPC method for prepare sensors.

USE_RPC_METHOD_PREPANDGET

RPC method for prepare and get data from sensors.

USE_RPC_METHOD_GETJSON

RPC method for get sensor's data.

USE_RPC_METHOD_REBOOT

RPC method for reboot station.

USE_RPC_METHOD_RECOVERY

RPC method for recovery data written on SD card from station.

CONFIGURATION_DEFAULT_TH_ADDRESS

Default i2c i2c-th address.

CONFIGURATION_DEFAULT_RAIN_ADDRESS

Default i2c i2c-rain address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

CONFIGURATION_DEFAULT_NTP_SERVER

Default ntp server.

CONFIGURATION_DEFAULT_ETHERNET_DHCP_ENABLE

Default DHCP status.

CONFIGURATION_DEFAULT_ETHERNET_MAC

Default mac address.

CONFIGURATION_DEFAULT_ETHERNET_IP

Default ip address.

CONFIGURATION_DEFAULT_ETHERNET_NETMASK

Default netmask address.

CONFIGURATION_DEFAULT_ETHERNET_GATEWAY

Default gateway address.

CONFIGURATION_DEFAULT_ETHERNET_PRIMARY_DNS

Default primary dns address.

SENSOR_ERROR_COUNT_MAX
USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

W5500_CHIP_SELECT_PIN

Chip select pin for Wiznet W5500 ethernet module.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

RTC_FREQUENCY

Real time clock frequency for generating interrupt for awaken the microprocessor and execute timed tasks.

RTC_INTERRUPT_PIN

Interrupt pin for rtc.

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler.

USE_CONSTANTDATA_COUNT

Constantdata count.

SENSORS_RETRY_COUNT_MAX

Maximum number of retry for sensors reading.

SENSORS_RETRY_DELAY_MS

Waiting for reading between two attempts.

SENSORS_TESTING_DELAY_S
DATA_PROCESSING_RETRY_COUNT_MAX

Maximum number of retry for processing acquired data.

DATA_PROCESSING_RETRY_DELAY_MS

Wait time between two attempts.

DATA_SAVING_RETRY_COUNT_MAX

Maximum number of retry for saving data on SD-Card.

DATA_SAVING_DELAY_MS

Wait time between two attempts.

MQTT_RETRY_COUNT_MAX

Maximum number of retry for doing mqtt operations.

MQTT_DELAY_MS

Wait time between two attempts.

IP_STACK_TIMEOUT_MS

IPStack timeout.

SUPERVISOR_CONNECTION_RETRY_COUNT_MAX

Maximum number of retry for doing supervisor operations.

SUPERVISOR_CONNECTION_TIMEOUT_MS

Timeout for connecting.

NTP_RETRY_COUNT_MAX

Maximum number of retry for doing ntp operations.

NTP_RETRY_DELAY_MS

Wait time between two NTP attempts.

NTP_TIME_FOR_RESYNC_S

Maximum seconds for resync time over ntp.

NTP_MAX_DIFF_VALID_TIME_S
LCD_TIME_FOR_REINITIALIZE_S

Maximum seconds for reinitialize LCD.

DISPLAY_SET_MAX

Max number of page to show on display when testing sensors.

ETHERNET_RETRY_COUNT_MAX

Maximum number of retry for doing ethernet operations.

ETHERNET_RETRY_DELAY_MS

Wait time between two attempts.

DATE_TIME_STRING_LENGTH

Length of datetime string %04u-%02u-%02uT%02u:%02u:%02u.

file stima-config.h
#include <sensors_config.h>#include <constantdata_config.h>

Defines

MODULE_MAIN_VERSION

Module main version.

MODULE_MINOR_VERSION

Module minor version.

MODULE_CONFIGURATION_VERSION

Module version of compatibile configuration. If you change it, you have to reconfigure.

MODULE_TYPE

Type of module. It is defined in registers.h.

USE_MQTT

MQTT support.

USE_LCD

LCD support.

USE_SDCARD

SD-Card support.

USE_RTC

RTC support.

USE_TIMER_1

Timer 1 support instead of RTC.

USE_RPC_METHOD_CONFIGURE

RPC method for station configuration.

USE_RPC_METHOD_PREPARE

RPC method for prepare sensors.

USE_RPC_METHOD_PREPANDGET

RPC method for prepare and get data from sensors.

USE_RPC_METHOD_GETJSON

RPC method for get sensor's data.

USE_RPC_METHOD_REBOOT

RPC method for reboot station.

USE_RPC_METHOD_RECOVERY

RPC method for recovery data written on SD card from station.

CONFIGURATION_DEFAULT_TH_ADDRESS

Default i2c i2c-th address.

CONFIGURATION_DEFAULT_RAIN_ADDRESS

Default i2c i2c-rain address.

CONFIGURATION_RESET_PIN

Input pin for reset configuration at startup.

CONFIGURATION_DEFAULT_NTP_SERVER

Default ntp server.

CONFIGURATION_DEFAULT_ETHERNET_DHCP_ENABLE

Default DHCP status.

CONFIGURATION_DEFAULT_ETHERNET_MAC

Default mac address.

CONFIGURATION_DEFAULT_ETHERNET_IP

Default ip address.

CONFIGURATION_DEFAULT_ETHERNET_NETMASK

Default netmask address.

CONFIGURATION_DEFAULT_ETHERNET_GATEWAY

Default gateway address.

CONFIGURATION_DEFAULT_ETHERNET_PRIMARY_DNS

Default primary dns address.

SENSOR_ERROR_COUNT_MAX
USE_POWER_DOWN

Enable or disable power down.

DEBOUNCING_POWER_DOWN_TIME_MS

Debounce power down ms.

W5500_CHIP_SELECT_PIN

Chip select pin for Wiznet W5500 ethernet module.

WDT_TIMER

Watchdog timer for periodically check microprocessor block states.

Possible value for WDT_TIMER are: WDTO_15MS, WDTO_30MS, WDTO_60MS, WDTO_120MS, WDTO_250MS, WDTO_500MS, WDTO_1S, WDTO_2S, WDTO_4S, WDTO_8S

RTC_FREQUENCY

Real time clock frequency for generating interrupt for awaken the microprocessor and execute timed tasks.

RTC_INTERRUPT_PIN

Interrupt pin for rtc.

TIMER1_INTERRUPT_TIME_MS

Value in milliseconds for generating timer1 interrupt.

TIMER1_TCNT1_VALUE

Timer1 timer overflow with 1024 prescaler.

USE_CONSTANTDATA_COUNT

Constantdata count.

SENSORS_RETRY_COUNT_MAX

Maximum number of retry for sensors reading.

SENSORS_RETRY_DELAY_MS

Waiting for reading between two attempts.

SENSORS_TESTING_DELAY_S
DATA_PROCESSING_RETRY_COUNT_MAX

Maximum number of retry for processing acquired data.

DATA_PROCESSING_RETRY_DELAY_MS

Wait time between two attempts.

DATA_SAVING_RETRY_COUNT_MAX

Maximum number of retry for saving data on SD-Card.

DATA_SAVING_DELAY_MS

Wait time between two attempts.

MQTT_RETRY_COUNT_MAX

Maximum number of retry for doing mqtt operations.

MQTT_DELAY_MS

Wait time between two attempts.

IP_STACK_TIMEOUT_MS

IPStack timeout.

SUPERVISOR_CONNECTION_RETRY_COUNT_MAX

Maximum number of retry for doing supervisor operations.

SUPERVISOR_CONNECTION_TIMEOUT_MS

Timeout for connecting.

NTP_RETRY_COUNT_MAX

Maximum number of retry for doing ntp operations.

NTP_RETRY_DELAY_MS

Wait time between two NTP attempts.

NTP_TIME_FOR_RESYNC_S

Maximum seconds for resync time over ntp.

NTP_MAX_DIFF_VALID_TIME_S
LCD_TIME_FOR_REINITIALIZE_S

Maximum seconds for reinitialize LCD.

DISPLAY_SET_MAX
ETHERNET_RETRY_COUNT_MAX

Maximum number of retry for doing ethernet operations.

ETHERNET_RETRY_DELAY_MS

Wait time between two attempts.

DATE_TIME_STRING_LENGTH

Length of datetime string %04u-%02u-%02uT%02u:%02u:%02u.

file sensor_config.h
#include <sensors_config.h>#include <mqtt_config.h>#include <constantdata_config.h>#include <gsm_config.h>#include <ntp_config.h>#include <typedef.h>
file stima.h
#include <stima_module.h>#include "stima-config.h"#include <typedef.h>#include <registers.h>#include <registers-master.h>#include <debug.h>#include <ArduinoLog.h>#include <StreamUtils.h>#include <i2c_config.h>#include <json_config.h>#include <ntp_config.h>#include <constantdata_config.h>#include <gsm_config.h>#include <SPI.h>#include <Wire.h>#include <pcf8563.h>#include <rmap_utility.h>#include <TimeLib.h>#include <SensorDriver.h>#include <i2c_utility.h>#include <arduinoJsonRPC.h>#include <ethernet_config.h>#include <Ethernet2.h>#include <IWatchdog.h>#include "STM32LowPower.h"#include <STM32RTC.h>#include <rtc.h>

Defines

WDTO_1S
SLEEP_MODE_PWR_DOWN

Enums

enum state_t

Main loop finite state machine.

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enum supervisor_state_t

Supervisor task finite state machine.

Values:

enumerator SUPERVISOR_INIT

init task variables

enumerator SUPERVISOR_CONNECTION_LEVEL_TASK

enable hardware related tasks for doing connection

enumerator SUPERVISOR_WAIT_CONNECTION_LEVEL_TASK

enable hardware related tasks for doing connection

enumerator SUPERVISOR_TIME_LEVEL_TASK

enable time task for sync time with ntp server

enumerator SUPERVISOR_MANAGE_LEVEL_TASK

enable tasks for manage data (mqtt)

enumerator SUPERVISOR_TEST_SDCARD
enumerator SUPERVISOR_END

performs end operations and deactivate task

enumerator SUPERVISOR_WAIT_STATE

non-blocking waiting time

enum ethernet_state_t

Ethernet task finite state machine.

Values:

enumerator ETHERNET_INIT

init task variables

enumerator ETHERNET_CONNECT

begin ethernet operations

enumerator ETHERNET_OPEN_UDP_SOCKET

open udp socket

enumerator ETHERNET_END

performs end operations and deactivate task

enumerator ETHERNET_WAIT_STATE

non-blocking waiting time

enum sensors_reading_state_t

Sensors reading task finite state machine.

Values:

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_SETUP_CHECK

check errors and if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT
enumerator SENSORS_READING_PREPARE
enumerator SENSORS_READING_IS_PREPARED
enumerator SENSORS_READING_GET
enumerator SENSORS_READING_IS_GETTED
enumerator SENSORS_READING_READ
enumerator SENSORS_READING_NEXT
enumerator SENSORS_READING_END
enumerator SENSORS_READING_WAIT_STATE
enum time_state_t

Time task finite state machine.

Values:

enumerator TIME_INIT

init task variables

enumerator TIME_SEND_ONLINE_REQUEST

send ntp request

enumerator TIME_WAIT_ONLINE_RESPONSE

wait ntp response

enumerator TIME_SET_SYNC_NTP_PROVIDER

set ntp time

enumerator TIME_SET_SYNC_RTC_PROVIDER

set rtc time

enumerator TIME_END

performs end operations and deactivate task

enumerator TIME_WAIT_STATE

non-blocking waiting time

enum rpc_state_t

RPC task finite state machine.

Values:

enumerator RPC_INIT

init task variables

enumerator RPC_EXECUTE

execute function loop

enumerator RPC_END

performs end operations

Functions

JsonRPC streamRpc (false)

Remote Procedure Call object.

void realreboot()
time_t getSystemTime()
void init_logging(void)

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_system(void)

Init system.

Return

void.

void init_rpc(void)

Register RPC.

Return

void.

void init_buffers(void)

Init buffers.

Return

void.

void init_tasks(void)

Init tasks variable and state.

Return

void.

void init_pins(void)

Init hardware pins.

Return

void.

void init_wire(void)

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_spi(void)

Init SPI library.

Return

void.

void init_rtc(void)

Init RTC module.

Return

void.

void init_timer1(void)

Init Timer1 module.

Return

void.

void start_timer(void)

Start Timer1 module.

Return

void.

void stop_timer(void)

Stop Timer1 module.

Return

void.

void interrupt_task_1s(void)

1 seconds task.

Return

void.

void init_sensors(void)

Create and setup sensors.

Return

void.

void print_configuration(void)

Print current configuration.

Return

void.

void load_configuration(void)

Load configuration from EEPROM.

Return

void.

void save_configuration(bool)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void set_default_configuration(void)

Set default configuration to global configuration variable.

Return

void.

void setNextTimeForSensorReading(time_t *next_time, uint16_t time_s)
bool extractSensorsParams(JsonObject &params, char *driver, char *type, uint8_t *address, uint8_t *node)

Extract sensor's parameter.

Return

status code.

Parameters
  • [in] *params: json's params

  • [out] *driver: driver

  • [out] *type: type

  • [out] *address: address

  • [out] *node: node

int configure(JsonObject &params, JsonObject &result)

RPC configuration.

Return

status code.

Parameters
  • *params: json's params

  • &result: json's response

int prepare(JsonObject &params, JsonObject &result)

RPC prepare.

Return

status code.

Parameters
  • *params: json's params

  • &result: json's response

int getjson(JsonObject &params, JsonObject &result)

RPC get json.

Return

status code.

Parameters
  • *params: json's params

  • &result: json's response

int prepandget(JsonObject &params, JsonObject &result)

RPC prepare and get json.

Return

status code.

Parameters
  • *params: json's params

  • &result: json's response

int reboot(JsonObject &params, JsonObject &result)

RPC reboot.

Return

status code.

Parameters
  • *params: json's params

  • &result: json's response

void supervisor_task(void)

Supervisor task. Manage RTC and NTP sync and open/close gsm and ethernet connection.

Return

void.

void sensors_reading_task(bool do_prepare = true, bool do_get = true, char *driver = NULL, char *type = NULL, uint8_t address = 0, uint8_t node = 0, uint8_t *sensor_index = 0, uint32_t *wait_time = NULL)

Sensors reading Task. Read data from sensors.

Return

void.

Parameters
  • do_prepare: if true, execute the prepare sensor's procedure

  • do_get: if true, execute the get sensor's procedure

  • *driver: sensor's driver

  • *type: sensor's type

  • *address: sensor's address

  • *node: sensor's node

  • *sensor_index: sensor's index

  • *wait_time: sensor's wait time

void rtc_task(void)

Real Time Clock task. Read RTC time and sync system time with it.

Return

void.

void time_task(void)

Time task. Get time from NTP and sync RTC with it.

Return

void.

void ethernet_task(void)

Ethernet task. Manage Ethernet operation.

Return

void.

void rtc_interrupt_handler(void)

Real Time Clock interrupt handler.

Return

void.

HardwareSerial Serial1(PB11, PB10)
void wdt_enable(int wdt_timer)
void wdt_reset()
void wdt_disable()
void power_adc_disable()
void power_spi_disable()
void power_timer0_disable()
void power_timer1_disable()
void power_timer2_disable()
void power_adc_enable()
void power_spi_enable()
void power_timer0_enable()
void power_timer1_enable()
void power_timer2_enable()
void set_sleep_mode(int SLEEP_MODE_PWR_DOWN)
void sleep_enable()
void sleep_cpu()
void sleep_disable()

Variables

uint8_t sensors_count = 0
bool is_datetime_set

A valid date and time is setted and usable by station.

bool have_to_reboot

Request for a reboot as soon as possible.

configuration_t readable_configuration

Configuration for this module.

configuration_t writable_configuration

Configuration for this module.

uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
EthernetUDP eth_udp_client

Ethernet UDP client structure.

EthernetClient eth_tcp_client

Ethernet TCP client structure.

SensorDriver *sensors[SENSORS_MAX]
bool is_first_run

If true, the first reading of the sensors was performed.

bool do_reset_first_run

If true, the first reading of the sensors was performed.

bool is_first_test

If true, the first reading of the sensors was performed.

bool is_test
bool is_time_set

If true, the time was readed from rtc or ntp and was setted in system.

bool is_time_for_sensors_reading_updated

If true, the next time has been calculated to read the sensors.

bool is_client_connected

If true, the client (ethernet or gsm) was connected to socket (TCP or UDP).

bool is_client_udp_socket_open

If true, the client (ethernet or gsm) was opened the UDP socket.

bool is_event_client_executed

If true, the client has executed its task.

bool is_event_time_executed

If true, the time task has executed.

bool do_ntp_sync

If true, you must update the time from ntp.

time_t last_ntp_sync

Last date and time when ntp sync was performed.

char json_sensors_data[SENSORS_MAX][JSON_BUFFER_LENGTH]

buffer containing the data read by sensors in json text format.

char json_sensors_data_test[JSON_BUFFER_LENGTH]

buffer containing the data read by sensors in json text format for test only.

time_t system_time

System time since 01/01/1970 00:00:00.

time_t next_ptr_time_for_sensors_reading

Next scheduled time (in seconds since 01/01/1970 00:0:00) for sensors reading.

time_t next_ptr_time_for_testing_sensors

Next scheduled time (in seconds since 01/01/1970 00:0:00) for sensors reading.

uint8_t sensor_reading_failed_count

Counter for failed and skipped sensors.

tmElements_t sensor_reading_time

Date and time corresponding to the last reading of the sensors.

time_t ptr_time_data

Readed data pointer stored on SD-Card for data send.

char stima_name[20]

Name of this module.

state_t state
supervisor_state_t supervisor_state

Supervisor task state.

ethernet_state_t ethernet_state

Ethernet task state.

uint8_t i2c_error
time_state_t time_state

Time task state.

sensors_reading_state_t sensors_reading_state
rpc_state_t rpc_state

RPC task state.

bool is_event_supervisor

Enable or disable the Supervisor task.

bool is_event_sensors_reading
bool is_event_sensors_reading_rpc

Enable or disable the Sensors reading task from RPC.

bool is_event_rtc

Enable or disable the Real Time Clock task.

bool is_event_time

Enable or disable the Time task.

bool is_event_ethernet

Enable or disable the Ethernet task.

bool is_event_rpc

Indicate if RPC is active or not.

STM32RTC &rtc = STM32RTC::getInstance()
file stima.ino
#include <debug_config.h>#include "stima.h"

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_buffers()

Init buffers.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_pins()

Init hardware pins.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void reset_wire()
void init_spi()

Init SPI library.

Return

void.

void init_system()

Init system.

Return

void.

void init_rpc()

Register RPC.

Return

void.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_timer1()

Init Timer1 module.

Return

void.

void start_timer()

Start Timer1 module.

Return

void.

void stop_timer()

Stop Timer1 module.

Return

void.

ISR(TIMER1_OVF_vect)
void init_sensors()

Create and setup sensors.

Return

void.

void setNextTimeForSensorReading(time_t *next_time, uint16_t time_s)
void print_configuration()

Print current configuration.

Return

void.

void set_default_configuration()

Set default configuration to global configuration variable.

Return

void.

void save_configuration(bool is_default)

Save configuration to EEPROM.

Return

void.

Parameters
  • is_default: if true save default configuration; if false save current configuration.

void load_configuration()

Load configuration from EEPROM.

Return

void.

time_t getSystemTime()
void realreboot()
void interrupt_task_1s()

1 seconds task.

Return

void.

void supervisor_task()

Supervisor task. Manage RTC and NTP sync and open/close gsm and ethernet connection.

Return

void.

void rtc_task()

Real Time Clock task. Read RTC time and sync system time with it.

Return

void.

void time_task()

Time task. Get time from NTP and sync RTC with it.

Return

void.

void ethernet_task()

Ethernet task. Manage Ethernet operation.

Return

void.

void sensors_reading_task(bool do_prepare, bool do_get, char *driver, char *type, uint8_t address, uint8_t node, uint8_t *sensor_index, uint32_t *wait_time)

Sensors reading Task. Read data from sensors.

Return

void.

Parameters
  • do_prepare: if true, execute the prepare sensor's procedure

  • do_get: if true, execute the get sensor's procedure

  • *driver: sensor's driver

  • *type: sensor's type

  • *address: sensor's address

  • *node: sensor's node

  • *sensor_index: sensor's index

  • *wait_time: sensor's wait time

file event_groups.h
#include <freertos/event_groups.h>
file FreeRTOS.h
#include <freertos/FreeRTOS.h>
file queue.h
#include <freertos/queue.h>
file semphr.h
#include <freertos/semphr.h>
file stimawifi_config.h

Defines

SOFTWARE_VERSION
MAJOR_VERSION
MINOR_VERSION
WIFI_SSED
WIFI_PASSWORD
DEFAULT_SAMPLETIME
UDP_PORT
OLEDI2CADDRESS
LOG_LEVEL
DATE_TIME_STRING_LENGTH
HEAP_MIN_WARNING
STACK_MIN_WARNING
STIMAHTTP_PORT
FIRMWARE_TYPE
PMS_RESET
SCL_PIN
SDA_PIN
SENSORDRIVER_DRIVER_LEN
SENSORDRIVER_TYPE_LEN
SENSORDRIVER_META_LEN
CH
DATA_BURST
DATA_BURST_RECOVERY
DB_QUEUE_LEN
MQTT_QUEUE_LEN
MQTT_QUEUE_SPACELEFT_MEASURE
MQTT_QUEUE_SPACELEFT_PUBLISH
MQTT_QUEUE_SPACELEFT_RECOVERY
C3SCK
C3MISO
C3MOSI
C3SS
SPICLOCK
SDMAXFILE
SDCARD_INFO_FILE_NAME
SDCARD_ARCHIVE_FILE_NAME
LFMAXFILE
SDRECOVERYTIME
SQLITE_MEMORY
MQTT_TIMEOUT_MS

Timeout in milliseconds for mqtt stack.

IP_STACK_TIMEOUT_MS

IPStack timeout.

MQTT_PACKET_SIZE

Length in bytes for max mqtt packet size.

MQTT_SERVER_PORT
CONSTANTDATA_BTABLE_LENGTH

Maximum lenght of btable code plus terminator that describe one constant data.

CONSTANTDATA_VALUE_LENGTH

Maximum lenght of value plus terminator for one constant data.

file task.h
#include <freertos/task.h>
file timers.h
#include <freertos/timers.h>
file common.h
#include "Arduino.h"#include "stimawifi_config.h"#include "typedef.h"#include <frtosLog.h>#include "thread.hpp"#include "ticks.hpp"#include "queue.hpp"#include <DNSServer.h>#include <ArduinoJson.h>#include <Wire.h>#include <U8g2lib.h>#include "time.h"#include <WiFi.h>#include <ESPmDNS.h>#include <WebServer.h>#include <HTTPClient.h>#include <LittleFS.h>#include "esp_netif.h"#include "esp_sntp.h"#include <TimeAlarms.h>#include <WiFiManager.h>#include <LOLIN_I2C_BUTTON.h>#include <HTTPUpdate.h>#include <Adafruit_NeoPixel.h>#include <sqlite3.h>#include "udp_thread.h"#include "gps_thread.h"#include "measure_thread.h"#include "publish_thread.h"#include "db_thread.h"#include "critical.hpp"#include "semaphore.hpp"#include "SD.h"#include <StreamUtils.h>#include <DS1307RTC.h>#include <esp_task_wdt.h>
file db_thread.cpp
#include "common.h"

Functions

void clearSD()
static int db_exec_callback(void *data, int argc, char **argv, char **azColName)
static int db_obsolete_callback(void *result, int argc, char **argv, char **azColName)
file db_thread.h
file gps_thread.cpp
#include "common.h"

Defines

GPS_SERIAL_SPEED
MESSAGELEN

Functions

HardwareSerial Serial2 (0)

Variables

OZGPS gps_gps
MGPS gps_mgps
file gps_thread.h
#include "ozgps.h"#include <cmath>
file measure_thread.cpp
#include "common.h"#include "measure_thread.h"

Variables

unsigned short int displaypos
file measure_thread.h
#include "SensorManager.h"

Functions

void enqueueMqttMessage(const char *values, const char *timerange, const char *level, measure_data_t &data)
void doMeasure(measure_data_t &data)
void web_values(const char *values)
file publish_thread.cpp
#include "common.h"
file publish_thread.h
#include <Countdown.h>#include <WifiIPStack.h>#include <MQTTClient.h>

Functions

bool publish_maint(MQTT::Client<IPStack, Countdown, MQTT_PACKET_SIZE, 1> &mqttclient, publish_data_t &data)
bool publish_constantdata(MQTT::Client<IPStack, Countdown, MQTT_PACKET_SIZE, 1> &mqttclient, publish_data_t &data)
file stimawifi.h
#include "common.h"

Functions

WebServer webserver(STIMAHTTP_PORT)
U8G2_SSD1306_64X48_ER_F_HW_I2C u8g2(U8G2_R0)
Queue dbQueue (DB_QUEUE_LEN, sizeof(mqttMessage_t))
Queue mqttQueue (MQTT_QUEUE_LEN, sizeof(mqttMessage_t))
BinaryQueue recoveryQueue (sizeof(rpcRecovery_t))
BinarySemaphore recoverySemaphore (false)
String Json()
String Data()
String FullPage()
void writeconfig()
void handle_FullPage()
void handle_Data()
void handle_Json()
void handle_NotFound()
void saveConfigCallback()
String rmap_get_remote_config()
void firmware_upgrade()
String readconfig_rmap()
void writeconfig_rmap(const String payload)
int rmap_config(const String payload)
void readconfig()
void web_values(const char *values)
void measureAndPublish()
void reboot()
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

const char * update_url = "/firmware/update/" FIRMWARE_TYPE "/"
const uint16_t update_port = 80
WiFiManager wifiManager
WiFiClient httpClient
WiFiClient networkClient
MutexStandard loggingmutex
MutexStandard i2cmutex
MutexStandard geomutex
bool shouldSaveConfig = false
bool pmspresent = false
bool oledpresent = false
I2C_BUTTON button
summarydata_t summarydata
georef_t georef = {"", "", 0, &geomutex}
stimawifiStatus_t stimawifiStatus
station_t station
udp_data_t udp_data = {1, &frtosLog, &stimawifiStatus.udp, &georef}
gps_data_t gps_data = {1, &frtosLog, &stimawifiStatus.gps, &georef}
db_data_t db_data = {1, &frtosLog, &dbQueue, &mqttQueue, &recoverySemaphore, &recoveryQueue, &stimawifiStatus.db, &station}
measure_data_t measure_data = {1, &frtosLog, &mqttQueue, &dbQueue, &stimawifiStatus.measure, &station, &summarydata, &i2cmutex, &georef}
publish_data_t publish_data = {1, &frtosLog, &mqttQueue, &dbQueue, &recoveryQueue, &stimawifiStatus.publish, &station, &networkClient}
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, LED_PIN, NEO_GRB + NEO_KHZ800)
char status[15] = ""
file stimawifi.ino
#include "stimawifi.h"

Functions

void display_summary_data(char *status)
void printLocalTime()
void timeavailable(struct timeval *t)
String Json()
String Geo()
String Data()
String FullPage()
void handle_FullPage()
void handle_Data()
void handle_Json()
void handle_Geo()
void handle_NotFound()
void saveConfigCallback()
time_t ntp_set_time()
String rmap_get_remote_config()
void firmware_upgrade()
String readconfig_rmap()
void writeconfig_rmap(const String payload)
int rmap_config(const String payload)
void readconfig()
void writeconfig()
void displayStatus()
void dataRecovery()
void measureAndPublish()
void reboot()
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

file typedef.h
#include <mqtt_config.h>#include <mutex.hpp>

Defines

CONSTANTDATA_BTABLE_LENGTH

Maximum lenght of btable code plus terminator that describe one constant data.

CONSTANTDATA_VALUE_LENGTH

Maximum lenght of value plus terminator for one constant data.

MAX_CONSTANTDATA_COUNT

Numero massimo di dati costanti di stazione (metadati).

Enums

enum status_e

Values:

enumerator unknown
enumerator ok
enumerator error
file udp_thread.cpp
#include "common.h"

Variables

WiFiUDP UDP
OZGPS udp_gps
MGPS udp_mgps
file udp_thread.h
#include <WiFiUdp.h>#include "ozgps.h"#include <cmath>
file test_hyt271.ino
#include <hyt2x1.h>

Defines

POWER_PIN

Copyright (C) 2017 Marco Baldinetti m.baldinetti@digiteco.it authors: Marco Baldinetti m.baldinetti@digiteco.it

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Functions

void test_read_ht(int8_t address)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

file hardware_config.h

Defines

I2C_BUS_CLOCK
I2C_MAX_DATA_LENGTH
file test_i2c_multimaster.ino
#include <Arduino.h>#include <debug_config.h>#include <i2c_config.h>#include <avr/sleep.h>#include <avr/power.h>#include <avr/wdt.h>#include <Wire.h>#include <i2c_utility.h>#include <ArduinoLog.h>

Defines

I2C_ADDRESS_1
I2C_ADDRESS_2
I2C_ADDRESS_3
I2C_ADDRESS_4
I2C_MY_ADDRESS
I2C_MAX_ERROR_COUNT
I2C_CHECK_DELAY_MS
I2C_REQUEST_MIN_DELAY_MS
I2C_REQUEST_MAX_DELAY_MS
I2C_SEND_DATA_MIN_DELAY_MS
I2C_SEND_DATA_MAX_DELAY_MS
PRINT_STATUS_DELAY_MS
WDT_TIMER

Enums

enum state_t

Values:

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator REBOOT

reboot the machine

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

enumerator INIT

init tasks and sensors

enumerator TASKS_EXECUTION

execute active tasks

enumerator END

go to ENTER_POWER_DOWN or TASKS_EXECUTION

Functions

uint8_t I2C_ClearBus_NEW()
bool check_i2c_bus()
void i2c_request_interrupt_handler()

I2C request interrupt handler.

Return

void.

void i2c_receive_interrupt_handler(int rx_data_length)

I2C receive interrupt handler.

Return

void.

Parameters
  • [in] rx_data_length: received data length in bytes.

void init_power_down(uint32_t *time_ms, uint32_t debouncing_ms)

Enter power down mode.

Return

void.

Parameters
  • time_ms: pointer to a variable to save the last instant you entered power down.

  • debouncing_ms: delay to power down.

void init_wdt(uint8_t wdt_timer)

Init watchdog.

Return

void.

Parameters
  • wdt_timer: a time value for init watchdog (WDTO_xxxx).

void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void init_system()

Init system.

Return

void.

void init_tasks()

Init tasks variable and state.

Return

void.

void init_sensors()

Create and setup sensors.

Return

void.

void reset_i2c_buffer(void *buffer, uint8_t *length)
void received_data()
void send_data(uint8_t write_data_length, uint8_t i2c_other_address)
void request_data(uint8_t length, uint8_t i2c_other_address)
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void init_logging()

Init logging system.

Return

void.

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

state_t state
uint8_t ready_tasks_count
uint32_t awakened_event_occurred_time_ms
bool is_event_request_data
bool is_event_send_data
uint32_t start_print_status_delay_ms
uint32_t start_i2c_check_delay_ms
uint32_t i2c_request_delay_ms
uint32_t start_time_i2c_request_delay_ms
uint32_t i2c_send_delay_ms
uint32_t start_time_i2c_send_delay_ms
static uint8_t rx_buffer[I2C_MAX_DATA_LENGTH]
static uint8_t rx_buffer_length
uint8_t tx_buffer[I2C_MAX_DATA_LENGTH + 1]
uint8_t tx_buffer_length
uint8_t rq_buffer[I2C_MAX_DATA_LENGTH + 1]
uint8_t rq_buffer_length
uint16_t i2c_rx_error_count
uint16_t i2c_rx_success_count
uint16_t i2c_tx_error_count
uint16_t i2c_tx_success_count
uint16_t i2c_rq_error_count
uint16_t i2c_rq_success_count
file ToggleLED.ino
#include <arduinoJsonRPC.h>

Functions

JsonRPC rpc (false)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

int toggle(JsonObject params, JsonObject result)
void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

int led = 13
file HelloWorld.ino
#include <Wire.h>#include <hd44780.h>#include <hd44780ioClass/hd44780_I2Cexp.h>

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

hd44780_I2Cexp lcd
const int LCD_COLS = 20
const int LCD_ROWS = 4
file SDlog.ino
#include <ArduinoLog.h>#include <SPI.h>#include <SdFat.h>#include <StreamUtils.h>

Defines

USE_SDCARD

This example sketch shows most of the features of the ArduinoLog library with SD card

USE_SDCARD RAM: [= ] 10.4% (used 1700 bytes from 16384 bytes) Flash: [== ] 16.7% (used 21668 bytes from 130048 bytes)

serial only logger RAM: [= ] 6.1% (used 996 bytes from 16384 bytes) Flash: [= ] 12.7% (used 16500 bytes from 130048 bytes)

DISABLE_LOGGING RAM: [= ] 5.8% (used 958 bytes from 16384 bytes) Flash: [= ] 8.8% (used 11426 bytes from 130048 bytes)

SDCARD_CHIP_SELECT_PIN
SPI_SPEED
SDCARD_LOGGING_FILE_NAME
LOG_LEVEL

Functions

WriteLoggingStream loggingStream(logFile, Serial)
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

SdFat SD

SD-Card structure.

File logFile

File for logging on SD-Card.

int intValue1
int intValue2
long longValue1
long longValue2
bool boolValue1
bool boolValue2
const char *charArray = "this is a string"
String stringValue1 = "this is a string"
float floatValue
double doubleValue
file test_mqtt.ino
#include <debug_config.h>#include <sim800Client.h>#include <Sim800IPStack.h>#include <Countdown.h>#include <MQTTClient.h>#include <ArduinoLog.h>

Defines

TIMEOUT
REPEATWAIT
ENABLE_SUBSCRIBE
ENABLE_QOS0
ENABLE_QOS1
ENABLE_QOS2
MQTTCLIENT_QOS2
MQTTCLIENT_QOS
SERIAL_TRACE_LEVEL
SIM800_ON_OFF_PIN
GSM_APN
GSM_USERNAME
GSM_PASSWORD
TOPIC
HOSTNAME
DATE_TIME_STRING_LENGTH

Functions

HardwareSerial Serial1(PB11, PB10)
void messageArrived(MQTT::MessageData &md)
IPStack ipstack(s800)
bool initmodem(void)
bool connect(void)
bool publish(void)
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

unsigned int arrivedcount = 0
sim800Client s800
MQTT::Client<IPStack, Countdown, 120, 2> client = MQTT::Client<IPStack, Countdown, 120, 2>(ipstack, TIMEOUT)
file test_mqtt_subscribe.ino
#include <sim800Client.h>#include <Sim800IPStack.h>#include <Countdown.h>#include <MQTTClient.h>

Defines

TIMEOUT
MQTTCLIENT_QOS
SIM800_ON_OFF_PIN
GSM_APN
GSM_USERNAME
GSM_PASSWORD
TOPICCOM
TOPICRES
HOSTNAME

Functions

HardwareSerial Serial1(PB11, PB10)
IPStack ipstack(s800)
bool publish(const char *topic, const char *payload)
void messageArrived(MQTT::MessageData &md)
bool initmodem(void)
bool connect(void)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

sim800Client s800
MQTT::Client<IPStack, Countdown, 120, 1> client = MQTT::Client<IPStack, Countdown, 120, 1>(ipstack, TIMEOUT)
bool send_response = false
file test_ntp.ino
#include <debug_config.h>#include <sim800Client.h>#include <Sim800IPStack.h>#include <Countdown.h>#include <ArduinoLog.h>#include <ntp.h>

Defines

SIM800_ON_OFF_PIN
GSM_APN
GSM_USERNAME
GSM_PASSWORD
NTP_SERVER
DATE_TIME_STRING_LENGTH

Functions

HardwareSerial Serial1(PB11, PB10)
bool initmodem(void)
void getNtp()
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

sim800Client s800
file test_rtc.ino
#include <ArduinoLog.h>#include <TimeLib.h>#include <pcf8563.h>

Defines

DATE_TIME_STRING_LENGTH

Functions

void resetrtc()
void initrtc()
bool getrtc(time_t &time)
bool setrtc(const time_t time)
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

time_t current_time
file test_sdcard.ino
#include <SPI.h>#include "FS.h"#include "SD.h"

Defines

C3SCK
C3MISO
C3MOSI
C3SS

Functions

void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop(void)

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

File test_file
file Fat16Config.h

Configuration file

Defines

USE_ACMD41

Set USE_ACMD41 zero to initialize the card with CMD1. This will allowed limited use of MMC cards.

FAT16_DEBUG_SUPPORT

Set non-zero to allow access to Fat16 internals by cardInfo debug sketch

file mSPI.cpp
#include "mSPI.h"#include <inttypes.h>#include <avr/io.h>

Functions

void SPI_begin(void)
uint8_t SPI_transfer(uint8_t data)
file mSPI.h
#include <inttypes.h>#include <avr/io.h>

Defines

SPI_SPCR_CONFIG

Functions

void SPI_begin(void)
uint8_t SPI_transfer(uint8_t data)
file optiboot.ino
#include "SdCard.h"

Defines

BLOCK_SIZE
FAT16_ID_POS
MBR_FIRST_PART_POS
MBR_PART_LBA_POS
BLOCKS_PER_CLUSTER_POS
RESERVED_BLOCKS_COUNT_POS
ROOT_ENTRIES_COUNT_POS
BLOCKS_PER_FAT_POS
ROOT_ENTRY_SIZE
ROOT_ENTRY_FREE_TAG
ROOT_ENTRY_FILENAME_SIZE
ROOT_ENTRY_CLUSTER_POS
ROOT_ENTRY_SIZE_POS
FAT_ENTRY_SIZE
FAT_FILENAME_SIZE
FAT_EOF_TAG
FAT_FREE_TAG
WAIT_FOR_LINE_START
READ_LINE_SIZE
READ_ADDRESS
READ_LINE_TYPE
READ_DATA

Functions

bool fatTagFound(void)
uint8_t *find_firmware_data(FatFileDesc *fat, uint8_t cardType)
void write_page(uint16_t address)
int sdcard_loader(void)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

uint8_t buff[1000]
file SdCard.cpp
#include "SdCard.h"#include <stdint.h>#include <avr/io.h>#include "Fat16Config.h"#include "mSPI.h"

Defines

RAMSTART
buff

Functions

uint8_t spiReceive(void)
bool waitNotBusy(void)
void chipSelectHigh(void)
void chipSelectLow(void)
uint8_t cardCommand(uint8_t cmd, uint32_t arg)
uint8_t cardAcmd(uint8_t cmd, uint32_t arg)
uint8_t SdCard_begin(void)
bool SdCard_readBlock(uint32_t blockNumber, uint8_t cardType)

Reads a 512 byte block from a storage device.

Return

The value one, true, is returned for success and the value zero, false, is returned for failure.

Parameters
  • [in] blockNumber: Logical block to be read.

  • [out] dst: Pointer to the location that will receive the data.

bool SdCard_writeBlock(uint32_t blockNumber, uint8_t cardType)

Writes a 512 byte block to a storage device.

Return

The value one, true, is returned for success and the value zero, false, is returned for failure.

Parameters
  • [in] blockNumber: Logical block to be written.

  • [in] src: Pointer to the location of the data to be written.

file SdCard.h
#include <stdint.h>#include <avr/io.h>#include "mSPI.h"

Defines

__STDC_LIMIT_MACROS
SD_SS_PORT
SD_SS_PIN
SD_SS_PORT_REG
SD_SS_DDR_REG
SPI_SCK_INIT_DIVISOR
SD_MAX_CMD0_TRIES
SD_MAX_TRANSFERTS
SD_MAX_COMMANDS
CMD0

GO_IDLE_STATE - init card in spi mode if CS low

CMD8

SEND_IF_COND - verify SD Memory Card interface operating condition.

CMD9

SEND_CSD - read the Card Specific Data (CSD register)

CMD10

SEND_CID - read the card identification information (CID register)

CMD12

STOP_TRANSMISSION - end multiple block read sequence

CMD13

SEND_STATUS - read the card status register

CMD17

READ_SINGLE_BLOCK - read a single data block from the card

CMD18

READ_MULTIPLE_BLOCK - read a multiple data blocks from the card

CMD24

WRITE_BLOCK - write a single data block to the card

CMD25

WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION

CMD32

ERASE_WR_BLK_START - sets the address of the first block to be erased

CMD33

ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased

CMD38

ERASE - erase all previously selected blocks

CMD55

APP_CMD - escape for application specific command

CMD58

READ_OCR - read the OCR register of a card

CMD59

CRC_ON_OFF - enable or disable CRC checking

ACMD23

SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing

ACMD41

SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process

R1_READY_STATE

status for card in the ready state

R1_IDLE_STATE

status for card in the idle state

R1_ILLEGAL_COMMAND

status bit for illegal command

DATA_START_BLOCK

start data token for read or write single block

STOP_TRAN_TOKEN

stop token for write multiple blocks

WRITE_MULTIPLE_TOKEN

start data token for write multiple blocks

DATA_RES_MASK

mask for data response tokens after a write block operation

DATA_RES_ACCEPTED

write data accepted token

CARD_TYPE_SDV1

sd card type v1

CARD_TYPE_SDV2

sd card type v2

CARD_TYPE_SDHC

sd card type sdhc

Functions

uint8_t SdCard_begin()
bool SdCard_readBlock(uint32_t block, uint8_t cardType)

Reads a 512 byte block from a storage device.

Return

The value one, true, is returned for success and the value zero, false, is returned for failure.

Parameters
  • [in] blockNumber: Logical block to be read.

  • [out] dst: Pointer to the location that will receive the data.

bool SdCard_writeBlock(uint32_t block, uint8_t cardType)

Writes a 512 byte block to a storage device.

Return

The value one, true, is returned for success and the value zero, false, is returned for failure.

Parameters
  • [in] blockNumber: Logical block to be written.

  • [in] src: Pointer to the location of the data to be written.

file test_sensor_driver.ino
#include <i2c_config.h>#include <debug_config.h>#include <sensors_config.h>#include <SensorDriver.h>#include <ArduinoLog.h>

Defines

I2C_BUS_CLOCK
SENSORS_RETRY_COUNT_MAX
SENSORS_RETRY_DELAY_MS
DELAY_ACQ_MS
DELAY_TEST_MS

Enums

enum sensors_reading_state_t

Values:

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_SETUP_CHECK

check errors and if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT

init task variables

enumerator SENSORS_READING_SETUP_CHECK

check sensor errors

enumerator SENSORS_READING_POWER_OFF

power off sensor

enumerator SENSORS_READING_POWER_ON

power on sensor

enumerator SENSORS_READING_SETUP

if required try a sensor setup

enumerator SENSORS_READING_PREPARE

prepare sensor

enumerator SENSORS_READING_IS_PREPARED

check if the sensor has been prepared

enumerator SENSORS_READING_GET

read and get values from sensor

enumerator SENSORS_READING_IS_GETTED

check if the sensor has been readed

enumerator SENSORS_READING_READ

intermediate state (future implementation...)

enumerator SENSORS_READING_NEXT

go to next sensor

enumerator SENSORS_READING_END

performs end operations and deactivate task

enumerator SENSORS_READING_WAIT_STATE

non-blocking waiting time

enumerator SENSORS_READING_INIT
enumerator SENSORS_READING_PREPARE
enumerator SENSORS_READING_IS_PREPARED
enumerator SENSORS_READING_GET
enumerator SENSORS_READING_IS_GETTED
enumerator SENSORS_READING_READ
enumerator SENSORS_READING_NEXT
enumerator SENSORS_READING_END
enumerator SENSORS_READING_WAIT_STATE

Functions

void init_sensors()

Create and setup sensors.

Return

void.

void sensors_reading_task(bool do_prepare = true, bool do_get = true, char *driver = NULL, char *type = NULL, uint8_t address = 0, uint8_t node = 0, uint8_t *sensor_index = 0, uint32_t *wait_time = NULL)

Sensors reading Task. Read data from sensors.

Return

void.

Parameters
  • do_prepare: if true, execute the prepare sensor's procedure

  • do_get: if true, execute the get sensor's procedure

  • *driver: sensor's driver

  • *type: sensor's type

  • *address: sensor's address

  • *node: sensor's node

  • *sensor_index: sensor's index

  • *wait_time: sensor's wait time

void reset_wire()
void init_wire()

Init wire (i2c) library and performs checks on the bus.

Return

void.

void check_i2c_bus()
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

uint8_t sensors_count
SensorDriver *sensors[SENSORS_MAX]
bool is_first_run
bool is_test
bool is_event_sensors_reading
bool do_reset_first_run
int32_t values_readed_from_sensor[SENSORS_MAX][VALUES_TO_READ_FROM_SENSOR_COUNT]
sensors_reading_state_t sensors_reading_state
uint32_t acquiring_sensors_delay_ms
uint32_t testing_sensors_delay_ms
uint8_t i2c_error
file test_sensor_manager.ino
#include <SensorManager.h>

Defines

DELAY_ACQ_MS
DELAY_TEST_MS

Functions

void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

sensorManage sensorm[SENSORS_MAX]
uint32_t acquiring_sensor_delay_ms
uint32_t testing_sensor_delay_ms
uint8_t sensors_count
SensorDriver *sensors[SENSORS_MAX]
file basic.ino
#include <gsm_config.h>#include <sim800Client.h>#include <ArduinoLog.h>

Defines

LOG_LEVEL
SIM800_ON_OFF_PIN
SIM800_GSM_APN
SIM800_GSM_USERNAME
SIM800_GSM_PASSWORD

Enums

enum gsm_state_t

Values:

enumerator GSM_INIT

init task variables

enumerator GSM_SWITCH_ON

gsm power on

enumerator GSM_AUTOBAUD

gsm autobaud procedure

enumerator GSM_SETUP

gsm setup

enumerator GSM_START_CONNECTION

gsm open connection

enumerator GSM_CHECK_OPERATION

check operations (ntp or mqtt)

enumerator GSM_OPEN_UDP_SOCKET

open udp socket for ntp sync

enumerator GSM_SUSPEND

wait other tasks for complete its operations with gsm

enumerator GSM_STOP_CONNECTION

gsm close connection

enumerator GSM_WAIT_FOR_SWITCH_OFF

wait gsm for power off

enumerator GSM_SWITCH_OFF

gsm power off

enumerator GSM_END

performs end operations and deactivate task

enumerator GSM_WAIT_STATE

non-blocking waiting time

Functions

HardwareSerial Serial1(PB11, PB10)
void gsm_task()
void logPrefix(Print *_logOutput)
void logSuffix(Print *_logOutput)
void setup()

Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.

Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.

Return

void.

void loop()

Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.

Return

void.

Variables

sim800Client s800
bool is_event_gsm
bool is_client_connected
bool is_client_udp_socket_open
bool is_event_client_executed
uint8_t ready_tasks_count
gsm_state_t gsm_state
group avr_boot

#include <avr/io.h>
#include <avr/boot.h>

The macros in this module provide a C language interface to the bootloader support functionality of certain AVR processors. These macros are designed to work with all sizes of flash memory.

Global interrupts are not automatically disabled for these macros. It is left up to the programmer to do this. See the code example below. Also see the processor datasheet for caveats on having global interrupts enabled during writing of the Flash.

Todo:

From email with Marek: On smaller devices (all except ATmega64/128), __SPM_REG is in the I/O space, accessible with the shorter "in" and "out" instructions - since the boot loader has a limited size, this could be an important optimization.

Note

Not all AVR processors provide bootloader support. See your processor datasheet to see if it provides bootloader support.

#include <inttypes.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

void boot_program_page (uint32_t page, uint8_t *buf)
{
    uint16_t i;
    uint8_t sreg;

    // Disable interrupts.

    sreg = SREG;
    cli();

    eeprom_busy_wait ();

    boot_page_erase (page);
    boot_spm_busy_wait ();      // Wait until the memory is erased.

    for (i=0; i<SPM_PAGESIZE; i+=2)
    {
        // Set up little-endian word.

        uint16_t w = *buf++;
        w += (*buf++) << 8;
    
        boot_page_fill (page + i, w);
    }

    boot_page_write (page);     // Store buffer in flash page.
    boot_spm_busy_wait();       // Wait until the memory is written.

    // Reenable RWW-section again. We need this if we want to jump back
    // to the application after bootloading.

    boot_rww_enable ();

    // Re-enable interrupts (if they were ever enabled).

    SREG = sreg;
}
API Usage Example

The following code shows typical usage of the boot API.

#include <avr/io.h>
#include <avr/boot.h>

The macros in this module provide a C language interface to the bootloader support functionality of certain AVR processors. These macros are designed to work with all sizes of flash memory.

Global interrupts are not automatically disabled for these macros. It is left up to the programmer to do this. See the code example below. Also see the processor datasheet for caveats on having global interrupts enabled during writing of the Flash.

Todo:

From email with Marek: On smaller devices (all except ATmega64/128), __SPM_REG is in the I/O space, accessible with the shorter "in" and "out" instructions - since the boot loader has a limited size, this could be an important optimization.

Note

Not all AVR processors provide bootloader support. See your processor datasheet to see if it provides bootloader support.

#include <inttypes.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

void boot_program_page (uint32_t page, uint8_t *buf)
{
    uint16_t i;
    uint8_t sreg;

    // Disable interrupts.

    sreg = SREG;
    cli();

    eeprom_busy_wait ();

    boot_page_erase (page);
    boot_spm_busy_wait ();      // Wait until the memory is erased.

    for (i=0; i<SPM_PAGESIZE; i+=2)
    {
        // Set up little-endian word.

        uint16_t w = *buf++;
        w += (*buf++) << 8;
    
        boot_page_fill (page + i, w);
    }

    boot_page_write (page);     // Store buffer in flash page.
    boot_spm_busy_wait();       // Wait until the memory is written.

    // Reenable RWW-section again. We need this if we want to jump back
    // to the application after bootloading.

    boot_rww_enable ();

    // Re-enable interrupts (if they were ever enabled).

    SREG = sreg;
}
API Usage Example

The following code shows typical usage of the boot API.

Defines

BOOTLOADER_SECTION

Used to declare a function or variable to be placed into a new section called .bootloader. This section and its contents can then be relocated to any address (such as the bootloader NRWW area) at link-time.

boot_spm_interrupt_enable()

Enable the SPM interrupt.

boot_spm_interrupt_disable()

Disable the SPM interrupt.

boot_is_spm_interrupt()

Check if the SPM interrupt is enabled.

boot_rww_busy()

Check if the RWW section is busy.

boot_spm_busy()

Check if the SPM instruction is busy.

boot_spm_busy_wait()

Wait while the SPM instruction is busy.

GET_LOW_FUSE_BITS

address to read the low fuse bits, using boot_lock_fuse_bits_get

GET_LOCK_BITS

address to read the lock bits, using boot_lock_fuse_bits_get

GET_EXTENDED_FUSE_BITS

address to read the extended fuse bits, using boot_lock_fuse_bits_get

GET_HIGH_FUSE_BITS

address to read the high fuse bits, using boot_lock_fuse_bits_get

boot_lock_fuse_bits_get(address)

Read the lock or fuse bits at address.

Parameter address can be any of GET_LOW_FUSE_BITS, GET_LOCK_BITS, GET_EXTENDED_FUSE_BITS, or GET_HIGH_FUSE_BITS.

Note

The lock and fuse bits returned are the physical values, i.e. a bit returned as 0 means the corresponding fuse or lock bit is programmed.

boot_signature_byte_get(addr)

Read the Signature Row byte at address. For some MCU types, this function can also retrieve the factory-stored oscillator calibration bytes.

Parameter address can be 0-0x1f as documented by the datasheet.

Note

The values are MCU type dependent.

boot_page_fill(address, data)

Fill the bootloader temporary page buffer for flash address with data word.

Note

The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address.

boot_page_erase(address)

Erase the flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_page_write(address)

Write the bootloader temporary page buffer to flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_rww_enable()

Enable the Read-While-Write memory section.

boot_lock_bits_set(lock_bits)

Set the bootloader lock bits.

For example, to disallow the SPM instruction from writing to the Boot Loader memory section of flash, you would use this macro as such:

Note

In this context, a 'set bit' will be written to a zero value. Note also that only BLBxx bits can be programmed by this command.

Parameters
  • lock_bits: A mask of which Boot Loader Lock Bits to set.

boot_lock_bits_set (_BV (BLB11));

Note

Like any lock bits, the Boot Loader Lock Bits, once set, cannot be cleared again except by a chip erase which will in turn also erase the boot loader itself.

boot_page_fill_safe(address, data)

Same as boot_page_fill() except it waits for eeprom and spm operations to complete before filling the page.

boot_page_erase_safe(address)

Same as boot_page_erase() except it waits for eeprom and spm operations to complete before erasing the page.

boot_page_write_safe(address)

Same as boot_page_write() except it waits for eeprom and spm operations to complete before writing the page.

boot_rww_enable_safe()

Same as boot_rww_enable() except waits for eeprom and spm operations to complete before enabling the RWW mameory.

boot_lock_bits_set_safe(lock_bits)

Same as boot_lock_bits_set() except waits for eeprom and spm operations to complete before setting the lock bits.

BOOTLOADER_SECTION

Used to declare a function or variable to be placed into a new section called .bootloader. This section and its contents can then be relocated to any address (such as the bootloader NRWW area) at link-time.

boot_spm_interrupt_enable()

Enable the SPM interrupt.

boot_spm_interrupt_disable()

Disable the SPM interrupt.

boot_is_spm_interrupt()

Check if the SPM interrupt is enabled.

boot_rww_busy()

Check if the RWW section is busy.

boot_spm_busy()

Check if the SPM instruction is busy.

boot_spm_busy_wait()

Wait while the SPM instruction is busy.

GET_LOW_FUSE_BITS

address to read the low fuse bits, using boot_lock_fuse_bits_get

GET_LOCK_BITS

address to read the lock bits, using boot_lock_fuse_bits_get

GET_EXTENDED_FUSE_BITS

address to read the extended fuse bits, using boot_lock_fuse_bits_get

GET_HIGH_FUSE_BITS

address to read the high fuse bits, using boot_lock_fuse_bits_get

boot_lock_fuse_bits_get(address)

Read the lock or fuse bits at address.

Parameter address can be any of GET_LOW_FUSE_BITS, GET_LOCK_BITS, GET_EXTENDED_FUSE_BITS, or GET_HIGH_FUSE_BITS.

Note

The lock and fuse bits returned are the physical values, i.e. a bit returned as 0 means the corresponding fuse or lock bit is programmed.

boot_signature_byte_get(addr)

Read the Signature Row byte at address. For some MCU types, this function can also retrieve the factory-stored oscillator calibration bytes.

Parameter address can be 0-0x1f as documented by the datasheet.

Note

The values are MCU type dependent.

boot_page_fill(address, data)

Fill the bootloader temporary page buffer for flash address with data word.

Note

The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address.

boot_page_erase(address)

Erase the flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_page_write(address)

Write the bootloader temporary page buffer to flash page that contains address.

Note

address is a byte address in flash, not a word address.

boot_rww_enable()

Enable the Read-While-Write memory section.

boot_lock_bits_set(lock_bits)

Set the bootloader lock bits.

For example, to disallow the SPM instruction from writing to the Boot Loader memory section of flash, you would use this macro as such:

Note

In this context, a 'set bit' will be written to a zero value. Note also that only BLBxx bits can be programmed by this command.

Parameters
  • lock_bits: A mask of which Boot Loader Lock Bits to set.

boot_lock_bits_set (_BV (BLB11));

Note

Like any lock bits, the Boot Loader Lock Bits, once set, cannot be cleared again except by a chip erase which will in turn also erase the boot loader itself.

boot_page_fill_safe(address, data)

Same as boot_page_fill() except it waits for eeprom and spm operations to complete before filling the page.

boot_page_erase_safe(address)

Same as boot_page_erase() except it waits for eeprom and spm operations to complete before erasing the page.

boot_page_write_safe(address)

Same as boot_page_write() except it waits for eeprom and spm operations to complete before writing the page.

boot_rww_enable_safe()

Same as boot_rww_enable() except waits for eeprom and spm operations to complete before enabling the RWW mameory.

boot_lock_bits_set_safe(lock_bits)

Same as boot_lock_bits_set() except waits for eeprom and spm operations to complete before setting the lock bits.

page md__home_pat1_git_rmap_platformio_stima_v3_digitecoboot_ihex_ihex_README

A small library for reading and writing the Intel HEX (or IHEX) format. The library is mainly intended for embedded systems and microcontrollers, such as Arduino, AVR, PIC, ARM, STM32, etc - hence the emphasis is on small size rather than features, generality, or error handling.

See the header file kk_ihex.h for documentation, or below for simple examples.

~ Kimmo Kulovesi, 2013-12-27

Writing

Basic usage for writing binary data as IHEX ASCII:

#include "kk_ihex_write.h"

struct ihex_state ihex;
ihex_init(&ihex);
ihex_write_at_address(&ihex, 0);
ihex_write_bytes(&ihex, my_data_bytes, my_data_size);
ihex_end_write(&ihex);
The function ihex_write_bytes may be called multiple times to pass any amount of data at a time.

The actual writing is done by a callback called ihex_flush_buffer, which must be implemented, e.g., as follows:

void ihex_flush_buffer(struct ihex_state *ihex, char *buffer, char *eptr) {
    *eptr = '\0';
    (void) fputs(buffer, stdout);
}
The length of the buffer can be obtained from eptr - buffer. The actual implementation may of course do with the IHEX data as it pleases, e.g., transmit it over a serial port.

For a complete example, see the included program bin2ihex.c.

Reading

Basic usage for reading ASCII IHEX into binary data:

#include "kk_ihex_read.h"

struct ihex_state ihex;
ihex_begin_read(&ihex);
ihex_read_bytes(&ihex, my_ascii_bytes, my_ascii_length);
ihex_end_read(&ihex);
The function ihex_read_bytes may be called multiple times to pass any amount of data at a time.

The reading functions call the function ihex_data_read, which must be implemented by the caller to store the binary data, e.g., as follows:

ihex_bool_t ihex_data_read (struct ihex_state *ihex,
                            ihex_record_type_t type,
                            ihex_bool_t checksum_error) {
    if (type == IHEX_DATA_RECORD) {
        unsigned long address = (unsigned long) IHEX_LINEAR_ADDRESS(ihex);
        (void) fseek(outfile, address, SEEK_SET);
        (void) fwrite(ihex->data, ihex->length, 1, outfile);
    } else if (type == IHEX_END_OF_FILE_RECORD) {
        (void) fclose(outfile);
    }
    return true;
}
Of course an actual implementation is free to do with the data as it chooses, e.g., burn it on an EEPROM instead of writing it to a file.

For an example complete with error handling, see the included program ihex2bin.c.

Example Programs

The included example programs, ihex2bin and bin2ihex, implement a very simple conversion between raw binary data and Intel HEX. Usage by example:

# Simple conversion from binary to IHEX:
bin2ihex <infile.bin >outfile.hex

# Add an offset to the output addresses (i.e., make the address
# of the first byte of the input other than zero):
bin2ihex -a 0x8000000 -i infile.bin -o outfile.hex

# Encode 64 input bytes per output IHEX line:
bin2ihex -b 64 <infile.bin >outfile.hex

# Simple conversion from IHEX to binary:
ihex2bin <infile.hex >outfile.bin

# Manually specify the initial address written (i.e., subtract
# an offset from the input addresses):
ihex2bin -a 0x8000000 -i infile.hex -o outfile.bin

# Start output at the first data byte (i.e., make the address offset
# equal to the address of the first data byte read from input):
ihex2bin -A -i infile.hex -o outfile.bin
Both programs also accept the option -v to increase verbosity.

When using ihex2bin on Intel HEX files produced by compilers and such, it is a good idea to specify the command-line option -A to autodetect the address offset. Otherwise the program will simply fill any unused addresses, starting from 0, with zero bytes, which may total mega- or even gigabytes.

Utilities

Four additional utilities are provided to help working with ROM images:

  • split16bit – splits a 16-bit ROM binary into two 8-bit halves

  • merge16bit – merges two 8-bit ROM binary halves into a single 16-bit file

  • split32bit – splits a 32-bit ROM binary into four 8-bit parts

  • merge32bit – merges four 8-bit ROM binary parts into a single 32-bit file

Both 16-bit utilities take the filenames of the high and low halves with the arguments -llow.bin and -hhigh.bin, respectively. The bytes are in little endian order, i.e., the one with the lowest address is the "low" half.

# Split 16bit.bin into low.bin and high.bin:
split16bit -i 16bit.bin -l low.bin -h high.bin

# Merge low.bin and high.bin into 16bit.bin:
merge16bit -o 16bit.bin -l low.bin -h high.bin
Both 32-bit utilities take the filenames of the four 8-bit files with the arguments -0, -1, -2, and -3, with byte 0 being the one with the lowest address, i.e., the bytes are in little endian order.
# Split 32bit.bin into a.bin, b.bin, c.bin, and d.bin
split32bit -i 32bit.bin -0 a.bin -1 b.bin -2 c.bin -3 d.bin

# Merge a.bin, b.bin, c.bin, and d.bin into 32bit.bin
merge32bit -o 32bit.bin -0 a.bin -1 b.bin -2 c.bin -3 d.bin
These utilities have nothing to with IHEX as such, but they are so small that it didn't seem worth the bother to release them separately.

page md__home_pat1_git_rmap_platformio_stima_v3_stimawifi_README

con la stazione di monitoraggio ambientale Stimawifi.

Tutta la documentazione la trovate:

https://doc.rmap.cc/stima_wifi/stima_wifi_howto.html

Nello specifico

page todo

Module avr_boot

From email with Marek: On smaller devices (all except ATmega64/128), __SPM_REG is in the I/O space, accessible with the shorter "in" and "out" instructions - since the boot loader has a limited size, this could be an important optimization.

From email with Marek: On smaller devices (all except ATmega64/128), __SPM_REG is in the I/O space, accessible with the shorter "in" and "out" instructions - since the boot loader has a limited size, this could be an important optimization.

dir /home/pat1/git/rmap/platformio/stima_v3/arduino_as_isp
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot_ihex
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-leaf
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-opc
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-power
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-radiation
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-rain
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-th
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-thr
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-wind
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot_ihex/ihex
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_sim800/include
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_i2c_multimaster/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_subscribe_sim800/include
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_ntp/include
dir /home/pat1/git/rmap/platformio/stima_v3/stimawifi/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_sim800/include
dir /home/pat1/git/rmap/platformio/stima_v3/stima/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_pin/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-wind/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensordriver/include
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensormanager/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-th/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-rain/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-radiation/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-power/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-opc/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-leaf/include
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu_sdcard/include
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-thr/include
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot/pff
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot_ihex/pff
dir /home/pat1/git/rmap/platformio
dir /home/pat1/git/rmap/platformio/stima_v3/SdFormatter
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu_sdcard
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-thr/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-rain/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_jsonrpc/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-th/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_pin/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-wind/src
dir /home/pat1/git/rmap/platformio/stima_v3/SdFormatter/src
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config/src
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu/src
dir /home/pat1/git/rmap/platformio/stima_v3/sensor_config_menu_sdcard/src
dir /home/pat1/git/rmap/platformio/stima_v3/stima/src
dir /home/pat1/git/rmap/platformio/stima_v3/stimawifi/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_logging/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_hyt271/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_i2c_multimaster/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_lcd/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-power/src
dir /home/pat1/git/rmap/platformio/stima_v3/arduino_as_isp/src
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot/pff/src
dir /home/pat1/git/rmap/platformio/stima_v3/digitecoboot_ihex/pff/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_sim800/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensormanager/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensordriver/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_sdfat16/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_sdcard/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_rtc/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_ntp/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_subscribe_sim800/src
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_sim800/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-leaf/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-opc/src
dir /home/pat1/git/rmap/platformio/stima_v3/i2c-radiation/src
dir /home/pat1/git/rmap/platformio/stima_v3/stima
dir /home/pat1/git/rmap/platformio/stima_v3
dir /home/pat1/git/rmap/platformio/stima_v3/stimawifi
dir /home/pat1/git/rmap/platformio/stima_v3/test_hyt271
dir /home/pat1/git/rmap/platformio/stima_v3/test_i2c_multimaster
dir /home/pat1/git/rmap/platformio/stima_v3/test_jsonrpc
dir /home/pat1/git/rmap/platformio/stima_v3/test_lcd
dir /home/pat1/git/rmap/platformio/stima_v3/test_logging
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_sim800
dir /home/pat1/git/rmap/platformio/stima_v3/test_mqtt_subscribe_sim800
dir /home/pat1/git/rmap/platformio/stima_v3/test_ntp
dir /home/pat1/git/rmap/platformio/stima_v3/test_pin
dir /home/pat1/git/rmap/platformio/stima_v3/test_rtc
dir /home/pat1/git/rmap/platformio/stima_v3/test_sdcard
dir /home/pat1/git/rmap/platformio/stima_v3/test_sdfat16
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensordriver
dir /home/pat1/git/rmap/platformio/stima_v3/test_sensormanager
dir /home/pat1/git/rmap/platformio/stima_v3/test_sim800
page index

Introduction

software to collect weather data contributed by citizens; to make these data available for weather services and homeland security; to provide feedback to the data contributors so that they have the tools to check and improve their data quality

http://doc.rmap.cc

Howto

STIMA over Ethernet:

../_images/ethernet.jpg../_images/ethernet.jpg

Hardware

1) Stima I2C-Base @ 5V

2) Microduino Ethernet WIZ

3) Microduino RJ45

4) Stima core+1284 @ 5V

5) Stima I2C-RTC @ 5V

6) Stima FT232RL

7) Stima SD-Card

Software

1) open sketch arduino/sketchbook/rmap/rmap/rmap.ino

2) in arduino/sketchbook/rmap/rmap/rmap-config.h set STIMA_MODULE_TYPE_REPORT_ETH or STIMA_MODULE_TYPE_SAMPLE_ETH in MODULE_VERSION define

3) open arduino/sketchbook/libraries/RmapConfig/sensors_config.h and set true or false sensors's define and json's define in order to enable or disable relative sensor's driver and library

4) compile and upload firmware

5) short-circuit the two configure pins with a jumper and configure it!

STIMA over GSM/GPRS:

../_images/gsm.jpg../_images/gsm.jpg

Hardware

1) Stima I2C-Base @ 5V

2) Stima SIM800C Power

3) Stima SIM800C Module

4) Stima core+1284 @ 5V

5) Stima I2C-RTC @ 5V

6) Stima FT232RL

7) Stima SD-Card

Software

1) open sketch arduino/sketchbook/rmap/rmap/rmap.ino

2) in arduino/sketchbook/rmap/rmap/rmap-config.h set STIMA_MODULE_TYPE_REPORT_GSM or STIMA_MODULE_TYPE_SAMPLE_GSM in MODULE_VERSION define

3) open arduino/sketchbook/libraries/RmapConfig/sensors_config.h and set true or false sensors's define and json's define in order to enable or disable relative sensor's driver and library

4) compile and upload firmware

5) short-circuit the two configure pins with a jumper and configure it!

STIMA Passive:

../_images/passive.jpg../_images/passive.jpg

Hardware

1) Stima I2C-Base @ 5V / 3.3V

2) Stima core+1284 @ 5V / Stima core+644 @ 3.3V

3) Stima I2C-RTC @ 5V / 3.3V

4) Stima FT232RL

Software

1) open sketch arduino/sketchbook/rmap/rmap/rmap.ino

2) in arduino/sketchbook/rmap/rmap/rmap-config.h set STIMA_MODULE_TYPE_PASSIVE in MODULE_VERSION define

3) open arduino/sketchbook/libraries/RmapConfig/sensors_config.h and set true or false sensors's define and json's define in order to enable or disable relative sensor's driver and library

4) compile and upload firmware

5) short-circuit the two configure pins with a jumper and configure it!

STIMA I2C-TH:

../_images/th.jpg../_images/th.jpg

Hardware

1) Stima I2C-Base @ 3.3V

2) Stima core+644 @ 3.3V

3) Stima FT232RL

4) Stima SD-Card

Software

1) open sketch arduino/sketchbook/rmap/i2c-th/i2c-th.ino

2) open arduino/sketchbook/libraries/RmapConfig/sensors_config.h and set true or false sensors's define and json's define in order to enable or disable relative sensor's driver and library

3) compile and upload firmware

STIMA I2C-Rain:

../_images/rain.jpg../_images/rain.jpg

Hardware

1) Stima I2C-Base @ 3.3V

2) Stima core+644 @ 3.3V

3) Stima I2C-Digital

4) Stima FT232RL

5) Stima SD-Card

Software

1) open sketch arduino/sketchbook/rmap/i2c-rain/i2c-rain.ino

2) open arduino/sketchbook/libraries/RmapConfig/sensors_config.h and set false in all sensors's define and json's define

3) compile and upload firmware

STIMA Meteo Station assembly

../_images/station.jpg../_images/station.jpg

1) Stima over Ethernet or Stima over GSM

--> connect with a cable at 5V hub port --> in GSM/GPRS version: connect SMA antenna and insert a SIM card --> in Ethernet version: connect ethernet/POE cable

2) Stima I2C-TH

--> connect with a cable at 3.3V hub port

3) Stima I2C-Rain

--> connect with a cable at 3.3V hub port

--> connect at tipping bucket rain on 2 external pins of Stima I2C-Digital

4) I2C sensor's:

--> connect with a cable at 3.3V or 5V hub port

5) I2C LCD Display

--> connect with a cable at 5V hub port

6) Stima I2C-HUB

Power up the station through one of the following ways:

1) USB power supply with USB type B connector

2) Plug a POE cable into RJ45 interface (only for ethernet version)

3) 5V DC power supply through hub input port

4) DigitecoPower through hub input port with capability of 12V battery backup, solar panel or 12-30V DC input source voltage

in that case, the pins on the DigitecoPower module are:

1) VCC_IN: 12-30V DC input source VCC (+)

2) GND_IN: 12-30V DC input source GND (-)

3) VCC_BAT: 12V DC input/otput battery backup VCC (+)

4) GND_BAT: 12V DC input/otput battery backup GND (-)

5) Status LED: green for battery charged, orange for medium charged battery, red for low battery

6) VCC_OUT: 5V DC output for input hub connector VCC (+)

7) SCL: I2C SCL for input hub connector

8) SDA: I2C SDA for input hub connector

9) GND_OUT: 5V DC output for input hub connector GND (-)

Project Library

For details, look at the specific library files.

RmapConfig

This library contains the definitions that are useful for configuring some default values. Below is a list of the files contained therein.

debug_config.h: Enable or disable debug in sketch and library

ethernet_config.h: Ethernet configuration's parameters (IP, DHCP, delay, ecc..)

gsm_config.h: GSM configuration's parameters (APN, username, ecc..)

hardware_config.h: Hardware configuration's parameters (I2C bus clock, ecc..)

json_config.h: JSON configuration's parameters (buffer length)

lcd_config.h: LCD configuration's parameters (rows, columns, ecc..)

mqtt_config.h: MQTT configuration's parameters (topic length, buffers length, ecc..)

ntp_config.h: NTP configuration's parameters (timezone, server, ecc..)

sdcard_config.h: SDCARD configuration's parameters (name length, ecc..)

sensors_config.h: Enable or disable sensor driver sensors for specific sketch

Rmap

This library contains generic utility features. Below is a list of the files contained therein.

debug.h debug.cpp: Debugging functions for print debug message on serial port or LCD

eeprom_utility.h eeprom_utility.cpp: EEPROM utility for write and read eeprom

i2c_utility.h i2c_utility.cpp: I2C utility for bus recovery

registers.h: General register's define

registers-th.h: I2C-TH register's define

registers-rain.h: I2C-Rain register's define

rmap_utility.h rmap_utility.cpp: RMAP useful functions

sdcard_utility.h sdcard_utility.cpp: SD-Card useful functions

stima_module.h: STIMA station's definition

typedef.h: Useful project typedef

SensorDriver

This library is provided to read measurements from I2C sensors.

SensorDriverSensors.h: define list with sensor names in SensorDriver

SensorDriver.h SensorDriver.cpp: SensorDriver library files

HYT2X1

This library implements functions for read and configure HYT271 and HYT221 sensors.

hyt2x1.h hyt2x1.cpp: HYT2X1 library files

NTP

This library implements NTP functions for read time over NTP server with ethernet client or sim800 client.

ntp.h ntp.cpp: NTP library files

PCF8563

This library implements PCF8563 functions for communicate with pcf8563 real time clock.

pcf8563.h pcf8563.cpp: PCF8563 library files

SIM800

This library implements SIM800 functions for communicate with SIM800C/SIM800L GSM/GPRS module.

sim800.h sim800.cpp: SIM800 library files

sim800Client.h: SIM800 library interface for Arduino Client.

SIM800C is fully supported, SIM800L is partially supported (coming soon...)

Implemented features

Transport

o) Serial: yes

o) Ethernet: partial (basic functions are present but need to interface with Ethernet Client)

o) MQTT: partial (subscribe functions are present but need to interface with rpc process function)

See ArduinoJsonRPC library

SD-Card files

On the sdcard there is a file called mqtt_ptr.txt containing a binary data in uint32_t format corresponding to the seconds passed since 00:00:00 01/01/1970 indicating the last data sent by MQTT.

The data is recorded on files (one file for each recording day) named in the format yyyy_mm_dd.txt and each data recorded on sd card is MQTT_SENSOR_TOPIC_LENGTH + MQTT_MESSAGE_LENGTH bytes long (look at the mqtt_config.h file).

Each recorded data has the format of the type: TRANGE/LEVEL/VAR { “v”: VALUE, “t”: TIME}

SensorDriver's sensors

o) ADT7420 (ADT)

o) HIH6100 (HIH)

o) HYT221 (HYT)

o) HYT271 (HYT)

o) DigitecoPower (DEP)

o) I2C-TH (STH, ITH, NTH, MTH, XTH)

o) I2C-Rain (TBS, TBR)

o) I2C-Wind (DW1)

other sensors can be easily integrated (see SensorDriver library).