mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-16 08:31:35 +10:00
+11


![github-actions[bot]](/assets/img/avatar_default.png)





5cc8ca59a3
* Fix protobuf structs handling (#4140) * Fix protobuf structs handling * Log instead of assert --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * BLE based logging (#4146) * WIP log characteristic * Bluetooth logging plumbing * Characteristic * Callback * Check for nullptr * Esp32 bluetooth impl * Formatting * Add thread name and log level * Add settings guard * Remove comments * Field name * Fixes esp32 * Open it up * Whoops * Move va_end past our logic * Use `upload_protocol = esptool` as with the other heltec devices instead of `esp-builtin` (#4151) * Standardize lat/lon position logs (#4156) * Standardize lat/lon position logs * Missed sone and condensed logs * [create-pull-request] automated change (#4157) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Pause BLE logging during want_config flow (#4162) * Update NimBLE to 1.4.2 (#4163) * Implement replies for all telemetry types based on variant tag (#4164) * Implement replies for all telemetry types based on variant tag * Remove check for `ignoreRequest`: modules can set this, don't need to check --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Esptool is better * Explicitly set characteristic * fix INA3221 sensor (#4168) - pass wire to begin() - remove redundant setAddr() (already set in header) * Show compass on waypoint frame; clear when waypoint deleted (#4116) * Clear expired or deleted waypoint frame * Return 0 to CallbackObserver * Add a missing comment * Draw compass for waypoint frame * Display our own waypoints * [create-pull-request] automated change (#4171) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Add semihosting support for nrf52 devices (#4137) * Turn off vscode cmake prompt - we don't use cmake on meshtastic * Add rak4631_dap variant for debugging with NanoDAP debug probe device. * The rak device can also run freertos (which is underneath nrf52 arduino) * Add semihosting support for nrf52840 devices Initial platformio.ini file only supports rak4630 Default to non TCP for the semihosting log output for now... Fixes https://github.com/meshtastic/firmware/issues/4135 * fix my botched merge - keep board_level = extra flag for rak3631_dbg --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * [create-pull-request] automated change (#4174) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Display alerts (#4170) * Move static functions into Screen.h, show compass during calibration * Move to _fontHeight macro to avoid collision * Move some alert functions to new alert handler * Catch missed reboot code * ESP32 fixes * Bump esp8266-oled-ssd1306 * Fixes for when a device has no screen * Use new startAlert(char*) helper class * Add EINK bits back to alert handling * Add noop class for no-display devices --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Send file system manifest up on want_config (#4176) * Send file system manifest up on want_config * Platform specific methods * Helps to actually make the change * Clear * tell vscode, if formatting, use whatever our trunk formatter wants (#4186) without this flag if the user has set some other formatter (clang) in their user level settings, it will be looking in the wrong directory for the clang options (we want the options in .trunk/clang) Note: formatOnSave is true in master, which means a bunch of our older files are non compliant and if you edit them it will generate lots of formatting related diffs. I guess I'll start letting that happen with my future commits ;-). * fix the build - would loop forever if there were no files to send (#4188) * Show owner.short_name on boot (and E-Ink sleep screen) (#4134) * Show owner.short_name on boot and sleep screen (on e-ink) * Update Screen.cpp - new line for short_name Boot screen short_name now below the region setting. Looks better on small screens. * Draw short_name on right --------- Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com> Co-authored-by: todd-herbert <herbert.todd@gmail.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * nrf52 soft device will watchdog if you use ICE while BT on... (#4189) so have debugger disable bluetooth. * correct xiao_ble build preventing sx1262 init (#4191) * Force a compile time failur if FromRadio or ToRadio get larger than (#4190) a BLE packet size. We are actually very close to this threshold so important to make sure we don't accidentally pass it. * Clear vector after complete config state (#4194) * Clear after complete config * Don't collect . entries * Log file name and size * [create-pull-request] automated change (#4200) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Make the logs Colorful! (#4199) * Squash needlessly static functions (#4183) * Trim extra vprintf and filter for unprintable characters * Deprecate Router Client role (and make it Client) (#4201) * [create-pull-request] automated change (#4205) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Move waypoint (#4202) * Move waypoint screen draw into the waypoint module * Get the observer set up for the waypoint screen draw * Static squashing: screen dimensions Macros moved back to Screen.cpp, as a band-aid until we eventually move all those static functions into the Screen class. * Move getCompassDiam into Screen class (supress compiler warnings) At this stage, the method is still static, because it's used by drawNodeInfo, which has no tidy reference to our screen instance. This is probably just another band-aid until these static functions all move. * Use new getCompassDiam function in AccelerometerThread * Properly gate display code in WaypointModule --------- Co-authored-by: Todd Herbert <herbert.todd@gmail.com> * Fix flakey phone api transition from file manifest to complete (#4209) * Try fix flakey phone api transition from file manifest to complete * Skip * enable colors in platformio serial monitor (#4217) * When talking via serial, encapsulate log messages in protobufs if necessary (#4187) * clean up RedirectablePrint::log so it doesn't have three very different implementations inline. * remove NoopPrint - it is no longer needed * when talking to API clients via serial, don't turn off log msgs instead encapsuate them * fix the build - would loop forever if there were no files to send * don't use Segger code if not talking to a Segger debugger * when encapsulating logs, make sure the strings always has nul terminators * nrf52 soft device will watchdog if you use ICE while BT on... so have debugger disable bluetooth. * Important to not print debug messages while writing to the toPhone scratch buffer * don't include newlines if encapsulating log records as protobufs --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * [create-pull-request] automated change (#4218) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Fix SHT41 support (#4222) * Add SHT41 Serial to I2c Detection Code On the Seeed Wio-WM1110 Dev Kit board, the SHT41 chip was being incorrectly detected as SHT31. This patch adds the necessary serial number for the SHT41 chip to be correctly detected. fixes meshtastic/firmware#4221 * Add missing sensor read for SHT41 * Typo fix in logs - mhz - MHz (#4225) As reported by karamo, a few different places in our logs had incorrect capitalization of MHz. fixes meshtastic/firmware#4126 * New new BLE logging characteristic with LogRecord protos (#4220) * New UUID * New log radio characteristic with LogRecord protobuf * LogRecord * Merge derp * How did you get there * Trunk * Fix length * Remove assert * minor cleanup proposal (#4169) * MESHTASTIC_EXCLUDE_WIFI and HAS_WIFI cleanup... Our code was checking HAS_WIFI and the new MESHTASTIC_EXCLUDE_WIFI flags in various places (even though EXCLUDE_WIFI forces HAS_WIFI to 0). Instead just check HAS_WIFI, only use EXCLUDE_WIFI inside configuration.h * cleanup: use HAS_NETWORKING instead of HAS_WIFI || HAS_ETHERNET We already had HAS_NETWORKING as flag in MQTT to mean 'we have tcpip'. Generallize that and move it into configuration.h so that we can use it elsewhere. * Use #pragma once, because supported by gcc and all modern compilers instead of #ifdef DOTHFILE_H etc... --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> * Add PowerMon support (#4155) * Turn off vscode cmake prompt - we don't use cmake on meshtastic * Add rak4631_dap variant for debugging with NanoDAP debug probe device. * The rak device can also run freertos (which is underneath nrf52 arduino) * Add semihosting support for nrf52840 devices Initial platformio.ini file only supports rak4630 Default to non TCP for the semihosting log output for now... Fixes https://github.com/meshtastic/firmware/issues/4135 * powermon WIP (for https://github.com/meshtastic/firmware/issues/4136 ) * oops - mean't to mark the _dbg variant as an 'extra' board. * powermon wip * Make serial port on wio-sdk-wm1110 board work By disabling the (inaccessible) adafruit USB * Instrument (radiolib only for now) lora for powermon per https://github.com/meshtastic/firmware/issues/4136 * powermon gps support https://github.com/meshtastic/firmware/issues/4136 * Add CPU deep and light sleep powermon states https://github.com/meshtastic/firmware/issues/4136 * Change the board/swversion bootstring so it is a new "structured" log msg. * powermon wip * add example script for getting esp S3 debugging working Not yet used but I didn't want these nasty tricks to get lost yet. * Add PowerMon reporting for screen and bluetooth pwr. * make power.powermon_enables config setting work. * update to latest protobufs * fix bogus shellcheck warning * make powermon optional (but default enabled because tiny and no runtime impact) * tell vscode, if formatting, use whatever our trunk formatter wants without this flag if the user has set some other formatter (clang) in their user level settings, it will be looking in the wrong directory for the clang options (we want the options in .trunk/clang) Note: formatOnSave is true in master, which means a bunch of our older files are non compliant and if you edit them it will generate lots of formatting related diffs. I guess I'll start letting that happen with my future commits ;-). * add PowerStress module * nrf52 arduino is built upon freertos, so let platformio debug it * don't accidentally try to Segger ICE if we are using another ICE * clean up RedirectablePrint::log so it doesn't have three very different implementations inline. * remove NoopPrint - it is no longer needed * when talking to API clients via serial, don't turn off log msgs instead encapsuate them * fix the build - would loop forever if there were no files to send * don't use Segger code if not talking to a Segger debugger * when encapsulating logs, make sure the strings always has nul terminators * nrf52 soft device will watchdog if you use ICE while BT on... so have debugger disable bluetooth. * Important to not print debug messages while writing to the toPhone scratch buffer * don't include newlines if encapsulating log records as protobufs * update to latest protobufs (needed for powermon goo) * PowerStress WIP * fix linter warning * Cleanup buffer * Merge hex for wm1110 target(s) * Only sdk * Sudo * Fix exclude macros (#4233) * fix MESHTASTIC_EXCLUDE_BLUETOOTH * fix HAS_SCREEN=0 * fix MESHTASTIC_EXCLUDE_GPS * fix typo in build-nrf52.sh (#4231) chmod is the command, '+x' is the argument. * Tidy Wireless Paper variant files (#4238) * Quick tidy of pins_arduino.h Matches requests made at https://github.com/meshtastic/firmware/pull/4226#discussion_r1664183480) * Tidy variant.h * Change deprecated ADC attenuation parameter From 11dB to 12dB. Resolves compiler warning. Allegly, no impact on function: `This is deprecated, it behaves the same as `ADC_ATTEN_DB_12` * Updated raspbian CI to update apt repository ahead of libbluetooth. (#4243) * Fix BLE logging on nrf52 (#4244) * allow ble logrecords to be fetched either by NOTIFY or INDICATE ble types This allows 'lossless' log reading. If client has requested INDICATE (rather than NOTIFY) each log record emitted via log() will have to fetched by the client device before the meshtastic node can continue. * Fix serious problem with nrf52 BLE logging. When doing notifies of LogRecords it is important to use the binary write routines - writing using the 'string' write won't work. Because protobufs can contain \0 nuls inside of them which if being parsed as a string will cause only a portion of the protobuf to be sent. I noticed this because some log messages were not getting through. --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Fix build when HAS_NETWORKING is false on nrf52 (#4237) (tested on a rak4631 by setting HAS_ETHERNET false when shrinking image) * If `toPhoneQueue` is full, still increment `fromNum` to avoid client never getting packets (#4246) * Update to SoftDevice 7.3.0 for wio-sdk-wm1110 and wio-tracker-wm1110 (#4248) * Update variant.h * Update wio-tracker-wm1110.json * Update wio-sdk-wm1110.json * Update platformio.ini * Update platformio.ini * Add files via upload * Add files via upload * Update variant.h * Cleanup NRF s140 Softdevice variants (#4252) Note: This idea is originally from @caveman99 and should be credited as such. Submitting as a separate PR so the work in meshtastic/firmware#4148 can be a bit cleaner and Seeed boards can build while that work is ongoing. The nrf52 boards that depend on the v7 softdevice all use the same code and linker files. Rather than duplicate the code, keep it all together with the platform. * Remove tracker variant specific soft device headers (#4255) * [create-pull-request] automated change (#4247) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Add wio-sdk-wm1110 to build. (#4258) The wio-sdk-wm1110 is distinct from the wio-tracker-wm1110, with different platformio build options and pin config. This change adds the wio-sdk-wm1110 to the CI matrix so firmware is built as part of release. * fix python warning in uf2conf (#4235) the old regex worked but was technically incorrect. fixes: Generating NRF52 uf2 file /home/kevinh/development/meshtastic/firmware/bin/uf2conv.py:195: SyntaxWarning: invalid escape sequence '\s' words = re.split('\s+', line) Converting to uf2, output size: 1458688, start address: 0x26000 * Collect hex files and specifically wm1110 sdk * Skip dfu file for sdk (for now) * Helps if you remove the original clause * Add Heltec new boards. (#4226) * Add Heltec new boards * Update variant.h disable RTC by default * Add Heltec New boards * Add Heltec new boards * Update Heltec Mesh Node definition. * Update Heltec Vision Mater E290 * [create-pull-request] automated change (#4259) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Trunk fmt * Fix macros * Move e290 to board level extra while CI is broken * Tell trunk to ignore bin folder * Fix missing * Update trunk.yaml, fix whitespace * Update trunk.yaml * Update build_raspbian_armv7l.yml --fix-missing * [create-pull-request] automated change (#4263) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * GPS Power State tidy-up (#4161) * Refactor GPSPowerState enum Identifies a case where the GPS hardware is awake, but an update is not yet desired * Change terminology * Clear old lock-time prediction on triple press * Use exponential smoothing to predict lock time * Rename averageLockTime to predictedLockTime * Attempt: Send PMREQ with duration 0 on MCU deep-sleep * Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep * Revert "Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep" This reverts commit 8b697cd2a445355dcfab5b33e0ce7a3128cab151. * Revert "Attempt: Send PMREQ with duration 0 on MCU deep-sleep" This reverts commit 9d29ec7603a88056b9115796b29b5023165a93bb. * Remove unused notifyGPSSleep Observable Handled with notifyDeepSleep, and enable() / disable() * WIP: simplify GPS power management An initial attempt only. * Honor #3e9e0fd * No-op when moving between GPS_IDLE and GPS_ACTIVE * Ensure U-blox GPS is awake to receive indefinite sleep command * Longer pause when waking U-blox to send sleep command * Actually implement soft and hard sleep.. * Dynamically estimate the threshold for GPS_HARDSLEEP * Fallback to GPS_HARDSLEEP, if GPS_SOFTSLEEP unsupported * Move "excessive search time" behavior to scheduler class * Minor logging adjustments * Promote log to warning * Gratuitous buffer clearing on boot * Fix inverted standby pin logic Specifically the standby pin for L76B, L76K and clones Discovered during T-Echo testing: totally broken function, probe method failing. * Remove redundant pin init Now handled by setPowerState * Replace max() with if statements Avoid those platform specific implementations.. * Trunk formatting New round of settings.json changes keep catching me out, have to remember to re-enable my "clang-format" for windows workaround. * Remove some asserts from setPowerState Original aim was to prevent sending a 0 second PMREQ to U-blox hardware as part of a timed sleep (GPS_HARDSLEEP, GPS_SOFTSLEEP). I'm not sure this is super important, and it feels tidier to just allow the 0 second sleeptime here, rather than fudge the sleeptime further up. * Fix an error determining whether GPS_SOFTSLEEP is supported * Clarify a log entry * Set PIN_STANDBY for MCU deep-sleep Required to reach TTGO's advertised 0.25mA sleep current for T-Echo. Without this change: ~6mA. * Optimize the shutdown current of RAK10701 to around 25uA (#4260) Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> * INA3221 sensor: use for bus voltage & environment metrics (#4215) * use INA3221 for bus voltage; fixes for telemetry variants - add to sensors available for environment telemetry (to report voltage/current) - add vars to define channels to use for battery voltage (for getBusVoltage) and environment metrics (default to CH1 for both) - write to the correct fields on the measurement struct depending on the measurement variant, and DRY up the sensor measurement collection code a bit - this might be suitable for a common implementation for the INA* sensors in a future PR... * formatting * derp --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * WM1110 SDK kit enter serial DFU and add deployment packages (#4266) * Switch default upload protocol to nrfutil so that pio generates zip deploy packages * Enter serial DFU on SDK board * Remove guard for DFU zip from SDK build * NRF_USE_SERIAL_DFU macro instead * Show specific frame when updating screen (#4264) * Updated setFrames in Screen.cpp Added code to attempt to revert back to the same frame that user was on prior to setFrame reload. * Space added Screen.cpp * Update Screen.cpp Make screen to revert to Frame 0 if the originally displayed frame is no longer there. * Update Screen.cpp Inserted boolean holdPosition into setFrames to indicate the requirement to stay on the same frame ( if =true) or else it will switch to new frame . Only Screen::handleStatusUpdate calls with setFrame(true). ( For Node Updates) All other types of updates call as before setFrame(), so it will change focus as needed. * Hold position, even if number of frames increases * Hold position, if handling an outgoing text message * Update Screen.cpp * Reverted chnages related to devicestate.has_rx_text_message * Reset to master * CannedMessages only handles routing packets when waiting for ACK Previously, this was calling Screen::setFrames at unexpected times * Gather position info about screen frames while regenerating * Make admin module observable Notify only when relevant. Currently: only to handle remove_nodenum. * Optionally specify which frame to focus when setFrames runs * UIFrameEvent uses enum instead of multiple booleans * Allow modules to request their own frame to be focussed This is done internally by calling MeshModule::requestFocus() Easier this way, insteady of passing the info in the UIFrameEvent: * Modules don't always know whether they should be focussed until after the UIFrameEvent has been raised, in dramFrame * Don't have to pass reference to module instance as parameter though several methods * E-Ink screensaver uses FOCUS_PRESERVE Previously, it had its own basic implementation of this. * Spelling: regional variant * trunk * Fix HAS_SCREEN guarding * More HAS_SCREEN guarding --------- Co-authored-by: BIST <77391720+slash-bit@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: slash-bit <v-b2@live.com> * Move up telemetry defaults to every 30 minutes (#4274) * Don't send node info interrogation when ch. util is >25% (#4273) * Moar LR1110 Targets * update SD_FLASH_SIZE to 0x27000 (#4232) The 7.3.0 softdevice needs the extra 1000 :) * Fix spacing. --------- Co-authored-by: Mike <mikhael.skvortsov@gmail.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Mike G <mkgin@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Co-authored-by: Warren Guy <5602790+warrenguy@users.noreply.github.com> Co-authored-by: todd-herbert <herbert.todd@gmail.com> Co-authored-by: geeksville <kevinh@geeksville.com> Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Alexander <156134901+Dorn8010@users.noreply.github.com> Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com> Co-authored-by: quimnut <github@dopegoat.com> Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com> Co-authored-by: Agent Blu, 006 <blu006@ucr.edu> Co-authored-by: Mark Trevor Birss <markbirss@gmail.com> Co-authored-by: Aaron.Lee <32860565+Heltec-Aaron-Lee@users.noreply.github.com> Co-authored-by: Daniel.Cao <144674500+DanielCao0@users.noreply.github.com> Co-authored-by: BIST <77391720+slash-bit@users.noreply.github.com> Co-authored-by: slash-bit <v-b2@live.com>
378 lines
17 KiB
C
378 lines
17 KiB
C
/* Automatically generated nanopb header */
|
|
/* Generated by nanopb-0.4.8 */
|
|
|
|
#ifndef PB_MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_INCLUDED
|
|
#define PB_MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_INCLUDED
|
|
#include <pb.h>
|
|
|
|
#if PB_PROTO_HEADER_VERSION != 40
|
|
#error Regenerate this file with the current version of nanopb generator.
|
|
#endif
|
|
|
|
/* Enum definitions */
|
|
/* Supported I2C Sensors for telemetry in Meshtastic */
|
|
typedef enum _meshtastic_TelemetrySensorType {
|
|
/* No external telemetry sensor explicitly set */
|
|
meshtastic_TelemetrySensorType_SENSOR_UNSET = 0,
|
|
/* High accuracy temperature, pressure, humidity */
|
|
meshtastic_TelemetrySensorType_BME280 = 1,
|
|
/* High accuracy temperature, pressure, humidity, and air resistance */
|
|
meshtastic_TelemetrySensorType_BME680 = 2,
|
|
/* Very high accuracy temperature */
|
|
meshtastic_TelemetrySensorType_MCP9808 = 3,
|
|
/* Moderate accuracy current and voltage */
|
|
meshtastic_TelemetrySensorType_INA260 = 4,
|
|
/* Moderate accuracy current and voltage */
|
|
meshtastic_TelemetrySensorType_INA219 = 5,
|
|
/* High accuracy temperature and pressure */
|
|
meshtastic_TelemetrySensorType_BMP280 = 6,
|
|
/* High accuracy temperature and humidity */
|
|
meshtastic_TelemetrySensorType_SHTC3 = 7,
|
|
/* High accuracy pressure */
|
|
meshtastic_TelemetrySensorType_LPS22 = 8,
|
|
/* 3-Axis magnetic sensor */
|
|
meshtastic_TelemetrySensorType_QMC6310 = 9,
|
|
/* 6-Axis inertial measurement sensor */
|
|
meshtastic_TelemetrySensorType_QMI8658 = 10,
|
|
/* 3-Axis magnetic sensor */
|
|
meshtastic_TelemetrySensorType_QMC5883L = 11,
|
|
/* High accuracy temperature and humidity */
|
|
meshtastic_TelemetrySensorType_SHT31 = 12,
|
|
/* PM2.5 air quality sensor */
|
|
meshtastic_TelemetrySensorType_PMSA003I = 13,
|
|
/* INA3221 3 Channel Voltage / Current Sensor */
|
|
meshtastic_TelemetrySensorType_INA3221 = 14,
|
|
/* BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280) */
|
|
meshtastic_TelemetrySensorType_BMP085 = 15,
|
|
/* RCWL-9620 Doppler Radar Distance Sensor, used for water level detection */
|
|
meshtastic_TelemetrySensorType_RCWL9620 = 16,
|
|
/* Sensirion High accuracy temperature and humidity */
|
|
meshtastic_TelemetrySensorType_SHT4X = 17,
|
|
/* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */
|
|
meshtastic_TelemetrySensorType_VEML7700 = 18,
|
|
/* MLX90632 non-contact IR temperature sensor. */
|
|
meshtastic_TelemetrySensorType_MLX90632 = 19,
|
|
/* TI OPT3001 Ambient Light Sensor */
|
|
meshtastic_TelemetrySensorType_OPT3001 = 20,
|
|
/* Lite On LTR-390UV-01 UV Light Sensor */
|
|
meshtastic_TelemetrySensorType_LTR390UV = 21,
|
|
/* AMS TSL25911FN RGB Light Sensor */
|
|
meshtastic_TelemetrySensorType_TSL25911FN = 22,
|
|
/* AHT10 Integrated temperature and humidity sensor */
|
|
meshtastic_TelemetrySensorType_AHT10 = 23,
|
|
/* DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction) */
|
|
meshtastic_TelemetrySensorType_DFROBOT_LARK = 24,
|
|
/* NAU7802 Scale Chip or compatible */
|
|
meshtastic_TelemetrySensorType_NAU7802 = 25
|
|
} meshtastic_TelemetrySensorType;
|
|
|
|
/* Struct definitions */
|
|
/* Key native device metrics such as battery level */
|
|
typedef struct _meshtastic_DeviceMetrics {
|
|
/* 0-100 (>100 means powered) */
|
|
uint32_t battery_level;
|
|
/* Voltage measured */
|
|
float voltage;
|
|
/* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */
|
|
float channel_utilization;
|
|
/* Percent of airtime for transmission used within the last hour. */
|
|
float air_util_tx;
|
|
/* How long the device has been running since the last reboot (in seconds) */
|
|
uint32_t uptime_seconds;
|
|
} meshtastic_DeviceMetrics;
|
|
|
|
/* Weather station or other environmental metrics */
|
|
typedef struct _meshtastic_EnvironmentMetrics {
|
|
/* Temperature measured */
|
|
float temperature;
|
|
/* Relative humidity percent measured */
|
|
float relative_humidity;
|
|
/* Barometric pressure in hPA measured */
|
|
float barometric_pressure;
|
|
/* Gas resistance in MOhm measured */
|
|
float gas_resistance;
|
|
/* Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) */
|
|
float voltage;
|
|
/* Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) */
|
|
float current;
|
|
/* relative scale IAQ value as measured by Bosch BME680 . value 0-500.
|
|
Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here. */
|
|
uint16_t iaq;
|
|
/* RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. */
|
|
float distance;
|
|
/* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */
|
|
float lux;
|
|
/* VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. */
|
|
float white_lux;
|
|
/* Infrared lux */
|
|
float ir_lux;
|
|
/* Ultraviolet lux */
|
|
float uv_lux;
|
|
/* Wind direction in degrees
|
|
0 degrees = North, 90 = East, etc... */
|
|
uint16_t wind_direction;
|
|
/* Wind speed in m/s */
|
|
float wind_speed;
|
|
/* Weight in KG */
|
|
float weight;
|
|
/* Wind gust in m/s */
|
|
float wind_gust;
|
|
/* Wind lull in m/s */
|
|
float wind_lull;
|
|
} meshtastic_EnvironmentMetrics;
|
|
|
|
/* Power Metrics (voltage / current / etc) */
|
|
typedef struct _meshtastic_PowerMetrics {
|
|
/* Voltage (Ch1) */
|
|
float ch1_voltage;
|
|
/* Current (Ch1) */
|
|
float ch1_current;
|
|
/* Voltage (Ch2) */
|
|
float ch2_voltage;
|
|
/* Current (Ch2) */
|
|
float ch2_current;
|
|
/* Voltage (Ch3) */
|
|
float ch3_voltage;
|
|
/* Current (Ch3) */
|
|
float ch3_current;
|
|
} meshtastic_PowerMetrics;
|
|
|
|
/* Air quality metrics */
|
|
typedef struct _meshtastic_AirQualityMetrics {
|
|
/* Concentration Units Standard PM1.0 */
|
|
uint32_t pm10_standard;
|
|
/* Concentration Units Standard PM2.5 */
|
|
uint32_t pm25_standard;
|
|
/* Concentration Units Standard PM10.0 */
|
|
uint32_t pm100_standard;
|
|
/* Concentration Units Environmental PM1.0 */
|
|
uint32_t pm10_environmental;
|
|
/* Concentration Units Environmental PM2.5 */
|
|
uint32_t pm25_environmental;
|
|
/* Concentration Units Environmental PM10.0 */
|
|
uint32_t pm100_environmental;
|
|
/* 0.3um Particle Count */
|
|
uint32_t particles_03um;
|
|
/* 0.5um Particle Count */
|
|
uint32_t particles_05um;
|
|
/* 1.0um Particle Count */
|
|
uint32_t particles_10um;
|
|
/* 2.5um Particle Count */
|
|
uint32_t particles_25um;
|
|
/* 5.0um Particle Count */
|
|
uint32_t particles_50um;
|
|
/* 10.0um Particle Count */
|
|
uint32_t particles_100um;
|
|
} meshtastic_AirQualityMetrics;
|
|
|
|
/* Types of Measurements the telemetry module is equipped to handle */
|
|
typedef struct _meshtastic_Telemetry {
|
|
/* Seconds since 1970 - or 0 for unknown/unset */
|
|
uint32_t time;
|
|
pb_size_t which_variant;
|
|
union {
|
|
/* Key native device metrics such as battery level */
|
|
meshtastic_DeviceMetrics device_metrics;
|
|
/* Weather station or other environmental metrics */
|
|
meshtastic_EnvironmentMetrics environment_metrics;
|
|
/* Air quality metrics */
|
|
meshtastic_AirQualityMetrics air_quality_metrics;
|
|
/* Power Metrics */
|
|
meshtastic_PowerMetrics power_metrics;
|
|
} variant;
|
|
} meshtastic_Telemetry;
|
|
|
|
/* NAU7802 Telemetry configuration, for saving to flash */
|
|
typedef struct _meshtastic_Nau7802Config {
|
|
/* The offset setting for the NAU7802 */
|
|
int32_t zeroOffset;
|
|
/* The calibration factor for the NAU7802 */
|
|
float calibrationFactor;
|
|
} meshtastic_Nau7802Config;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Helper constants for enums */
|
|
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
|
|
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_NAU7802
|
|
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_NAU7802+1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Initializer values for message structs */
|
|
#define meshtastic_DeviceMetrics_init_default {0, 0, 0, 0, 0}
|
|
#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_PowerMetrics_init_default {0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_AirQualityMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}}
|
|
#define meshtastic_Nau7802Config_init_default {0, 0}
|
|
#define meshtastic_DeviceMetrics_init_zero {0, 0, 0, 0, 0}
|
|
#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_PowerMetrics_init_zero {0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_AirQualityMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
|
#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}}
|
|
#define meshtastic_Nau7802Config_init_zero {0, 0}
|
|
|
|
/* Field tags (for use in manual encoding/decoding) */
|
|
#define meshtastic_DeviceMetrics_battery_level_tag 1
|
|
#define meshtastic_DeviceMetrics_voltage_tag 2
|
|
#define meshtastic_DeviceMetrics_channel_utilization_tag 3
|
|
#define meshtastic_DeviceMetrics_air_util_tx_tag 4
|
|
#define meshtastic_DeviceMetrics_uptime_seconds_tag 5
|
|
#define meshtastic_EnvironmentMetrics_temperature_tag 1
|
|
#define meshtastic_EnvironmentMetrics_relative_humidity_tag 2
|
|
#define meshtastic_EnvironmentMetrics_barometric_pressure_tag 3
|
|
#define meshtastic_EnvironmentMetrics_gas_resistance_tag 4
|
|
#define meshtastic_EnvironmentMetrics_voltage_tag 5
|
|
#define meshtastic_EnvironmentMetrics_current_tag 6
|
|
#define meshtastic_EnvironmentMetrics_iaq_tag 7
|
|
#define meshtastic_EnvironmentMetrics_distance_tag 8
|
|
#define meshtastic_EnvironmentMetrics_lux_tag 9
|
|
#define meshtastic_EnvironmentMetrics_white_lux_tag 10
|
|
#define meshtastic_EnvironmentMetrics_ir_lux_tag 11
|
|
#define meshtastic_EnvironmentMetrics_uv_lux_tag 12
|
|
#define meshtastic_EnvironmentMetrics_wind_direction_tag 13
|
|
#define meshtastic_EnvironmentMetrics_wind_speed_tag 14
|
|
#define meshtastic_EnvironmentMetrics_weight_tag 15
|
|
#define meshtastic_EnvironmentMetrics_wind_gust_tag 16
|
|
#define meshtastic_EnvironmentMetrics_wind_lull_tag 17
|
|
#define meshtastic_PowerMetrics_ch1_voltage_tag 1
|
|
#define meshtastic_PowerMetrics_ch1_current_tag 2
|
|
#define meshtastic_PowerMetrics_ch2_voltage_tag 3
|
|
#define meshtastic_PowerMetrics_ch2_current_tag 4
|
|
#define meshtastic_PowerMetrics_ch3_voltage_tag 5
|
|
#define meshtastic_PowerMetrics_ch3_current_tag 6
|
|
#define meshtastic_AirQualityMetrics_pm10_standard_tag 1
|
|
#define meshtastic_AirQualityMetrics_pm25_standard_tag 2
|
|
#define meshtastic_AirQualityMetrics_pm100_standard_tag 3
|
|
#define meshtastic_AirQualityMetrics_pm10_environmental_tag 4
|
|
#define meshtastic_AirQualityMetrics_pm25_environmental_tag 5
|
|
#define meshtastic_AirQualityMetrics_pm100_environmental_tag 6
|
|
#define meshtastic_AirQualityMetrics_particles_03um_tag 7
|
|
#define meshtastic_AirQualityMetrics_particles_05um_tag 8
|
|
#define meshtastic_AirQualityMetrics_particles_10um_tag 9
|
|
#define meshtastic_AirQualityMetrics_particles_25um_tag 10
|
|
#define meshtastic_AirQualityMetrics_particles_50um_tag 11
|
|
#define meshtastic_AirQualityMetrics_particles_100um_tag 12
|
|
#define meshtastic_Telemetry_time_tag 1
|
|
#define meshtastic_Telemetry_device_metrics_tag 2
|
|
#define meshtastic_Telemetry_environment_metrics_tag 3
|
|
#define meshtastic_Telemetry_air_quality_metrics_tag 4
|
|
#define meshtastic_Telemetry_power_metrics_tag 5
|
|
#define meshtastic_Nau7802Config_zeroOffset_tag 1
|
|
#define meshtastic_Nau7802Config_calibrationFactor_tag 2
|
|
|
|
/* Struct field encoding specification for nanopb */
|
|
#define meshtastic_DeviceMetrics_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, UINT32, battery_level, 1) \
|
|
X(a, STATIC, SINGULAR, FLOAT, voltage, 2) \
|
|
X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 3) \
|
|
X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 4) \
|
|
X(a, STATIC, SINGULAR, UINT32, uptime_seconds, 5)
|
|
#define meshtastic_DeviceMetrics_CALLBACK NULL
|
|
#define meshtastic_DeviceMetrics_DEFAULT NULL
|
|
|
|
#define meshtastic_EnvironmentMetrics_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \
|
|
X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \
|
|
X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \
|
|
X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \
|
|
X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \
|
|
X(a, STATIC, SINGULAR, FLOAT, current, 6) \
|
|
X(a, STATIC, SINGULAR, UINT32, iaq, 7) \
|
|
X(a, STATIC, SINGULAR, FLOAT, distance, 8) \
|
|
X(a, STATIC, SINGULAR, FLOAT, lux, 9) \
|
|
X(a, STATIC, SINGULAR, FLOAT, white_lux, 10) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ir_lux, 11) \
|
|
X(a, STATIC, SINGULAR, FLOAT, uv_lux, 12) \
|
|
X(a, STATIC, SINGULAR, UINT32, wind_direction, 13) \
|
|
X(a, STATIC, SINGULAR, FLOAT, wind_speed, 14) \
|
|
X(a, STATIC, SINGULAR, FLOAT, weight, 15) \
|
|
X(a, STATIC, SINGULAR, FLOAT, wind_gust, 16) \
|
|
X(a, STATIC, SINGULAR, FLOAT, wind_lull, 17)
|
|
#define meshtastic_EnvironmentMetrics_CALLBACK NULL
|
|
#define meshtastic_EnvironmentMetrics_DEFAULT NULL
|
|
|
|
#define meshtastic_PowerMetrics_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch1_voltage, 1) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch1_current, 2) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch2_voltage, 3) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch2_current, 4) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch3_voltage, 5) \
|
|
X(a, STATIC, SINGULAR, FLOAT, ch3_current, 6)
|
|
#define meshtastic_PowerMetrics_CALLBACK NULL
|
|
#define meshtastic_PowerMetrics_DEFAULT NULL
|
|
|
|
#define meshtastic_AirQualityMetrics_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm10_standard, 1) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm25_standard, 2) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm100_standard, 3) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm10_environmental, 4) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm25_environmental, 5) \
|
|
X(a, STATIC, SINGULAR, UINT32, pm100_environmental, 6) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_03um, 7) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_05um, 8) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_10um, 9) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_25um, 10) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_50um, 11) \
|
|
X(a, STATIC, SINGULAR, UINT32, particles_100um, 12)
|
|
#define meshtastic_AirQualityMetrics_CALLBACK NULL
|
|
#define meshtastic_AirQualityMetrics_DEFAULT NULL
|
|
|
|
#define meshtastic_Telemetry_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, FIXED32, time, 1) \
|
|
X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \
|
|
X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environment_metrics), 3) \
|
|
X(a, STATIC, ONEOF, MESSAGE, (variant,air_quality_metrics,variant.air_quality_metrics), 4) \
|
|
X(a, STATIC, ONEOF, MESSAGE, (variant,power_metrics,variant.power_metrics), 5)
|
|
#define meshtastic_Telemetry_CALLBACK NULL
|
|
#define meshtastic_Telemetry_DEFAULT NULL
|
|
#define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics
|
|
#define meshtastic_Telemetry_variant_environment_metrics_MSGTYPE meshtastic_EnvironmentMetrics
|
|
#define meshtastic_Telemetry_variant_air_quality_metrics_MSGTYPE meshtastic_AirQualityMetrics
|
|
#define meshtastic_Telemetry_variant_power_metrics_MSGTYPE meshtastic_PowerMetrics
|
|
|
|
#define meshtastic_Nau7802Config_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, INT32, zeroOffset, 1) \
|
|
X(a, STATIC, SINGULAR, FLOAT, calibrationFactor, 2)
|
|
#define meshtastic_Nau7802Config_CALLBACK NULL
|
|
#define meshtastic_Nau7802Config_DEFAULT NULL
|
|
|
|
extern const pb_msgdesc_t meshtastic_DeviceMetrics_msg;
|
|
extern const pb_msgdesc_t meshtastic_EnvironmentMetrics_msg;
|
|
extern const pb_msgdesc_t meshtastic_PowerMetrics_msg;
|
|
extern const pb_msgdesc_t meshtastic_AirQualityMetrics_msg;
|
|
extern const pb_msgdesc_t meshtastic_Telemetry_msg;
|
|
extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
|
|
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
|
#define meshtastic_DeviceMetrics_fields &meshtastic_DeviceMetrics_msg
|
|
#define meshtastic_EnvironmentMetrics_fields &meshtastic_EnvironmentMetrics_msg
|
|
#define meshtastic_PowerMetrics_fields &meshtastic_PowerMetrics_msg
|
|
#define meshtastic_AirQualityMetrics_fields &meshtastic_AirQualityMetrics_msg
|
|
#define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg
|
|
#define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg
|
|
|
|
/* Maximum encoded size of messages (where known) */
|
|
#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size
|
|
#define meshtastic_AirQualityMetrics_size 72
|
|
#define meshtastic_DeviceMetrics_size 27
|
|
#define meshtastic_EnvironmentMetrics_size 85
|
|
#define meshtastic_Nau7802Config_size 16
|
|
#define meshtastic_PowerMetrics_size 30
|
|
#define meshtastic_Telemetry_size 92
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
#endif
|