MySensors Library & Examples  2.3.2
Modules | Macros
+ Collaboration diagram for Serial and debugging:

Detailed Description

These options control serial and debugging features and functionalities in the library.

Modules

 Transport selection
 These options control what transport type to use and various transport specific customisations.
 
 Routing and node
 These options control message routing and node configurations.
 
 Node registration
 These options control node registration configurations.
 
 Core
 These options control the library core configurations.
 
 Sleep
 These options control sleep configurations.
 
 Over The Air firmware
 These options control OTA firmware configurations.
 
 Gateway
 These options control gateway specific configurations.
 
 GSM
 These options control GSM specific configurations.
 
 LED
 These options control LED specific configurations.
 
 Security
 These options control security related configurations.
 
 Platform specifics
 These options control platform specific configurations.
 

Macros

#define MY_DEBUG_VERBOSE_OTA_UPDATE
 Define this for verbose debug prints related to FOTA updates.
 
#define MY_OTA_USE_I2C_EEPROM
 Define this if you want I2C EEPROM instead of a SPI flash. Used EEPROM needs to be large enough, an 24(L)C256 will do as minimum. HW I2C assumed. This will exclude the SPI flash code. Note that you also need an updated DualOptiboot supporting I2C EEPROM!
 
#define MY_IS_GATEWAY
 true when configuration indicate a gateway device, More...
 
#define MY_NODE_TYPE
 "GW" for gateways, REPEATER" for repeaters, "NODE" for nodes, More...
 
#define DEBUG_OUTPUT(x, ...)
 debug NULL
 
#define ARDUINO_ARCH_SAMD
 Automatically set when building for SAMD targets.
 
#define ARDUINO_ARCH_NRF5
 Automatically set when building for nRF5 targets.
 
#define ARDUINO_ARCH_ESP8266
 Automatically set when building for ESP8266 targets.
 
#define ARDUINO_ARCH_ESP32
 Automatically set when building for ESP32 targets.
 
#define ARDUINO_ARCH_AVR
 Automatically set when building for AVR targets.
 
#define ARDUINO_ARCH_STM32F1
 Automatically set when building for STM32F1 targets.
 
#define TEENSYDUINO
 Automatically set when building for Teensy targets.
 
#define MY_DEBUG
 Define MY_DEBUG to show debug prints. More...
 
#define MY_DEBUGDEVICE
 Define MY_DEBUGDEVICE to redirect debug prints. More...
 
#define MY_DEBUG_OTA
 Define MY_DEBUG_OTA to (nodeID) to redirect debug prints to given node ID. More...
 
#define MY_DEBUG_OTA_DISABLE_ECHO
 Define MY_DEBUG_OTA_DISABLE_ECHO to send messages without requesting the destination to echo the message. More...
 
#define MY_OTA_LOG_RECEIVER_FEATURE
 Define this to enable printing of OTA logs. More...
 
#define MY_OTA_LOG_SENDER_FEATURE
 Define this to enable printing of OTA logs. More...
 
#define MY_SPECIAL_DEBUG
 Define MY_SPECIAL_DEBUG to enable support for I_DEBUG messages. More...
 
#define MY_DISABLED_SERIAL
 Define MY_DISABLED_SERIAL if you want to use the UART TX/RX pins as normal I/O pins. More...
 
#define MY_BAUD_RATE   (115200ul)
 Serial output baud rate (debug prints and serial gateway speed). More...
 
#define MY_SERIAL_OUTPUT_SIZE   (120u)
 Maximum characters for serial output. More...
 
#define MY_SPLASH_SCREEN_DISABLED
 If defined, will disable the MySensors splash screen. More...
 

Macro Definition Documentation

◆ MY_BAUD_RATE

#define MY_BAUD_RATE   (115200ul)

Serial output baud rate (debug prints and serial gateway speed).

The baud rate configured here must match the baud rate at the "other" end.

Warning
Depending on your target device and clock speed, certain baud rates might not work well.

Definition at line 163 of file MyConfig.h.

◆ MY_DEBUG

#define MY_DEBUG

Define MY_DEBUG to show debug prints.

This option will add a lot to the size of the final sketch but is helpful to see what is actually is happening during development.

Note
Values in parenthesis indicate default values which will be used if you have not defined the flag in your sketch.

Definition at line 2232 of file MyConfig.h.

◆ MY_DEBUG_OTA

#define MY_DEBUG_OTA

Define MY_DEBUG_OTA to (nodeID) to redirect debug prints to given node ID.

Example:

#define MY_DEBUG_OTA (0)

will redirect debug prints to node ID 0.

With this option debugging messages over serial are disabled. It's not possible to send debug messages generated by the radio. All other debug messages redirected to the given Node ID. The debug messages are sent without signing.

This function allocates some additional memory for radio packet preparation and buffering. Debug messages are sent to child ID 255 (NODE_SENSOR_ID) as I_LOG_MESSAGE type.

You have to enable the MY_OTA_LOG_RECEIVER_FEATURE on the target node. Look into the LogOTAGateway and LogOTANode examples.

The output buffer can be configured via MY_SERIAL_OUTPUT_SIZE Transport related debugging is disabled when MY_DEBUG_OTA is enabled.

Definition at line 2234 of file MyConfig.h.

◆ MY_DEBUG_OTA_DISABLE_ECHO

#define MY_DEBUG_OTA_DISABLE_ECHO

Define MY_DEBUG_OTA_DISABLE_ECHO to send messages without requesting the destination to echo the message.

This option reduces the latency added by OTA debug messages by sending packages only once. You can loose debug messages.

Definition at line 2235 of file MyConfig.h.

◆ MY_DEBUGDEVICE

#define MY_DEBUGDEVICE

Define MY_DEBUGDEVICE to redirect debug prints.

If defined, MY_DEBUGDEVICE replaces MY_SERIALDEVICE for the purpose of printing debug messages. This only applies to debugging.

The intent is to provide the ability to send debugging messages out a different serial port than what is being used for communication between nodes or from gateway to controller when this communication uses a serial interface. This assumes that the MY_DEBUGDEVICE serial interface already exists. It can be a hardware serial device or a software serial device.

Definition at line 2233 of file MyConfig.h.

◆ MY_DISABLED_SERIAL

#define MY_DISABLED_SERIAL

Define MY_DISABLED_SERIAL if you want to use the UART TX/RX pins as normal I/O pins.

Note
When defined, if you want to use the pins as a UART, you need to handle initialization and configuration yourself.

Definition at line 2237 of file MyConfig.h.

◆ MY_IS_GATEWAY

#define MY_IS_GATEWAY

true when configuration indicate a gateway device,

Todo:
Mark these internals

Definition at line 2117 of file MyConfig.h.

◆ MY_NODE_TYPE

#define MY_NODE_TYPE

"GW" for gateways, REPEATER" for repeaters, "NODE" for nodes,

Todo:
Mark these internals

Definition at line 2118 of file MyConfig.h.

◆ MY_OTA_LOG_RECEIVER_FEATURE

#define MY_OTA_LOG_RECEIVER_FEATURE

Define this to enable printing of OTA logs.

This option requires additional memory for buffering. The buffer size can be configured via MY_SERIAL_OUTPUT_SIZE.

Definition at line 2249 of file MyConfig.h.

◆ MY_OTA_LOG_SENDER_FEATURE

#define MY_OTA_LOG_SENDER_FEATURE

Define this to enable printing of OTA logs.

This option requires additional memory for buffering. The buffer size can be configured via MY_SERIAL_OUTPUT_SIZE.

Definition at line 2250 of file MyConfig.h.

◆ MY_SERIAL_OUTPUT_SIZE

#define MY_SERIAL_OUTPUT_SIZE   (120u)

Maximum characters for serial output.

If you are running extremely low on memory, reducing this size might just save your day.

Definition at line 173 of file MyConfig.h.

◆ MY_SPECIAL_DEBUG

#define MY_SPECIAL_DEBUG

Define MY_SPECIAL_DEBUG to enable support for I_DEBUG messages.

I_DEBUG messages are sent from the controller to the node, which responds with the requested data. The request can be one of the following:

  • 'R': routing info (only repeaters): received msg XXYY (as stream), where XX is the node and YY the routing node
  • 'V': CPU voltage
  • 'F': CPU frequency
  • 'M': free memory
  • 'E': clear MySensors EEPROM area and reboot (i.e. "factory" reset)

Definition at line 2236 of file MyConfig.h.

◆ MY_SPLASH_SCREEN_DISABLED

#define MY_SPLASH_SCREEN_DISABLED

If defined, will disable the MySensors splash screen.

Note
This saves 120 bytes of flash.

Definition at line 2238 of file MyConfig.h.