Skip to content

Commit 215d3fc

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 304583f + e4b344f commit 215d3fc

File tree

7 files changed

+33
-348
lines changed

7 files changed

+33
-348
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ require some configuration to run in the right way.
99

1010
This 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

1720
But it is possible to install the following libraries if your project requires them.

installer.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ echo
66
echo "##############################"
77
echo "# EV3Dev-lang-java Installer #"
88
echo "##############################"
9-
echo "# Last update: 2017/05/14 #"
9+
echo "# Last update: 2017/06/05 #"
1010
echo "##############################"
1111
echo
1212

@@ -32,6 +32,7 @@ function initInstaller(){
3232

3333
MODE_HELP="help"
3434
MODE_JDK="jdk"
35+
MODE_BATTERY_MONITOR="batteryMonitor"
3536
MODE_COPY_INSTALLER="copy-installer"
3637
MODE_EXTENDED="extended"
3738

@@ -43,6 +44,7 @@ if [ "$1" == "$MODE_HELP" ]; then
4344
runModule help
4445
fi
4546

47+
#TODO Disable this option if platform is not EV3BRICK
4648
CREDENTIAL=""
4749
if [ "$1" == "$MODE_JDK" ]; then
4850
CREDENTIAL=$2
@@ -56,7 +58,10 @@ fi
5658

5759
runModule platform
5860
runModule java
59-
runModule battery-monitor
61+
62+
if [ "$1" == "$MODE_BATTERY_MONITOR" ]; then
63+
runModule battery-monitor
64+
fi
6065

6166
if [ "$1" == "$MODE_EXTENDED" ]; then
6267
runModule native-libraries

modules/battery-monitor.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
function 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

3637
if [ "$PLATFORM" == "$UNKNOWN" ]; then

modules/experimental/java-ev3-java8-installer.sh

Lines changed: 0 additions & 329 deletions
This file was deleted.

modules/help.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
echo "Installer options:"
44
echo "sudo ./installer.sh [Execute modules: platform, java & batteryMonitor]"
5+
echo "sudo ./installer.sh batteryMonitor [Install batteryMonitor]"
56
echo "sudo ./installer.sh extended [Execute modules: platform, java, batteryMonitor & native-libraries]"
67
echo "sudo ./installer.sh jdk [email protected] [Copy your local JRE to a remote brick]"
78
echo "sudo ./installer.sh copy-installer [email protected] [Copy the installer to a remote brick]"

modules/java.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
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-
143
function 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

modules/platform.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
EV3="EV3"
44
BRICKPI="BRICKPI"
5+
PISTORMS="PISTORMS"
56
UNKNOWN="UNKNOWN"
67
PLATFORM=$UNKNOWN
78

@@ -26,6 +27,9 @@ if [ -d "/sys/class/power_supply/legoev3-battery" ]; then
2627
elif [ -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
2933
fi
3034
echo "Platform detected: $PLATFORM"
3135
echo

0 commit comments

Comments
 (0)