omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Synchronization of SensorTags

    Pythonista
    3
    10
    4609
    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.
    • ProgrammingGo
      ProgrammingGo last edited by ProgrammingGo

      Hi I wanted to ask if there is a possibility to synchronize a Bluetooth connection with multiple Sensortags?
      The data are received by the Pythonista on the smartphone and since you switch the sensortags one after the other, you have a different amount of data for each sensortag. Do you know if it is possible to manage it directly via the Pythonista app?

      I was checking the cb library for a flag that maybe signalizes the connection of nodes.

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        The tricky part of this is that pythonista does not pass all of the identifying info to all of the callbacks. You can sort of manage this yourself, by only sending one request at a time and manually keeping track of which device you are querying. There was a thread on here on how to do it. But it ends up being pretty delicate if devices are disconnecting, or don't respond, etc.

        1 Reply Last reply Reply Quote 0
        • ProgrammingGo
          ProgrammingGo last edited by

          Thank you for the information. Can you tell me the URL of the thread?

          Okay, so it means it is complex to realize it. The problem is that I would like to handle 3 Sensortags and the Smartphone is receiving the sensor data from all of them. It is not nice when at the end STK1 has 20 datasets, STK2 10 and the 3 one only 5 datasets. So I thought about it, but it seems to be quite complex.

          I tried to work with the peripheral.status, but at the moment, I does not work :(

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            https://forum.omz-software.com/topic/4787/using-cb-library-to-connect-simultaneously-multiple-ti-sensortag-via-bluetooth-low-energy/32

            lol, it was your thread...

            1 Reply Last reply Reply Quote 0
            • ProgrammingGo
              ProgrammingGo last edited by

              Hi, is there may be the possibility that the pythonista app on the smartphone is firstly configuring the time of the incoming sensor tag and after that the smartphone can receive the sensor data? I gave a look in the modules available but, I did not find anything. In other words, I could maybe use the Network Time Protocol (NTP). Or do you have an idea that is easier to realize?

              1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by

                You can get the time using time module.for instance time.ctime() or time.time() or time.asctime(), etc, depending on the desired format.

                1 Reply Last reply Reply Quote 0
                • ProgrammingGo
                  ProgrammingGo last edited by

                  Hi thank you so much, I need a resolution to milliseconds.
                  Want I want to do is receive the timestamp of the sensortags on the smartphone via Pythonista, configure it (synchronize) and set it back to the sensortags. After that sensortags receive it, the tags should send the values to smartphone.

                  JonB 1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB @ProgrammingGo last edited by

                    @ProgrammingGo does the sensortag let you set the clock or sampling time? I looked at the API and it didn't seem like the default firmware did that, though of course you can always write tour own.

                    ProgrammingGo 1 Reply Last reply Reply Quote 0
                    • ccc
                      ccc last edited by ccc

                      @ProgrammingGo As I requested some months ago, can you please consider setting up a GitHub (or similar) repo with your code in it. It is much easier to debug Python code than English prose.

                      1 Reply Last reply Reply Quote 0
                      • ProgrammingGo
                        ProgrammingGo @JonB last edited by ProgrammingGo

                        @JonB yes I am able to set up a timestamp, you need to add the functionality to the firmware. So I am able to label all the sensor data with a timestamp. In which URL did you check up the API?

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB Forums | Contributors