User Tools

Site Tools


howto:pyduml

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:pyduml [2017/07/16 01:51]
czokie
howto:pyduml [2017/08/21 17:52] (current)
nils [4. Identify the port for the USB link to your aircraft]
Line 21: Line 21:
  
 ===== 3. Get some firmware ===== ===== 3. Get some firmware =====
-If you are planning to flash new firmware, you obviously need some firmware files. I am not going to publish where to find this here... If you are familiar with the right places, get your files... possibly in #archived_fw_flashing or from git source+If you are planning to flash new firmware, you obviously need some firmware files. The primary source is http://github.com/MAVProxyUser/dji_system.bin ... or, you can go to [[.:firmware]] for listing of what is available
  
 +**NOTE for Spark RC**: Firmware for Spark RC have the ending ".tar" as the Spark RC is quite different from the other devices (also how to flash, see below, skip to bottom of (4.) to see next Spark RC note...)
 ===== 4. Identify the port for the USB link to your aircraft ===== ===== 4. Identify the port for the USB link to your aircraft =====
 This step will find the TTY for connectivity to your aircraft, and store it in a file /tmp/dji.port for use later. This step will find the TTY for connectivity to your aircraft, and store it in a file /tmp/dji.port for use later.
Line 28: Line 29:
   * Power on your aircraft   * Power on your aircraft
   * Connect USB from your computer to your aircraft   * Connect USB from your computer to your aircraft
 +  * If you're using windows, check in device manager for the port (assistant 2 must be installed for drivers) then skip to step 5.
   * Open a terminal window   * Open a terminal window
  
 +<code>
   ls /dev/tty* | sed -e "s#.*/##g" > /tmp/dji.on   ls /dev/tty* | sed -e "s#.*/##g" > /tmp/dji.on
 +</code>
   * Disconnect the USB cable   * Disconnect the USB cable
 +<code>
   ls /dev/tty* | sed -e "s#.*/##g" > /tmp/dji.off   ls /dev/tty* | sed -e "s#.*/##g" > /tmp/dji.off
 +</code>
   * Now find what is our tty port for the aircraft   * Now find what is our tty port for the aircraft
 +<code>
   diff /tmp/dji.on /tmp/dji.off | grep "<" | sed -e "s/.* //" > /tmp/dji.port   diff /tmp/dji.on /tmp/dji.off | grep "<" | sed -e "s/.* //" > /tmp/dji.port
   rm /tmp/dji.on /tmp/dji.off   rm /tmp/dji.on /tmp/dji.off
   cat /tmp/dji.port   cat /tmp/dji.port
 +</code>
  
 +**NOTE for Spark RC**: Please skip above and just switch on RC and connect your Mac/PC to its WiFi network as a preparation. Also see notes for Spark RC in section (5.) 
 ===== 5. Flashing ===== ===== 5. Flashing =====
 FULLY CHARGE A BATTERY!!! do not try to flash with a depleted battery - itʼll only end in tears and a dead aircraft. If you aren't interested in changing firmware and you just want to get root access, skip ahead to the next step. FULLY CHARGE A BATTERY!!! do not try to flash with a depleted battery - itʼll only end in tears and a dead aircraft. If you aren't interested in changing firmware and you just want to get root access, skip ahead to the next step.
Line 48: Line 52:
   * Put the firmware into the same folder as pyduml.py - ~/Documents/pyduml   * Put the firmware into the same folder as pyduml.py - ~/Documents/pyduml
  
-  * Open a terminal window and go to our directory+  * Open a terminal window/command prompt and go to our directory
  
 +<code>
   cd ~/Documents/pyduml   cd ~/Documents/pyduml
 +</code>
   * Prepare our package for delivery - Rename the firmware   * Prepare our package for delivery - Rename the firmware
 +<code>
   cp <yourfirmwarename> dji_system.bin   cp <yourfirmwarename> dji_system.bin
 +</code> 
 +**NOTE for Spark RC**: 
 +<code> 
 +  #ONLY do this if flashing a Spark RC 
 +  cp <yourSparkRCfirmwarename.tar> fw.tar 
 +</code>
   * For example...   * For example...
- +<code> 
-  cp V01.03.0700_Mavic_dji_system dji_system.bin +  cp V01.03.0700_Mavic_dji_system.bin dji_system.bin 
 +</code> 
 +If your on windows substitute 'copy' for 'cp' 
 +<code> 
 +  copy V01.03.0700_Mavic_dji_system.bin dji_system.bin 
 +</code>
   * Deliver the package   * Deliver the package
 +<code>
   python pyduml.py /dev/`cat /tmp/dji.port`   python pyduml.py /dev/`cat /tmp/dji.port`
 +</code>  
 +**NOTE for Spark RC**: No additional Parameters needed, just choose the Spark RC as device when prompted...
 +<code>
 +  #ONLY do this if flashing a Spark RC
 +  python pyduml.py
 +</code>  
 +For windows users:
 +  python pyduml.py com#:
 +where # is the comport number you discovered in device manager.
  
-Flashing takes around 10 minutes. Watch the lights on the aircraft. It may reboot during the procedure but donʼt touch it. Once it chimes and the front beacons stop flashing, its done. Be patient - 10 minutes seems like an awfully long time, but you donʼt get a progress bar like when you flash with assistant.+Flashing takes around 10 minutes. Watch the lights on the aircraft. It may reboot during the procedure but donʼt touch it. Once it chimes and the front beacons stop flashing, its done. Be patient - 10 minutes seems like an awfully long time, but you donʼt get a pretty progress bar like when you flash with assistant.
  
 Do not disconnect the drone when the script says its finished - thats only the upload portion! The flashing process follows and its a good idea to leave it all alone until you hear the chimes. Do not disconnect the drone when the script says its finished - thats only the upload portion! The flashing process follows and its a good idea to leave it all alone until you hear the chimes.
  
 Want to watch the process? if you have root, you can issue the following commands in a second terminal session: Want to watch the process? if you have root, you can issue the following commands in a second terminal session:
- +  * monitor progress with terminal if you already have root: 
- * monitor progress with terminal if you already have root: +<code> 
- +  adb shell 
-   adb shell +  busybox tail -f /ftp/upgrade/dji/log/upgrade00.log 
-   busybox tail -f /ftp/upgrade/dji/log/upgrade00.log +</code>
   * Remove temporary file from the firmware upload that we created before   * Remove temporary file from the firmware upload that we created before
 +<code>
   rm dji_system.bin   rm dji_system.bin
 +</code> 
 +Windows users can simply del the file
 +<code>
 +  del dji_system.bin
 +</code>
  
 +The optional batteries then can upgraded/downgraded simply by inserting them in the aircraft and connecting to the Assistant, letting it detect and fix any discrepancy in the versions.
 ===== 6. Rooting ===== ===== 6. Rooting =====
- 
- 
   * Prepare our package for delivery   * Prepare our package for delivery
  
   cp fireworks.tar dji_system.bin   cp fireworks.tar dji_system.bin
 +Windows users: 
 +<code> 
 +  copy fireworks.tar dji_system.bin 
 +</code>  
   * Deliver the package   * Deliver the package
- +<code> 
-  python pyduml.py /dev/`cat /tmp/dji.port`+   python pyduml.py /dev/`cat /tmp/dji.port` 
 +</code> 
 +Windows users: 
 +  python pyduml.py com#:
  
   * Remove temporary file   * Remove temporary file
  
   rm dji_system.bin   rm dji_system.bin
 +
 +windows users:
 +  del dji_system.bin
  
 ===== 7. Open a shell ===== ===== 7. Open a shell =====
Line 113: Line 147:
 ===== Credits ===== ===== Credits =====
   * This FAQ was compiled based on work by vk2fro, and Dreadwing007.   * This FAQ was compiled based on work by vk2fro, and Dreadwing007.
-  * Of course, we have to thank hdnes for his work, and hostile for all of his work too, not to mention the_lord for all his help as well.+  * Of course, we have to thank hdnes for his work, and hostile for all of his work too, not to mention the_lord for all his help as well. hdnes is also our hero for helping out and getting pyduml to work. Not to mention darkwing007 who collaborated with vk2fro to get the linux portion working.
      
howto/pyduml.1500169889.txt.gz · Last modified: 2017/07/16 01:51 by czokie