From 843c1c8d1993e177164cc3cd379208be0dca5eaa Mon Sep 17 00:00:00 2001 From: Olivier Date: Sun, 29 Oct 2017 11:05:41 +0100 Subject: [PATCH] Update debug message table --- core/MySensorsCore.h | 2 +- core/MyTransport.h | 40 ++++++++++++++++----------------- drivers/RF24/RF24.h | 42 +++++++++++++++++------------------ drivers/RFM69/new/RFM69_new.h | 42 ++++++++++++----------------------- drivers/RFM95/RFM95.cpp | 2 +- drivers/RFM95/RFM95.h | 40 ++++++++++++++++----------------- 6 files changed, 77 insertions(+), 91 deletions(-) diff --git a/core/MySensorsCore.h b/core/MySensorsCore.h index 21ef27914..78bcfbee4 100644 --- a/core/MySensorsCore.h +++ b/core/MySensorsCore.h @@ -40,7 +40,7 @@ * |E| SYS | SUB | Message | Comment * |-|-----|-----|---------------------------------------------|---------------------------------------------------------------------------- * |!| MCO | BGN | HW ERR | Error HW initialization (e.g. ext. EEPROM) -* | | MCO | BGN | INIT %%s,CP=%%s,LIB=%%s | Core initialization, capabilities (CP), library version (LIB) +* | | MCO | BGN | INIT %%s,CP=%%s,VER=%%s | Core initialization, capabilities (CP), library version (VER) * | | MCO | BGN | BFR | Callback before() * | | MCO | BGN | STP | Callback setup() * | | MCO | BGN | INIT OK,TSP=%%d | Core initialised, transport status (TSP): 0=not initialised, 1=initialised, NA=not available diff --git a/core/MyTransport.h b/core/MyTransport.h index 74a26fe4f..9f17d8b3c 100644 --- a/core/MyTransport.h +++ b/core/MyTransport.h @@ -31,27 +31,27 @@ * - TSF: messages emitted by transport support functions * - SUB SYSTEMS: * - Transport state machine (TSM) -* - TSM:INIT from stInit Initialize transport and radio -* - TSM:FPAR from stParent Find parent -* - TSM:ID from stID Check/request node ID, if dynamic node ID set -* - TSM:UPL from stUplink Verify uplink connection by pinging GW -* - TSM:READY from stReady Transport is ready and fully operational -* - TSM:FAIL from stFailure Failure in transport link or transport HW +* - TSM:INIT from stInit Initialize transport and radio +* - TSM:FPAR from stParent Find parent +* - TSM:ID from stID Check/request node ID, if dynamic node ID set +* - TSM:UPL from stUplink Verify uplink connection by pinging GW +* - TSM:READY from stReady Transport is ready and fully operational +* - TSM:FAIL from stFailure Failure in transport link or transport HW * - Transport support function (TSF) -* - TSF:CKU from @ref transportCheckUplink(), checks connection to GW -* - TSF:SID from @ref transportAssignNodeID(), assigns node ID -* - TSF:PNG from @ref transportPingNode(), pings a node -* - TSF:WUR from @ref transportWaitUntilReady(), waits until transport is ready -* - TSF:CRT from @ref transportClearRoutingTable(), clears routing table stored in EEPROM -* - TSF:LRT from @ref transportLoadRoutingTable(), loads RAM routing table from EEPROM (only GW/repeaters) -* - TSF:SRT from @ref transportSaveRoutingTable(), saves RAM routing table to EEPROM (only GW/repeaters) -* - TSF:MSG from @ref transportProcessMessage(), processes incoming message -* - TSF:SAN from @ref transportInvokeSanityCheck(), calls transport-specific sanity check -* - TSF:RTE from @ref transportRouteMessage(), sends message -* - TSF:SND from @ref transportSendRoute(), sends message if transport is ready (exposed) -* - TSF:TDI from @ref transportDisable() -* - TSF:TRI from @ref transportReInitialise() -* - TSF:SIR from @ref transportSignalReport() +* - TSF:CKU from @ref transportCheckUplink(), checks connection to GW +* - TSF:SID from @ref transportAssignNodeID(), assigns node ID +* - TSF:PNG from @ref transportPingNode(), pings a node +* - TSF:WUR from @ref transportWaitUntilReady(), waits until transport is ready +* - TSF:CRT from @ref transportClearRoutingTable(), clears routing table stored in EEPROM +* - TSF:LRT from @ref transportLoadRoutingTable(), loads RAM routing table from EEPROM (only GW/repeaters) +* - TSF:SRT from @ref transportSaveRoutingTable(), saves RAM routing table to EEPROM (only GW/repeaters) +* - TSF:MSG from @ref transportProcessMessage(), processes incoming message +* - TSF:SAN from @ref transportInvokeSanityCheck(), calls transport-specific sanity check +* - TSF:RTE from @ref transportRouteMessage(), sends message +* - TSF:SND from @ref transportSendRoute(), sends message if transport is ready (exposed) +* - TSF:TDI from @ref transportDisable() +* - TSF:TRI from @ref transportReInitialise() +* - TSF:SIR from @ref transportSignalReport() * * Transport debug log messages: * diff --git a/drivers/RF24/RF24.h b/drivers/RF24/RF24.h index 7f627f9e5..ec50e8d12 100644 --- a/drivers/RF24/RF24.h +++ b/drivers/RF24/RF24.h @@ -1,4 +1,4 @@ -/* +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each @@ -34,26 +34,26 @@ * RF24 driver-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE * - [!] Exclamation mark is prepended in case of error * -* |E| SYS | SUB | Message | Comment -* |-|-------|-------|-----------------------------------|--------------------------------------------------------------------- -* | | RF24 | INIT | | Initialise RF24 radio -* | | RF24 | INIT | PIN,CE=%d,CS=%d | Pin configuration: chip enable (CE), chip select (CS) -* |!| RF24 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module -* | | RF24 | SPP | PCT=%d,TX LEVEL=%d | Set TX level, input TX percent (PCT) -* | | RF24 | RBR | REG=%d,VAL=%d | Read register (REG), value=(VAL) -* | | RF24 | WBR | REG=%d,VAL=%d | Write register (REG), value=(VAL) -* | | RF24 | FRX | | Flush RX buffer -* | | RF24 | FTX | | Flush TX buffer -* | | RF24 | OWP | RCPT=%d | Open writing pipe, recipient=(RCPT) -* | | RF24 | STL | | Start listening -* | | RF24 | SPL | | Stop listening -* | | RF24 | SLP | | Set radio to sleep -* | | RF24 | SBY | | Set radio to standby -* | | RF24 | TXM | TO=%d,LEN=%d | Transmit message to=(TO), length=(LEN) -* |!| RF24 | TXM | MAX_RT | Max TX retries, no ACK received -* |!| RF24 | GDP | PYL INV | Invalid payload size -* | | RF24 | RXM | LEN=%d | Read message, length=(LEN) -* | | RF24 | STX | LEVEL=%d | Set TX level, level=(LEVEL) +* |E| SYS | SUB | Message | Comment +* |-|------|------|--------------------|--------------------------------------------------------------------- +* | | RF24 | INIT | | Initialise RF24 radio +* | | RF24 | INIT | PIN,CE=%d,CS=%d | Pin configuration: chip enable (CE), chip select (CS) +* |!| RF24 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module +* | | RF24 | SPP | PCT=%d,TX LEVEL=%d | Set TX level, input TX percent (PCT) +* | | RF24 | RBR | REG=%d,VAL=%d | Read register (REG), value=(VAL) +* | | RF24 | WBR | REG=%d,VAL=%d | Write register (REG), value=(VAL) +* | | RF24 | FRX | | Flush RX buffer +* | | RF24 | FTX | | Flush TX buffer +* | | RF24 | OWP | RCPT=%d | Open writing pipe, recipient=(RCPT) +* | | RF24 | STL | | Start listening +* | | RF24 | SPL | | Stop listening +* | | RF24 | SLP | | Set radio to sleep +* | | RF24 | SBY | | Set radio to standby +* | | RF24 | TXM | TO=%d,LEN=%d | Transmit message to=(TO), length=(LEN) +* |!| RF24 | TXM | MAX_RT | Max TX retries, no ACK received +* |!| RF24 | GDP | PYL INV | Invalid payload size +* | | RF24 | RXM | LEN=%d | Read message, length=(LEN) +* | | RF24 | STX | LEVEL=%d | Set TX level, level=(LEVEL) * */ diff --git a/drivers/RFM69/new/RFM69_new.h b/drivers/RFM69/new/RFM69_new.h index 56394a0e0..4754318fc 100644 --- a/drivers/RFM69/new/RFM69_new.h +++ b/drivers/RFM69/new/RFM69_new.h @@ -42,20 +42,20 @@ * RFM69 driver-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE * - [!] Exclamation mark is prepended in case of error * -* |E| SYS | SUB | Message | Comment -* |-|-------|-------|-----------------------------------|----------------------------------------------------------------------------------- -* | | RFM69 | INIT | | Initialise RFM69 radio -* | | RFM69 | INIT | PIN,CS=%d,IQP=%d,IQN=%d[,RST=%d] | Pin configuration: chip select (CS), IRQ pin (IQP), IRQ number (IQN), Reset (RST) -* |!| RFM69 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module -* | | RFM69 | PTX | NO ADJ | TX power level, no adjustment -* | | RFM69 | PTX | LEVEL=%d dbM | TX power level, set to (LEVEL) dBm -* | | RFM69 | SLEEP | | Radio in sleep mode -* | | RFM69 | SAC | SEND ACK,TO=%d,RSSI=%d | ACK sent to (TO), RSSI of incoming message (RSSI) -* | | RFM69 | ATC | ADJ TXL,cR=%d,tR=%d,TXL=%d | Adjust TX power level (TXL) to match set RSSI (sR), current RSSI (cR) -* | | RFM69 | SWR | SEND,TO=%d,RETRY=%d | Send to (TO), retry if no ACK received (RETRY) -* | | RFM69 | SWR | ACK,FROM=%d,SEQ=%d,RSSI=%d | ACK received from (FROM), sequence nr (SEQ), ACK RSSI (RSSI) -* |!| RFM69 | SWR | NACK | Message sent, no ACK received -* | | RFM69 | SPP | PCT=%d,TX LEVEL=%d | Set TX level, input TX percent (PCT) +* |E| SYS | SUB | Message | Comment +* |-|-------|-------|----------------------------------|----------------------------------------------------------------------------------- +* | | RFM69 | INIT | | Initialise RFM69 radio +* | | RFM69 | INIT | PIN,CS=%d,IQP=%d,IQN=%d[,RST=%d] | Pin configuration: chip select (CS), IRQ pin (IQP), IRQ number (IQN), Reset (RST) +* |!| RFM69 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module +* | | RFM69 | PTX | NO ADJ | TX power level, no adjustment +* | | RFM69 | PTX | LEVEL=%d dbM | TX power level, set to (LEVEL) dBm +* | | RFM69 | SLEEP | | Radio in sleep mode +* | | RFM69 | SAC | SEND ACK,TO=%d,RSSI=%d | ACK sent to (TO), RSSI of incoming message (RSSI) +* | | RFM69 | ATC | ADJ TXL,cR=%d,tR=%d,TXL=%d | Adjust TX power level (TXL) to match set RSSI (sR), current RSSI (cR) +* | | RFM69 | SWR | SEND,TO=%d,RETRY=%d | Send to (TO), retry if no ACK received (RETRY) +* | | RFM69 | SWR | ACK,FROM=%d,SEQ=%d,RSSI=%d | ACK received from (FROM), sequence nr (SEQ), ACK RSSI (RSSI) +* |!| RFM69 | SWR | NACK | Message sent, no ACK received +* | | RFM69 | SPP | PCT=%d,TX LEVEL=%d | Set TX level, input TX percent (PCT) * * @brief API declaration for RFM69 * @@ -211,19 +211,6 @@ extern HardwareSPI SPI; //!< SPI #define RFM69_868MHZ (868000000ul) //!< RFM69_868MHZ #define RFM69_915MHZ (915000000ul) //!< RFM69_915MHZ -/* -#if !defined(RFM69_FREQ_MSB) -#define RFM69_FREQ_MSB (uint8_t)(MY_RFM69_FREQUENCY == RFM69_315MHZ ? RFM69_FRFMSB_315 : (MY_RFM69_FREQUENCY == RFM69_433MHZ ? RFM69_FRFMSB_433_92 : (MY_RFM69_FREQUENCY == RFM69_868MHZ ? RFM69_FRFMSB_868 : RFM69_FRFMSB_915))) //!< FREQ_MSB -#endif - -#if !defined(RFM69_FREQ_MID) -#define RFM69_FREQ_MID (uint8_t)(MY_RFM69_FREQUENCY == RFM69_315MHZ ? RFM69_FRFMID_315 : (MY_RFM69_FREQUENCY == RFM69_433MHZ ? RFM69_FRFMID_433_92 : (MY_RFM69_FREQUENCY == RFM69_868MHZ ? RFM69_FRFMID_868 : RFM69_FRFMID_915))) //!< FREQ_MID -#endif - -#if !defined(RFM69_FREQ_LSB) -#define RFM69_FREQ_LSB (uint8_t)(MY_RFM69_FREQUENCY == RFM69_315MHZ ? RFM69_FRFLSB_315 : (MY_RFM69_FREQUENCY == RFM69_433MHZ ? RFM69_FRFLSB_433_92 : (MY_RFM69_FREQUENCY == RFM69_868MHZ ? RFM69_FRFLSB_868 : RFM69_FRFLSB_915))) //!< FREQ_LSB -#endif -*/ #define RFM69_COURSE_TEMP_COEF (-90) //!< puts the temperature reading in the ballpark, user can fine tune the returned value #define RFM69_FXOSC (32*1000000ul) //!< OSC freq, 32MHz #define RFM69_FSTEP (RFM69_FXOSC / 524288.0f) //!< FXOSC / 2^19 = 32MHz / 2^19 (p13 in datasheet) @@ -233,7 +220,6 @@ extern HardwareSPI SPI; //!< SPI #define RFM69_LISTEN_IDLE_US MY_RFM69_DEFAULT_LISTEN_IDLE_US //!< RFM69_LISTEN_IDLE_US #endif - /** * @brief Radio modes */ diff --git a/drivers/RFM95/RFM95.cpp b/drivers/RFM95/RFM95.cpp index 097cbcffe..bc26942a6 100644 --- a/drivers/RFM95/RFM95.cpp +++ b/drivers/RFM95/RFM95.cpp @@ -18,7 +18,7 @@ * * Based on Mike McCauley's RFM95 library, Copyright (C) 2014 Mike McCauley * Radiohead http://www.airspayce.com/mikem/arduino/RadioHead/index.html - * RFM95 driver refactored and optimized for MySensors, Copyright (C) 2016 Olivier Mauti + * RFM95 driver refactored and optimized for MySensors, Copyright (C) 2017 Olivier Mauti * */ diff --git a/drivers/RFM95/RFM95.h b/drivers/RFM95/RFM95.h index 7b6e43a3f..26db33d42 100644 --- a/drivers/RFM95/RFM95.h +++ b/drivers/RFM95/RFM95.h @@ -1,4 +1,4 @@ -/* +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each @@ -40,19 +40,19 @@ * RFM95 driver-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE * - [!] Exclamation mark is prepended in case of error * -* |E| SYS | SUB | Message | Comment -* |-|-------|-------|-----------------------------------|----------------------------------------------------------------------------------- -* | | RFM95 | INIT | | Initialise RFM95 radio -* | | RFM95 | INIT | PIN,CS=%d,IQP=%d,IQN=%d[,RST=%d] | Pin configuration: chip select (CS), IRQ pin (IQP), IRQ number (IQN), Reset (RST) -* |!| RFM95 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module -* | | RFM95 | RCV | SEND ACK | ACK request received, sending ACK back -* | | RFM95 | PTC | LEVEL=%d | Set TX power level -* | | RFM95 | SAC | SEND ACK,TO=%d,RSSI=%d,SNR=%d | Send ACK to node (TO), RSSI of received message (RSSI), SNR of message (SNR) -* | | RFM95 | ATC | ADJ TXL,cR=%d,tR=%d,TXL=%d | Adjust TX level, current RSSI (cR), target RSSI (tR), TX level (TXL) -* | | RFM95 | SWR | SEND,TO=%d,RETRY=%d | Send message to (TO), NACK retry counter (RETRY) -* | | RFM95 | SWR | ACK FROM=%d,SEQ=%d,RSSI=%d,SNR=%d | ACK received from node (FROM), seq ID (SEQ), (RSSI), (SNR) -* |!| RFM95 | SWR | NACK | No ACK received -* | | RFM95 | SPP | PCT=%d,TX LEVEL=%d | Set TX level, input TX percent (PCT) +* |E| SYS | SUB | Message | Comment +* |-|-------|------|------------------------------------|----------------------------------------------------------------------------------- +* | | RFM95 | INIT | | Initialise RFM95 radio +* | | RFM95 | INIT | PIN,CS=%d,IQP=%d,IQN=%d[,RST=%d] | Pin configuration: chip select (CS), IRQ pin (IQP), IRQ number (IQN), Reset (RST) +* |!| RFM95 | INIT | SANCHK FAIL | Sanity check failed, check wiring or replace module +* | | RFM95 | RCV | SEND ACK | ACK request received, sending ACK back +* | | RFM95 | PTC | LEVEL=%d | Set TX power level +* | | RFM95 | SAC | SEND ACK,TO=%d,RSSI=%d,SNR=%d | Send ACK to node (TO), RSSI of received message (RSSI), SNR of message (SNR) +* | | RFM95 | ATC | ADJ TXL,cR=%d,tR=%d,TXL=%d | Adjust TX level, current RSSI (cR), target RSSI (tR), TX level (TXL) +* | | RFM95 | SWR | SEND,TO=%d,RETRY=%d | Send message to (TO), NACK retry counter (RETRY) +* | | RFM95 | SWR | ACK FROM=%d,SEQ=%d,RSSI=%d,SNR=%d | ACK received from node (FROM), seq ID (SEQ), (RSSI), (SNR) +* |!| RFM95 | SWR | NACK | No ACK received +* | | RFM95 | SPP | PCT=%d,TX LEVEL=%d | Set TX level percent (PCT), TX level (LEVEL) * * RFM95 modem configuration * @@ -60,12 +60,12 @@ * CR = Error correction code * SF = Spreading factor, chips / symbol * -* | CONFIG | REG_1D | REG_1E | REG_26 | BW | CR | SF | Comment | air-time (15 bytes) -* |------------------|--------|--------|--------|-------|-----|------|------------------------------------------------ -* | BW125CR45SF128 | 0x72 | 0x74 | 0x04 | 125 | 4/5 | 128 | Default, medium range | 50ms -* | BW500CR45SF128 | 0x92 | 0x74 | 0x04 | 500 | 4/5 | 128 | Fast, short range | 15ms -* | BW31_25CR48SF512 | 0x48 | 0x94 | 0x04 | 31.25 | 4/8 | 512 | Slow, long range | 900ms -* | BW125CR48SF4096 | 0x78 | 0xC4 | 0x0C | 125 | 4/8 | 4096 | Slow, long range | 1500ms +* | CONFIG | REG_1D | REG_1E | REG_26 | BW | CR | SF | Comment | air-time (15 bytes) +* |------------------|--------|--------|--------|-------|-----|------|-----------------------|------------------------ +* | BW125CR45SF128 | 0x72 | 0x74 | 0x04 | 125 | 4/5 | 128 | Default, medium range | 50ms +* | BW500CR45SF128 | 0x92 | 0x74 | 0x04 | 500 | 4/5 | 128 | Fast, short range | 15ms +* | BW31_25CR48SF512 | 0x48 | 0x94 | 0x04 | 31.25 | 4/8 | 512 | Slow, long range | 900ms +* | BW125CR48SF4096 | 0x78 | 0xC4 | 0x0C | 125 | 4/8 | 4096 | Slow, long range | 1500ms * * See here for air-time calculation: https://docs.google.com/spreadsheets/d/1voGAtQAjC1qBmaVuP1ApNKs1ekgUjavHuVQIXyYSvNc *