Commit Graph
370 Commits
Author SHA1 Message Date
FlorianandFlorian 4bbdeadb53 Update RN8209 sensors names (#1342)
to NRG to be more generic

Co-authored-by: Florian <1technophile@users.noreply.github.com>
2022-12-01 11:13:41 -06:00
DigiH 07b2a051ec Typo and clarification (#1340) 2022-11-30 20:13:45 -06:00
Florian 5a42b02ad8 Enable to configure the OTA password from the Wifi Manager portal (#1339)
So as to enable the user to change the default one when setting up the gateway
2022-11-30 14:51:37 -06:00
Florian dee3ef4de5 Improve reset mechanism when MQTT is not connected (#1338)
This enables to wait less for the reset to trigger
2022-11-30 14:27:27 -06:00
Florianandh2zero 8ee1c4e524 RN8209 energy sensor support with watt, voltage and current. (#1337)
Co-authored-by: h2zero <powellperalta@gmail.com>
2022-11-29 18:41:47 -06:00
Florian 145896516d Enable to set Manufacturer and Model (#1336)
from macros
2022-11-29 10:48:00 -06:00
Florian 8714141630 Remove the devices that have Random Mac from the internal memory (#1335)
So as to avoid to have a growing memory consumption, indeed each time these devices change their MAC it will create a new entry into the list. This increase continuously the memory consumption of the list. And as these devices can't be discovered and doesn't have interest to be white or black listed we don't store them
2022-11-28 20:29:07 -06:00
Florian c58e765253 Enable to keep actuator on off state in case of restart (#1334)
and publish status as a json when triggering actuator on off through a button
2022-11-28 20:28:40 -06:00
Florian 66588149a8 Change Error color to orange on RGB (#1333)
And enable its display when entering the WM portal
2022-11-28 20:28:03 -06:00
Florian c98511ba36 Set the AP name with the short name plus the 4 first digits of the ESP mac (#1331)
so as to don't disclose the password used for WM.
Also change the wm password from MAc to be the last 8 digits, as these will change more than the first 8 ones.
Also make consistent the ifndef qnd the parsing between WM_PWD_FROM_MAC and USE_MAC_AS_GATEWAY_NAME
2022-11-28 20:06:36 -06:00
Florian 3e9fbb21ff Move the button check at start of the program (#1330)
So as to enable to trigger the wm portal before the setup of all the modules
2022-11-28 20:04:48 -06:00
Florian 2ada47c3bc Enable to set the WM pwd from the Mac (#1323)
So as to reinforce security for AP configuration access, enable to set the Wifi Manager Password from the 8 first digits of the ESP Mac address
2022-11-28 13:21:03 -06:00
Radim 4afb4a972f Adc bugfix (#1328) 2022-11-28 11:35:11 -06:00
David Furey ec96b72d96 Support LM75 temperature sensor (#1327)
* First draft of LM75 sensor based on HTU21 sensor

* Initialise I2C on ESP8266

* Add LM75 sensor to test builds

So that it will be tested with the continuous integration
2022-11-28 11:31:46 -06:00
Florian ec21cbb880 Update default certificate of Github (#1322)
So as to enable updates with a payload without the cert, and add a command example. Also so change the update message to notice level
2022-11-16 15:16:32 -06:00
Florian f5ce12a641 Add rgb gpio powering pin (#1321)
* Add RGB GPIO powering pin

When the RGB Led is powered by an uC pin, enable to power it up from the led setup

* Comments improvements
2022-11-16 14:15:00 -06:00
Florian 33e162111a Add RGB Led management for errors, infos, and send receive events (#1320)
* Add RGB Led management for errors, infos, and send receive events

Add RGB led management for indicators, integrate it for M5 Atom and ESP32 C3 and S3 dev board
Update Fastled version to 3.5.0.

The default behavior is with regular LED, to use RGB Led the macro RGB_INDICATORS needs to be define, along with the FASTLED_IND_TYPE, FASTLED_IND_DATA_GPIO and FASTLED_IND_NUM_LEDS
Note that some RGB led need to have a different color scheme, so in this case it can be entered along with the data PIN definition: -DFASTLED_IND_DATA_GPIO=27,GRB

* Add FastLed library to the environments
2022-11-16 12:58:22 -06:00
h2zero 9d7086558b Update Arduino core and BLE/WiFiManager libs. (#1310)
* Update Arduino core and BLE/WiFiManager libs.

* Add esp32-s3 and esp32-c3 environments.

* Update build script to use matrix.

* Update release build.

* Fix WiFiManager crash

* Use espressif32 version 3.5.0 for standard ESP32.

* Resolves BLE scan_evt timeout issue with latest version (5.2.0).

* ESP32C3 and ESP32S3 Env's use espressif32 version 5.2.0.

* Update LED pins for C3/S3 environments.
2022-11-13 12:35:18 -06:00
Sami Salonen 3d589ffa90 Handle OTA actively when MQTT is not connected (#1307)
* Handle OTA actively when MQTT is not connected

Resolves #1292

* Fix compilation for targets not having OTA

* ArduinoOTA.handle() only with non-ESP targets

* OTA check before reboot: fix condition and add more comments


Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-11-13 09:34:20 -06:00
Radim d392964b90 ADC improvement & fix (#1314)
* fix when ADC_DIVIDER is defined
NEW multiple readings option

* publish at least every 1min

* define minimum pub adc interval
2022-11-10 06:21:05 -06:00
crasu 7c8b85f9f4 fix rf gateway f strings (#1313)
Signed-off-by: Christian Krämer <christian.kraemer@tngtech.com>
2022-11-07 10:30:51 -06:00
crasu 567c2053c0 check spi connectivity for c1101 (#1287)
Signed-off-by: Christian Krämer <christian.kraemer@tngtech.com>
2022-11-03 07:45:08 -05:00
Radim 7d10502b8d fix pub of res field (#1311) 2022-11-03 07:40:51 -05:00
Florian c612169ba8 Fix discovery duplicates for BT devices (#1297)
Fix isdisc = true identification, introduced by https://github.com/1technophile/OpenMQTTGateway/commit/25b8123ff6471352951d3def22c815017f5f11e1
2022-10-23 13:37:20 -05:00
Northern Man 19d58e01e0 Defensive code for Heltec Display (#1296)
Added to Heltec board display code logic to reduce corruption of messages on the display

Two piece of defensive code were added

- Only display messages to the display when operating on Core 1 ( Default Arduino ESP32 CONFIG_ARDUINO_RUNNING_CORE )

- Only display one character/string at a time

In the event of failure, default to Serial output.

PS SSD1306 driver similar issues

https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/326
https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/352
2022-10-23 13:36:59 -05:00
Sami Salonen 941b1e109f Re-publish BTtoMQTT Theengs discovery topics on MQTT re-connect (#1290)
* Re-publish BTtoMQTT Theengs discovery topics on MQTT re-connect

- Improved version of #1274, this should re-publish more
- Handle return value of (MQTT) client.loop() to detect connection loss
  faster

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-10-23 10:57:39 -05:00
Northern Man 8bc65d62dc Update of rtl_433_ESP to version 0.1.3 - Support for SX127X transceiver module (#1291)
The main features of the upgrade to 0.1.3 of rtl_433_ESP are

1 - Change Transceiver Library to RadioLib

2 - Add support for SX127X transceiver module ( I used the 433 Mhz version of this Heltec module for development ).

3 - Added automatic calibration of the RSSI Signal detection Threshold

4 - Removed dependency on loop for start and end of signal detection, and moved to a ESP32 Task

5 - Moved received signal decoding to a ESP32 Task

6 - Identified Blueline PowerCost Monitor decoder as source of significant memory overhead and disabled.

7 - Multi Receiver support has been validated with RF, RF2 and PiLight
2022-10-20 11:14:45 -05:00
Northern Man c570eead82 Delete main.ino.cpp (#1289) 2022-10-18 12:33:33 -05:00
Northern Man c45181ef7e Heltec SSD1306 Display Support (#1283)
My environment

[env:heltec-display]   ; Heltec ESP32 Board with SSD1306 display
platform = ${com.esp32_platform}
board = heltec_wifi_lora_32_V2
build_type = debug
monitor_filters = esp32_exception_decoder
board_build.partitions = min_spiffs.csv
extra_scripts = pre:scripts/omg_firmware_version.py
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.wifimanager32}
  ${libraries.heltec}
;  ${libraries.m5stickcp}

build_flags =
  ${com-esp.build_flags}
  ${test_env.build_flags}
; *** OpenMQTTGateway Config ***
  '-UZmqttDiscovery'          ; disables MQTT Discovery
  '-DvalueAsATopic=true'
  '-DLOG_LEVEL=LOG_LEVEL_TRACE'
; *** OpenMQTTGateway Modules ***
  '-DZboardHELTEC="HELTEC"'
; *** Heltec Board Options ***
  '-DDEBUG_OLEDDISPLAY(...)=Serial.printf( __VA_ARGS__ )'
  '-DLOG_TO_LCD=true'         ; Enable log to LCD
  '-DLED_ERROR=2'
  '-DONBOARD_LED=25'          ; Onboard LED is GPIO 25 on the Heltec Board

monitor_port = /dev/cu.SLAB_USBtoUART
monitor_speed = 921600
upload_port = /dev/cu.SLAB_USBtoUART
upload_speed = 921600

1 - Set default LCD log level to WARNING
2 - Implemented a macro based displayPrint function that will be usable across different displays

- Added logo display when idle
- Fixed log-lcd mqtt function
- Enable OLED Display on Heltec Boards
2022-10-13 21:17:25 -05:00
Florian bf38bb52f6 Remove HM10 support (#1282)
Removing HM10 support as announced in the forum
2022-10-10 20:34:12 -05:00
Florian bbaabcc20d Fix missing lowpowermode attribute (#1281)
LowPowerMode is not used outside of the BT gateway, removing it from discoveyr fixes #1267
2022-10-10 18:30:46 -05:00
spinpwr 0ff3e98d91 Adding unique device names to HA dicovery (#1270)
* Adding unique device names to HA dicovery

Multiple devices of the same model got the same name in Home Assistant,
making the device list less informative when there are many of e.g. the
same sensor.
To over come this changed the function publishing discovery messages to
add the second half of the device mac address to the device name so it
becomes unique.

Issue: #1269
2022-10-10 13:10:33 -05:00
Sami Salonen e9449f567b Re-publish discovery topics on re-connect (via cfg, disabled by default) (#1274)
Resolves https://github.com/1technophile/OpenMQTTGateway/issues/1273

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-09-26 15:49:02 -05:00
DigiH 765ec8415b Additional units from decoders (#1271) 2022-09-22 17:55:36 +02:00
DigiH 5c07e7ef9d CGDN1 classes & units (#1268) 2022-09-10 16:25:54 -05:00
Florian bb88f7e795 Add unit for Amphiro/Oras shower head (#1265) 2022-09-10 18:53:47 +02:00
DigiH b16fbcbef2 valueAsASubject to valueAsATopic inconsistency fix (#1260) 2022-09-03 18:51:52 -05:00
Bad 312ef858c1 Modify new BT config using MQTT (#1259)
* Move BTConfig_default to ZgatewayBT.ino as BTConfig_init()

* Remove unused function declaration & typo

* Move bleconnect outside of ifdef ESP32

* Add new parameters to json payload on MQTTtoBT/config
And move them to function BTConfig_fromJson()

new parameters: [presenceEnable, presenceTopic, presenceUseBeaconUuid, extDecoderEnable,
extDecoderTopic, filterConnectable, pubKnownServiceData,
pubUnknownServiceData, pubKnownManufData, pubUnknownManufData,
pubServiceDataUUID, pubBeaconUuidForTopic]

* Add ignoreWBlist as new configuration parameter

* Keep hasspresence keyword (do not use presenceEnable)

* Documentation

* Typos & Optimizations arround RemoveJsonPropertyIf

* Template for BT config update

* Ensure BTConfig.minRssi sign does not matter

* Report configuration change on topic /commands/BTtoMQTT/config

# Conflicts:
#	main/ZgatewayBT.ino

* Add BT config bool commands (init, load, erase & save) to persist config parameters

* Documentation

* Fix pre-compilation issue

* Fix Code Format

* Use Preference only for ESP32

* Update Doc
2022-09-03 15:08:07 -05:00
BadandFlorian 9120d06932 Mutate relevant compilation variables into config (#1256)
* Move minRssi in config_BT.h
Move var definitions next to compilation var definitions

* Introduce UseExtDecoder when is def MQTTDecodeTopic
Replace #ifdef MQTTDecodeTopic by #if UseExtDecoder

* Rename AttemptBLECOnnect to AttemptBLEConnect

* Create a struct (BTConfig_s) for BT configuration data
Create a default config for BTConfig_s (BTConfig_default) based on defines
Create a global variable (BTConfig) to hold live BT configuration data and initialize it
Move bleConnect to BTConfig

* Move BLEscanBeforeConnect in BTConfig

* Move BLEinterval in BTConfig

* Move PublishOnlySensors in BTConfig

* Move hassPresence in BTConfig

* Move minRssi into BTConfig

* Introduce presenceTopic into BTConfig

* Move MQTTDecodeTopic as extDecoderTopic into BTConfig

* Mutate UseExtDecoder as runtime var BTConfig.extDecoderTopic

* Remove ServicedataMinLength (unused)
Always declare AttemptBLEConnect & BLE_FILTER_CONNECTABLE

* Mutate BLE_FILTER_CONNECTABLE as runtime parameter BTConfig.filterConnectable

* Mutate pubKnownBLEServiceData as runtime var in BTConfig
Mutate pubUnknownBLEServiceData as runtime var in BTConfig
Mutate pubBLEManufacturerData as runtime var in BTConfig
Mutate pubUnknownBLEManufacturerData as runtime var in BTConfig
Mutate pubBLEServiceUUID as runtime var in BTConfig

* Mutate useBeaconUuidForTopic as runtime var in BTConfig
Mutate useBeaconUuidForPresence as runtime var in BTConfig

* Small optimization

* Formatting of config_BT

Co-authored-by: Florian <1technophile@users.noreply.github.com>
2022-08-20 14:28:25 -05:00
Amy Nagle b17247c049 Add missing macType param to NO_DEVICE_FOUND (#1253)
* Add missing macType param to NO_DEVICE_FOUND

* Simplify MAC address initialization
2022-08-09 05:19:19 -05:00
DigiH c4300a002f MQTT-MAC-IP-mDNS (#1245) 2022-07-19 12:10:51 -05:00
Bad 612c3f6322 Fix wrong base topic if gateway_name is changed (#1242)
* Rectify and match parameters sizes.
Increase mqtt_topic_max_size from 100/50 to 150/75 bytes

* Faster and safer compare in cmpToMainTopic()
2022-07-19 07:52:46 +02:00
Bad 7f4e27a664 Fix presence topic (#1238) 2022-07-17 04:59:40 -05:00
Grégoire SeuxandGrégoire Seux 537583e505 Configure LoRA gateway parameters at startup (#1234)
Without this (and without sending an initial MQTT message to the gateway
to configure it) messages are not necessarily received if parameters are
different from firmware defaults.

This patch helped at least two users:
- https://community.home-assistant.io/t/awesome-lora-soil-sensor/304351/23
- https://community.home-assistant.io/t/awesome-lora-soil-sensor/304351/18

Change-Id: Ia65ee5780b56f81fc73662c8779b79083805009b

Co-authored-by: Grégoire Seux <grego_openmqttgateway@familleseux.net>
2022-07-13 23:49:31 +02:00
DigiH a388f14e75 Publishing/receiving inconsistencies fix (#1229)
* Publishing/receiving inconsistencies

* General platformio.ini changes

General platformio.ini changes to allow for publishing/receiving settings to be defined in User_cofig.h instead of them only working if defined in the environments. Kept separate so far for discussion.
2022-07-01 07:17:02 -05:00
DigiH d62083a788 Lora band define (#1231) 2022-06-29 12:14:18 -05:00
Bad 77b022505c iBeacon: Flag to use UUID in topic or presence (and fixes) (#1226)
* Add useBeaconUuidForPresence flag (disabled by default)

* Change MQTTDecodeTopic to include only the sufixe

* Rename mac_address to topic and remove unnecessary variable mactopic

* Add useBeaconUuidForTopic flag (disabled by default)

* Fix jsonPublishing #ifdef -> #if

* Revert commit 02e2d03
2022-06-19 08:22:15 -05:00
h2zero 25b8123ff6 Add option to offload decoding to an external gateway over MQTT. (#1216)
* Add option to offload decoding to an external gateway over MQTT.

* Change decode topic and add to config_bt
2022-06-12 17:44:51 -05:00
steadramonandPaul 5b697e0306 Add Pilight limitProtocols support (#1223)
* Add ability to limit protocols

* Make serial feedback notice

Co-authored-by: Paul <steadramon@local>
2022-06-05 11:47:56 -05:00
Riceball LEE 8bced299dd feat: upgrade to IRremoteESP8266@2.8.2 (#1214) 2022-05-13 14:56:02 -05:00