This guide will help you set up your Xiaodu development environment for use with Genie.
Currently there were issues with building genie-client on a Linux VM hosted on M1 chip. So, please try not to run this on a VM.
This step only needs to be done once. After this step the device will be on the
network automatically after reboot, and accessible with SSH.
adb shell
If the last step fails with permission errors or no device found:
lsusb
to find the bus number, device number of the device, which isBus 001 Device 008: ID 18d1:d002 Google Inc. Nexus 4 (debug)
sudo chmod 0777 /dev/bus/usb/001/008
(use the bus number/device number found at the previous step)killall adb
adb shell
againThese are required for SSH.
adb push etc /opt/etc
Run adb shell
Edit /data/wifi/wpa_supplicant.conf
using vi
If you're not familiar with vi
:
i
to enter "insert" mode, where typing works the expected way; a I appears at the bottom leftesc
:x
followed by pressing enter
to save and closeAdd a configuration block for your wifi:
If your wifi has a password (assuming normal WPA/WPA2 with pre-shared key):
network={
scan_ssid=1
key_mgmt=WPA-PSK
ssid="your wifi name"
psk="your wifi password"
}
If your wifi is open:
network={
ssid="Stanford"
key_mgmt=NONE
}
run wpa_cli reconfigure
to connect to the wifi
run dhcpcd
to start DHCP
use ifconfig
to discover the IP address of the device; if no address is listed, wait until
connection completes and retry
git clone --recursive https://github.com/stanford-oval/genie-client-cpp
cd genie-client-cpp
pip install --user -r ./cli/requirements.txt
pip install --user -e ./cli
At this point, a command called genie-client-cpp
should be available. Check with which genie-client-cpp
that is installed correctly. If not, make sure that the pip installation directory (typically ~/.local/bin
) is included in your PATH.
genie-client-cpp build
Copy the file config.ini
to out/config.ini
Ensure the following keys are set as following:
In [general]
:
auth_mode=bearer
assets_dir=/opt/genie/assets
In [leds]
:
enabled=true
In [system]
:
dns=true
ssl_strict=true
ssl_ca_file=/opt/genie/assets/ca-certificates.crt
cache_dir=/tmp/.genie
Edit the url
and accessToken
keys in the [general]
section.
If using genie-server:
ws://$IP_ADDRESS:$PORT/api/conversation
, where IP_ADDRESS is the IP of almond-server and PORT is typically 3000If using genie-cloud:
wss://dev.genie.stanford.edu/me/api/conversation
Edit the path
in the [leds]
section according to the specific device. Use ls /sys/class/leds/
to identify the correct path among:
genie-client-cpp deploy -t root@$IP_ADDRESS
where $IP_ADDRESS is the address of the device.
If using adb
to deploy, run:
genie-client-cpp deploy -t adb
After deployment, reboot the device to start the client. The client is ready when the LED turns solid off.