Giter VIP home page Giter VIP logo

esp32_bletracker's People

Contributors

shogunxam 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

esp32_bletracker's Issues

New firmware release notification

Hi Mario,
from the ESP web panel it appears when you release a firmware update.
Could you implement the ability to receive an event notification?
Thank you

Build problem

Hi , I'm trying to build the master branch using platform.io: but I get this :
------------Tool Manager: Installing git+https://github.com/espressif/arduino-esp32#9be784f69b696d5bbb189a2fe5f1750ce2855426
git version 2.30.0.windows.2
Cloning into 'C:\Users******.platformio.cache\tmp\pkg-installing-bjh9ohhm'...
remote: Enumerating objects: 30622, done.
remote: Counting objects: 100% (152/152), done.
remote: Compressing objects: 100% (77/77), done.
Receiving objects: 100% (30622, reused 150 (delta 62), pack-reused 30470Receiving objects: 100% (30622/30622), 1.12 GiB | 21.12 MiB/s
/30622), 1.13 GiB | 22.65 MiB/s, done.
Resolving deltas: 100% (18749/18749), done.
Updating files: 100% (6908/6908), done.
fatal: not a git repository: ../../.git/modules/libraries/AzureIoT
fatal: could not reset submodule index
Error: VCS: Could not process command ['git', 'reset', '--hard', '9be784f69b696d5bbb189a2fe5f1750ce2855426']

I guess there's some dependencies problem, but I cannot figured it out 😫

Report the date and time of the last battery level detection

Would it be possible to report the date and time of the last battery level reading?
It would be useful in case one carries out the detection in manual mode.
It would also be advisable to provide for the retain of the data in case of ESP shutdown.

Thanks in advance

BLE Tracker

Tell me, with your firmware, any BLE tracker will work or certain models of BLE trackers? Какой BLE трекер порекомендуете, если заказать на aliexpress? Xiaomi Mi Smart Band 5 will see?

Last battery level status

Hi Mario,
it is possible to memorize the last battery status of the NUT, detected by the ESP, so as to make it available even if the ESP should restart (with the device tracker not home)?

Thanks

sysinfo is published not after 2 Minutes

I looked today a bit closer to everthing and I see small issue.
Maybe you like to fix it in the code

(main.ino)
#define SYS_INFORMATION_DELAY 120000 /2 minutes/

should be
#define SYS_INFORMATION_DELAY 120 /2 minutes/

//System Information if (((lastSySInfoTime + SYS_INFORMATION_DELAY) < NTPTime::seconds()) || (lastSySInfoTime == 0)) { publishSySInfo(); lastSySInfoTime = NTPTime::seconds(); }
NTPTime::seconds(); is in seconds but SYS_INFORMATION_DELAY is set in milliseconds in you code.
So the calculation went wrong and sysinfo will only be published every 33.33 hours

only battery state ?

mqtt logs :

nabaztag/BLETracker/chambre_enfant/6AC7B6D0DB24 {"state":"off","rssi":-100,"battery":-1}
nabaztag/BLETracker/chambre_enfant/LWT online
nabaztag/BLETracker/chambre_enfant/LWT offline
nabaztag/BLETracker/chambre_enfant/A4C1385292B8 {"state":"off","rssi":-100,"battery":100}
nabaztag/BLETracker/chambre_enfant/A4C13848CC60 {"state":"off","rssi":-100,"battery":100}
nabaztag/BLETracker/chambre_enfant/D8A35C6BF705 {"state":"off","rssi":-100,"battery":-1}
nabaztag/BLETracker/chambre_enfant/7CD1C3369470 {"state":"off","rssi":-100,"battery":-1}

Hi, it looks be only battery notifications or I did something bad ?

//Set to true if you want track only the devices in the white list
#define ENABLE_BLE_TRACKER_WHITELIST false

//List of known devices you want track
//Each entry is in the format {"MAC-ADDRESS", read-battery, "Description"} i.e.{"A6B5C4D3E2F1", true, "My iTag"}
//Mac Addresses are in the form "A6B5C4D3E2F1" (uppercase and no separator)
//Each block is coma separated
#define BLE_KNOWN_DEVICES_LIST {"A4C1385292B8", true, "LYWSD03MMC chambre Gabriel"}, {"A4C13848CC60", true, "LYWSD03MMC chambre parents"}

these are Hygro thermometer and I would like to get all datas from them
cf. https://esphome.io/components/sensor/xiaomi_ble.html#lywsd03mmc

is this feature available? if not maybe I can add it on the code. I just need to know where is it ^^
I get them from python :

ATC_characteristic_datas = [
['00002a1f-0000-1000-8000-00805f9b34fb', 'int', 10, 'temperature'],
['0002a6f-0000-1000-8000-00805f9b34fb', 'int', 100, 'humidity'],
['00002a19-0000-1000-8000-00805f9b34fb', 'int', 1, 'battery'],
]

and about iBeacon UUID is it a feature enable ?

here my extra configuration :

#define LOCATION "nabaztag"
#define GATEWAY_NAME "BLETracker/chambre_enfant"
#define TOPIC_FORMAT 1

//Set to true if you want to enable the iBeacon mode
#define ENABLE_IBEACON true

//iBeacon type
#define IBEACON_TYPE 0x0215

//iBeacon UUID (709ecc6d-2f85-891f-ea42-4a544ca7e2c4)
#define IBEACON_UUID 0x70, 0x9e, 0xcc, 0x6d, 0x2f, 0x85, 0x89, 0x1f, 0xea, 0x42, 0x4a, 0x54, 0x4c, 0xa7, 0xe2, 0xc4

//iBeacon major (etaj)
#define IBEACON_MAJOR 1

//iBeacon minor (piece)
#define IBEACON_MINOR 2

on espHome I used these parameters :

sensor:

  • platform: atc_mithermometer
    mac_address: "A4:C1:38:52:92:B8" # chambre de Gabriel
    temperature:
    name: "Température 2"
    humidity:
    name: "Humidité 2"
    battery_level:
    name: "Batterie 2"
    signal_strength:
    name: "Signal 2"
  • platform: atc_mithermometer
    mac_address: "A4:C1:38:48:CC:60" # chambre des parents
    temperature:
    name: "Température 3"
    humidity:
    name: "Humidité 3"
    battery_level:
    name: "Batterie 3"
    signal_strength:
    name: "Signal 3"

initially i tried this project because i wanted to use "esp32_ble_tracker" and "esp32_ble_beacon" at the same time, esphome doesn't allow that

esp32_ble_beacon:
type: iBeacon
uuid: '709ecc6d-2f85-891f-ea42-4a544ca7e2c4'
major: 1
minor: 2

Wrong time reported in the logs

As described here espressif/arduino-esp32#3797 there is an issue with the DST set in the NTP Time library .
The issue can be fixed using the proper Time Zone name instead of GMT and DST offsets.
Here there is the list of all the available Time Zones

Time Zone format is:
GMTGMT-1, M3.4.0/1,M10.4.0/2

  • GMTGMT-1 is the name of the time zone
  • GMT-1 is the abbreviation used when DST is off 1 hour is the time difference from GMT
  • GMT is the abbreviation used when DST is on
  • ,M3 is the third month
  • .4 is the forth occurrence of the day in the month when DST starts
  • .0 is Sunday
  • /1 is the time in hours when DST starts
  • ,M10 is the tenth month
  • .4 is the forth occurrence of the day in the month when DST ends
  • .0 is Sunday
  • /2 is the time in hours when DST ends

reset

Hello. I try to compile in debug mode
the only thing that I change in platformio.ini is:

[com]
esp32_platform = espressif32
#arduino-esp32 1.0.5-rc7
#esp32_platform = https://github.com/shogunxam/platform-espressif32.git#13a6a65fda58242ba3e10a7663fe07a2163c9f2f

My ESP32 just reebot/start and reboot

I have no messages on serial I try to print a string on
void setup() ... but it just reboot without messages

Decoder output is :

0x4009a1a9: abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/abort.c:38
0x401e5337: rcUpdatePhyMode at ??:?
0x401e537e: rcUpdatePhyMode at ??:?
0x401e5477: rcUpdatePhyMode at ??:?
0x401e5cf5: rcUpdateRate at ??:?
0x400db863: MyAdvertisedDeviceCallbacks::onResult(BLEAdvertisedDevice) at D:/Develop/Software/Local/ESP32_BLETracker-master/main/main.ino:152
0x400dbab9: _GLOBAL__sub_D_trackedDevicesMutex at D:/Develop/Software/Local/ESP32_BLETracker-master/main/main.ino:589
0x400dbb4b: _publishToMQTT(char const*, char const*, bool) at D:\Develop\Software\Local\ESP32_BLETracker-master/main/mqtt_client.cpp:43 (discriminator 8)
0x400dc60c: StringSumHelper::StringSumHelper(char const*) at D:\Develop\Software\Local\ESP32_BLETracker-master/main/settings.cpp:147
-> inlined by: Settings::toJSON() at D:\Develop\Software\Local\ESP32_BLETracker-master/main/settings.cpp:163
0x400f65c3: String::changeBuffer(unsigned int) at C:/Users/manjate/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.cpp:668 (discriminator 3)

Thanks in advanced

Noob needs help

Cannot build this project in VSCode

I have downloaded the code and unzipped it, then opened the folder in VSC. I have edited the user_config.h file only

This is what I get in the console window when I try to build

I am probably missing some simple step

Please help :)

Executing task: C:\Users\Admin.platformio\penv\Scripts\platformio.exe run <

Processing esp32dev-ble-release (platform: https://github.com/shogunxam/platform-espressif32.git#13a6a65fda58242ba3e10a7663fe07a2163c9f2f; board: esp32dev; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Platform Manager: Installing git+https://github.com/shogunxam/platform-espressif32.git#13a6a65fda58242ba3e10a7663fe07a2163c9f2f
Error: Traceback (most recent call last):
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands\run\processor.py", line 70, in process
p = PlatformFactory.new(self.options["platform"])
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\platform\factory.py", line 54, in new
raise UnknownPlatform(pkg_or_spec)
platformio.platform.exception.UnknownPlatform: Unknown development platform 'https://github.com/shogunxam/platform-espressif32.git#13a6a65fda58242ba3e10a7663fe07a2163c9f2f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\admin.platformio\penv\lib\site-packages\platformio_main_.py", line 109, in main
cli() # pylint: disable=no-value-for-parameter
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands_init_.py", line 44, in invoke
return super(PlatformioCLI, self).invoke(ctx)
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\users\admin.platformio\penv\lib\site-packages\click\decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 133, in cli
process_env(
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 175, in process_env
result = {"env": name, "duration": time(), "succeeded": ep.process()}
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands\run\processor.py", line 72, in process
self.cmd_ctx.invoke(
File "c:\users\admin.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\commands\platform.py", line 325, in platform_install
pkg = pm.install(
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\manager\platform.py", line 51, in install
pkg = super(PlatformPackageManager, self).install(
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\manager_install.py", line 48, in install
pkg = self._install(
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\manager_install.py", line 97, in install
pkg = self.install_from_url(spec.url, spec, silent=silent)
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\manager_install.py", line 141, in install_from_url
vcs = VCSClientFactory.new(tmp_dir, url)
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 54, in new
obj = getattr(sys.modules[name], "%sClient" % type
.title())(
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 137, in init
self.configure()
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 146, in configure
result = proc.exec_command([cls.command, "--exec-path"])
File "c:\users\admin.platformio\penv\lib\site-packages\platformio\proc.py", line 117, in exec_command
p = subprocess.Popen(*args, **kwargs)
File "C:\Users\Admin.platformio\python3\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Admin.platformio\python3\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

============================================================

An unexpected error occurred. Further steps:

============================================================

The terminal process "C:\Users\Admin.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

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

The status of the gateway is unstable

I noticed that the gateway status changes frequently, almost every 30-40 seconds. You can somehow fix it so that it is stable. I tried changing the time in the config, but it didn't help. How do I fix this?

here I specified 5 minutes
#define WIFI_CONNECTION_TIME_OUT 300000 /30 seconds/

#Check BLETracker state

  • platform: mqtt
    name: BLETracker_state
    state_topic: 'home/BLETracker/LWT'
    payload_on: "online"
    payload_off: "offline"
    device_class: "connectivity"

status

Feature Request: Start scan via html request

Hello shogunxam,

I use your software now for some month an it works great. Thanks for that at first.

In my hole house I have installed 4x ESP32 with the software, and the detection works great.
For an perfect automation it would be helpful to start the scan via command like http://ip/scan or equal.
Use case is e.g. with opening of the front door or garage, I'd like to start directly the scan to know the user at the door.

I'm not a good programmer in C, so would it be able that you can help me?

Thanks in advance.

HisMastersVoice

MAX_NON_ADV_PERIOD in control panel

Dear Mario,
would you be able to insert in the control panel the possibility of managing the MAX_NON_ADV_PERIOD in order to better define any false outputs when the NUT fails to communicate with the ESP for a few minutes?
You could put it in configuration, near the scan interval
Thanks in advance

FHEM Mode exceptions

Thank you @shogunxam for the nice firmware.

I compiled the newest git version with platform.io.
Decvices I use:

  • Gigabyte Gtags
  • Xiaomi Mi Band 3, 4, 5

I am trying to use the FHEM collectord mode, but I get lots of reboots:
"

2021-02-17 18:30:28 BLETracker initialized
2021-02-17 18:30:27 Software reset due to exception/panic
2021-02-17 18:30:27 Connected to ...
2021-02-17 18:29:25 Software reset due to exception/panic
2021-02-17 18:29:25 Connected to ...
2021-02-17 18:28:11 Software reset due to exception/panic
2021-02-17 18:28:11 Connected to ...
2021-02-17 18:27:43 Software reset due to exception/panic
"
Otherwise the funcion is good, but stability is not :(

How can I contribute to the debugging process?

Settings via the web interface

is it possible to modify the firmware so that the web interface can specify the IP and port mqtt, specify the white and black list, specify the mac address? It's just inconvenient to flash esp32 every time to enter the mac address in the white list and specify a different address of the mqtt server. Also add the ability to change the time interval for scanning BLE devices.

FHEM support request

Hi,

I'm a FHEM user, a program similar to Home Assistant.

I have looking for long time a software like this that get rssi and battery status without crashing.

In FHEM BLE trackers data transmission is currently done via TCP/IP to a daemon named Collectord. This firmware for ESP32 talk with the daemon but does not detect the battery status, while this script reads everything but does not run under ESP32.

Do you find it difficult to extend your software to support FHEM through Collectord?

Best regards,
Xavier0Smith

Retain State and Battery level after black-out

Hi,
would it be possible to implement a retain on the home / not home state and on the last battery level?

If I'm not mistaken, after a blackout, if the NUT is out of the house, the values are "unknown"

Thanks

Running extremely slow?

I have three ESP32 modules, two Wemos ESP32 Mini 1.0.0 and a generic Wroom one. Whenever I flash the firmware to them, I can access it via the webserver, but most of the time, the website is broken (no background, no boxes, etc, see:
image

It also does not detect any devices, no logs are generated on the log screen, none of the fields get populated.
I compiled with Arduino 1.8.13, ESP32 library 1.0.4, with the BLE library copied over as instructed.
When enabling serial debug logging, all seems good, the loop runs and shows that it connected to the broker and is sending data.

Any ideas what is going wrong here?

Friendly name to the MAC address

Hi,
would it be possible to associate a friendly name for each NUT that does not correspond to the real name and have it displayed next to the MAC ADDRESS in the devices?
It would be convenient to be able to immediately identify the NUT without having to remember the MAC, especially for new devices.

For example:
CXXXXXXXXXX0 with real name nut> friendly name Rocco
FXXXXXXXXXX3 with real name nut> friendly name Moana
DXXXXXXXXXX3 with real name nut> friendly name Selen

It's possible?

Thanks in advance

Add the capability to set a static IP

As per @xavier0smith request:

The only thing I'd like to add is the ability to set a static IP in the firmware. I don't want a captive portal, it takes up memory and if the power fails you get a lot of devices trying to connect. An optional line in user_config.h would suffice if possible

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.