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

    Can only see value of first GATT Characteristic

    Scheduled Pinned Locked Moved LoPy
    7 Posts 2 Posters 503 Views 2 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
      robertsehlstedt
      last edited by

      Hello!
      I am trying to implement some Bluetooth functionality to my LoPy4.
      Right now playing a bit with creating multiple characteristics within a service. I am using the nRF connect app to connect my phone via BLE, and see the data. But for some reason, I can only see the value of the first characteristic, and not the two following.

      Here I am creating a Location and Navigation service with latitude, longitude and altitude characteristics.

      lan = bt.service(0x1819, nbr_chars=3)
      # 0.001 precision
      lan.characteristic(uuid=0x2AAE, value=int(gps.lat * 1000))
      lan.characteristic(uuid=0x2AAF, value=int(gps.lon * 1000))
      lan.characteristic(uuid=0x2AB3, value=int(gps.alt * 1000))
      

      But my app looks like this:
      66594383_2542945739115615_1860967788433113088_n.jpg
      As you can see, there are for some reason only descriptors for the first characteristic and I can't find the value of the longitude and altitude. If I change the order around, it's always the first one working.

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        thinginnovations @robertsehlstedt
        last edited by

        @robertsehlstedt Looks like you're using the Nordic nRF Connect. I've used this too and you need to press the downward pointing arrow to read the value on each characteristic. Using the upwards pointing arrow would enable you to write the value. You can disable the write when setting up the characteristic on the Lopy4.
        There seems to be a lack of examples on using the GATT services.

        Cheers

        Andrew

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          robertsehlstedt @thinginnovations
          last edited by

          @thinginnovations Hello! Yes I did this to see the value of the first characteristic, but unfortunately it doesn't work for the others.

          T 1 Reply Last reply Reply Quote 0
          • T Offline
            thinginnovations @robertsehlstedt
            last edited by

            @robertsehlstedt Did you create individual callbacks for each characteristic?

            R 2 Replies Last reply Reply Quote 0
            • R Offline
              robertsehlstedt @thinginnovations
              last edited by

              @thinginnovations the code you see above is basically everything I did for services and characteristics. So I don't think I created any callbacks for the characteristics?

              1 Reply Last reply Reply Quote 0
              • R Offline
                robertsehlstedt @thinginnovations
                last edited by

                @thinginnovations I can try to implement this, but I don't see how callbacks will help? I have no control of what will be sent to the nRF Connect-app in the callback functions.

                1 Reply Last reply Reply Quote 0
                • R Offline
                  robertsehlstedt
                  last edited by

                  Well for some reason this was no longer a problem anymore, even though I don't believe I changed anything.

                  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