{{tag>[linux Intel Edison]}}
=====Intel Edison - Install and configure Jubilinux=====
{{::img_4009.jpg?nolink&400|}}
[[http://www.jubilinux.org/|Jubilinux]] = Debian Jessie for edison.
====Documentation====
* {{ ::edison-module_hg_331189.pdf | Hardware guide - IntelĀ® Edison Compute Module}}
* {{ ::edisonbreakout_hg_331190006.pdf |Hardware guide - IntelĀ® Edison Breakout Board}}
====Set up====
* Connect both USB cables to the Edison.
* Open serial terminal:screen /dev/ttyUSB0 115200
* Install dfu-util:sudo dnf install dfu-util
* Download the latest [[http://www.jubilinux.org/dist/|jubilinux]] version and unpack the archive.
====Install====
* Run the ''flashall.sh'' script.sudo ./flashall.sh
* Reconnect power (bottom cable on photo above).
* Monitor the installation (using serial console on another window), it involves three reboots, so don't pull the cords yet.
====Configure====
* Change ''edison'' and ''root'' passwords, default password is ''edison''.
* Edit ''/etc/rc.local'' For example:
### uncomment to disable USB device mode and enable host mode for the OTG port
rmmod g_multi || true
* Configure WPA_supplicant:# wpa_passphrase SSID # add output to /etc/wpa_supplicant/wpa_supplicant.conf
# vi /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# ifup wlan0
* If WiFi lags, disabled powermanagement (for example in /etc/rc.local):iwconfig wlan0 power off
* Update:apt-get update
apt-get upgrade
* Configure powerbutton handling. See: http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/plain/meta-intel-edison-bsp/recipes-support/pwr-button-handler/files/
wget http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/plain/meta-intel-edison-bsp/recipes-support/pwr-button-handler/files/pwr-button-handler.c
gcc pwr-button-handler.c -o pwr-button-handler
cp pwr-button-handler /usr/local/bin
# /usr/local/bin/pwr-button-handler
Usage:
/usr/local/bin/pwr-button-handler "command_line1" "command_line2" "command_line3"
command_line1: a command line to execute when the PWR button is pressed for more than 2s
command_line2: a second command line to execute when the PWR button is released (after being pressed for more than 2s)
command_line3: a third command line to execute when the PWR button is pressed three times (within 4s)
cat << EOF > /etc/systemd/system/pwr-button.service
[Unit]
Description=Edison PWR button handler
[Service]
ExecStart=/usr/local/bin/pwr_button_handler "touch /tmp/btn-1" "touch /tmp/btn-2" "/bin/systemctl poweroff"
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl enable /etc/systemd/system/pwr-button.service
systemctl start /etc/systemd/system/pwr-button.service