Coder Social home page Coder Social logo

jptrsn / esp32-mqtt-room Goto Github PK

View Code? Open in Web Editor NEW
249.0 249.0 46.0 1.48 MB

An ESP32 based presence detection node for use with the Home Assistant mqtt_room component for localized device presence detection.

License: GNU Affero General Public License v3.0

C++ 84.11% C 15.89%

esp32-mqtt-room's People

Contributors

anarchking avatar chrisjohns-me avatar demostenes avatar javawizard avatar jptrsn avatar kylegordon avatar patatman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-mqtt-room's Issues

allowedListCheck by UUID and not Mac Add

Is your feature request related to a problem? Please describe.
The allowed List Check is checking the mac add, this is not useful for apps like the Home Assistant Companion on android, where we set the UUID, it would be better to check by UUID

Describe the solution you'd like
Same logic but for the UUID

Describe alternatives you've considered
Not a lot, the alternative is by Mac Add, but that exists

Additional context
Nothing to add

No devices are found

Describe the bug
When doing scan, no devices are found.

Configuration

//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "WiFi"

//Replace with your Wifi password; example: #define password "12345678"
#define password "xxx"

//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "esp32_room_presence"

//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost IPAddress(192, 168, x, xx)

//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883

//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser "xx"

//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword "xx"

//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "kabinet"

//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2

// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0

//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"

//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" room

//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"

// Define bluetooth scan parameters
#define scanInterval 5 // Define the interval in seconds between scans
#define singleScanTime 5 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing

// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 2

// MQTT topic for sensor values from HTU21D temperature and humidity sensor
//#define htuSensorTopic "presence_nodes/" hostname "/sensor"


//List of allowed MAC Addresses for MQTT Publish. All others will be ignored.
//Feature is disabled by default.
#define allowedListCheck false
String allowedList[] = {"11223344aabb", "11223344aabb"};
uint32_t allowedListNumberOfItems = 2;

Logs

Scanning...     Scan done! Devices found: 0
devices_discovered: 0
devices_reported: 0
Telemetry sent

Hardware Details
I have ESP32S developer board. Two actually. On one I am running OpenMQTTGateway that detects all my Xiaomi temperature sensors. For this second one I plan to put it in one room in which I am working from home so I can have specific automation working when I am inside. I have put OpenMQTTGateway on the same ESP32 and it found devices so it is working. But with ESP32-mqtt-room it finds none.

I can see device in MQTT and state connected. So WiFi and MQTT connection is working fine. I can also see blue LED on ESP32 blinking when it says Scanning...

To Reproduce

Connect to USB power and check serial logs.

Expected behavior

I expect to find many devices inside the house. I have Beacon Simulator on phone and expect for it to detect it also.

Screenshots

Additional context

Missing Settings_d.h

I cannot compile in either Platformio or Arduino due to missing settings_d.h in both programs, I have tried searching for the relevant library and cannot find any results. I followed the recommendation of creating settings_local.h so is settings_d.h a library or a file that I should be creating?

Can't get OTA to work

Describe the bug
I tried several ways to OTA my esp32, but never works, I use VSCode, but also tried to upload by command line, I allways get a "No response from the ESP" error

Configuration

//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "WiFi"

//Replace with your Wifi password; example: #define password "12345678"
#define password "xxxxxx"

//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "esp32_rp_bedroom1"

//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost "mosquitto.home"

//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883

//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser ""

//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword ""

//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "bedroom"

//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2

// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0

//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"

//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" hostname "/connected"

//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"

// Define bluetooth scan parameters
#define scanInterval 5 // Define the interval in seconds between scans
#define singleScanTime 5 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing

// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 0

// MQTT topic for sensor values from HTU21D temperature and humidity sensor
//#define htuSensorTopic "presence_nodes/" hostname "/sensor"


//List of allowed MAC Addresses for MQTT Publish. All others will be ignored.
//Feature is disabled by default.
#define allowedListCheck false
String allowedList[] = {"123", "456"};
uint32_t allowedListNumberOfItems = 2;

Logs

CURRENT: upload_protocol = esptool
Uploading .pio/build/esp32/firmware.bin
11:32:19 [DEBUG]: Options: {'esp_ip': '192.168.7.107', 'host_ip': '0.0.0.0', 'esp_port': 3232, 'host_port': 43215, 'auth': '', 'image': '.pio/build/esp32/firmware.bin', 'spiffs': False, 'debug': True, 'progress': True, 'timeout': 10}
11:32:19 [INFO]: Starting on 0.0.0.0:43215
11:32:19 [INFO]: Upload size: 1433984
Sending invitation to 192.168.7.107 ..........
11:33:59 [ERROR]: No response from the ESP
*** [upload] Error 1
============================================== [FAILED] Took 145.08 seconds ==============================================
The terminal process "platformio 'run', '--target', 'upload'" terminated with exit code: 1.

I can ping the device and the device is reporting measurements into MQTT

Not connecting to WiFi

Hi guys, I'm trying to flash an ESP32 Wemos Lolin 32 OLED.

This one

However, I'm receiving this information on serial monitor:

k⸮E⸮⸮⸮0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
Connecting to WiFi...
[WiFi-event] event: 0

Wifi Ready
restarted
[WiFi-event] event: 2

STA Start
WiFi Time remaining: 1999
Connecting to WiFi...
[WiFi-event] event: 5

WiFi lost connection, resetting timer	
restarted
Connecting to WiFi...
[WiFi-event] event: 5

WiFi lost connection, resetting timer	
restarted
Connecting to WiFi...
[WiFi-event] event: 5

WiFi lost connection, resetting timer	
restarted
Connecting to WiFi...
[WiFi-event] event: 5

WiFi lost connection, resetting timer	
restarted
Connecting to WiFi...
[WiFi-event] event: 5

WiFi lost connection, resetting timer	
restarted

I'm using Visual Studio for MAC OS with Platform.io

----------------------------- Remove above -----------------------------
Hardware:

Board: Lolin32
IDE name: Platform.io
Upload Speed: 115200
Computer OS: Mac OSX

Question/Feature Request: Support of PIR and maybe other sensors

Is your feature request related to a problem? Please describe.
As the ESP32 supports many IO devices, I would like to utilize it for other functions, such as Motion and temperature monitoring using something like a DHT22 or Dallas DS18B20.
Ideally this would be selectable via a web interface on the device so it would feel less project like.

Describe the solution you'd like
To be able to utilize other sensors on the ESP32 while running ESP32-mqtt-room

Describe alternatives you've considered
If not integrated or able to be integrated in this project, it would involve having separate devices to perform this function

Not seeing any BLE devices

Hi,

I have successfully uploaded your project into one of my ESP32 boards for use with my Home assistant but it is not seeing any BLE devices. I have many iBeacon units as well as units that would send just a mac address:

I have tried hardcoding a MAC address into the settings file and setting the filter to true but still nothing
settings.h file extract all other settings set for my network and mqtt access:

#define allowedListCheck true
String allowedList[] = {"AC233F58A884", "11223344aabb"};
uint32_t allowedListNumberOfItems = 2;

The mac is not important so I have not "hidden" it from your view

Output from serial monitor:
Scanning... Scan done! Devices found: 0
devices_discovered: 0
devices_reported: 0
Telemetry sent

All the MQTT links and WiFi connection etc is correct but I just can't seem to work out why I can't see BLE devices I probably have 10-20 in the house with battery on as I use them at work for other projects just wanted to use tracking in the house too.

I have tried using Estimote Beacon Minew and using my Phone (Android) with an iBeacon/Eddystone client app running

I have not used VC studio before with platformio as I always use Arduino IDE or the home Assistant ESPHome for very basic projects normally (temp lights etc) so I may be doing something wrong but everything compiles and uploads so I would have thought I have the required libraries etc. I am hoping you could point me to some setting I have overlooked.

Apologies if I am missing something obvious and many thanks in advance

Regards

Dave

Updated Settings for a ESP32 and it no longer detects info for Home Assistant

Describe the bug
For about the past year I have been using ESP32-mqtt-room for room presence and it has worked flawlessly when I set it up the first time. I wanted to make a few minor changes in range detection on one of the ESP32s, but once I flashed the new data on the chip, Home Assistant no longer "sees" data coming from it despite it being connected to my MQTT Broker.

I have troubleshooted everything I can think of, but nothing I do seems to work and I'm hoping someone here knows way more about MQTT that may be able to offer some insight.

I have been using PlatformIO on VScode to flash the ESP32s without issue. I'm also using a Beacon Simulator on my android phone to be tracked by the ESP32s which has worked without issue as well.

  - platform: mqtt_room
    device_id: "9ad13236f8064c4caa1d1be47d75e12e-1-0"
    name: 'Phone Room Location'
    state_topic: 'room_presence'
    timeout: 10
    away_timeout: 15

I've tried going back a few versions on github, I have also tried using older versions of PlatformIO, have uninstalled/reinstalled the MQTT integration, created a new beacon on my phone, but nothing. I am at a complete loss and this is as far as my knowledge goes.

If there's any other information I'm able to provide, please let me know. I would hate to lose out on this great solution to Room Presence.

Configuration

//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "Secret SSID"
 
//Replace with your Wifi password; example: #define password "12345678"
#define password "mypassword"
 
//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "living_room_presence"
 
//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost IPAddress(192, 168, 1, 185)
 
//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883
 
//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser "homeassistant"
 
//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword "xxxxxxxxxxxxxxxxxxxxxxxx"
 
//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "living_room"
 
//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2
 
// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0
 
//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"
 
//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" room
 
//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"
 
// Define bluetooth scan parameters
#define scanInterval 5 // Define the interval in seconds between scans
#define singleScanTime 5 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
 
// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 7
 
// MQTT topic for sensor values from HTU21D temperature and humidity sensor
//#define htuSensorTopic "presence_nodes/" hostname "/sensor"
 
 
//List of allowed MAC Addresses for MQTT Publish. All others will be ignored.
//Feature is disabled by default.
#define allowedListCheck false
String allowedList[] = {"11223344aabb", "11223344aabb"};
uint32_t allowedListNumberOfItems = 2;

Logs
I don't have any logs from the serial, but I used MQTT Explorer to find that the ESP32 is sending this to the broker:
{"room":"living_room","ip":"192.168.1.163","hostname":"living_room_presence","scan_dur":5,"wait_dur":5,"max_dist":7,"disc_ct":0,"rept_ct":0}

Here's a image of how I got this information: https://i.imgur.com/Y2dSALz.png

Hardware Details
Using Beacon Simulator for Android. Has worked fine up until I attempted to make changes to my ESP32 settings.

T18_3.0 18650 Battery Monitoring Support

Thank you for your work on this project. I am using this on two t18_3.0 boards which support an onboard 18650 battery that also exposes the voltages via pin 35 and was looking for a way to support monitoring the battery voltages and reporting them back to the MQTT server. While I'm not a developer I am dangerous enough to tinker and using the following I was able to make this work.

https://www.pangodream.es/esp32-getting-battery-charging-level
https://github.com/pangodream/18650CL

If you are interested in including or improving this feature I have submit PR #52 which includes my branch. Technically this could be much more widely adopted by exposing the Pin configuration in src/Settings.h and passing to ADC_PIN in src/ESP32-mqtt-room.ino. Because I do not have that requirement or setup I could not test this and therefore passed on it. The voltage levels are reported to 'presence_nodes/$hostname/battery/{pinvalue,pinvalueavg,voltage,chargelevel}' to the configured MQTT server as well to serial.

This was basically just emulating your HTU21D source as well as incorporating pangodream's library to do the calculations. It would be great if you opted to include or improve this! Thanks again.

Add a white list of devices to reduce useless publishing on the MQTT server

Hi! Thank you for this great tool, allows me to replace a RaspberryPi by an ESP-32 dev board! :)
I discovered that a lot of unwanted BLE devices are detected, like TV's, phones etc. I use 2 trackers, and 11 devices are detected by the scans.

A feature that may be very useful:

Add a white list of BLE devices using their MAC address, in Settings.h .
Other BLE MAC addresses would simply be ignored, greatly reducing the number of publishes on the MQTT server.

Thank you!

PatBoud

Guru Meditation Error: Core 1 panic

Bluetooth/WiFi coexistence issue affects MQTT connectivity. When MQTT async library disconnects during a BLE scan, device crashes with core 1 panic.

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x40172a5f  PS      : 0x00060a30  A0      : 0x801b54d8  A1      : 0x3ffde240  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x00000045  A5      : 0x002c5912  
A6      : 0x00000000  A7      : 0x0000059c  A8      : 0x8017c93c  A9      : 0x3ffde210  
A10     : 0x3ffdd5c0  A11     : 0x3ffc1170  A12     : 0x3ffdd620  A13     : 0x00000000  
A14     : 0x3ffdd644  A15     : 0x00000000  SAR     : 0x00000010  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000038  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

Backtrace: 0x40172a5f:0x3ffde240 0x401b54d5:0x3ffde260 0x4016af81:0x3ffde280


HTU21D Sensor Support

Add support for reading from and reporting temperature and humidity values from HTU21D i2c sensors to MQTT topics.

This should be modular and optional so that the basic functionality of the module is unchanged.

Link to Person in HomeAssistant

I am trying to link the mqtt-room tracker to a Person in home assistant so i can track if a person is home / in what room within home assistant. But there doesnt seem to be a device_tracker link in mqtt-room to enable this with.
It'd be great if i could link a beacon to a person. Preferably through a device tracker of some kind so i can add it through the home assistant person interface.
It would allow for a lot more automation.

Task watchdog got triggered

esp32 Task watchdog got triggered. The following tasks did not reset the watchdog in time: - IDLE (CPU 0)

MQTT states retained

Describe the bug
By default it appears that MQTT messages are being retained - which is reflected of course in HA.
When the ESP32 is running it reports CONNECTED for example - now because retain is enabled even-though the esp32 is powered off MQTT still has the old value as CONNECTED

To Reproduce
Steps to reproduce the behavior:

  1. Power On
  2. Wait
  3. Power Off

Expected behavior
No retain or Configurable retain on MQTT States - so after a given retain_timout state should be cleared- therefore consider esp32 disconnected

Screenshots
If applicable, add screenshots to help explain your problem.
image

Add tracking by name.

i found an app that somehow permanently changes the name in the UUID. Well until a reboot. For IOS. “nRF connect”. Even when forced closed and locking the iPhone. Not sure how. But it does. It might be something to look in to

Not reporting manufacturer data.

I love the software so far, and it seems like it'll be perfect for my uses, the only issue I'm running into is that it's detecting devices without a UUID and just manufacturer data but not reporting them. I can see in the log it finds them but it only sends the data for devices with a beacon UUID over MQTT therefore BeaconScope works but my MiBand and Fitbit for example do not, despite being picked up.

humidity and temperature sensor library suggestion

Hey,
This is not really an issue related to your project, but any advice is appreciated.
I'm using 3 esp32 flashed with your project around my house and they are working pretty good.

I have attached to those esp32 the HTU21D temperature and humidity sensor as well, but the library that i used (this one) is messing up my sensors since when there is a crc error it sends 255 as result.

I don't know why i have those crc errors, generally are just in the umidity sensor, but not in the temperature. This happens in all the 3 esp32 devices.

Is there any other library that i can use?
Thanks

Team Up - DHT 11/22

** First of all, thanks for your project... I've only read since I'm on a business trip, but it will be the first thing when I get back home **

Would be nice if we could keep using the EPS for other sensors,
since the idea (at least my idea) is to have one for each room at home and I want to do the same for a temperature and humidity sensor would be easier if both could run on the same board.

Compilation code with VScode

Describe the bug
I don't understand the problem, maybe the error is relation with ArduinoJson library/version.
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:48:11: error: 'panic' was not declared in this scope

Configuration

//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "Ubuntu"

//Replace with your Wifi password; example: #define password "12345678"
#define password "xXXxxxxxxXY"

//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "esp32_dormitorio_presence"

//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost IPAddress(192, 168, 1, 18)

//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883

//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser "mqtt"

//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword "XXXXXX"

//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "dormitorio"

//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2

// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0

//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"

//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" room

//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"

// Define bluetooth scan parameters
#define scanInterval 10 // Define the interval in seconds between scans
#define singleScanTime 15 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing

// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 10

Logs

> Executing task: platformio run --target upload <

Processing esp32 (platform: espressif32; framework: arduino; board: esp32dev)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.11.2 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-mkspiffs 2.230.0 (2.30) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
Converting ESP32-mqtt-room.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ArduinoJSON library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64 @ ^6
ArduinoJson @ 6.14.1 is already installed
Found 39 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP32 BLE Arduino> 1.0.1
|-- <AsyncMqttClient> 0.8.2
|   |-- <ESPAsyncTCP> 1.2.2
|   |-- <AsyncTCP> 1.1.1
|-- <AsyncTCP> 1.1.1
|-- <ArduinoJson> 6.14.1
|-- <ArduinoOTA> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
|-- <WiFi> 1.0
Building in release mode
Compiling .pio/build/esp32/src/ESP32-mqtt-room.ino.cpp.o
Archiving .pio/build/esp32/lib89e/libBLE.a
Compiling .pio/build/esp32/lib83d/ESPAsyncTCP_ID305/AsyncPrinter.cpp.o
Indexing .pio/build/esp32/lib89e/libBLE.a
Compiling .pio/build/esp32/lib83d/ESPAsyncTCP_ID305/ESPAsyncTCP.cpp.o
In file included from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/opt.h:51:0,
                 from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/init.h:40,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:31,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.h:26,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:22:
/Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwipopts.h:326:0: warning: "TCP_MSS" redefined
 #define TCP_MSS                         CONFIG_TCP_MSS
 ^
In file included from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:25:0,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.h:26,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:22:
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/async_config.h:13:0: note: this is the location of the previous definition
 #define TCP_MSS (1460)
 ^
Compiling .pio/build/esp32/lib83d/ESPAsyncTCP_ID305/ESPAsyncTCPbuffer.cpp.o
In file included from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/opt.h:51:0,
                 from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/init.h:40,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:31,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:75:
/Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwipopts.h:326:0: warning: "TCP_MSS" redefined
 #define TCP_MSS                         CONFIG_TCP_MSS
 ^
In file included from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:25:0,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:75:
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/async_config.h:13:0: note: this is the location of the previous definition
 #define TCP_MSS (1460)
 ^
In file included from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/opt.h:51:0,
                 from /Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/init.h:40,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:31,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.h:37,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp:29:
/Users/yorchtf/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwipopts.h:326:0: warning: "TCP_MSS" redefined
 #define TCP_MSS                         CONFIG_TCP_MSS
 ^
In file included from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.h:25:0,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.h:37,
                 from .pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp:29:
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/async_config.h:13:0: note: this is the location of the previous definition
 #define TCP_MSS (1460)
 ^
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino: In function 'void WiFiEvent(system_event_id_t)':
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_SCAN_DONE' not handled in switch [-Wswitch]
   switch(event) {
         ^
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_CONNECTED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_AUTHMODE_CHANGE' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_LOST_IP' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_SUCCESS' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_FAILED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_TIMEOUT' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PIN' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_START' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STOP' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STACONNECTED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STADISCONNECTED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STAIPASSIGNED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_PROBEREQRECVED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_GOT_IP6' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_START' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_STOP' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_CONNECTED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_DISCONNECTED' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_GOT_IP' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_MAX' not handled in switch [-Wswitch]
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino: In lambda function:
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:493:50: warning: unknown conversion type character 0xa in format [-Wformat=]
       Serial.printf("Progress: %u% \n\r", percent);
                                                  ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In constructor 'AsyncPrinter::AsyncPrinter(AsyncClient*, size_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:48:11: error: 'panic' was not declared in this scope
     panic(); //What should we do?
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In member function 'int AsyncPrinter::connect(IPAddress, uint16_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:71:11: error: 'panic' was not declared in this scope
     panic();
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In member function 'int AsyncPrinter::connect(const char*, uint16_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:88:11: error: 'panic' was not declared in this scope
     panic();
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In member function 'void AsyncPrinter::_onConnect(AsyncClient*)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:109:11: error: 'panic' was not declared in this scope
     panic();
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In member function 'AsyncPrinter& AsyncPrinter::operator=(const AsyncPrinter&)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:130:11: error: 'panic' was not declared in this scope
     panic();
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp: In member function 'size_t AsyncPrinter::_sendBuffer()':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/AsyncPrinter.cpp:182:11: error: 'panic' was not declared in this scope
     panic(); // Connection should be aborted instead
           ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'bool AsyncClient::connect(IPAddress, uint16_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:248:8: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   addr.addr = ip;
        ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'bool AsyncClient::connect(const char*, uint16_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:282:35: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
     return connect(IPAddress(addr.addr), port);
                                   ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'bool AsyncClient::operator==(const AsyncClient&)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:331:66: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   return (_pcb != NULL && other._pcb != NULL && (_pcb->remote_ip.addr == other._pcb->remote_ip.addr) && (_pcb->remote_port == other._pcb->remote_port));
                                                                  ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:331:96: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   return (_pcb != NULL && other._pcb != NULL && (_pcb->remote_ip.addr == other._pcb->remote_ip.addr) && (_pcb->remote_port == other._pcb->remote_port));
                                                                                                ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'void AsyncClient::_dns_found(const ip_addr*)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:707:31: error: 'const struct ip_addr' has no member named 'addr'
     connect(IPAddress(ipaddr->addr), _connect_port);
                               ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getRemoteAddress()':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:837:26: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   return _pcb->remote_ip.addr;
                          ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getLocalAddress()':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:849:25: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   return _pcb->local_ip.addr;
                         ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp: In member function 'void AsyncServer::begin()':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCP.cpp:1122:14: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
   local_addr.addr = (uint32_t) _addr;
              ^
*** [.pio/build/esp32/lib83d/ESPAsyncTCP_ID305/AsyncPrinter.cpp.o] Error 1
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp: In constructor 'AsyncTCPbuffer::AsyncTCPbuffer(AsyncClient*)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp:35:15: error: 'panic' was not declared in this scope
         panic();
               ^
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino: In function 'bool handleMqttDisconnect()':
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:173:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp: In member function 'virtual size_t AsyncTCPbuffer::write(const uint8_t*, size_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp:127:23: error: 'panic' was not declared in this scope
                 panic();
                       ^
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp: In member function 'size_t AsyncTCPbuffer::_handleRxBuffer(uint8_t*, size_t)':
.pio/libdeps/esp32/ESPAsyncTCP_ID305/src/ESPAsyncTCPbuffer.cpp:469:21: error: 'panic' was not declared in this scope
               panic(); //TODO: What action should this be ?
                     ^
*** [.pio/build/esp32/lib83d/ESPAsyncTCP_ID305/ESPAsyncTCP.cpp.o] Error 1
*** [.pio/build/esp32/lib83d/ESPAsyncTCP_ID305/ESPAsyncTCPbuffer.cpp.o] Error 1
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino: In function 'bool reportDevice(BLEAdvertisedDevice)':
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:409:18: warning: 'distance' may be used uninitialized in this function [-Wmaybe-uninitialized]
     Serial.printf("%s exceeded distance threshold %.2f\n\r", mac_address.c_str(), distance);
                  ^
/Users/yorchtf/playground/domotica/ESP32-mqtt-room-ORIGINAL/ESP32-mqtt-room.ino:283:8: note: 'distance' was declared here
  float distance;
        ^
================================================================================================ [FAILED] Took 6.86 seconds ================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Hardware Details

  • Mac OSX
  • ESP32

To Reproduce
Only press to Upload

Expected behavior
Two months ago, the compilation was finished correctly without any problem and the same code (today) and the same hardware

ESP32-wroom-32 not responding after 5-10 min

Describe the bug
ESP32-wroom-32 not responding after 5-10 min, resulting in not sending the scanned iBeacons

Configuration
//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "HUIS"

//Replace with your Wifi password; example: #define password "12345678"
#define password "not the real PW"

//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "BLE_Tracker_1"

//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost IPAddress(192, 168, 1, 50)

//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883

//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser "HUIS"

//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword "not the real PW"

//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "ROOM_1"

//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2

// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0

//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"

//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" room

//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"

// Define bluetooth scan parameters
#define scanInterval 5 // Define the interval in seconds between scans
#define singleScanTime 5 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing

// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 5

// MQTT topic for sensor values from HTU21D temperature and humidity sensor
//#define htuSensorTopic "presence_nodes/" hostname "/sensor"

//List of allowed MAC Addresses for MQTT Publish. All others will be ignored.
//Feature is disabled by default.
#define allowedListCheck false
String allowedList[] = {"11223344aabb", "11223344aabb"};
uint32_t allowedListNumberOfItems = 2;

Logs
Not possible

Hardware Details
ESP32-wroom-32

To Reproduce
Steps to reproduce the behavior:
after a power pull it instantly works again, and than after 5-10 minutes gets unresponsive

Expected behavior
Stable sending of signal

Screenshots
not possible

Additional context
Add any other context about the problem here.

Hi, I have a problem. when I run the build I see the following in the status window

Hi, I have a problem. when I run the build I see the following in the status window
`Compiling .pio\build\esp32\lib480\BLE\BLEAdvertising.cpp.o
Compiling .pio\build\esp32\lib480\BLE\BLEBeacon.cpp.o
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'void WiFiEvent(system_event_id_t)':
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_SCAN_DONE' not handled in switch [-Wswitch]
switch(event) {
^
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_CONNECTED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_AUTHMODE_CHANGE' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_LOST_IP' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_SUCCESS' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_FAILED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_TIMEOUT' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PIN' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_START' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STOP' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STACONNECTED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STADISCONNECTED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STAIPASSIGNED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_PROBEREQRECVED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_GOT_IP6' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_START' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_STOP' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_CONNECTED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_DISCONNECTED' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_GOT_IP' not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_MAX'
not handled in switch [-Wswitch]
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In lambda function:
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:493:50: warning: unknown conversion type character 0xa in format [-Wformat=]
Serial.printf("Progress: %u% \n\r", percent);
Compiling .pio\build\esp32\lib480\BLE\BLECharacteristic.cpp.o
^
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool handleMqttDisconnect()':
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:173:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool reportDevice(BLEAdvertisedDevice)':
Compiling .pio\build\esp32\lib480\BLE\BLECharacteristicMap.cpp.o
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:409:18: warning: 'distance' may be used uninitialized in this function [-Wmaybe-uninitialized]
Serial.printf("%s exceeded distance threshold %.2f\n\r", mac_address.c_str(), distance);
^
C:/Users/shvedko/Desktop/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:283:8: note: 'distance' was declared here
float distance;
^
Compiling .pio\build\esp32\lib480\BLE\BLEClient.cpp.o

Compiling .pio\build\esp32\lib480\BLE\BLESecurity.cpp.o
C:\Users\shvedko.platformio\packages\framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp: In member function 'void BLERemoteService::getCharacteristics(std::map<short unsigned int, BLERemoteCharacteristic*>)':
C:\Users\shvedko.platformio\packages\framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp:246:89: warning: parameter 'pCharacteristicMap' set but not used [-Wunused-but-set-parameter]
void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic
>* pCharacteristicMap) {`

The settings file is full. tell me how to solve my problem

Static IP setup

Is your feature request related to a problem? Please describe.
Thank you for this amazing software, I would like to configure a static IP

Describe the solution you'd like
I've tried to implement the standard "Static IP" code for ESP32 but i get:
[E][AsyncTCP.cpp:934]

WS2812 Support

Add support for WS2812 LED to be used as status indicator rather than built-in LED.

Implement use of LEDs as mqtt light component.

Visually indicate state of switch if using GPIO cap sense input (requires completion of #21 )

Integrate with esphome lib

Have you considered contributing your work to esphome?

I'm currently working on creating a multi sensor which has:

  • pir sensor
  • bme680 for temperature
  • light (lumen) sensor
  • smoke sensor
  • air quality

I also wanted to add ble scanning but esphome currently doesn't support that. The combination of your project and esphome would be great. Any idea why not to integrate?

Add BLE to name or description/summary

While searching the internet for projects like this I did not find this one because I was searching ble. The only reason why I found it was because I searched esp32 and room assistant

I feel like it would be easier to find if BLE was in either the name, description or the first paragraph in the readme. This could possibly bring more developers to the repo.

Just a thought
Anarchking

BLE Beacon Not Showing

Describe the bug
I have a BLE bluetooth beacon, https://www.amazon.com/gp/product/B07FC5FMHW/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1, which I have used with other ESP32 room presense software and it always shows as active. This application is not showing this device and never detects it from what I can tell. All of my existing Tile devices show however none of the devices I have listed above do. Again, these were showing with other ESP32 room presence software on this exact hardware.

Configuration
//Replace with your Wifi SSID; example: #define ssid "MyWifi"
#define ssid "PQxxxxxxxxxxxxxxr"

//Replace with your Wifi password; example: #define password "12345678"
#define password "Jxxxxxxxxxxxxxxx"

//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
#define hostname "esp32_garage"

//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttHost IPAddress(192, 168, 1, 50)

//Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort 1883

//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
#define mqttUser "hassioxxxxxxxxxx"

//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
#define mqttPassword "Fxxxxxxxxxxxxxx"

//Replace with the room name where the node will be placed; example: #define room "living-room"
#define room "garage"

//Specify the LED pin. For most dev boards, this is GPIO2
#define LED_BUILTIN 2

// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
#define LED_ON 0

//Define the base topic for room detection. Usually "room_presence"
#define channel "room_presence"

//Define the topic for publishing availability
#define availabilityTopic "presence_nodes/" room

//Define the topic for publishing JSON attributes
#define telemetryTopic "presence_nodes/" hostname "/tele"

// Define bluetooth scan parameters
#define scanInterval 5 // Define the interval in seconds between scans
#define singleScanTime 5 // Define the duration of a single scan in seconds
#define activeScan true // Active scan uses more power, but get results faster
#define bleScanInterval 0x80 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
#define bleScanWindow 0x10 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing

// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
#define maxDistance 5

sensors.yaml

  • platform: mqtt_room
    device_id: '1804ed51934c' # Note that major version must match, but any minor version will be ignored
    name: 'Puck 1'
    state_topic: 'room_presence'
    timeout: 60
    away_timeout: 120

binary_sensors.yaml

  • platform: mqtt
    name: Esp32 Garage
    state_topic: "presence_nodes/garage"
    json_attributes_topic: "presence_nodes/esp32_garage/tele"
    payload_on: "CONNECTED"
    payload_off: "DISCONNECTED"
    device_class: connectivity

Logs
Nothing to show as this particular device is not being discovered by the ESP32.

Hardware Details
https://www.amazon.com/gp/product/B07FC5FMHW/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

To Reproduce
Place device near ESP32 to be read and the ID never shows in the MQTT queueu.

Expected behavior
I should see the device id being read and displayed in the MQTT topic. It't almost like the device is being filtered out but I am unable to determine why.

I have been through the source code and have not seen any reason for this not to show on this particular device ESP32. I have utilized this ESP for multiple tests with other firmware however this is the only one that I found that these devices are not showing. So far, this is the big winner for me in for room presence and if I can get past this hurdle I will have several of these running in my home. Both test devices right now are having the same issue whereby the device is not showing. Both were utilized for other firmware tests and it previously reported without issue.

Web UI

A web ui where you can update the settings so they don't have to be hard coded. So if anything changes to your network it would be easy to fix.

Capacitive Touch support

Support using ESP32 capacitive touch enabled GPIO as input. Basic implementation should provide boolean state (e.g. to support MQTT switch component in Home Assistant). Retain state in local variable that can be modified without requirement for reading from MQTT.

Build as modular option that can be included/excluded through config property.

Future goals can be to add support for multiple GPIO use as a slider (e.g. for a light dimmer)

ArduinoJson problem general compile problem

Does anyone successfully run this on ESP32
I tried 4h compile this on ArduinoIDE or PlatformIO and have all time same problem
ArduinoJson.h no file or directory.
I installed by hand or with package manager and always the same error.

Please any advice.
esp32 is perfect for room-assistant . RPi0W Is overkill.

No wifi network connection

create own "Settings_local.h" file change in "ESP32-mqtt-room.ino" to use them.
Build and upload.
After press reset button on device serial port monitor show next:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
[E][esp32-hal-misc.c:218] initArduino(): Failed to initialize NVS! Error: 4368
Connecting to WiFi...
[E][WiFiGeneric.cpp:137] wifiLowLevelInit(): esp_wifi_init 4353
First contact!

Starting access point for configuration portal.
SSID: 'esp32-247d69'
[E][WiFiGeneric.cpp:137] wifiLowLevelInit(): esp_wifi_init 4353
[E][WiFiAP.cpp:97] softAP(): enable AP first!
0.0.0.0

No AP created. No wifi connection established for home wifi network.

Unable to Build/Compile.

Describe the bug
When trying to build the Project, I get an error, tried with both VS and Atom. Both using the PlatformIO plugin

Configuration
#define ssid "Chilling Spot"
#define password ""
#define hostname "esp32_room_presence"
#define mqttHost IPAddress(192, 168, 34, 15)
#define mqttPort 1883
#define mqttUser "homeassistant"
#define mqttPassword "123456789"
#define room "living-room"
#define channel "room_presence"
#define scanInterval 15
#define singleScanTime 10
#define activeScan true
#define bleScanInterval 15
#define bleScanWindow 20

Logs
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.11.0 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), framework-arduinoespressif32 2.10004.191002 (1.0.4), tool-esptoolpy 1.20600.0 (2.6.0)
Converting ESP32-mqtt-room.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ArduinoJSON library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64 @ ^6
ArduinoJson @ 6.12.0 is already installed
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.0.1
|-- 0.8.2
| |-- 1.1.1
|-- 1.1.1
|-- 6.12.0
|-- 1.0
| |-- 1.0
| |-- 1.0
| |-- 1.0
| | |-- 1.0
|-- 1.0
Compiling .pio\build\esp32\src\ESP32-mqtt-room.ino.cpp.o
Archiving .pio\build\esp32\lib395\libAsyncTCP_ID1826.a
Archiving .pio\build\esp32\lib7b6\libAsyncMqttClient_ID346.a
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool sendTelemetry(int, int)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:107:21: error: 'maxDistance' was not declared in this scope
tele["max_dist"] = maxDistance;
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:122:25: error: 'telemetryTopic' was not declared in this scope
if (mqttClient.publish(telemetryTopic, 0, 1, teleMessageBuffer) == true) {
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'void WiFiEvent(system_event_id_t)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:209:19: error: 'LED_BUILTIN' was not declared in this scope
digitalWrite(LED_BUILTIN, !LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:209:33: error: 'LED_ON' was not declared in this scope
digitalWrite(LED_BUILTIN, !LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_SCAN_DONE' not handled in switch [-Wswitch]
switch(event) {
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_CONNECTED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_AUTHMODE_CHANGE' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_LOST_IP' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_SUCCESS' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_FAILED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_TIMEOUT' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PIN' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_START' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STOP' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STACONNECTED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STADISCONNECTED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_STAIPASSIGNED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_AP_PROBEREQRECVED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_GOT_IP6' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_START' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_STOP' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_CONNECTED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_DISCONNECTED' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_ETH_GOT_IP' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:207:9: warning: enumeration value 'SYSTEM_EVENT_MAX' not handled in switch [-Wswitch]
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'void onMqttConnect(bool)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:255:25: error: 'availabilityTopic' was not declared in this scope
if (mqttClient.publish(availabilityTopic, 0, 1, "CONNECTED") == true) {
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool reportDevice(BLEAdvertisedDevice)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:395:8: error: 'maxDistance' was not declared in this scope
if (maxDistance == 0 || doc["distance"] < maxDistance) {
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In member function 'virtual void MyAdvertisedDeviceCallbacks::onResult(BLEAdvertisedDevice)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:431:16: error: 'LED_BUILTIN' was not declared in this scope
digitalWrite(LED_BUILTIN, LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:431:29: error: 'LED_ON' was not declared in this scope
digitalWrite(LED_BUILTIN, LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In lambda function:
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:488:17: error: 'LED_BUILTIN' was not declared in this scope
digitalWrite(LED_BUILTIN, !LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:488:31: error: 'LED_ON' was not declared in this scope
digitalWrite(LED_BUILTIN, !LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In lambda function:
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:493:50: warning: unknown conversion type character 0xa in format [-Wformat=]
Serial.printf("Progress: %u% \n\r", percent);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:494:17: error: 'LED_BUILTIN' was not declared in this scope
digitalWrite(LED_BUILTIN, percent % 2);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'void setup()':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:514:10: error: 'LED_BUILTIN' was not declared in this scope
pinMode(LED_BUILTIN, OUTPUT);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:515:28: error: 'LED_ON' was not declared in this scope
digitalWrite(LED_BUILTIN, LED_ON);
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:526:21: error: 'availabilityTopic' was not declared in this scope
mqttClient.setWill(availabilityTopic, 0, 1, "DISCONNECTED");
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool sendTelemetry(int, int)':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:130:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'bool handleMqttDisconnect()':
C:/Users/Maxi/Documents/PlatformIO/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:173:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
*** [.pio\build\esp32\src\ESP32-mqtt-room.ino.cpp.o] Error 1

To Reproduce
Steps to reproduce the behavior:

  1. Open Atom
  2. Open the project through PLatformIo
  3. Press on build.
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

ArduinoJSON^6 has not been found in PlatformIO Registry; distance uninitialized

Hello. When building this with Platformio, I get a message stating that a required library has not been found in PlatformIO Registry:

Warning! Library `{'requirements': None, 'name': 'ArduinoJSON^6'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'requirements': None, 'name': 'ArduinoJSON^6'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.

which in turn results in this error:
ESP32-mqtt-room.ino:29:25: fatal error: ArduinoJSON.h: No such file or directory

In platformio.ini defined in libs_deps I can see l ArduinoJSON^6 - and I suspect that the ^6 is surplus to requirements? Can anyone confirm?

Anyway, cannot build with that^6, but can build by removing that. However, when I do that, I get other build errors:

D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:110:11: warning: enumeration value 'SYSTEM_EVENT_ETH_DISCONNECTED' not handled in switch [-Wswitch]

D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:110:11: warning: enumeration value 'SYSTEM_EVENT_ETH_GOT_IP' not handled in switch [-Wswitch]
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:110:11: warning: enumeration value 'SYSTEM_EVENT_MAX' not handled in switch [-Wswitch]
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In lambda function:
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:366:48: warning: unknown conversion type character 0xa in format [-Wformat=]
Serial.printf("Progress: %u% \n", percent);
^
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino: In function 'void reportDevice(BLEAdvertisedDevice)':
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:297:37: warning: 'distance' may be used uninitialized in this function [-Wmaybe-uninitialized]
} else if (mqttClient.connected() && distance >= maxDistance) {
^
D:/BLE/ESP32-mqtt-room-master/ESP32-mqtt-room.ino:172:8: note: 'distance' was declared here
float distance;
^

I'm not too worried about most of these, but reportDevice and specifically distance not being declared will prevent this from working, right?

Having built this with platformio and uploaded it to my ESP32, I can see the ESP device connected in Home Assistant, but impossible to get my devices presence to show up.

Any ideas?

How to fix it "Cannot report; mqtt disconnected"

Starting reconnect timer
Scanning... Connecting to MQTT
Connected to MQTT.

Success sending message to topic: presence_nodes/room
Telemetry sent
Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Scan done! Devices found: 3
Cannot report; mqtt disconnected
Scanning... Disconnected from MQTT.
Starting reconnect timer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.