Announcement

Collapse
No announcement yet.

Finally BLE scanning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Finally BLE scanning

    anyone got an ESP32 and want to try this? I’m interested in putting these all around the house for indoor positioning and also putting beacons in my cars

    https://www.instructables.com/id/Nan...2-BLE-Scanner/

  • #2
    Yes. Big5 will receive the data that this tiny device sends out ( HTTP POST) and will create/update HS3 devices accordingly.

    With this said, the concept is not clear to me. This battery powered device goes into "deep sleep" for 5 minutes after each "report". Yes, you can re-program it but if you have it report too often the battery will be gone in no time. So it may be good for tracking items that do not move often however it can not be a substitute for motion sensors and indoors human location tracking.

    Comment


    • #3
      I wouldn’t build it the way they did I’d just power off USB and keep it active all the time. Honestly I just wish someone would make a client server model for this application and these devices that’s graphically configurable. All of them get deployed in the property and you just sit there on the couch with your iPad in the main interface saying yup that’s a device I want to track and do this when you see it come and go.

      Comment


      • #4
        Originally posted by kideon View Post
        I wouldn’t build it the way they did I’d just power off USB and keep it active all the time. Honestly I just wish someone would make a client server model for this application and these devices that’s graphically configurable. All of them get deployed in the property and you just sit there on the couch with your iPad in the main interface saying yup that’s a device I want to track and do this when you see it come and go.
        This is nothing new. There are attempts that worked well but not funded enough. Go look at "Happy Bubble" good system I bought some of their boards and their server was good. There's also a few implementations used by Home Assistant with the room assistant component. The pieces are all there to do this. However it's not a complete system and I would not consider it a "production" quality solution yet which is why I believe there are no ready made affordable commercial systems yet.

        However for personal use a simple solution with some raspberry pi's spread around the house a mqtt broker and some beacons be it tokens or software (android/iphone) and then a receiver that does some logic of proximity between the receiving location points and then marks a "location" is possible to hack together.

        I had a similar setup in my house for a while but the problem is the beacon's. People must carry them at all times for the system to work correctly, so if that's a little fob or sticker or phone if they don't carry it then the system doesn't work. I'm still looking/working on find a "good" solution...so are lots of other people.

        Comment


        • #5
          I tried the ESP32 forf BLE using MQTT rather than HTTP and did not employ the sleep mode. Change the address to use hyphen rather than colon since colon has special meaning in MQTT. I have the payload set to active if the scan finds it and has not yet been reported. Inactive if previously found and no longer found in the scan. This is just an evaluation per kideon's request. The points made by SimplexTechnology are good if intending to use this for people detection.

          Messages at startup
          BLEscan/64-67-4f-6a-6c-be = active
          BLEscan/40-16-3b-f0-70-df = active
          BLEScan/6f-7e-39-14-30-b1 = active

          Message after one device powered down
          BLEScan/6f-7e-39-14-30-b1 = inactive

          Comment


          • #6
            While this is not a new idea it looks so attainable for first time to me. I'm excited. ESP32 boards are so easy to work with. Unlike previous ESP8266 that required an external UART, and a bunch of connections, the ESP32 boards connect to USB port directly and have all power management and communications management on board.

            I don't know about you but I forget my glasses sometimes, my hat, my wallet, my keys, but I never forget my iPhone. So for me the issue of the beacon is a non issue. The iPhone/beacon is always with me. Same with other family members.

            Big5 can easily manage any input protocol and data format. The data format shown above (courtesy of Michael McSharry ) can be accommodated easily by Big5 conditions' ability to search in a string

            If {input} contains "BLEscan/64-67-4f-6a-6c-be = active" in 1 st position than --> HS3 action follows for example set HS3 device Home-->Kitchen-->John to value 1.


            If {input} contains "BLEscan/64-67-4f-6a-6c-be = inactive" in 1 st position than --> HS3 action follows for example set HS3 device Home-->Kitchen-->John to value 0.


            If your HS3 device "John" has value 1 than John is in the kitchen. Use it as you please for any HS3 action.

            With this said, is there anyone out there who will be willing to modify and share here the original Arduino IDE code for the purpose of permanent continuous BLE scanner (not battery powered and not intermittent as in the original).


            Comment


            • #7
              I further developed the BLE scanner sketch to utilize the two cores of the ESP32. I also added /INFO topics to report all the information that was available in the scan. The log of results during my testing, the sketch, and other reference material was place at http://mcsSprinklers.com/mcsMQTT.pdf Section 14.15.

              I do not know enough about Bluetooth to know exactly what to expect, but I thought that I should be able to power down/up devices and see a difference in the devices in the scan. I used Android smart phone and Amazon Echos during the cursory evaluation. I could not see any direct correlation with actions on these. I did see several devices being scanned then no longer in the scan. Three hours of data is shown in the above reference. Since none of these devices reported their name, and only their MAC address, I do not know which device is actually being detected. Was it in my house or in a neighbor's house?

              risquare These are MQTT topics and payload with "=" used to separate topic from payload in the post. There is no further extraction required as the payload will go directly into a HS device that is mapped to the topic.

              Comment


              • #8
                The issue/trick in regards to Bluetooth for presence detection from multiple beacons within a confined space is the triagulation. The only method available is through the RSSI signals that the beacons (most) provide. This can be used in a deterministic method to know what receiver the beacon is closest to and furthest away from.

                By nature it's best to have 3 receivers (triangle ) to have an accurate idea of the location of the beacon within the given proximity. Fewer can be used in larger spaces or with broader "location" awareness ie kitchen vs bedroom (unless they are right next to each other which is possible.)

                The room assistant approach used rPi's as the receivers to collect the BT data and RSSI and forward that to a central system (could be another rPi) which then would compare the incoming data from the receivers to make the decision of closest proximity to a receiver which in turn was "tagged" to a location and then would change a corresponding device.

                Months ago I tested this with the Happy Bubbles server that I modified to send the data to HS. The Happy Bubbles recorded the receivers and registered the beacons and performed the proximity determination and that result was then sent to HS. I never went further into a full plugin though. Which is possible but I found little utility in it. Phone beacons are great but just another thing draining the battery on the phone and having to remember/remind family to "carry your beacon" became annoying to the family very quickly.

                Comment


                • #9
                  Michael McSharry Thanks for the sketch. For those of us who are not programmers would it be possible to post a .zip file with the sketch and all necessary libraries subroutines (whatever they are called) ready for compilation and deployment. The sketch is well commented/documented IMHO, however it's not clear to me what does "MQTT broker" mean. Is it the IP address of the broker? How about port # ? By default 1883 or needs to be specified?

                  Comment


                  • #10
                    Simplistically for my first iteration I just want to mount a esp32 in my garage and put beacons in my car triggering events when they are detected vs not. Haven’t dived into mqtt yet but I can do it with events through JSON or this big5 I suppose. Will order some and start fiddling. Shame about happy bubbles though.

                    Comment


                    • #11
                      Originally posted by Simplex Technology View Post
                      The issue/trick in regards to Bluetooth for presence detection from multiple beacons within a confined space is the triagulation. The only method available is through the RSSI signals that the beacons (most) provide. This can be used in a deterministic method to know what receiver the beacon is closest to and furthest away from.

                      By nature it's best to have 3 receivers (triangle ) to have an accurate idea of the location of the beacon within the given proximity. Fewer can be used in larger spaces or with broader "location" awareness ie kitchen vs bedroom (unless they are right next to each other which is possible.)

                      The room assistant approach used rPi's as the receivers to collect the BT data and RSSI and forward that to a central system (could be another rPi) which then would compare the incoming data from the receivers to make the decision of closest proximity to a receiver which in turn was "tagged" to a location and then would change a corresponding device.

                      Months ago I tested this with the Happy Bubbles server that I modified to send the data to HS. The Happy Bubbles recorded the receivers and registered the beacons and performed the proximity determination and that result was then sent to HS. I never went further into a full plugin though. Which is possible but I found little utility in it. Phone beacons are great but just another thing draining the battery on the phone and having to remember/remind family to "carry your beacon" became annoying to the family very quickly.
                      I thought it could passively scan so beacons w rent necessary like it just sees the BLE capable device like the phone fitbit it or watch

                      Comment


                      • #12
                        Originally posted by kideon View Post
                        Simplistically for my first iteration I just want to mount a esp32 in my garage and put beacons in my car triggering events when they are detected vs not. Haven’t dived into mqtt yet but I can do it with events through JSON or this big5 I suppose. Will order some and start fiddling. Shame about happy bubbles though.
                        Done this with various beacon's. Signal strength being inside the vehicle was a big problem a very hit or miss on detection. YMMV.

                        Comment


                        • #13
                          It looked like it’s worth a shot how did you go about it?

                          Comment


                          • #14
                            Originally posted by kideon View Post
                            It looked like it’s worth a shot how did you go about it?
                            Happy Bubbles receiver (or raspberry pi works) and a beacon in the car. The rPi or HB receiver was sending messages to the Happy Bubbles server which would then feed the information to MQTT.

                            Comment


                            • #15
                              I flashed three ESP32 and collecting data now. My thinking is that the consolidation of data from each ESP willbbe done in the ESP rather than an independent server. There us just so much untapped power in the ESP32 that it does not make sense to add another computer. They can all subscribe so each has full information. If consolidation is needed then I likely would do it the HS plugin.

                              Are there any algorithms published that I could take advantage for position isolation?

                              Comment

                              Working...
                              X