Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Enhancing the readout speed of BLE devices around the PyCom

    Scheduled Pinned Locked Moved WiPy 2&3
    data ratetimeperformanceblewipy
    1 Posts 1 Posters 816 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      redimo
      last edited by

      Hello,

      We are currently testing and logging Data for our indoor localization engine. The current problem we are facing are the, oftentimes, long reaction times until the WiPy realizes the BLE Token has moved, aswell as how often it reads values from it. This is the important part of the code:

      try:
      for x in range(0, (self.data.getAnzahlTokens())):

                  if str(binascii.hexlify(adv.mac)) == str(self.data.getnextMac()): 
                          print('*********************************************')
                          print("Geraete Mac Adresse = {}".format(binascii.hexlify(adv.mac)))
                          print("Geraete Sendestaerke = {}".format(adv.rssi)) 
                          data_stream= str(adv.data)
                          self.data.setRssi(binascii.hexlify(adv.mac), adv.rssi)
                          self.data.setDaten(binascii.hexlify(adv.mac), data_stream.replace("\\", ";"))
                          break
          except:
              pass 
          self.bluetooth.stop_scan()          
      

      The problem of it not being accurate is something that solely relies on the Math behind it. what we have seen is that when opening a door and getting in, we have reaction times on 1 up to 10s, most of the times in the upper half of the time spectrum.

      Currently our code reads data and then checks to see if we the MAC of the device is on our list, if so the Data gets saved into a storage, and if not it gets dumbed. This goes on and on and on. reducing the amount of MAC addresses to 1 aswell as reducing the amount of BL devices to around 4 in total does not help either.

      Has anyone any idea about how we could decrease the reaction time? Would a connect to MAC work better? Or should we start to 1 Thread/MAC?

      We also had to add in stop_scan and restart scanning as endlessli running ble.scan() would crash the WiPy.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better đź’—

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom