espressif / esp-drone

Mini Drone/Quadcopter Firmware for ESP32 and ESP32-S Series SoCs.
GNU General Public License v3.0
830 stars 242 forks source link

How to connect my ESP32-Drone aircraft to cfclient? #33

Closed zhendehanzi closed 1 year ago

zhendehanzi commented 2 years ago

How to connect my ESP32-Drone aircraft to cfclient?I successfully run the latest cfclient, but I would like to know how do I connect to my aircraft to achieve PID parameter adjustment, via USB? Or is it UDP communication? I can't seem to find complete instructions on how to use it, and have been confused.

image

leeebo commented 2 years ago

@zhendehanzi We have a modified version cfclient, please try this: https://docs.espressif.com/projects/espressif-esp-drone/zh_CN/latest/gettingstarted.html#pc-cfclient

Spring641 commented 2 years ago

@zhendehanzi我们有修改版cfclient,请试试这个:https ://docs.espressif.com/projects/espressif-esp-drone/zh_CN/latest/gettingstarted.html#pc-cfclient

是都有编译好直接在win10运行的exe

leeebo commented 2 years ago

@Spring641 这是一段开源的 Python 程序,我们不会以 exe 的形式发布

Spring641 commented 2 years ago

@Spring641 这是一段开源的 Python 程序,我们不会以 exe 的形式发布

目前按流程来编译运行在win10上 只出现闪屏就没了

bakecool commented 1 year ago

在解决了pyqt5的QtGui升级QtWidgets问题、并安装了SDL2-2.26.5-win32-x64之后,QActionGroup去掉了exclusive=True,我成功运行起了for espdrone的配套的cflib和cfclient。但是我不知道如何去连接udp://192.168.43.42.如果我用笔记本的wifi去连接飞机的wifi,scan不到,如果我用自己的局域网192.168.5.*,我不理解udp如何能把信号传递过来。求指点。

lovefool commented 3 months ago

This issues is closed, but no solution found here? Any solution?

leeebo commented 3 months ago

@lovefool please try with the new version cfclient in https://github.com/qljz1993/crazyflie-clients-python.git

lovefool commented 3 months ago

@lovefool please try with the new version cfclient in https://github.com/qljz1993/crazyflie-clients-python.git

@leeebo thank you for your update. I uninstalled old "cflib" and "cfclient", then installed from the link you provided. Now I can scan and find ESP-Drone. But click "connect", cfclient is trying to connect but seems not succeed. (at left-top corner keep connectiong)

image

Cannot find a Crazyradio Dongle INFO:cflib.drivers.cfusb:Looking for devices.... INFO:cflib.crtp.prrtdriver:Initialized PRRT driver. INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cflib.crazyflie:Callback->Connection initialized[udp://192.168.43.42:2390] INFO:cflib.crazyflie:We are connected[udp://192.168.43.42:2390], request connection setup INFO:cflib.crazyflie.platformservice:Request _request_protocol_version() INFO:cflib.crazyflie:Callback->Connected to [udp://192.168.43.42:2390] INFO:cflib.crazyflie.platformservice:_crt_service_callback INFO:cflib.crazyflie.platformservice:Request protocol version INFO:cflib.crazyflie.platformservice:_platform_callback INFO:cflib.crazyflie.platformservice:Protocol version (platform): 4 INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices WARNING:cflib.crazyflie.toccache:Could not save cache, no writable directory INFO:cflib.crazyflie:Log TOC finished updating INFO:cflib.crazyflie:Resending for pattern (76, 1) INFO:cflib.crazyflie:Resending for pattern (76, 1) INFO:cflib.crazyflie:Resending for pattern (76, 1) INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cflib.crazyflie:Resending for pattern (76, 1) INFO:cflib.crazyflie:Resending for pattern (76, 1) INFO:cflib.crazyflie:Resending for pattern (76, 1)

leeebo commented 3 months ago

@lovefool please update to the latest esp-drone code also, the bug has been fixed in 9a14c4a47c348be436fe377a9fe93880142caf2e

lovefool commented 3 months ago

@lovefool please update to the latest esp-drone code also, the bug has been fixed in [9a14c4a](https://github.com/espressif/esp-drone/commit/9a14c4a47c348be436fe377a9fe93880142caf2e

@leeebo thank you for your advice. I finally got connect esp-drone and cfclient. There are two questions.

  1. cfclient screen stuks after 5~10 seconds. Disconnect and Connect make it work again, but soon stuck. (Need more test)  When cfclient connects, Green LED start blinking, and when cfclient screen stuck (stops updating) Green LED become off. There are no data on ctrf sniffer screen.
  2. I made esp-idf environment fot this project. Are there any tutorial to use this esp-drone repository on VS Code+ESP-IDF ext environment, or VS Code + PlatformIO +ESP-IDF?

image

UserWarning: Using SDL2 binaries from pysdl2-dll 2.24.0 INFO:cfclient.gui:Disabling STL printouts INFO:cfclient.utils.input.inputreaders:Input readers: ['linuxjsdev', 'pysdl2'] INFO:cfclient.utils.input.inputreaders:Could not initialize [linuxjsdev]: Only supported on Linux INFO:cfclient.utils.input.inputreaders:Successfully initialized [pysdl2] INFO:cfclient.utils.input.inputinterfaces:Found interfaces: ['leapmotion', 'wiimote', 'zmqpull'] INFO:cfclient.utils.input.inputinterfaces:Could not initialize [leapmotion]: Leap Motion library probably not installed (No module named 'leapsdk') INFO:cfclient.utils.input.inputinterfaces:Could not initialize [wiimote]: Missing cwiid (wiimote) driver No module named 'cwiid' INFO:cfclient.utils.config:Dist config read from z:\esp-drone-leebo\crazyflie-clients-python-master\src\cfclient/configs/config.json INFO:cfclient.utils.config:Config file read from [C:\Users\jayte.HP-PAVILION\AppData\Local\Bitcraze\cfclient/config.json] INFO:cfclient.utils.input.inputinterfaces:Could not initialize [zmqpull]: ZMQ input disabled in config file INFO:OpenGL.acceleratesupport:No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate' INFO:cfclient.utils.zmq_led_driver:ZMQ led disabled in config file INFO:cfclient.utils.zmq_param:ZMQ param disabled in config file INFO:cfclient.utils.input:Using device blacklist [(VirtualBox|VMware)] WARNING:cfclient.ui.dialogs.bootloader:Failed to make web request to get firmware-release WARNING:cfclient.ui.dialogs.bootloader:Failed to parse firmware-releases in web request Cannot find a Crazyradio Dongle INFO:cflib.drivers.cfusb:Looking for devices.... INFO:cflib.crtp.prrtdriver:Initialized PRRT driver. INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cflib.crazyflie:Callback->Connection initialized[udp://192.168.43.42:2390] INFO:cflib.crazyflie:We are connected[udp://192.168.43.42:2390], request connection setup INFO:cflib.crazyflie.platformservice:Request _request_protocol_version() INFO:cflib.crazyflie:Callback->Connected to [udp://192.168.43.42:2390] INFO:cflib.crazyflie.platformservice:_crt_service_callback INFO:cflib.crazyflie.platformservice:Request protocol version INFO:cflib.crazyflie.platformservice:_platform_callback INFO:cflib.crazyflie.platformservice:Protocol version (platform): 4 INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices WARNING:cflib.crazyflie.toccache:Could not save cache, no writable directory INFO:cflib.crazyflie:Log TOC finished updating INFO:cflib.crazyflie.mem:0 memories found INFO:cflib.crazyflie:Memories finished updating INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices WARNING:cflib.crazyflie.toccache:Could not save cache, no writable directory INFO:cflib.crazyflie:Param TOC finished updating INFO:cflib.crazyflie:Callback->Connection setup finished [udp://192.168.43.42:2390] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning/Attitude.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning/Attitude_rate.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning/Position.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning/Velocity.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Pitch.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Pitch_rate.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Position_x.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Position_y.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Position_z.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Roll.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Roll_rate.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Velocity_x.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Velocity_y.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Velocity_z.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Yaw.json] INFO:cfclient.utils.logconfigreader:Parsing [PID_tuning_components/Yaw_rate.json] INFO:cfclient.utils.logconfigreader:Parsing [stabilizer.json] WARNING:cflib.crazyflie.toc:Unable to find variable [supervisor.info] INFO:cflib.crazyflie.log:Have successfully started logging for id=1 INFO:cflib.crazyflie.log:Have successfully started logging for id=19 INFO:cflib.crazyflie.log:Have successfully started logging for id=20 INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cflib.crazyflie:All parameters updated INFO:cflib.crazyflie:Callback->Connection completed [udp://192.168.43.42:2390] INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:root:SIGINT received, exiting ... INFO:cfclient.utils.config:Config file saved to [C:\Users\jayte.HP-PAVILION\AppData\Local\Bitcraze\cfclient/config.json] INFO:cflib.crazyflie:Closing link INFO:cfclient.utils.input.inputreaders.pysdl2:Looking for devices INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices INFO:cflib.crazyflie:Callback->Disconnected from [udp://192.168.43.42:2390]