Browse Source

Drone fin

master
Your Name 4 years ago
parent
commit
d93f6d32dd
20 changed files with 1345 additions and 0 deletions
  1. BIN
      Phantom3Standard_BadCamera/data/UART_pin5
  2. BIN
      Phantom3Standard_BadCamera/data/UART_pin7
  3. BIN
      Phantom3Standard_BadCamera/data/i2c_phantom_export.csv
  4. +172
    -0
      Phantom3Standard_BadCamera/data/i2c_phantom_to_gimbal_board_uart_sample
  5. +116
    -0
      Phantom3Standard_BadCamera/data/i2c_phantom_to_gimbal_board_uart_sample2
  6. BIN
      Phantom3Standard_BadCamera/docs/10.pdf
  7. +181
    -0
      Phantom3Standard_BadCamera/docs/10.tex
  8. +17
    -0
      Phantom3Standard_BadCamera/docs/4.tex
  9. +162
    -0
      Phantom3Standard_BadCamera/docs/5.tex
  10. BIN
      Phantom3Standard_BadCamera/docs/6.pdf
  11. +164
    -0
      Phantom3Standard_BadCamera/docs/6.tex
  12. +172
    -0
      Phantom3Standard_BadCamera/docs/7.tex
  13. +180
    -0
      Phantom3Standard_BadCamera/docs/8.tex
  14. +181
    -0
      Phantom3Standard_BadCamera/docs/9.tex
  15. BIN
      Phantom3Standard_BadCamera/pics/Ols-cover.jpg
  16. BIN
      Phantom3Standard_BadCamera/pics/drone_to_gimbal_sample_uart.png
  17. BIN
      Phantom3Standard_BadCamera/pics/logic_analyze_i2c_decode.png
  18. BIN
      Phantom3Standard_BadCamera/pics/logic_analyze_i2c_decode2.png
  19. BIN
      Phantom3Standard_BadCamera/pics/logic_analyze_i2c_phantom.png
  20. BIN
      Phantom3Standard_BadCamera/pics/ols_limited_sampling_spi_snapshot.png

BIN
Phantom3Standard_BadCamera/data/UART_pin5 View File


BIN
Phantom3Standard_BadCamera/data/UART_pin7 View File


BIN
Phantom3Standard_BadCamera/data/i2c_phantom_export.csv View File


+ 172
- 0
Phantom3Standard_BadCamera/data/i2c_phantom_to_gimbal_board_uart_sample View File

@ -0,0 +1,172 @@
"index","start-time","end-time","event?","event-type","RxD event","TxD event","RxD data","TxD data"
"0","430.00 μs","490.50 μs","false","","","","85",""
"1","525.50 μs","577.50 μs","false","","","","51",""
"2","605.50 μs","664.50 μs","false","","","","4",""
"3","638.50 μs","707.50 μs","false","","","","","85"
"4","690.00 μs","759.50 μs","false","","","","194",""
"5","734.00 μs","794.50 μs","false","","","","","47"
"6","769.00 μs","838.00 μs","false","","","","3",""
"7","829.00 μs","881.50 μs","false","","","","","4"
"8","873.00 μs","925.00 μs","false","","","","4",""
"9","916.00 μs","968.00 μs","false","","","","","99"
"10","943.50 μs","1.02 ms","false","","","","175",""
"11","986.00 μs","1.06 ms","false","","","","","3"
"12","1.05 ms","1.10 ms","false","","","","4",""
"13","1.08 ms","1.14 ms","false","","","","","2"
"14","1.14 ms","1.19 ms","false","","","","0",""
"15","1.19 ms","1.23 ms","false","","","","","23"
"16","1.22 ms","1.27 ms","false","","","","3",""
"17","1.27 ms","1.32 ms","false","","","","","0"
"18","1.30 ms","1.36 ms","false","","","","66",""
"19","1.34 ms","1.40 ms","false","","","","","0"
"20","1.39 ms","1.45 ms","false","","","","77",""
"21","1.43 ms","1.49 ms","false","","","","","3"
"22","1.48 ms","1.53 ms","false","","","","156",""
"23","1.51 ms","1.58 ms","false","","","","","68"
"24","1.56 ms","1.62 ms","false","","","","56",""
"25","1.60 ms","1.66 ms","false","","","","","0"
"26","1.66 ms","1.71 ms","false","","","","63",""
"27","1.69 ms","1.75 ms","false","","","","","0"
"28","1.74 ms","1.80 ms","false","","","","164",""
"29","1.78 ms","1.84 ms","false","","","","","0"
"30","1.84 ms","1.88 ms","false","","","","95",""
"31","1.85 ms","1.92 ms","false","","","","","0"
"32","1.91 ms","1.98 ms","false","","","","246",""
"33","1.98 ms","2.01 ms","false","","","","","0"
"34","1.99 ms","2.05 ms","false","","","","62",""
"35","2.04 ms","2.10 ms","false","","","","","106"
"36","2.09 ms","2.14 ms","false","","","","47",""
"37","2.12 ms","2.18 ms","false","","","","","40"
"38","2.17 ms","2.23 ms","false","","","","30",""
"39","2.21 ms","2.27 ms","false","","","","","65"
"40","2.25 ms","2.32 ms","false","","","","141",""
"41","2.31 ms","2.36 ms","false","","","","","0"
"42","2.34 ms","2.40 ms","false","","","","62",""
"43","2.38 ms","2.45 ms","false","","","","","0"
"44","2.43 ms","2.50 ms","false","","","","182",""
"45","2.47 ms","2.53 ms","false","","","","","0"
"46","2.51 ms","2.58 ms","false","","","","157",""
"47","2.55 ms","2.62 ms","false","","","","","0"
"48","2.61 ms","2.67 ms","false","","","","212",""
"49","2.64 ms","2.71 ms","false","","","","","0"
"50","2.69 ms","2.75 ms","false","","","","62",""
"51","2.73 ms","2.79 ms","false","","","","","106"
"52","2.78 ms","2.84 ms","false","","","","0",""
"53","2.84 ms","2.88 ms","false","","","","","40"
"54","2.86 ms","2.92 ms","false","","","","0",""
"55","2.91 ms","2.97 ms","false","","","","","65"
"56","2.95 ms","3.01 ms","false","","","","128",""
"57","2.99 ms","3.05 ms","false","","","","","118"
"58","3.04 ms","3.10 ms","false","","","","63",""
"59","3.08 ms","3.15 ms","false","","","","","176"
"60","3.12 ms","3.18 ms","false","","","","0",""
"61","3.18 ms","3.24 ms","false","","","","","168"
"62","3.21 ms","3.27 ms","false","","","","0",""
"63","3.25 ms","3.32 ms","false","","","","","194"
"64","3.30 ms","3.36 ms","false","","","","0",""
"65","3.34 ms","3.40 ms","false","","","","","6"
"66","3.40 ms","3.44 ms","false","","","","0",""
"67","3.44 ms","3.49 ms","false","","","","","32"
"68","3.47 ms","3.53 ms","false","","","","0",""
"69","3.51 ms","3.57 ms","false","","","","","30"
"70","3.57 ms","3.62 ms","false","","","","0",""
"71","3.62 ms","3.66 ms","false","","","","","0"
"72","3.66 ms","3.71 ms","false","","","","0",""
"73","3.71 ms","3.75 ms","false","","","","","0"
"74","3.75 ms","3.79 ms","false","","","","0",""
"75","3.79 ms","3.84 ms","false","","","","","0"
"76","3.84 ms","3.88 ms","false","","","","0",""
"77","3.88 ms","3.92 ms","false","","","","","0"
"78","3.92 ms","3.97 ms","false","","","","0",""
"79","3.95 ms","4.01 ms","false","","","","","30"
"80","4.01 ms","4.05 ms","false","","","","0",""
"81","4.05 ms","4.10 ms","false","","","","","0"
"82","4.10 ms","4.14 ms","false","","","","0",""
"83","4.14 ms","4.18 ms","false","","","","","0"
"84","4.18 ms","4.23 ms","false","","","","0",""
"85","4.23 ms","4.27 ms","false","","","","","48"
"86","4.25 ms","4.31 ms","false","","","","0",""
"87","4.31 ms","4.36 ms","false","","","","","0"
"88","4.36 ms","4.40 ms","false","","","","0",""
"89","4.40 ms","4.44 ms","false","","","","","0"
"90","4.44 ms","4.49 ms","false","","","","0",""
"91","4.49 ms","4.53 ms","false","","","","","0"
"92","4.53 ms","4.57 ms","false","","","","0",""
"93","4.56 ms","4.62 ms","false","","","","","76"
"94","4.60 ms","4.66 ms","false","","","","0",""
"95","4.65 ms","4.70 ms","false","","","","","99"
"96","4.69 ms","4.75 ms","false","","","","9",""
"97","4.73 ms","4.79 ms","false","","","","","85"
"98","4.77 ms","4.83 ms","false","","","","80",""
"99","4.81 ms","4.88 ms","false","","","","","14"
"100","4.86 ms","4.92 ms","false","","","","85",""
"101","4.90 ms","4.96 ms","false","","","","","4"
"102","4.96 ms","5.01 ms","false","","","","47",""
"103","4.98 ms","5.05 ms","false","","","","","102"
"104","5.04 ms","5.10 ms","false","","","","4",""
"105","5.09 ms","5.14 ms","false","","","","","3"
"106","5.13 ms","5.18 ms","false","","","","99",""
"107","5.16 ms","5.23 ms","false","","","","","2"
"108","5.21 ms","5.27 ms","false","","","","9",""
"109","5.25 ms","5.31 ms","false","","","","","54"
"110","5.29 ms","5.36 ms","false","","","","1",""
"111","5.36 ms","5.40 ms","false","","","","","0"
"112","5.40 ms","5.44 ms","false","","","","23",""
"113","5.42 ms","5.49 ms","false","","","","","0"
"114","5.49 ms","5.53 ms","false","","","","0",""
"115","5.52 ms","5.57 ms","false","","","","","3"
"116","5.57 ms","5.62 ms","false","","","","0",""
"117","5.60 ms","5.66 ms","false","","","","","50"
"118","5.64 ms","5.70 ms","false","","","","9",""
"119","5.70 ms","5.75 ms","false","","","","","39"
"120","5.73 ms","5.79 ms","false","","","","2",""
"121","5.77 ms","5.83 ms","false","","","","","14"
"122","5.83 ms","5.88 ms","false","","","","0",""
"123","5.87 ms","5.92 ms","false","","","","","12"
"124","5.92 ms","5.96 ms","false","","","","0",""
"125","6.05 ms","6.05 ms","false","","","","0",""
"126","6.14 ms","6.14 ms","false","","","","0",""
"127","6.22 ms","6.22 ms","false","","","","0",""
"128","6.25 ms","6.31 ms","false","","","","106",""
"129","6.35 ms","6.40 ms","false","","","","40",""
"130","6.42 ms","6.49 ms","false","","","","65",""
"131","6.57 ms","6.57 ms","false","","","","0",""
"132","6.66 ms","6.66 ms","false","","","","0",""
"133","6.75 ms","6.75 ms","false","","","","0",""
"134","6.83 ms","6.83 ms","false","","","","0",""
"135","6.92 ms","6.92 ms","false","","","","0",""
"136","6.95 ms","7.01 ms","false","","","","106",""
"137","7.05 ms","7.09 ms","false","","","","40",""
"138","7.12 ms","7.18 ms","false","","","","65",""
"139","7.21 ms","7.27 ms","false","","","","118",""
"140","7.32 ms","7.36 ms","false","","","","176",""
"141","7.40 ms","7.45 ms","false","","","","168",""
"142","7.47 ms","7.54 ms","false","","","","194",""
"143","7.55 ms","7.61 ms","false","","","","6",""
"144","7.68 ms","7.70 ms","false","","","","32",""
"145","7.73 ms","7.79 ms","false","","","","30",""
"146","7.88 ms","7.88 ms","false","","","","0",""
"147","7.96 ms","7.96 ms","false","","","","0",""
"148","8.05 ms","8.05 ms","false","","","","0",""
"149","8.14 ms","8.14 ms","false","","","","0",""
"150","8.16 ms","8.22 ms","false","","","","30",""
"151","8.31 ms","8.31 ms","false","","","","0",""
"152","8.40 ms","8.40 ms","false","","","","0",""
"153","8.45 ms","8.48 ms","false","","","","48",""
"154","8.57 ms","8.57 ms","false","","","","0",""
"155","8.66 ms","8.66 ms","false","","","","0",""
"156","8.74 ms","8.74 ms","false","","","","0",""
"157","8.77 ms","8.83 ms","false","","","","6",""
"158","8.88 ms","8.98 ms","false","","","","240",""
"159","11.25 ms","11.31 ms","false","","","","85",""
"160","11.33 ms","11.40 ms","false","","","","21",""
"161","11.43 ms","11.48 ms","false","","","","4",""
"162","11.51 ms","11.58 ms","false","","","","169",""
"163","11.60 ms","11.66 ms","false","","","","9",""
"164","11.69 ms","11.74 ms","false","","","","4",""
"165","11.79 ms","11.83 ms","false","","","","88",""
"166","11.86 ms","11.92 ms","false","","","","2",""
"167","12.00 ms","12.00 ms","false","","","","0",""
"168","12.04 ms","12.09 ms","false","","","","4",""
"169","12.12 ms","12.18 ms","false","","","","6",""
"170","12.26 ms","12.26 ms","false","","","","0",""

+ 116
- 0
Phantom3Standard_BadCamera/data/i2c_phantom_to_gimbal_board_uart_sample2 View File

@ -0,0 +1,116 @@
"index","start-time","end-time","event?","event-type","RxD event","TxD event","RxD data","TxD data"
"0","3.34 ms","3.40 ms","false","","","","85",""
"1","3.44 ms","3.49 ms","false","","","","51",""
"2","3.52 ms","3.58 ms","false","","","","4",""
"3","3.53 ms","3.60 ms","false","","","","","85"
"4","3.60 ms","3.67 ms","false","","","","194",""
"5","3.63 ms","3.69 ms","false","","","","","43"
"6","3.69 ms","3.75 ms","false","","","","3",""
"7","3.72 ms","3.77 ms","false","","","","","4"
"8","3.77 ms","3.84 ms","false","","","","4",""
"9","3.79 ms","3.86 ms","false","","","","","88"
"10","3.86 ms","3.92 ms","false","","","","127",""
"11","3.90 ms","3.95 ms","false","","","","","3"
"12","3.95 ms","4.01 ms","false","","","","120",""
"13","3.97 ms","4.03 ms","false","","","","","2"
"14","4.03 ms","4.10 ms","false","","","","0",""
"15","4.07 ms","4.12 ms","false","","","","","108"
"16","4.12 ms","4.18 ms","false","","","","3",""
"17","4.15 ms","4.21 ms","false","","","","","2"
"18","4.21 ms","4.27 ms","false","","","","66",""
"19","4.25 ms","4.30 ms","false","","","","","0"
"20","4.30 ms","4.37 ms","false","","","","160",""
"21","4.33 ms","4.38 ms","false","","","","","3"
"22","4.38 ms","4.45 ms","false","","","","196",""
"23","4.40 ms","4.47 ms","false","","","","","81"
"24","4.47 ms","4.53 ms","false","","","","56",""
"25","4.49 ms","4.56 ms","false","","","","","0"
"26","4.56 ms","4.62 ms","false","","","","63",""
"27","4.60 ms","4.64 ms","false","","","","","0"
"28","4.64 ms","4.71 ms","false","","","","149",""
"29","4.66 ms","4.73 ms","false","","","","","0"
"30","4.73 ms","4.79 ms","false","","","","24",""
"31","4.75 ms","4.82 ms","false","","","","","0"
"32","4.82 ms","4.89 ms","false","","","","246",""
"33","4.84 ms","4.90 ms","false","","","","","0"
"34","4.90 ms","4.97 ms","false","","","","62",""
"35","4.95 ms","4.99 ms","false","","","","","0"
"36","4.99 ms","5.06 ms","false","","","","145",""
"37","5.02 ms","5.08 ms","false","","","","","15"
"38","5.08 ms","5.15 ms","false","","","","227",""
"39","5.11 ms","5.16 ms","false","","","","","0"
"40","5.16 ms","5.24 ms","false","","","","140",""
"41","5.19 ms","5.25 ms","false","","","","","10"
"42","5.25 ms","5.31 ms","false","","","","62",""
"43","5.30 ms","5.34 ms","false","","","","","0"
"44","5.34 ms","5.41 ms","false","","","","195",""
"45","5.38 ms","5.42 ms","false","","","","","0"
"46","5.42 ms","5.50 ms","false","","","","138",""
"47","5.44 ms","5.51 ms","false","","","","","0"
"48","5.51 ms","5.58 ms","false","","","","212",""
"49","5.53 ms","5.60 ms","false","","","","","0"
"50","5.60 ms","5.66 ms","false","","","","62",""
"51","5.64 ms","5.69 ms","false","","","","","0"
"52","5.69 ms","5.75 ms","false","","","","0",""
"53","5.75 ms","5.77 ms","false","","","","","0"
"54","5.77 ms","5.84 ms","false","","","","0",""
"55","5.84 ms","5.86 ms","false","","","","","0"
"56","5.86 ms","5.93 ms","false","","","","128",""
"57","5.91 ms","5.95 ms","false","","","","","0"
"58","5.95 ms","6.01 ms","false","","","","63",""
"59","5.99 ms","6.03 ms","false","","","","","0"
"60","6.03 ms","6.10 ms","false","","","","0",""
"61","6.10 ms","6.12 ms","false","","","","","0"
"62","6.12 ms","6.18 ms","false","","","","0",""
"63","6.18 ms","6.21 ms","false","","","","","0"
"64","6.21 ms","6.27 ms","false","","","","0",""
"65","6.27 ms","6.29 ms","false","","","","","0"
"66","6.29 ms","6.36 ms","false","","","","0",""
"67","6.36 ms","6.38 ms","false","","","","","0"
"68","6.38 ms","6.44 ms","false","","","","0",""
"69","6.44 ms","6.47 ms","false","","","","","0"
"70","6.47 ms","6.53 ms","false","","","","0",""
"71","6.53 ms","6.55 ms","false","","","","","0"
"72","6.55 ms","6.62 ms","false","","","","0",""
"73","6.58 ms","6.65 ms","false","","","","","254"
"74","6.65 ms","6.70 ms","false","","","","0",""
"75","6.67 ms","6.73 ms","false","","","","","66"
"76","6.73 ms","6.79 ms","false","","","","0",""
"77","6.76 ms","6.81 ms","false","","","","","91"
"78","6.81 ms","6.88 ms","false","","","","0",""
"79","6.84 ms","6.90 ms","false","","","","","30"
"80","6.90 ms","6.96 ms","false","","","","0",""
"81","6.93 ms","7.00 ms","false","","","","","138"
"82","7.00 ms","7.05 ms","false","","","","0",""
"83","7.02 ms","7.07 ms","false","","","","","100"
"84","7.07 ms","7.14 ms","false","","","","0",""
"85","7.10 ms","7.17 ms","false","","","","","198"
"86","7.17 ms","7.23 ms","false","","","","0",""
"87","7.19 ms","7.25 ms","false","","","","","29"
"88","7.25 ms","7.31 ms","false","","","","0",""
"89","7.40 ms","7.40 ms","false","","","","0",""
"90","7.49 ms","7.49 ms","false","","","","0",""
"91","7.57 ms","7.57 ms","false","","","","0",""
"92","7.62 ms","7.66 ms","false","","","","48",""
"93","7.70 ms","7.75 ms","false","","","","87",""
"94","7.77 ms","7.83 ms","false","","","","85",""
"95","7.86 ms","7.92 ms","false","","","","21",""
"96","7.96 ms","8.01 ms","false","","","","4",""
"97","8.03 ms","8.10 ms","false","","","","169",""
"98","8.12 ms","8.18 ms","false","","","","9",""
"99","8.22 ms","8.27 ms","false","","","","4",""
"100","8.29 ms","8.35 ms","false","","","","63",""
"101","8.39 ms","8.44 ms","false","","","","60",""
"102","8.51 ms","8.53 ms","false","","","","64",""
"103","8.56 ms","8.61 ms","false","","","","4",""
"104","8.64 ms","8.70 ms","false","","","","1",""
"105","8.79 ms","8.79 ms","false","","","","0",""
"106","8.82 ms","8.88 ms","false","","","","4",""
"107","8.90 ms","8.96 ms","false","","","","0",""
"108","8.99 ms","9.05 ms","false","","","","4",""
"109","9.07 ms","9.14 ms","false","","","","0",""
"110","9.17 ms","9.22 ms","false","","","","4",""
"111","9.31 ms","9.31 ms","false","","","","0",""
"112","9.40 ms","9.40 ms","false","","","","0",""
"113","9.41 ms","9.48 ms","false","","","","98",""
"114","9.51 ms","12.29 ms","false","","","","229",""

BIN
Phantom3Standard_BadCamera/docs/10.pdf View File


+ 181
- 0
Phantom3Standard_BadCamera/docs/10.tex View File

@ -0,0 +1,181 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Let's try a Logic Analyzer}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit already. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 8 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test of the gimbal, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\subsection{Drone Mobile App}
Looking at the drone in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\begin{center}
\includegraphics[scale=0.5]{../pics/Ols-cover.jpg}
\captionof{figure}{Open Bench Logic Sniffer}
\end{center}
\subsubsection{Open Bench Logic Sniffer}
The Open Bench Logic Sniffer is the first result that comes up when you search for Open Source Logic Analyzer. It's from 2010 by Dangerous Prototypes whom also made the Bus Pirate.
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, about as good as the cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the program. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage. Again, the lower the sampling rate, the longer the sample.
\end{itemize}
Everything should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.\footnote{Although export is limited, which I will get to.}
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be I2C, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{I2C Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. In defenes of the Logic Analyzer, it is still good for what it is. Perhaps if development hadn't stopped, they would've been able to fully develop the missing features.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\subsection{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
\subsubsection{Confirming Baudrate from an oscilloscope}
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://
reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\subsection{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see in a project like this:
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking. Tell the whole story.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
%In defense of the Open Bench Logic Sniffer, how do I get the source code, a small FPGA, and put my own logic sniffer into my product? Something to try.
\subsection{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
As a concluding note, I gave it a try, and I made some progress, but no cigar here. I can always try again later.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\vspace{0.2in}
http://web.archive.org/web/https:/
/reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

+ 17
- 0
Phantom3Standard_BadCamera/docs/4.tex View File

@ -65,6 +65,23 @@ I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be synchronous SPI, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{SPI Decode}
The pins on the board indicate SDI, which is a SPI pin. Using the Open Logic Sniffer, at 1MHz speed, I am able to get 24ms of sampling. Unfortunately, this is not enough to read more than one packet. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get SPI decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new SPI decode window. The workflow, needs work. Ideally, I could capture, and re-analyze in the SPI window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Let's tap into the 10 pins from the main board while we have the drone on the bench though.
\section{Tapping into Main Wires}
\section{References}

+ 162
- 0
Phantom3Standard_BadCamera/docs/5.tex View File

@ -0,0 +1,162 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
%\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Work Log}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 10 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\subsection{Open Bench Logic Sniffer}
Looking at this device in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\subsubsection{Open Bench Logic Sniffer Setup}
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, just as good as these cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the programm. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together. Do that too.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage (seems obvious). Again, lower the sampling rate, the longer the sample.
\end{itemize}
Should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be synchronous SPI, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{SPI Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. But the lack of development on the product is not indicated on the main selling webpages.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\section{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://reverseengineering.stackexchange.com/questions/12523/routers-serial-port-only-outputs-garbage
\section{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see the developers
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
\section{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\space{0.2in}
http://web.archive.org/web/https://reverseengineering.stackexchange.com/questions/12523/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

BIN
Phantom3Standard_BadCamera/docs/6.pdf View File


+ 164
- 0
Phantom3Standard_BadCamera/docs/6.tex View File

@ -0,0 +1,164 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Let's try a Logic Analyzer}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 10 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\subsection{Open Bench Logic Sniffer}
Looking at this device in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\subsubsection{Open Bench Logic Sniffer Setup}
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, just as good as these cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the programm. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together. Do that too.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage (seems obvious). Again, lower the sampling rate, the longer the sample.
\end{itemize}
Should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be synchronous SPI, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{SPI Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. But the lack of development on the product is not indicated on the main selling webpages.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\subsection{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://reverseengineering.stackexchange.com/questions/12523/routers-serial-port-only-outputs-garbage
\subsection{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see the developers
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking. Tell the whole story.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
\subsection{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
As a concluding note, I gave it a try, and I made some progress, but no cigar here. I can always try again later.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\space{0.2in}
http://web.archive.org/web/https://reverseengineering.stackexchange.com/questions/12523/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

+ 172
- 0
Phantom3Standard_BadCamera/docs/7.tex View File

@ -0,0 +1,172 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Let's try a Logic Analyzer}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit already. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 8 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test of the gimbal, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\subsection{Open Bench Logic Sniffer}
Looking at this device in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\subsubsection{Open Bench Logic Sniffer Setup}
The Open Bench Logic Sniffer is the first result that comes up when you search for Open Source Logic Analyzer. It's from 2010 by Dangerous Prototypes whom also made the Bus Pirate.
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, about as good as the cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the program. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage. Again, the lower the sampling rate, the longer the sample.
\end{itemize}
Everything should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.\footnote{Although export is limited, which I will get to.}
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be I2C, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{I2C Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. But the lack of development on the product is not indicated on the main selling webpages.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\subsection{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://
reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\subsection{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see in a project like this:
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking. Tell the whole story.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
\subsection{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
As a concluding note, I gave it a try, and I made some progress, but no cigar here. I can always try again later.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\vspace{0.2in}
http://web.archive.org/web/https:/
/reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

+ 180
- 0
Phantom3Standard_BadCamera/docs/8.tex View File

@ -0,0 +1,180 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Let's try a Logic Analyzer}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit already. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 8 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test of the gimbal, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\begin{center}
\includegraphics[scale=0.4]{../pics/Ols-cover.jpg}
\captionof{figure}{Open Bench Logic Sniffer}
\end{center}
\subsection{Open Bench Logic Sniffer}
Looking at this device in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\subsubsection{Open Bench Logic Sniffer Setup}
The Open Bench Logic Sniffer is the first result that comes up when you search for Open Source Logic Analyzer. It's from 2010 by Dangerous Prototypes whom also made the Bus Pirate.
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, about as good as the cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the program. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage. Again, the lower the sampling rate, the longer the sample.
\end{itemize}
Everything should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.\footnote{Although export is limited, which I will get to.}
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be I2C, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{I2C Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. In defenes of the Logic Analyzer, it is still good for what it is. Perhaps if development hadn't stopped, they would've been able to fully develop the missing features.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\subsection{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
\subsubsection{Confirming Baudrate from an oscilloscope}
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://
reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\subsection{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see in a project like this:
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking. Tell the whole story.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
%In defense of the Open Bench Logic Sniffer, how do I get the source code, a small FPGA, and put my own logic sniffer into my product? Something to try.
\subsection{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
As a concluding note, I gave it a try, and I made some progress, but no cigar here. I can always try again later.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\vspace{0.2in}
http://web.archive.org/web/https:/
/reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

+ 181
- 0
Phantom3Standard_BadCamera/docs/9.tex View File

@ -0,0 +1,181 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Phantom 3 Drone Repair / Diagnosis}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
\textbf{Phantom 3 Drone Repair / Diagnosis}
\tableofcontents
\section{Overview}
User reports drone is unable to sync to mobile phone. Upon testing drone, I find that the gimbal is not able to get a proper level base. It continously moves around.
\section{Let's try a Logic Analyzer}
Unfortunately a lot of my work in not in notes, although I thought I had written it down, but in any case... I've looked at this drone a bit already. The issues are likely in the camera / gimbal assembly. The price of a new assembly is \$200 on ebay, and extremely expensive. The drone used is about \$240 or \$300 on ebay now (Jan - June 2019).
The pin connector that goes to the gimbal board from the drone is about 8 pins. Not bad. The ribbon connector on the gimbal, that goes to the camera is some obscene 50+ pin, double stacked monster. Not easy to decipher without schematics. There are a few motors on the camera board, which all seem to work. The issue is with the self test of the gimbal, at which point the drone never stabilizes. The user reported that he had a crash, but he also reported that he replaced the gimbal board.
\subsection{Drone Mobile App}
Looking at the drone in detail, it relies on a mobile phone app to work with the drone. This app doesn't work on my old phone. I tried an Ipad model one, and that didn't work either. The only phone I was able to get the app to work on was a more recent apple phone (that I do not own). So, right away we are having trouble interfacing to this device. The future doesn't bode well for this drone. What will 10 years in the future be like?
I've somewhat given up on any interest in repairing this. It's a black box, and cheaply made. Instead, I'm going to tap into the 8 wires going hetween the drone and the gimbal and just take a look. I've needed an excuse to use my Logic Analyzer for a while, and here's a good one. Let's see what / if we can learn, if anything.
\begin{center}
\includegraphics[scale=0.5]{../pics/Ols-cover.jpg}
\captionof{figure}{Open Bench Logic Sniffer}
\end{center}
\subsubsection{Open Bench Logic Sniffer}
The Open Bench Logic Sniffer is the first result that comes up when you search for Open Source Logic Analyzer. It's from 2010 by Dangerous Prototypes whom also made the Bus Pirate.
First off, I need a case for this board. It's exposed. I found two on thingiverse. Let's fire up the 3d printer and get one of those made. Looking at the two cases, they are nothing more than bottoms for the boards. Helpful, but I would've liked a top on these. A bit too rushed. (see cad folder). I'll just throw some electrical tape on the bottom, about as good as the cases.
\subsubsection{Abandoned Project?}
The github\footnote{Not a fan} repo https://github.com/GadgetFactory/OpenBench-Logic-Sniffer/issues seems to be quiet. Is the project abandoned?
\subsection{Setup Cont...}
Let's get this thing. Running. On devuan ascii (d9), follow the quick start guide here:
http://dangerousprototypes.com/docs/Logic\_Sniffer\_quick\_start\_guide
Linked from the main logic sniffer page.
It looks like the Sump program runs as a shell script (without any installation), so you can follow that page where they link to here:
http://www.lxtreme.nl/ols/
and download the latest client. Then extract, untar and run the program. Unfortunately there is no verifcation of the tar files that I see. A bit shady. A package for a distribution is warranted here... Also looks like the Sump client is customized for Open Bench Logic Sniffer, and as a result, hasn't been updated as the project has been somewhat quiet...
\subsection{Basic Test}
The demonstrations section shows some basic tests. They use a bus pirate, but instead, you can just plug in an Arduino Uno (much easier). Here's what you do.
\begin{itemize}
\item Plug in Arduino, set it to Serial Read example, confirm that some data is being spit out.
\item Plug in TX of UART on Uno to pin 0-7 of the OLS (open logic sniffer). Also, obviously you'll need to tie the grounds together.
\item Set the sampling frequency to be lower than the 200MHz default. Lower sampling frequency means longer sampling times, but less detail.
\item Do a sample, then go into UART decode mode in the menus, choose auto detect speed, and run a sample, making sure to assign the TX pin of the UART decode to whatever your TX pin is connected to in OLS (this is somewhat obvious, so just fool around with the program until you get it).
\item Note that what speed works for your given application may vary. With a 9600 baud UART, I can do 50KHz sampling and get everything, but 5KHz returns garbage. Again, the lower the sampling rate, the longer the sample.
\end{itemize}
Everything should work. The decoding on the main time line view is poor, but the UART printout works reasonably well in its own menu.\footnote{Although export is limited, which I will get to.}
Some things to do: enable side measurement window. And go to preferences - theme - Logic Sniffer. Looks better.
I think I've seen enough, let's try to connect it to the Drone.
\section{Drone Logic Sniffing}
I was looking at the feet of the drone, and noticed something I had not seen before. There are two wires (antennas or thermocouples) on two legs, and then on a third, there was a board, with four wires going to it. The wires appear to be I2C, as there is a GND, and an SDA, SCL wire. I plugged the OLS into this, and started recording, but then the battery died. I did realize that in order to get the sampling rate right, you'll have to first probe with an Oscilloscope, and at least look at the signal first. Then after you have an idea of what you are dealing with, you program OLS and go after decoding.
\subsection{I2C Decode}
The pins on the board indicate SDA and SCL, which is I2C. Using the Open Logic Sniffer, at 2MHz speed, I am able to get 12ms of sampling. Unfortunately, this is not enough to read more than one packet. The packets are sent from the Phantom at a rate of one per every 20ms. Thus, the limitations of this speed show up.
Another drawback, is that it's not seamless to re-sample, when using OLS. In order to get I2C decoding, I have to begin capture, then go into the measurement menus, and click analyze. In order to get a 2nd sample, I have to close that analyation window, and click begin capture again, and then open a new I2C decode window.\footnote{And if you aren't using the default pins, e.g. in an SPI protocol decode, you have to change all the pin values again...} The workflow, is poor for this use case. Ideally, I could capture, and re-analyze in the I2C window (perhaps one button), without needing to click through menus.
The limited sampling issue is addressed on the Dangerous Prototypes website:
\emph{"The major difference is that the OLS has a limited number of samples, while the hobby USB analyzers can theoretically take infinite samples. Most of our debugging is done with the first few hundred samples, so this feature isn’t usually important to our work, your situation may be different. Future versions of the OLS will definitely have more sample storage, and we can work an infinite sampling mode into a future firmware update too."}
Seems that they acknowledge this as a flaw.
In any case, I'll have to get a Saleae, I think... In order to do further testing. I'll buy one used. I don't wish to use a clone, and I can't afford to pay \$150 for one.
Seems like the OLS is more a demonstration of making an Open Source Logic Sniffer, rather than an actual developed open source logic sniffer. At least in this scenario of 2MHz speeds with packets being burst. Perhaps it works better for slow sampling rates.
Anyways, what did we find? First off, you must get the sampling rate right. At 1MHz there were decoding errors, but at 2MHz, no errors.
See this picture of an example packet capture:
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode.png}
Exporting it, results in a csv file that lacks the binary output... Not sure why. It does have ascii. Another limited option. \footnote{I don't have a problem with this product being undeveloped, but I do have a problem with the way its touted as a working product. Call a spade a spade. This is an open source project that is in development. By no way is it mature enough to be sold to the average hobbyist. They are too eager to tout the product as an open source logic analyzer. Well, it is, but it's not finished... It's an in-development open source logic analyzer. Basic functionalities in the software and hardware are lacking. Don't sugar coat it. Call a spade a spade. Maybe it's my fault for not realizing the company is called Dangerous Prototypes. I mean, it's in the name... Prototypes. Though the bus pirate is generally considered mature enough for the hobbyist. The problem is that if you search Open Source Logic Analyzer (as I did) this shows up as the main result. In defenes of the Logic Analyzer, it is still good for what it is. Perhaps if development hadn't stopped, they would've been able to fully develop the missing features.} From the output, we can see what is likely a bit being written from the Phantom main board, before the sensor on the leg sends out the data.
Let's compare a 2nd sample, and correlate.
\includegraphics[scale=0.5]{../pics/logic_analyze_i2c_decode2.png}
Here we can see that the write code is ascii 60, address is 3, then the return data is a number, followed by a 0, a number followed by 255 (0xFF), another number, another 0xFF, and then a final number before closing the connection. Clearly the foot part is some kind of sensor, maybe vibration to detect a landing.
\subsection{Tapping into Main Wires}
To tap into the wires, I will use a sharp exacto blade\footnote{Exacto 11SS blades}, to slice the insulation off, then connect the logic probe to the exposed wiring.
Being careful not to cut the wiring, I peeled off the insulation. One mistake I made, was making a straight line of cuts. It would've been better to stagger, or offset the cuts, to avoid shorts. Actually, I can still do that. The Ground pin, is pin 1.
Let's check the signals with a scope to make sure they aren't over 7V, otherwise, I will break my OLS.
Pins 1 being ground, I'm not sure what 2 is. Pins 3, and 4 are 12V. Yikes!!! Can't connect there. Pin 5 appears to be data. Pin 6 is about 3.3V. Pin 7 is some kind of data. Pin 8 is about 3.3v. Looks like we only need pin 5 and 7.
The motors are getting stinky and hot, being unconnected to the drone, and trying endlessly to run. There doesn't appear to be a failsafe in the firmware to stop the motors from burning themselves out. I have to power the drone off after a couple of minutes.
Let's analyze pins 5 and 7.
\includegraphics[scale=0.5]{../pics/drone_to_gimbal_sample_uart.png}
It appears to be a UART at 115200. RX and TX between the drone and the gimbal board.
What is it sending? It's too hard to get this via sampling with the OLS. I'd be better off connecting the drone to my laptop and using a USB-to-Serial adapter. Let's do that, now that I know the baudrate.
\subsubsection{Confirming Baudrate from an oscilloscope}
How to confirm the baudrate? Get a sample of a bit on the UART on the scope, find its timing, and contrast with the speed.
I have a High signal that is 10us roughly. 10us is 0.000010 seconds. 1 / 115200 is 0.000008 seconds. The numbers line up. 1 second == 1,000 milli == 1,000,000 micro == 1,000,000,000 nano == 1,000,000,000,000 pico seconds. \footnote{Almost seems like these should be named neg-thousand, or neg-million, neg-billion, and neg-trillion... Or similar. Would that not be simpler?}
Unfortunately, the UART is all garbage, or at least not decipherable. Samples in resources. It's possible there is too much capacitance on the line, or something is hurting the signal, as per:
http://web.archive.org/web/https://
reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\subsection{Open Bench Logic Sniffer Review}
Overall, it's a good project, but I would like to see in a project like this:
\begin{itemize}
\item A) Not abandon it, or if it's abandoned, indicate that development has slowed down in an obvious place.
\item B) Tout it as what it is, an in-development open source logic sniffer. They should emphasize that basic functions are lacking. Tell the whole story.
\item C) Would've like to see them personally sell it. I feel that other companies have benefitted more from their products than they have.
\end{itemize}
%In defense of the Open Bench Logic Sniffer, how do I get the source code, a small FPGA, and put my own logic sniffer into my product? Something to try.
\subsection{Other Approaches to troubleshooting the Drone}
There is a USB port. I bet I could get debugging info out of that if I had the right tool. There is also a USB port on the camera gimbal. Clearly, I am missing a tool that I need to do the job. There must be an easier way.
As a concluding note, I gave it a try, and I made some progress, but no cigar here. I can always try again later.
\section{References}
http://dangerousprototypes.com/docs/Open\_Bench\_Logic\_Sniffer
\vspace{0.2in}
https://github.com/o-gs/dji-firmware-tools/issues/109
\vspace{0.2in}
http://web.archive.org/web/https:/
/reverseengineering.stackexchange.com/questions/12523
/routers-serial-port-only-outputs-garbage
\vspace{0.2in}
\end{document}

BIN
Phantom3Standard_BadCamera/pics/Ols-cover.jpg View File

Before After
Width: 550  |  Height: 338  |  Size: 74 KiB

BIN
Phantom3Standard_BadCamera/pics/drone_to_gimbal_sample_uart.png View File

Before After
Width: 1020  |  Height: 742  |  Size: 76 KiB

BIN
Phantom3Standard_BadCamera/pics/logic_analyze_i2c_decode.png View File

Before After
Width: 993  |  Height: 726  |  Size: 62 KiB

BIN
Phantom3Standard_BadCamera/pics/logic_analyze_i2c_decode2.png View File

Before After
Width: 988  |  Height: 720  |  Size: 61 KiB

BIN
Phantom3Standard_BadCamera/pics/logic_analyze_i2c_phantom.png View File

Before After
Width: 1021  |  Height: 435  |  Size: 38 KiB

BIN
Phantom3Standard_BadCamera/pics/ols_limited_sampling_spi_snapshot.png View File

Before After
Width: 1010  |  Height: 594  |  Size: 61 KiB

Loading…
Cancel
Save