#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/terror # # -------------------------------------- # terror-3 - the Lisp terror # Emacs on the Lego Mindstorms ev3 droid # by Emanuel Berg # https://dataswamp.org/~incal/#terror # updated 2022-11-17 # -------------------------------------- # # droid photos: # https://dataswamp.org/~incal/terror-3/img/terror-3.jpg # https://dataswamp.org/~incal/terror-3/img/terror.jpg # # interface screenshot: # https://dataswamp.org/~incal/terror-3/img/terror-cmd-loop.png # # project history and source: # terror C https://dataswamp.org/~incal/terror/ # Terror 2 Prolog https://dataswamp.org/~incal/terror-2/ # terror-3 Elisp https://dataswamp.org/~incal/terror-3/ # # hardware notes: # https://dataswamp.org/~incal/terror-3/PORTS # https://dataswamp.org/~incal/terror-3/FILES # # facts for fans: # The droid is named Terror after a vehicle in the # Jules Verne novel "Master of the World", 1904. # # tramp: # (find-file "/-:incal@ev3dev:.zshrc") # (find-file "/-:incal@ev3dev:.irssi/config") # # setup ssh: # # 1. Verify that the droid is connected to WiFi as shown on # the brick's screen under "Wireless and Networks". # Note that it should say "Online" and not "Connected". # # 2. Then set up a shared connection from your computer: # # $ nmcli # get MAC # $ nmcli con show # check for existent connection # $ nmcli con edit type ethernet # edit Ethernet connection # nmcli> set con.id terror-net # nmcli> set 802-3-ethernet.mac-address A8:5E:45:55:AB:6B # nmcli> set ipv4.method shared # nmcli> verify # nmcli> save # nmcli> quit # # compile, rsync, and ssh: # # $ compile-droid # $ rsync-droid-all # $ ssh-droid # # (Do all three with 'all-droid'.) # # inhibit the password, which is "maker": # # $ ssh-keygen -t rsa # $ ssh incal@ev3dev mkdir -p .ssh # $ cat ~/.ssh/id_rsa.pub | ssh incal@ev3dev 'cat >> ~/.ssh/authorized_keys' # # upgrade ev3dev: # # $ sudo apt-get -qq update # sudo password is "maker" # $ sudo apt-get -qq upgrade # $ reboot droid=ev3dev droid_path=~/terror/terror-3 find-usb-droid () { lsusb | grep --color=never Lego } ssh-droid-ip () { local ip=192.168.10.243 ssh ${USER}@${ip} } compile-droid () { make -C $droid_path again } alias rac=compile-droid rsync-droid () { rsync -aLv --exclude '*.elc' $@ ${USER}@${droid}: } rsync-droid-all () { rsync-droid $droid_path } alias rad=rsync-droid-all ssh-droid () { ssh ${USER}@${droid} } alias tass=ssh-droid all-droid () { compile-droid rsync-droid-all ssh-droid } alias ra=all-droid find-in-droid-src () { local args=($@) egrep-in-files $args ${droid_path}/*.el } alias gr=find-in-droid-src dd-ev3dev-iso-to-sd () { local iso=$1 local sd=$2 sudo dd \ bs=4M \ if=${iso} \ of=${sd} \ status=progress \ oflag=sync }