Skip to content

User Configuration File

Previously, on Configure PlatformIO, we have seen how to configure rhomb.IoT to work with each microcontroller, but we have many other parameters to configure how our application will work. The list may be a little long but don't worry, you'll also find ready-made settings that you can simply copy and paste.

The configuration file is located on lib/rhomb.iot/conf/conf-user.h and is composed of a list of C++ MACROS that we can edit.

A small example

We want to configure the network to transmit data with GPRS. Open conf-user.h, search and edit:

#define USE_NET true
#define NET_MODEM NET_SIM868

With these two options we are enabling the network module (USE_NET true) and configure the communication module NET_SIM868. Other modems will be listed below.

In this article you will learn about the different sections of the configuration file and how to change the values.

All the options

#define CFG_VERSION 1 // change to invalidate previous stored config
#define DEVICE_NAME "" // device name
#define DEVICE_ID "" // device id
#define USE_SERIAL_SOFTWARE 0 // Use software serial
#define SERIAL_DEBUG Serial // Serial object for debug monitor
#define SERIAL_DEBUG_BAUDS 115200 // speed
#define SERIAL_DEBUG_TX 0 // if software serial enabled, tx pin
#define SERIAL_DEBUG_RX 0 // if software serial enabled, rx pin
#define SERIAL_DEBUG_WAIT 1 // wait after begin() for leonardo and zero
#define SERIAL_AT Serial2 // Serial object for modem communication (At commands)
#define SERIAL_AT_BAUDS 115200 // speed
#define SERIAL_AT_RX 0 // if software serial enabled, tx pin
#define SERIAL_AT_TX 0 // if software serial enabled, rx pin
#define SERIAL_AT_WAIT 1 // wait after begin() for leonardo and zero
#define SERIAL_EXT -1 // Serial object for external UART controller
#define SERIAL_EXT_BAUDS 0 // speed
#define SERIAL_EXT_RX 0 // if software serial enabled, tx pin
#define SERIAL_EXT_TX 0 // if software serial enabled, rx pin
#define SERIAL_EXT_WAIT 0 // wait after begin() for leonardo and zero
#define USE_NET true // enable communication module
#define KEEP_TCP_OPEN false // keep TCP open for fast transmissions
#define BATCH_TRANSMIT 5 // transmit multiple messages at once
#define REMOTE_SERVER1 "192.168.1.37" // remote server ip/domain
#define REMOTE_SERVER2 "" // backup server
#define REMOTE_PORT1 3000 // remote server port
#define REMOTE_PORT2 3000 // backup remote server port
#define NET_MODEM MODEM_ESP32 // select communication module
#define NET_SERIAL -1 // assign a serial object (SERIAL_AT or SERIAL_EXT)
#define WIFI_USER "" // wifi ssid if usign MODE_ESP32
#define WIFI_PASS "" // wifi pass if usign MODE_ESP32
#define WIFI_AP_SSID "rhomb.iot" // wifi hot spot user if usign MODE_ESP32
#define WIFI_AP_PASS "12345678" // wifi hot spot pass if using MODEM_ESP32
#define USE_GPS false // Enable GPS module
#define GPS_MODEM -1 // Select GPS module, GPS_L86 or GPS_868
#define GPS_SERIAL -1 // assign a serial object, SERIAL_AT or SERIAL_EXT
#define INTERRUPT_PIN NMI // main interrupt pin
#define USE_SENSORS false // enable reading data sensors
#define USE_SENS_TEMP -1 // enable temperature sensor BME280, DHT11, SHT20...
#define USE_SENS_HUMI -1 // enable humidity BME280, DHT11, SHT20...
#define USE_SENS_PRESS -1 // enable atmospheric pressure BME280
#define USE_TIME true // add time marks to server messages
#define TICK_TIMER1 10 // main time interval for message creation
#define TICK_TIMER2 0 // secondary time interval
#define USE_STORAGE -1 // memory method for persistent configuration
#define USE_BATT BATT_HALLEY // read battery status
#define USE_VBAT true // read VBAT (lithium battery)
#define USE_VSYS true // read VSYS (usb connector)
#define USE_VIN true // read VIN (pin VIN)
#define REQUIRED_VBAT 0 // minimum vbat before enter sleep mode
#define REQUIRED_VSYS 0 // minimum vsys before enter sleep mode
#define REQUIRED_VIN 0 // minimum vin before enter sleep mode
// do not configure this
#define BUFFER_SIZE 120
#define BUFFER_SIZE_MSG 120
#define BUFFER_SIZE_APN 15
#define BUFFER_SIZE_APN_USER 1
#define BUFFER_SIZE_APN_PASS 1
#define BUFFER_SIZE_REMOTE_SERVER 20
#define BUFFER_SIZE_REMOTE_PORT 6
#define BUFFER_SIZE_SMS_NUMBER 1
#define BUFFER_SIZE_DEVICE_NAME 20
#define BUFFER_SIZE_DEVICE_ID 20

Along this article we will explain these options.

Debug

Comments