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()
    drone.pair(drone.Nearest)

    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/Test.py"
    Traceback (most recent call last):
    File "C:/Users/jia_f/Documents/SIT (ICT)/Modules Notes/ICT2111-Integrative Team Project/Distek ITP Project/Python Program/Test.py", line 3, in <module>
    drone.pair(drone.Nearest)
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\CoDrone\codrone.py", line 725, in pair
    self.open(port_name)
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\CoDrone\codrone.py", line 666, in open
    self._serialPort = serial.Serial(
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\serialwin32.py", line 31, in init
    super(Serial, self).init(*args, **kwargs)
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\serialutil.py", line 240, in init
    self.open()
    File "C:\Program Files (x86)\Python38-32\lib\site-packages\serial\serialwin32.py", 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.

    0_1590220753199_9797bae4-5ad3-4788-a308-1d9f10139b83-image.png



  • @robolink_leila
    thanks for the information, it works.

    0_1590220711432_de49cf9b-6746-4a83-87a9-c583a61ea7dd-image.png


  • 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.