File tree Expand file tree Collapse file tree 7 files changed +33
-348
lines changed
Expand file tree Collapse file tree 7 files changed +33
-348
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,12 @@ require some configuration to run in the right way.
99
1010This project tries to save time in this process.
1111
12- The installer will install the following libraries & utilities by default:
12+ The installer will install the following libraries by default:
1313
1414+ Java JDK 8 (Only for BrickPi/PiStorms)
15+
16+ If you like, you can install a utility to monitor the battery. (Recommended)
17+
1518+ [ BatteryMonitor] ( https://github.com/ev3dev-lang-java/batteryMonitor ) (A Java utility to monitor the Battery)
1619
1720But it is possible to install the following libraries if your project requires them.
Original file line number Diff line number Diff line change 66echo " ##############################"
77echo " # EV3Dev-lang-java Installer #"
88echo " ##############################"
9- echo " # Last update: 2017/05/14 #"
9+ echo " # Last update: 2017/06/05 #"
1010echo " ##############################"
1111echo
1212
@@ -32,6 +32,7 @@ function initInstaller(){
3232
3333MODE_HELP=" help"
3434MODE_JDK=" jdk"
35+ MODE_BATTERY_MONITOR=" batteryMonitor"
3536MODE_COPY_INSTALLER=" copy-installer"
3637MODE_EXTENDED=" extended"
3738
@@ -43,6 +44,7 @@ if [ "$1" == "$MODE_HELP" ]; then
4344 runModule help
4445fi
4546
47+ # TODO Disable this option if platform is not EV3BRICK
4648CREDENTIAL=" "
4749if [ " $1 " == " $MODE_JDK " ]; then
4850 CREDENTIAL=$2
5658
5759runModule platform
5860runModule java
59- runModule battery-monitor
61+
62+ if [ " $1 " == " $MODE_BATTERY_MONITOR " ]; then
63+ runModule battery-monitor
64+ fi
6065
6166if [ " $1 " == " $MODE_EXTENDED " ]; then
6267 runModule native-libraries
Original file line number Diff line number Diff line change 22
33function installBatteryMonitor() {
44 cd /home/robot
5- wget https://github.com/ev3dev-lang-java/batteryMonitor/raw/develop/ releases/batteryMonitor-0.2.0-SNAPSHOT .zip
5+ wget https://github.com/ev3dev-lang-java/batteryMonitor/raw/release/v0.2.0-RELEASE/ releases/batteryMonitor-0.2.0-RELEASE .zip
66
7+ # TODO Move block to function
78 isInstalled unzip
89 if [ " $INSTALLED " == " $INSTALLED_NO " ]; then
910 if [ " $PLATFORM " == " $EV3 " ]; then
@@ -19,8 +20,9 @@ function installBatteryMonitor() {
1920
2021 fi
2122
22- unzip batteryMonitor-0.2.0-SNAPSHOT.zip
23- mv batteryMonitor-0.2.0-SNAPSHOT batteryMonitor
23+ # TODO Move to a function
24+ unzip batteryMonitor-0.2.0-RELEASE.zip
25+ mv batteryMonitor-0.2.0-RELEASE batteryMonitor
2426 cd batteryMonitor
2527 chmod +x ./start.sh
2628 chmod +x ./stop.sh
@@ -29,8 +31,7 @@ function installBatteryMonitor() {
2931 chmod +x batteryMonitor-service.sh
3032 update-rc.d batteryMonitor-service.sh defaults
3133 cd /home/robot/batteryMonitor
32- ./start.sh
33- ps aux | grep java
34+ ./start.sh &
3435}
3536
3637if [ " $PLATFORM " == " $UNKNOWN " ]; then
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33echo " Installer options:"
44echo " sudo ./installer.sh [Execute modules: platform, java & batteryMonitor]"
5+ echo " sudo ./installer.sh batteryMonitor [Install batteryMonitor]"
56echo " sudo ./installer.sh extended [Execute modules: platform, java, batteryMonitor & native-libraries]"
67echo " sudo ./installer.sh jdk [email protected] [Copy your local JRE to a remote brick]" 78echo " sudo ./installer.sh copy-installer [email protected] [Copy the installer to a remote brick]"
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- function installJavaForBrickPi() {
4- apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
5- echo " deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
6- echo " deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
7- sudo apt-get update
8- sudo apt-get install oracle-java8-installer
9-
10- # Review in the future how to accept licence automatically
11- # https://askubuntu.com/questions/190582/installing-java-automatically-with-silent-option
12- }
13-
143function installJavaForEV3(){
154 if [ -e " /home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" ]; then
165 tar -zxvf " /home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" -C /opt
@@ -25,6 +14,17 @@ function installJavaForEV3(){
2514 fi
2615}
2716
17+ function installJavaForBrickPi() {
18+ apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
19+ echo " deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
20+ echo " deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
21+ sudo apt-get update
22+ sudo apt-get install oracle-java8-installer
23+
24+ # Review in the future how to accept licence automatically
25+ # https://askubuntu.com/questions/190582/installing-java-automatically-with-silent-option
26+ }
27+
2828# 1. Detect Java
2929# 1.1 Install Java
3030# 1.2 Create JAVA_HOME PENDING
Original file line number Diff line number Diff line change 22
33EV3=" EV3"
44BRICKPI=" BRICKPI"
5+ PISTORMS=" PISTORMS"
56UNKNOWN=" UNKNOWN"
67PLATFORM=$UNKNOWN
78
@@ -26,6 +27,9 @@ if [ -d "/sys/class/power_supply/legoev3-battery" ]; then
2627elif [ -d " /sys/class/power_supply/brickpi-battery" ]; then
2728 echo " The user has a BrickPi+"
2829 PLATFORM=$BRICKPI
30+ elif [ -d " /sys/class/power_supply/pistorms-battery" ]; then
31+ echo " The user has a PiStorms"
32+ PLATFORM=$PISTORMS
2933fi
3034echo " Platform detected: $PLATFORM "
3135echo
You can’t perform that action at this time.
0 commit comments