# Issues connecting with CF2

**URL:** <https://discuss.px4.io/t/issues-connecting-with-cf2/9586>\
**Category:** MAVSDK\
**Created:** [February 12, 2019, 12:04am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586 "2019-02-12T00:04:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 12, 2019, 12:04am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/1 "2019-02-12T00:04:31Z")

</div>

I’ve been using the SDK examples to test the connection between the SDK and my crazyflie 2.0 (CF2). So far, I have been successful in connecting via udp (./takeoff\_and\_land udp://:14540) to the simulator but I have yet to figure out how to connect to the physical quadcopter.

I have a CrazyRadio that is connected via USB on my macOS and I have been trying to connect using serial connection (./takeoff\_and\_land serial:///dev/ttys000:14540). I have tried many combinations of baudrate but none have been successful. The error I get is ‘Waiting to discover system…; no system found, exiting’.

Does anyone have any ideas on where I might be going wrong?

---

<div class="post-metadata">

**Author:** ![Kyuhyong\_You](https://discuss.px4.io/user_avatar/discuss.px4.io/kyuhyong_you/32/2210_2.png) [@Kyuhyong\_You](https://discuss.px4.io/u/Kyuhyong_You)\
**Post date:** [February 13, 2019, 5:44am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/2 "2019-02-13T05:44:15Z")

</div>

Hi @cboustead  
Did you check [https://github.com/bitcraze/crazyflie-lib-python](https://github.com/bitcraze/crazyflie-lib-python) and tried to connect through it?  
Which instruction did you follow? like this one? [https://docs.px4.io/en/complete\_vehicles/crazyflie2.html](https://docs.px4.io/en/complete_vehicles/crazyflie2.html)

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [February 13, 2019, 1:33pm UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/3 "2019-02-13T13:33:16Z")

</div>

> [@cboustead](#):
>
> ./takeoff\_and\_land serial:///dev/ttys000:14540)

This seems wrong. You need to find out what the path is of your serial device. Easiest is to do `ls /dev/` before plugging the device in and again after and then finding the diff.

I would expect something like `/dev/tty.usbmodem1`, `/dev/tty.usbserial-XXXXX` or something similar.  
Also, you need to pass tthe baudrate, otherwise it’s likely not going to work.

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 20, 2019, 11:25am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/4 "2019-02-20T11:25:00Z")

</div>

I do get a radio connection between CF2 and Crazyradio PA using crazyflie-lib-python but QGC does not detect the CF2.

I’m not sure the steps that are required to run the SDK examples. Do I need to connection with QGC or should the example programs such as takeoff\_and\_land.py be able to connect with the CF2 without QGC.

Any advise you can offer would be appreciated, I’ve been stuck on setup for over a week.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [February 20, 2019, 2:00pm UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/5 "2019-02-20T14:00:20Z")

</div>

Yes you should be able to connect without QGroundControl. In fact once QGroundControl opens the port, the SDK probably can’t connect anymore.

What’s the interface of this crazyflie radio? Is it serial? Have you fixed the permissions for Linux as explained [here](https://github.com/bitcraze/crazyflie-lib-python#setting-udev-permissions). Have you tried with sudo to check if it is a permission thing?

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 20, 2019, 3:49pm UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/6 "2019-02-20T15:49:59Z")

</div>

The documentation I have read suggests that it should be a udp connection. I have tried both serial and udp, neither have worked.

There aren’t any permission issues, I’m using OS X.

When I run cfbridge.py I get this output. As you can see, there are no messages between the CF2 and ground station:

Scanning interfaces for Crazyflies…  
DEBUG:cflib.crtp:Scanning: \<class ‘cflib.crtp.radiodriver.RadioDriver’\>  
INFO:cflib.crtp.radiodriver:v0.53 dongle with serial N/A found  
DEBUG:cflib.crtp:Scanning: \<class ‘cflib.crtp.serialdriver.SerialDriver’\>  
DEBUG:cflib.crtp:Scanning: \<class ‘cflib.crtp.udpdriver.UdpDriver’\>  
DEBUG:cflib.crtp:Scanning: \<class ‘cflib.crtp.usbdriver.UsbDriver’\>  
INFO:cflib.drivers.cfusb:Looking for devices…  
Crazyflies found:  
radio://0/80/2M  
DEBUG:cflib.crazyflie:Adding callback on port [6] to [\<bound method Localization.\_incoming of \<cflib.crazyflie.localization.Localization object at 0x10a508ba8\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [5] to [\<bound method Log.\_new\_packet\_cb of \<cflib.crazyflie.log.Log object at 0x10a508c50\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [0] to [\<bound method Console.incoming of \<cflib.crazyflie.console.Console object at 0x10a42d1d0\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [2] to [\<bound method \_ParamUpdater.\_new\_packet\_cb of \<\_ParamUpdater(Thread-2, initial daemon)\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [4] to [\<bound method Memory.\_new\_packet\_cb of \<cflib.crazyflie.mem.Memory object at 0x10a508f98\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [13] to [\<bound method PlatformService.\_platform\_callback of \<cflib.crazyflie.platformservice.PlatformService object at 0x10a5440b8\>\>]  
DEBUG:cflib.crazyflie:Adding callback on port [15] to [\<bound method PlatformService.\_crt\_service\_callback of \<cflib.crazyflie.platformservice.PlatformService object at 0x10a5440b8\>\>]  
Connecting to radio://0/80/2M  
INFO:cflib.crazyflie:Callback-\>Connection initialized[radio://0/80/2M]  
INFO:cflib.crazyflie:We are connected[radio://0/80/2M], request connection setup

waiting to receive message  
INFO:cflib.crazyflie:Callback-\>Connected to [radio://0/80/2M]

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 20, 2019, 3:52pm UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/7 "2019-02-20T15:52:49Z")

</div>

Also, when I connect the radio, there are no obvious serial connections in /dev/ (tty\* etc)

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 20, 2019, 3:55pm UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/8 "2019-02-20T15:55:07Z")

</div>

and here is my output from a Dronecode example:

calums-MBP:build calumboustead$ ./takeoff\_and\_land udp://127.0.0.1:14550  
[04:04:34|Info] DronecodeSDK version: 0.14.1 (dronecode\_sdk\_impl.cpp:25)  
[04:04:34|Debug] New: System ID: 0 Comp ID: 0 (dronecode\_sdk\_impl.cpp:285)  
[04:04:34|Error] No known remotes (udp\_connection.cpp:130)  
[04:04:34|Error] send fail (dronecode\_sdk\_impl.cpp:91)  
Waiting to discover system…  
[04:04:35|Error] No known remotes (udp\_connection.cpp:130)  
[04:04:35|Error] send fail (dronecode\_sdk\_impl.cpp:91)  
No system found, exiting.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [February 21, 2019, 6:59am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/9 "2019-02-21T06:59:08Z")

</div>

I see this: [https://github.com/bitcraze/crazyflie-lib-python/blob/master/examples/cfbridge.py#L67-L75](https://github.com/bitcraze/crazyflie-lib-python/blob/master/examples/cfbridge.py#L67-L75)

Which means that you could presumably receive mavlink by connecting to 127.0.0.1:14550 as you tried. Did you try this while cfbridge.py was running?

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 21, 2019, 7:29am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/10 "2019-02-21T07:29:42Z")

</div>

Yes I tried that. I get the same output.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [February 21, 2019, 8:28am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/11 "2019-02-21T08:28:22Z")

</div>

In that case you could use wireshark and check if you see any packets on loopback.

---

<div class="post-metadata">

**Author:** ![cboustead](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cboustead](https://discuss.px4.io/u/cboustead)\
**Post date:** [February 21, 2019, 9:10am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/12 "2019-02-21T09:10:27Z")

</div>

Can you tell me what I should be looking for in Wireshark?

I’m going to move onto a Ubuntu PC as I believe the issues I’m having might be cause by my Macintosh.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [February 21, 2019, 9:50am UTC](https://discuss.px4.io/t/issues-connecting-with-cf2/9586/13 "2019-02-21T09:50:51Z")

</div>

You are looking for UDP packets on the loopback interface, and port numbers like 14550.
