1## Using WALT on ChromeOS
2
3WALT can be used on ChromeOS in two different modes:
4 1. Via the [pywalt/walt.py](/pywalt/walt.py) command line script - for this mode refer to [pywalt/README.md](/pywalt/README.md)
5 1. Using the [WALT Android app](https://play.google.com/store/apps/details?id=org.kamrik.latency.walt) and walt.py script as a bridge
6
7
8For either mode you will need to use a ChromeOS test image -
9[some pointers on how to get it installed](https://www.chromium.org/chromium-os/testing/autotest-developer-faq/ssh-test-keys-setup)
10
11Copy the [pywalt/](/pywalt) directory from WALT repo to the Chromebook. One option is to download a repo tarball directly from GitHub:
12
13```
14wget https://github.com/google/walt/archive/master.tar.gz
15tar -xzf master.tar.gz
16cd walt-master/pywalt
17./walt.py --help
18```
19
20
21
22Connect WALT to Chromebook's USB port and test the setup by running: `$ ./walt.py -t sanity` on the Chromebook.
23This continuously displays readings from WALT's sensors (press Ctrl-C to stop):
24```
25Starting sanity test
26q G:480 PD_screen:3 PD_laser:910	min-max: 480-480 3-3 910-910
27q G:514 PD_screen:3 PD_laser:896	min-max: 480-514 3-3 896-910
28q G:486 PD_screen:4 PD_laser:894	min-max: 480-514 3-4 894-910
29q G:509 PD_screen:4 PD_laser:891	min-max: 480-514 3-4 891-910
30...
31```
32The first reading `G` is the accelerometer, it should change when WALT is rotated.
33`PD_screen` and `PD_laser` are the light sensors (photodiodes), shading them or exposing to light should change their readings.
34
35
36### Using WALT Android app
37
38If you intend to run the android app, run walt.py in TCP bridge mode. This is needed because Android container on ChromeOS has no access to USB.
39 - `iptables -A INPUT -p tcp --dport 50007 -j ACCEPT`
40 - `./walt.py -t bridge`
41
42The script will respond with `Listening on port 50007`. It can be stopped by pressing Ctrl-C. At this point you should be able to use the WALT Android app as if it's running on a regular Android device. If you reset or reconnect the WALT device, you'll need to re-run the script (no need to re-run the iptables command).
43
44If you need to deploy your own version of WALT Android app, follow instruction in [Development.md](Development.md)
45