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

    type object 'Bluetooth' has no attribute 'BLE'

    Scheduled Pinned Locked Moved LoPy
    bluetoohlopybluetoorh bl
    7 Posts 4 Posters 1.7k Views 4 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.
    • L Offline
      luc
      last edited by

      Hello,
      I'm trying to set up a bluetooth object exactly as described in the documentation.
      I type :
      from network import Bluetooth
      bluetooth = Bluetooth()
      bluetooth.init(id=0, mode=Bluetooth.BLE, antenna=None)

      And this is what I get :
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      AttributeError: type object 'Bluetooth' has no attribute 'BLE'

      I updated the firmware, I'm using a Lopy with a Pytrack as interface boar
      I don't understand what is happening. Anybody with an idea or with the same problem ?

      Sincerely yours,
      Lucas

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @luc
        last edited by

        Hi @luc

        That's actually an error in the documentation, thank you for finding it.

        You don't need to do bluetooth.init(id=0, mode=Bluetooth.BLE, antenna=None), just doing bluetooth = Bluetooth() is sufficient (and also calls init)

        1 Reply Last reply Reply Quote 0
        • L Offline
          luc
          last edited by

          Hello @jmarcelino
          Thanks for the quick answer ! :)

          I have another question concerning the property "antenna" (Bluetooth.EXT_ANT or Bluetooth.INT_ANT).

          When I write bluetooth=Bluetooth(antenna=Bluetooth.Ext_ANT), I have no error and my script is running normally. But I don't see any concrete improvement in the RSSI of the beacons signals I'm scanning, as if this 'antenna' property had no effect at all.

          Can you confirm this 'antenna' option is really doing something or it is an option that is useless for a Lopy ?
          Thanks a lot,
          sincerely yours,
          Lucas

          sebS 1 Reply Last reply Reply Quote 0
          • sebS Offline
            seb @luc
            last edited by

            @luc
            This should switch between the on-board 2.4ghz antenna and the U.FL connector near said antenna. There was an issue a few firmware versions ago where this wasnt working as expected. What firmware are you running?

            1 Reply Last reply Reply Quote 0
            • L Offline
              luc
              last edited by

              Hi @seb ,
              Thanks for your answer ! I'm using the latest firmware and an external PCB antenna. My problem is that I don't see absolutely no difference in signal RSSI and range of detection with and without PCB antenna.

              Now if I have the confirmation from Pycom that this BLE property is active and running smoothly in the latest firmware, I will change my antenna for my next test :). I will post the results of my test here for information.

              Cheers,

              Lucas

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                luc @luc
                last edited by

                Hi @seb ,
                Ok, I went through some testing, using a hi-gain 2,4 GHz external antenna and there is absolutely no difference in the RSSI of the BLE received signal. I even "hot" unplugged the antenna with absolutely no change in RSSI and no complain from the Lopy board (I would not do this with a Lora antenna :) ).

                Are you sure this function (Bluetooth.EXT_ANT) is really implemented for the Lopy using the latest up to date firmware ?
                I bought this Lopy about 1 year ago (if this can be of any help).

                Cheers and thanks,
                Lucas

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mattliddle
                  last edited by

                  @jmarcelino What is bluetooth.init(id=0, mode=Bluetooth.BLE, antenna=None) used for then?

                  I also noticed when I was trying to run it, that Bluetooth.BLE as the mode did not work at all.

                  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