Other Projects

TuxDroid meets the banana

1 2999
nka11  
Edited by nka11 at 2014-10-22 05:33

For those who don't know the beast, let me introduce you TuxDroid, visit that wiki page to know more about it.

So the project has started yesterday, here is what is done for the moment :

1. switch on bananapi
2. switch on TuXdroid
3. plug TuxDroid to bananapi on their respective I2C connexions :



Detect I2C slaves on bus :
  1. i2cdetect -y 2                                                                                                                             :(
  2.      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  3. 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
  4. 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  5. 20: -- -- -- -- -- -- -- -- -- -- 2a -- -- -- -- --
  6. 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  7. 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  8. 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  9. 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  10. 70: -- -- -- -- -- -- -- --                        
Copy the Code
according to the firmware source, 2A is the adress of the TUXCORE controller, so I can tell I "see" the tux over i2c, well...

Then I tried to hack around how i could get status from the droid using a sample py script.
I use the 0x02 I2C command (still reading the firmware to find it) and the "timber coding method" to read brutally (i know there is another i2c device on the tuxdroid, but it's a master...)

here is the script, then it's result :
  1. #!/usr/bin/env python
  2. from __future__ import print_function

  3. import smbus
  4. import time
  5. bus = smbus.SMBus(2)
  6. address = 0x2a # The tuxdroid

  7. def write(value):
  8.         bus.write_byte_data(address, 0, value)
  9.         return -1

  10. def raw():
  11.   raw =[]
  12.   data = 0x00
  13.   cptzer = 0
  14.   while (cptzer < 5):
  15.     data = bus.read_byte_data(address, 1)
  16.     raw.append(data)
  17.     if (data == 0x00):
  18.       cptzer += 1
  19.   return raw

  20. while True:
  21.     time.sleep(0.7)
  22.     write(0x02)
  23.     rng = raw()
  24.     print("[0x02] ", end="")
  25.     for b in rng:
  26.         print("0x%.2X " % b, end="")
  27.     print("")
Copy the Code
  1. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  2. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  3. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  4. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  5. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  6. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  7. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  8. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  9. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x02 0xB1 0x00 0x00 0x00 0x00 0x00
  10. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  11. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  12. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  13. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  14. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  15. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  16. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  17. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  18. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  19. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x03 0x10 0x00 0x00 0x00 0x00 0x00
  20. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  21. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  22. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  23. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  24. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  25. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  26. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  27. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  28. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  29. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x02 0xE9 0x00 0x00 0x00 0x00 0x00
  30. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  31. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  32. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  33. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  34. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  35. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  36. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  37. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  38. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  39. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x02 0xDA 0x00 0x00 0x00 0x00 0x00
  40. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  41. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  42. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  43. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  44. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  45. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  46. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  47. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  48. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  49. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x02 0xC0 0x00 0x00 0x00 0x00 0x00
  50. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  51. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  52. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  53. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  54. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  55. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  56. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  57. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  58. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  59. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0x02 0xB2 0x00 0x00 0x00 0x00 0x00
  60. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  61. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  62. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  63. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
  64. [0x02] 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C 0x00 0x00 0x00 0x00 0x00
Copy the Code
What i can observe : First result varies randomly, so i drop it from analysis.

I reviece always the same bytes sequence : 0xC1 0xC0 0xC3 0xC4 0xC2 0xC7 0xC1 0xC0 0xA8 0x32 0x8C

except every 10 lines, where i got more info.

I guess the other controller (TUXAUDIO), which is another master on the bus, sends commands at regular interval (7sec?).

That's all I have rigth now, I'd like to try more commands, but will grab more info before.

Hope you've enjoyed it ;)
Single Polls, Total 6 Users voted
0.00% (0)
83.33% (5)
16.67% (1)
0.00% (0)
Your User group have no permission to vote
I'm a tuxdroid owners too.
Glad to see what you do and very excited to know what you will hack ^^

Good job !

You have to log in before you can reply Login | Sign Up

Points Rules