Comments (4)
Hi @rcarreira88, could you please explain a bit more your request? Thx
from esp32_bletracker.
Hi, @shogunxam,
i want to put your code in my mailbox esp32 to send a MQTT command to open door if it detects my smartband MAC address ,
but i also want:
Switch1 connects to GPIO and sends MQTT message and turns on LED connected to a GPIO,
Switch2 connects to GPIO and sends MQTT message and turns off LED.
from esp32_bletracker.
If I have understood you want integrate my code in an existing project. I hope you are a software developer because the work could not so easy if you haven't the proper knowledge.
I think you have to give up the idea to have a web server because my code has already reached the limit of the ESP32 memory.
The project uses this external libraries:
- [email protected]
- [email protected]
- For the BLE library I used this one https://github.com/espressif/arduino-esp32/tree/6b0114366baf986c155e8173ab7c22bc0c5fcedc/libraries/BLE. I think you can use also the latest
released with the ArduinoESP32 platform. If you are using platformIO I suggest to you to copy from my platformio.ini
I tried to make the project modular, but the code become a little messed up after the introduction of the support for the FHEM platform.
Main modules are:
- WiFiManager -> used to access the WiFi
- mqtt_client -> Used to connect to the MQTT broker and publish messages
- There are other utility modules such as mutex or NTPTime to get the time and date from a server.
- In the main module there is the code to scan the BlueToothLE, the core is composed by two pieces one is the class MyAdvertisedDeviceCallbacks where each advertised device is processed, then in the loop function there is the code executing the scan (search for the macro PROGRESSIVE_SCAN). I made two kind of scan one progressive with limited time search and one searching for all the available devices in a longer time range.
If you need also the battery status of the devices follow the batteryTask function.
If you need something simpler take a look to this project
https://github.com/sdesalve/dss_mqtt_binary_sensor_ble_scanner
I started from this project and I evolved it.
About the GPIO I have never worked with them, but googling, I'm sure you will find what you need, in example here you can find how to turn on a led.
https://microcontrollerslab.com/gpio-pins-esp32-led-blinking-example/
from esp32_bletracker.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from esp32_bletracker.
Related Issues (20)
- FHEM support request HOT 16
- Add the capability to set a static IP
- FHEM Mode exceptions HOT 49
- Friendly name to the MAC address HOT 2
- MAX_NON_ADV_PERIOD in control panel HOT 3
- Retain State and Battery level after black-out HOT 2
- Wrong time reported in the logs HOT 2
- Report the date and time of the last battery level detection HOT 2
- Last battery level status HOT 9
- New firmware release notification HOT 2
- Multiple esp32 network HOT 4
- Noob needs help HOT 2
- Running extremely slow? HOT 3
- Build problem HOT 7
- only battery state ? HOT 2
- reset HOT 7
- Feature Request: Start scan via html request HOT 14
- sysinfo is published not after 2 Minutes
- The status of the gateway is unstable HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32_bletracker.