ArduPilot / apm_planner

APM Planner Ground Control Station (Qt)
https://ardupilot.org
Other
507 stars 464 forks source link

Unable to flash pixhawk (recognize it other than in the serial port information) #835

Closed AndKe closed 8 years ago

AndKe commented 8 years ago

Ubuntu 15.10 + AP 2.0.19-rc4 (current master) Unable to upload firmware to any pixhawk (thought at first it was blank/new pixhawks only)

this is what I see: screenshot from 2015-11-10 18-37-19

This (contradicting) text appears below if I click "stable"
screenshot from 2015-11-10 20-06-12

and this is what I see when trying to upload "custom" firmware (after selecting firmware, no instructions to dis/reconnect pixhawk is given, and the progress bar is going nowhere.) screenshot from 2015-11-10 18-40-43

In earlier versions/before, flashing was not a problem. Tested on three computers, with four different Pixhawks (what I had at hand at office/home+laptop) - all are real 3DR products. There is no problem connecting to the Pixhawks using USB Log: (strangely many "inserting" lines, but ttyACM0 seems steady in GUI) DEBUG 2015-11-10T20:05:56.774 "retrieve versionobject from server: http://firmware.diydrones.com/Tools/APMPlanner/apm_planner_version.json" DEBUG 2015-11-10T20:05:57.152 Downloading: 2815 / 2815 DEBUG 2015-11-10T20:05:57.153 Downloading: 2815 / 2815 DEBUG 2015-11-10T20:05:57.153 AutoUpdateCheck::httpFinished() DEBUG 2015-11-10T20:05:57.273 Requesting firmware: "stable" "" ERROR 2015-11-10T20:05:57.275 Unknown autopilot in ApmFirmwareConfig::requestFirmwares() "" DEBUG 2015-11-10T20:05:57.387 Inserting "ttyS4" DEBUG 2015-11-10T20:05:57.387 Inserting "ttyACM0" DEBUG 2015-11-10T20:05:57.388 Inserting "ttyS0" DEBUG 2015-11-10T20:05:59.387 Inserting "ttyS4" DEBUG 2015-11-10T20:05:59.387 Inserting "ttyACM0" DEBUG 2015-11-10T20:05:59.388 Inserting "ttyS0" DEBUG 2015-11-10T20:06:01.387 Inserting "ttyS4" DEBUG 2015-11-10T20:06:01.388 Inserting "ttyACM0" DEBUG 2015-11-10T20:06:01.388 Inserting "ttyS0" DEBUG 2015-11-10T20:06:03.387 Inserting "ttyS4" DEBUG 2015-11-10T20:06:03.388 Inserting "ttyACM0" DEBUG 2015-11-10T20:06:03.388 Inserting "ttyS0" DEBUG 2015-11-10T20:06:05.386 Inserting "ttyS4" DEBUG 2015-11-10T20:06:05.386 Inserting "ttyACM0"

AndKe commented 8 years ago

the problem is with variable "autopilot" being empty: logline DEBUG 2015-11-10T20:05:57.273 Requesting firmware: "stable" "" is supposed to contain "autopilot" QLOG_DEBUG() << "Requesting firmware:" << type << autopilot; this variable is used to detect which firmware to request.

billbonney commented 8 years ago

You have a radio connected at the same time?

AndKe commented 8 years ago

nope - this are new pixhawks, (never flashed, and some programmed before) - no thing plugged ito them, no other ttyUSB or ttyACM devices on the computer(s)

billbonney commented 8 years ago

That's what I means, what's plugged into the computer. AP2 looks like its reading a port that is not a PH, and then get confused. with only a PH connected it should flash correctly

AndKe commented 8 years ago

not sure what you mean there, I just wrote that there are no ttyACM* or ttyUSB* connected (except of one pixhawk at a time) ttyACM0 pops up correctly every time pixhawk is connected, and is correctly described on the right side as "PX4 FMU 2.x 3D Robotics" - yet ,the mentioned variable is empty, and device "unrecognised"

billbonney commented 8 years ago

Sorry, trying to do too many things at the sametime ;)

I need to test this on linux, It works as expected on OSX, and I am not near my Linux machine at the moment.

AndKe commented 8 years ago

were you able to reproduce it ?

billbonney commented 8 years ago

I looked at it and the Pixhawk now reports the product Identifier as 0x27CA on linux. I'll post a fix.

billbonney commented 8 years ago

This should fix it, but I am not sure why the product identifier has changed https://github.com/diydrones/apm_planner/commit/16489dd112b498ae79b31eb993723d7fa69b3db1

AndKe commented 8 years ago

sorry to say, a clean build of (16489dd1-2.0.19-rc4-19-g16489dd) still does not work

DEBUG 2015-11-26T14:08:32.335 Requesting firmware: "stable" "" 
AndKe commented 8 years ago

new comment just so you "discover" it. I've added some debugging, and found that Detected: 7718 "PX4 FMU v2.x"

7718d , (0x1E26) -while you see 0x27CA
so I tried same Pixhawk on another system (same Ubuntu) sees 7206d - also , same number while bootloader or booted.

The productIdentifier is 100% reproducible, no amount of plugging/unplugging changes them , While the real VID/PID from lsusb shows always 26ac:0011 - on both systems... during boot or operation. So if productidentifier is meant to show PID, (which is apparently normal) could this be some bizzare Qt bug ?

One workaround would be to check for "FMU v2.x" (same for BL or not) - testing now will submit a PR if it works as I expect

AndKe commented 8 years ago

confirmed solved on two different systems (seee above) with this fix https://github.com/diydrones/apm_planner/pull/840

billbonney commented 8 years ago

Yep. Looks like some Qt bug. I'll merger your fix later today. Thx

billbonney commented 8 years ago

Fixed with https://github.com/diydrones/apm_planner/commit/98c08f19d30dcebc366f91e27130a8e6da4de369