Tuesday, 28 August 2012

Nexus Q in a (little for now) more depth...

This post will continue to grow as I play around with the Nexus Q, so for the first while it might be like a minefield of thoughts but it may help someone else while I'm busy playing.... All the below are used at your own risk, if you turn the very nice Nexus Q into a paperweight don't blame me, the following worked on mine...

So far I only have Linux instructions, Windows users -> 1a. Install Linux

Rooting the Nexus Q and adding apps

1. Install the Nexus Q app on a tablet/phone supporting it, this may be an issue if your using a non-US account
2. Within the Nexus Q app setup your Nexus Q if you haven't done so yet, then select the device in the app home screen (mine is called "Living Room") and tap on Advanced, ensure you have USB debugging enabled (this also opens up port 4321, which telnet or nmap (eg. nmap -p 4321 192.168.1.185) can confirm for you
3. Download fastboot from: http://koushikdutta.blurryfox.com/G1/
4. Become root user and place fastboot executable in /bin/ for easy access, stay logged in as root, many commands below require you to have root access...
5. You will also need adb from the Android SDKs from http://developer.android.com/sdk/index.html (the adb application is in the platform-tools directory)
 5a. Make a symbolic link for adb to /bin/
6. Plug your Nexus Q into a USB port on your system and run:
 6a. adb start-server (from the platform tools directory in the Android SDK)
 6b. adb devices (should show your device: eg. List of devices attached AW1xxxxxxxx    device)
 6c. adb reboot bootloader (should turn the Nexus Q's lights red)
 6d. fastboot-linux-i386 devices (should show your device again, eg. AW1xxxxxxxx     fastboot)
 6e. fastboot-linux-i386 oem unlock (within 5 seconds run: fastboot-linux-i386 oem unlock_accept if you agree to the "world of hurt" message, hehe)
 6f. After fastboot finishes you should have the last two lines as (INFOdone and OKAY) and your Nexus should turn blue (If not I hope you don't have a nice new paperweight...)
 6g. Download the file: http://www.bliny.net/downloads/nexusq-boot.img (The image allows for ro.secure=0 ie. allowing remount)
 6h. Make some coffee, your nerves are probably a bit in need of some!
Nexus Q after reboot into bootloader

7. Open the Nexus Q app on your client device, you should have to re-setup it in the app, enable the USB debugging option again
 7a. adb reboot bootloader (once again your device's lights should all turn red)
 7b. fastboot-linux-i386 boot nexusq-boot.img (should show: downloading 'boot.img'... OKAY and then booting... OKAY, device lights should be blue again)
 7c. adb remount (should reply: remount succeeded)
8. Download http://oss.reflected.net/jenkins/6581/cm-9-20120819-NIGHTLY-n7000.zip
  8a. Unzip the file, it should have the folders and files in required below and step 9
  8b. adb push ./app/Superuser.apk /system/app
  8c. adb push ./xbin/su /system/xbin
  8d. adb shell chmod 06755 /system/xbin/su
9. Now you should be ready to install some apk's on the Nexus Q
 9a. adb push ./app/Browser.apk /system/app
 9b. adb install ./app/Trebuchet.apk
10. Start the app launcher up: adb shell "am start com.cyanogenmod.trebuchet/.Launcher" (if you have a bluetooth mouse/keyboard this should work, mine is coming in the post at present...)

About in Nexus Q

Keyboard and Mouse - Under dev... not working yet but in the meantime:

The Nexus Q has a Micro AB USB port which supports USB OTG (On-The-Go), if you plug it into your computer with a normal cable it will act like a normal peripheral, using a normal Micro USB cable to hub will result in the hub simply not working... You need to buy or make a USB OTG cable, this is exactly what you need to be able to use your mouse/keyboard on the Nexus Q. To make one (I made one because the shops were closed and I wanted to play ;-) ... you need some electronic skills though):

1. Carefully break/cut open the micro connector
2. Using a multimeter identify each pin, I opened my hub up and used the end point to identify each pin on the connector
3. Pin 4 of the 5 pins on the micro connector is the one you need to solder to pin 5 (GND pin)
4. Check all your pins for shorts, plug in and hope for the best!

The USB port in host mode seems to ignore USB devices, I'm working on this part too...



More commands that may be of interest:

Connecting to the Nexus Q via network: adb connect 192.168.1.185:4321
Reboot the device: adb reboot
Tail Android Logfile: adb logcat
Open Settings: adb shell am start -a android.settings.SETTINGS
Open Browser: adb shell am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity
Open Google Play: adb shell am start -a android.intent.action.MAIN -n com.android.vending/.AssetBrowserActivity
Up: adb shell input keyevent 19
Down: adb shell input keyevent 20
Menu: adb shell input keyevent 1
Home: adb shell input keyevent 3
Back: adb shell input keyevent 4
Enter: adb shell input keyevent 23

More codes that can be used with adb shell input keyevent:

0 - KEYCODE_UNKNOWN
1 - KEYCODE_MENU
2 - KEYCODE_SOFT_RIGHT
3 - KEYCODE_HOME
4 - KEYCODE_BACK
5 - KEYCODE_CALL
6 - KEYCODE_ENDCALL
7 - KEYCODE_0
8 - KEYCODE_1
9 - KEYCODE_2
10 - KEYCODE_3
11 - KEYCODE_4
12 - KEYCODE_5
13 - KEYCODE_6
14 - KEYCODE_7
15 - KEYCODE_8
16 - KEYCODE_9
17 - KEYCODE_STAR
18 - KEYCODE_POUND
19 - KEYCODE_DPAD_UP
20 - KEYCODE_DPAD_DOWN
21 - KEYCODE_DPAD_LEFT
22 - KEYCODE_DPAD_RIGHT
23 - KEYCODE_DPAD_CENTER
24 - KEYCODE_VOLUME_UP
25 - KEYCODE_VOLUME_DOWN
26 - KEYCODE_POWER
27 - KEYCODE_CAMERA
28 - KEYCODE_CLEAR
29 - KEYCODE_A
30 - KEYCODE_B
31 - KEYCODE_C
32 - KEYCODE_D
33 - KEYCODE_E
34 - KEYCODE_F
35 - KEYCODE_G
36 - KEYCODE_H
37 - KEYCODE_I
38 - KEYCODE_J
39 - KEYCODE_K
40 - KEYCODE_L
41 - KEYCODE_M
42 - KEYCODE_N
43 - KEYCODE_O
44 - KEYCODE_P
45 - KEYCODE_Q
46 - KEYCODE_R
47 - KEYCODE_S
48 - KEYCODE_T
49 - KEYCODE_U
50 - KEYCODE_V
51 - KEYCODE_W
52 - KEYCODE_X
53 - KEYCODE_Y
54 - KEYCODE_Z
55 - KEYCODE_COMMA
56 - KEYCODE_PERIOD
57 - KEYCODE_ALT_LEFT
58 - KEYCODE_ALT_RIGHT
59 - KEYCODE_SHIFT_LEFT
60 - KEYCODE_SHIFT_RIGHT
61 - KEYCODE_TAB
62 - KEYCODE_SPACE
63 - KEYCODE_SYM
64 - KEYCODE_EXPLORER
65 - KEYCODE_ENVELOPE
66 - KEYCODE_ENTER
67 - KEYCODE_DEL
68 - KEYCODE_GRAVE
69 - KEYCODE_MINUS
70 - KEYCODE_EQUALS
71 - KEYCODE_LEFT_BRACKET
72 - KEYCODE_RIGHT_BRACKET
73 - KEYCODE_BACKSLASH
74 - KEYCODE_SEMICOLON
75 - KEYCODE_APOSTROPHE
76 - KEYCODE_SLASH
77 - KEYCODE_AT
78 - KEYCODE_NUM
79 - KEYCODE_HEADSETHOOK
80 - KEYCODE_FOCUS
81 - KEYCODE_PLUS
82 - KEYCODE_MENU
83 - KEYCODE_NOTIFICATION
84 - KEYCODE_SEARCH
85 - TAG_LAST_KEYCODE

Credits:

1. http://forum.xda-developers.com/showthread.php?p=28484300
2. http://forum.xda-developers.com/showthread.php?t=1209567


1 comment:

  1. Wow! I love trying newer technologies and devices.I must wanna try this new mogo Bluetooth mouse.Will it serve the purposes of the best ergonomic mouse because health is the first issue to be considered.

    ReplyDelete