From 69d3b03337d8ea676137d9fd4d1fc926803591a3 Mon Sep 17 00:00:00 2001 From: Pranau-R Date: Tue, 29 Oct 2024 13:25:02 +0530 Subject: [PATCH 1/3] fix #10: This is v0.4.1 --- README.md | 3 +++ catena4618m201_simple.ino | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62a3ca1..7885d53 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,9 @@ Many of the sketches in other directories in this tree are for engineering use a ### Release History +- v0.4.1 minor bug fixes for V2 changes +- v0.4.0 added V2 boards support +- v0.3.0 added firmware update via serial feature - v0.2.0 adopts the common build system. - v0.1.3 is the first official release diff --git a/catena4618m201_simple.ino b/catena4618m201_simple.ino index 03a301a..3dd70df 100644 --- a/catena4618m201_simple.ino +++ b/catena4618m201_simple.ino @@ -6,7 +6,7 @@ Function: Sensor program for Catena 4618m201. Copyright notice: - This file copyright (C) 2019, 2022 by + This file copyright (C) 2019 - 2024 by MCCI Corporation 3520 Krums Corners Road @@ -184,7 +184,7 @@ static constexpr const char *filebasename(const char *s) | \****************************************************************************/ -static const char sVersion[] = "0.4.0"; +static const char sVersion[] = "0.4.1"; /****************************************************************************\ | From 7099a3884745bf4e54e0b6e8c9bfc0629f69537c Mon Sep 17 00:00:00 2001 From: Pranau-R Date: Tue, 29 Oct 2024 13:45:51 +0530 Subject: [PATCH 2/3] updated README with v0.4.1 changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7885d53..cf616aa 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ Many of the sketches in other directories in this tree are for engineering use a ### Release History -- v0.4.1 minor bug fixes for V2 changes +- v0.4.1 fix typo of revision to compare the board revision from flash - v0.4.0 added V2 boards support - v0.3.0 added firmware update via serial feature - v0.2.0 adopts the common build system. From 7c8b77b920b3a1f6dda1345d946d7e0583f3f794 Mon Sep 17 00:00:00 2001 From: Dhinesh Kumar Pitchai Date: Tue, 29 Oct 2024 16:01:51 +0530 Subject: [PATCH 3/3] update decoder file name and document name --- ...a-message-port3-port6-decoder-node-red.js} | 0 ...catena-message-port3-port6-decoder-ttn.js} | 0 ...d => catena-message-port3-port6-format.md} | 45 ++++++++++++++----- 3 files changed, 35 insertions(+), 10 deletions(-) rename extras/{catena-message-port3-decoder-node-red.js => catena-message-port3-port6-decoder-node-red.js} (100%) rename extras/{catena-message-port3-decoder-ttn.js => catena-message-port3-port6-decoder-ttn.js} (100%) rename extras/{catena-message-port3-format.md => catena-message-port3-port6-format.md} (67%) diff --git a/extras/catena-message-port3-decoder-node-red.js b/extras/catena-message-port3-port6-decoder-node-red.js similarity index 100% rename from extras/catena-message-port3-decoder-node-red.js rename to extras/catena-message-port3-port6-decoder-node-red.js diff --git a/extras/catena-message-port3-decoder-ttn.js b/extras/catena-message-port3-port6-decoder-ttn.js similarity index 100% rename from extras/catena-message-port3-decoder-ttn.js rename to extras/catena-message-port3-port6-decoder-ttn.js diff --git a/extras/catena-message-port3-format.md b/extras/catena-message-port3-port6-format.md similarity index 67% rename from extras/catena-message-port3-format.md rename to extras/catena-message-port3-port6-format.md index 0871f8b..f8790b1 100644 --- a/extras/catena-message-port3-format.md +++ b/extras/catena-message-port3-port6-format.md @@ -1,4 +1,4 @@ -# Understanding MCCI Catena data sent on port 3 +# Understanding MCCI Catena data sent on port 3 and port 6 @@ -9,11 +9,13 @@ - [Boot counter (field 2)](#boot-counter-field-2) - [Environmental Readings (field 3)](#environmental-readings-field-3) - [Ambient light (field 4)](#ambient-light-field-4) + - [Light intensity](#light-intensity-field-4) - [Bus Voltage (field 5)](#bus-voltage-field-5) - [Data Formats](#data-formats) - [uint16](#uint16) - [int16](#int16) - [uint8](#uint8) + - [sflt24](#sflt24) - [Test Vectors](#test-vectors) - [Node-RED Decoding Script](#node-red-decoding-script) - [The Things Network Console decoding script](#the-things-network-console-decoding-script) @@ -22,7 +24,7 @@ ## Overall Message Format -Port 3 uplink messages are used by Catena4617_simple, Catena4618_simple and related sketches. They're designed to minimize power use and maximize battery life; so instead of using a port code plus a message discrimintor, these simply use port 3. +Port 3 uplink messages are used by Catena4618_simple and Catena4618m201_simple sketches. They're designed to minimize power use and maximize battery life; so instead of using a port code plus a message discrimintor, these simply use port 3 for version 1 boards and port 6 for version 2 boards. Each message has the following layout. @@ -35,7 +37,7 @@ Each bit in byte 0 represents whether a corresponding field in bytes 1..n is pre ## Bitmap fields and associated fields -The bitmap byte has the following interpretation. `int16`, `uint16`, etc. are defined after the table. +The bitmap byte has the following interpretation for version 1 boards (transmitting over port 3). Bitmap bit | Length of corresponding field (bytes) | Data format |Description :---:|:---:|:---:|:---- @@ -43,11 +45,26 @@ Bitmap bit | Length of corresponding field (bytes) | Data format |Description 1 | 2 | [int16](#int16) | [System voltage](#sys-voltage-field-1) 2 | 1 | [uint8](#uint8) | [Boot counter](#boot-counter-field-2) 3 | 5 | [int16](#int16), [uint16](#uint16) | [Temperature, humidity](environmental-readings-field-3) -4 | 2 | [uint16](#uint16), [uint16](#uint16), [uint16](#uint16) | [Ambient Light](#ambient-light-field-4) (IR, white, UV) +4 | 6 | [uint16](#uint16), [uint16](#uint16), [uint16](#uint16) | [Ambient Light](#ambient-light-field-4) (IR, white, UV) 5 | 2 | [int16](#int16) | [Bus voltage](#bus-voltage-field-5) 6 | n/a | _reserved_ | Reserved for future use. 7 | n/a | _reserved_ | Reserved for future use. +The bitmap byte has the following interpretation for version 2 boards (transmitting over port 6). + +Bitmap bit | Length of corresponding field (bytes) | Data format |Description +:---:|:---:|:---:|:---- +0 | 2 | [int16](#int16) | [Battery voltage](#battery-voltage-field-0) +1 | 2 | [int16](#int16) | [System voltage](#sys-voltage-field-1) +2 | 1 | [uint8](#uint8) | [Boot counter](#boot-counter-field-2) +3 | 5 | [int16](#int16), [uint16](#uint16) | [Temperature, humidity](environmental-readings-field-3) +4 | 3 | [sflt24](#sflt24) | [Light intensity](#light-intensity-field-4) (IR, white, UV) +5 | 2 | [int16](#int16) | [Bus voltage](#bus-voltage-field-5) +6 | n/a | _reserved_ | Reserved for future use. +7 | n/a | _reserved_ | Reserved for future use. + +NOTE: `int16`, `uint16`, etc. are defined after the table. + ### Battery Voltage (field 0) Field 0, if present, carries the current battery voltage. To get the voltage, extract the int16 value, and divide by 4096.0. (Thus, this field can represent values from -8.0 volts to 7.998 volts.) @@ -72,7 +89,7 @@ Field 3, if present, has two environmental readings as four bytes of data. ### Ambient light (field 4) -Field 4, if present, has three light readings as six bytes of data. +For version 1 boards, Field 4, if present, has three light readings as six bytes of data. - The first two bytes are a [`uint16`](#uint16) representing the IR measurement. - Bytes two and three are a [`uint16`](#uint16) representing the white light measurement. @@ -80,6 +97,10 @@ Field 4, if present, has three light readings as six bytes of data. The measurements range from 0 to 65536, but must be calibrated to obtain engineering units. +### Light intensity (field 4) + +For version 2 boards, Field 4, if present, has light intensity reading as three bytes of signed float lux data. + ### Bus Voltage (field 5) Field 5, if present, carries the current voltage from USB VBus. Divide by 4096.0 to convert from counts to volts. (Thus, this field can represent values from -8.0 volts to 7.998 volts.) @@ -100,6 +121,10 @@ a signed integer from -32,768 to 32,767, in two's complement form. (Thus 0..0x7F an integer from 0 to 255. +### sflt24 + +a signed float from 0 to 16777215. + ## Test Vectors The following input data can be used to test decoders. @@ -115,14 +140,14 @@ The following input data can be used to test decoders. A Node-RED script to decode this data is part of this repository. You can download the latest version from github: -- in raw form: https://raw.githubusercontent.com/mcci-catena/Catena-Sketches/master/extras/catena-message-port3-decoder-node-red.js -- or view it: https://github.com/mcci-catena/Catena-Sketches/blob/master/extras/catena-message-port3-decoder-node-red.js +- in raw form: https://raw.githubusercontent.com/mcci-catena/catena4618m201_simple/refs/heads/master/extras/catena-message-port3-port6-decoder-node-red.js +- or view it: https://github.com/mcci-catena/catena4618m201_simple/blob/master/extras/catena-message-port3-port6-decoder-node-red.js ## The Things Network Console decoding script -The repository contains a generic script that decodes all formats, including port 3, for [The Things Network console](https://console.thethingsnetwork.org). +The repository contains a generic script that decodes all formats, including port 3 and port 6, for [The Things Network console](https://console.thethingsnetwork.org). You can get the latest version on github: -- in raw form: https://raw.githubusercontent.com/mcci-catena/Catena-Sketches/master/extras/catena-message-generic-decoder-ttn.js -- or view it: https://github.com/mcci-catena/Catena-Sketches/blob/master/extras/catena-message-generic-decoder-ttn.js +- in raw form: https://raw.githubusercontent.com/mcci-catena/catena4618m201_simple/refs/heads/master/extras/catena-message-port3-port6-decoder-ttn.js +- or view it: https://github.com/mcci-catena/catena4618m201_simple/blob/master/extras/catena-message-port3-port6-decoder-ttn.js