ESP32 #72: Arduino Eddystone Beacon
Вставка
- Опубліковано 10 вер 2024
- Using the #ESP32 as an Eddystone Beacon playing with the TLM Frame .
Arduino Sketch
github.com/pcb...
github.com/pcb...
Eddystone
github.com/goo...
Development Environment
ubuntu 17.10 64 Bit (www.ubuntu.com/) (unity)
Eclipse Oxygen (www.eclipse.org/)
esp-idf commit 4f44d16e88cf73dcc4999ca6dab28c44aaeed8db Fri Dec 29 06:11:50 2017 +0800 (github.com/esp...)
xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-75-gbaf03c2) 5.2.0 (dl.espressif.c...)
Arduino 1.8.4 (www.arduino.cc/)
arduino-esp32 commit 20db2ee421f5bba2d1dd6aaab7b3442e498f7cdd Thu Dec 14 21:13:42 2017 +0100 (github.com/esp...)
With CC or Public domain Pictures from pixabay
pixabay.com/en...
Excellent video, thank you! I'm going to go back and watch the other related video.
Absolute clear what you explain. And now we need the opposite. The ESP32 as receiver from eddystone beacon advertisements. When possible with sending this data to the Thinkspeak Website. Thank you for the very clear explanation.
Olof Scholten Thanks. Got it on the ToDo List but can not promise...
coming soon ... but the thinkspeak part is not integrated yet.
I want to read data from beacon ( temp ,acc sensor values) through esp32 using Arduino ide
pay me and i can program it for you
Hello! Thank for that tutorial. I have a question: by measuring the mA of my board (Nodemcu with Esp-Wroom-32) the value varies between 78 and 81 mA. It is pretty high. I need to read data from an accelerometer in real time (i.e. no deep sleep is possible), make a simple elaboration and send it through BLE with a frequency, for example, of 1 min. I was thinking to use it as iBeacon or Eddystone. I need to power the Esp32 with a battery like an iBeacon, so I need to reduce more and more the power consumption. Is possibile to lower the consumption under 10 mA with that device? Obviously a generic iBeacon has a power consumption on the order of microA, it would be great to get to those levels but I suppose it can't be done with an esp32, right? Thanks!
With a Beacon frequency of 1 min (set GPIO_DEEP_SLEEP_DURATION to 60) the average consumption should be way below 10 mA. But sure, this Arduino Beacon example with the ESP32 is not in the ultra low power range like other specialized chips for Bluetooth only. If you want further to improve the firmware with the ESP32 use the esp-idf (github.com/espressif/esp-idf) not Arduino.
Thanks for answer! I can not use deep sleep because I need to analyze data from an accelerometer and make some calculation and then I need to pass an integer through bluetooth every x minute (for example, 5). This means that I can not use deep sleep. Esp32 maybe is not the best choice for my project, right? Could you suggest me something that could fit my situation?
For a Bluetooth only solution you can have a look at the Nordic Semiconductor devices based on a ARM Cortex Processor ultra-low power 2.4 GHz wireless System on Chip (SoC): nRF51 Series or nRF52 Series (www.nordicsemi.com/eng/Products/Bluetooth-low-energy).
where can I find the documentation of this lib?
I'm also using the raw ESP32, but the moment I want to use BLE the "Brownout Detector" kicks in and resets the whole system. I guess there is a voltage drop that causes this. What kind capacitor are you using to stabilize the voltage?
Simon Slama Using a 1000uF/25V but in my case the bigger problem is the burden voltage drop of the Uni-T meter (like other meters as well) in the mA range, but measuring the esp32 in the A range make no sense with this meter.
I was trying out a 100µF (25V) and 10µF (35V) capacitator - because I had those lying around - and had no success. So do you think this might be actually be the cause and I only need to use a bigger capacity - or could there be another reason for the brownout detector to kick in?
Apart from that - thank you very much for your videos - they are very helpful!
Thank you :)
Hi, thanks a lot for your videos! I follow your projects carefully, especially this, which is part of my final year project.
I have a doubt with the SEC_CNT (of the "Unencrypted TLM Frame Specification").
I have wrong values of time when i scan with the app.
On the line 59 of code:
uint32_t tmil = now.tv_sec*10;
I had to remove "*10" and works well.
Is this right?
Regards from Argentina!
Hi, think what ever works for you is fine. But according to the Eddystone "Unencrypted TLM Frame Specification" SEC_CNT is a 0.1 second resolution counter (see github.com/google/eddystone/blob/master/eddystone-tlm/tlm-plain.md ).
Yes it works but i have a bad habit (or not) of try to understand why.
Yes i have readed the spec and the 0.1 sec resolution that confirm the logic of your expression. I will try to live with the doubt :D
Thank for the reply and congrats for your work again.
Guillermo Trangoni Thank you.
I was trying out a 100µF (25V) and 10µF (35V) capacitator - because I had those lying around - and had no success. So do you think this might be actually be the cause and I only need to use a bigger capacity - or could there be another reason for the brownout detector to kick in?
Apart from that - thank you very much for your videos - they are very helpful!
Simon Slama Can you describe your setup? Energysource, regulator any other circuitry or meters? Do you use the UART converter as a source or regulator (like cp2102)? With the cp2102 the brownout is common. (In my setup I use the ams1117 inside the ST-Link as a 3.3V source but only because I could find my 18650 LiFePos and my AAA LiFePos are to weak for the burden voltage of the meter but working without meter).
I have tried various power sources - cp2104 as powersource, an external power source PeakTech 6225A, and a 3.6V Li-SoCL2 battery. In all three cases I get the Brownout. When I accidently wired the 5V output from the UART converter to the 3.3V Pin on the ESP32 it actually worked...
Do you have any idea how to solve this?
Sorry no clue. The PeakTech 6225A should deliver 5A more then the ESP32 need. Maybe try 3.6V instead of 3.3V. The brownout should kick in below 2.3V (but see also the esp32 errata espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf ).
Ok - at least now I found one of my mistakes. I set the PeakTech 6225A to only 200 mA. From 311 mA it works and I can initialize the BLE functionality. Below that I get the Brownout. Can I reduce the drop with a bigger capacitator? In the end I want to power the ESP with bateries and not with an external laboratory power source.
I tried using thie sketch, but it doesn't compile :(
Can you provide the errors? The Versions of Arduino, OS, arduino-esp32 etc.
The beacon doesnt appear on the "eddystone" scanner, any idea how to get it the appear?
David Markey Hi, think most of the scanner only scans for Eddystone URL frames and not for TLM frame. Tomorrow I can publish the URL example and you can try it again. I've tested this with an APP called Beacon Scanner.
Try this with Eddystone URL frame: goo.gl/7wgpTQ
I tried your example, however i get an error when trying to compile this. The error is 'BLEAdvertisementData' was not declared in this scope BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); Any Idea whats wrong?
Have you update the arduino-esp32 library lately? The BLE libraries from Neil Kolban was introduced 2 month ago. See github.com/espressif/arduino-esp32
Yes i have the latest libraries installed.