Pairing Test issue

  • when I using python to do a pair test I got error from the result.

    Below is my python code I use:

    import CoDrone
    drone = CoDrone.CoDrone()

    and below is the output result I got:

    "C:\Program Files (x86)\Python38-32\python.exe" "C:/Users/jia_f/Documents/SIT (ICT)/Modules Notes/ICT2111-Integrative Team Project/Distek ITP Project/Python Program/"
    Traceback (most recent call last):
    File "C:/Users/jia_f/Documents/SIT (ICT)/Modules Notes/ICT2111-Integrative Team Project/Distek ITP Project/Python Program/", line 3, in <module>
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\CoDrone\", line 725, in pair
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\CoDrone\", line 666, in open
    self._serialPort = serial.Serial(
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\", line 31, in init
    super(Serial, self).init(*args, **kwargs)
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\", line 240, in init
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
    serial.serialutil.SerialException: could not open port 'COM8': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)

    Process finished with exit code 1

  • administrators

    @alpha You don't need to run all three functions 🙂 You can stick with the last one only. The middle one is if you know your drone's four-digit ID. The example given uses '1234' but you can find out your drone ID by looking at the output once your drone pairs. Let me know if you have any more questions!

  • @robolink_leila
    thanks for the info, it works.


  • @robolink_leila
    thanks for the information, it works.


  • administrators

    @alpha Try the following steps if you are having difficulty pairing:

    1. Disconnect and reconnect the BLE board to your computer. Make sure the BLE board is not connected to anything else but your computer.
    2. Check your device manager to verify which COM port is being detected. Go to the start menu and search for "Device Manager". In the window, check under the list of USB devices. If nothing is showing up, then try a different USB cable or port until it does.
    3. Once you can verify which port is being detected, try calling the pair() function with the specific port using one of the following:
    drone.pair(port_name = 'COM3')
    drone.pair('1234', 'COM3')
    drone.pair(drone.Nearest, 'COM3')

    Let me know if this works for you!

Log in to reply

Looks like your connection to Robolink community was lost, please wait while we try to reconnect.