Kind of a dumb question but how exactly can I take the scripts/missions that we created in the “Drone Programming Primer” course and apply them to my F450 drone that I built in “How to build a raspberry pi drone”?
I’m only familiar with using Putty to ssh into my raspberry pi drone, but I want to be able to run an autonomous mission via a python code like we did in the “autonomous dronekit mission with AUTO mode”.
Thanks. I noticed in the 9:33 mark of that video he has established connection through his Ubuntu environment to the RPI drone and runs the takeoff and land script that way. Do you happen to know how that is done?
That was done by SSH’ing to the Raspberry Pi on the drone from an Ubuntu laptop. It’s like the same PuTTy process done on windows just on an Ubuntu machine.
The way you would run scripts from the Drone Programming Primer on a real drone would be to:
Write the scripts onto the Raspberry Pi of the drone
Call the scripts via some sort of SSH connection from a Laptop -> To the Raspberry Pi
Step two can be a bit tricky if you aren’t close to a WiFi source you have access to. In that video, both my drone and my laptop were connected to my home WiFi network so no special network configurations were needed.
@Jspatafore49 Check out how to create an ad hoc network. @caleberg Could you clarify advantages/disadvantages of using adhoc vs radio telemetry/UART in the field when using QGC/Mission Planner and ssh to the scripts?
Okay thank you @caleberg and @jax200. I didn’t realize you could SSH into the drone from the Ubuntu platform. I thought PuTTy had to be involved from a windows platform.
Link timeout, no heartbeat in last 5 seconds
No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File “takeoff_and_land.py”, line 55, in
vehicle=connectMyCopter()
File “takeoff_and_land.py”, line 19, in connectMyCopter
vehicle = connect(connection_string, wait_ready=True)
File “/home/pi/.local/lib/python2.7/site-packages/dronekit/init.py”, line 2845, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/home/pi/.local/lib/python2.7/site-packages/dronekit/init.py”, line 2117, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection.
I’ve seen another thread on the forum with people having this issue, and it seemed the solution was to update ArduCopter to 4.0? I believe I am running 3.5.
Try searching the forum for “heartbeat” and a number of cases will appear. This one might be of interest: “Connect() Link timeout, no heartbeat in last 5 seconds”.
Try searching on “version” and " IMPORTANT NOTE ON NAVIO2 ARDUPILOT VERSION".