Skip to content

Commit 55a5226

Browse files
committed
Merge branch 'release/v1.0.0'
2 parents c0666db + 90e30dd commit 55a5226

File tree

13 files changed

+717
-1
lines changed

13 files changed

+717
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
3+

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
11
# installer
2-
A Bash script to install everything related with EV3Dev-lang-java
2+
A Bash script to install everything related with [EV3Dev-lang-java](http://ev3dev-lang-java.github.io/)
3+
4+
## Motivation
5+
6+
[EV3Dev](http://www.ev3dev.org/) is a fantastic Complete Linux environment
7+
to build software for robots. But as any technology, the installation
8+
require some configuration to run in the right way.
9+
10+
This project tries to save time in this process.
11+
12+
The installer will install the following libraries & utilities:
13+
14+
+ Java JDK 8 (Only for BrickPi/PiStorms)
15+
+ [BatteryMonitor](https://github.com/ev3dev-lang-java/batteryMonitor) (A Java utility to monitor the Battery)
16+
+ OpenCV
17+
+ RXTX (Library used on [RPLIDAR4J](https://github.com/ev3dev-lang-java/RPLidar4J))
18+
19+
## Getting Started
20+
21+
### Starting point:
22+
23+
The starting point to use this installer, is a Brick running
24+
with EV3Dev and updated:
25+
26+
```
27+
sudo apt-get update
28+
sudo apt-get upgrade
29+
sudo apt-get dist-upgrade
30+
sudo reboot
31+
```
32+
33+
### EV3 Brick and Java
34+
35+
If you are using a EV3Brick, you will have to install Java JRE8 Manually.
36+
Download the file: `ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz` from:
37+
http://www.oracle.com/technetwork/java/embedded/downloads/javase/javaseemeddedev3-1982511.html
38+
and copy the file the following route: `/home/robot/`
39+
40+
**Example:**
41+
42+
```
43+
scp "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" "[email protected]:/home/robot"
44+
```
45+
46+
The Installer will manage later.
47+
48+
### Running the installer
49+
50+
```
51+
cd /home/robot
52+
mkdir installer
53+
cd installer
54+
wget -N https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/installer.sh
55+
chmod +x installer.sh
56+
sudo ./installer.sh
57+
```
58+
59+

installer.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
# A Bash script to install Linux Libraries used on EV3Dev-lang-java.
3+
# Author: Juan Antonio Breña Moral, [email protected]
4+
5+
echo
6+
echo "##############################"
7+
echo "# EV3Dev-lang-java Installer #"
8+
echo "##############################"
9+
echo "# Last update: 2017/05/14 #"
10+
echo "##############################"
11+
echo
12+
13+
OFF=0
14+
MODULE="EMPTY"
15+
MODULE_FOLDER="module2"
16+
function runModule(){
17+
if ! [ "$2" == "$OFF" ]; then
18+
createHeader $1
19+
fi
20+
local domain="https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/modules"
21+
wget -N "$domain/$1.sh"
22+
MODULE=$1
23+
mv ./$1.sh ./$MODULE_FOLDER/$1.sh
24+
source "$MODULE_FOLDER/$1.sh"
25+
}
26+
27+
function initInstaller(){
28+
echo "Init installer"
29+
mkdir -p $MODULE_FOLDER
30+
rm ./$MODULE_FOLDER/*
31+
}
32+
33+
MODE_HELP="help"
34+
MODE_JDK="jdk"
35+
MODE_COPY_INSTALLER="copy-installer"
36+
MODE_EXTENDED="extended"
37+
38+
#Init
39+
initInstaller
40+
runModule utilities 0
41+
42+
if [ "$1" == "$MODE_HELP" ]; then
43+
runModule help
44+
fi
45+
46+
CREDENTIAL=""
47+
if [ "$1" == "$MODE_JDK" ]; then
48+
CREDENTIAL=$2
49+
runModule copy-jdk
50+
fi
51+
52+
if [ "$1" == "$MODE_COPY_INSTALLER" ]; then
53+
CREDENTIAL=$2
54+
runModule copy-installer
55+
fi
56+
57+
runModule platform
58+
runModule java
59+
runModule battery-monitor
60+
61+
if [ "$1" == "$MODE_EXTENDED" ]; then
62+
runModule native-libraries
63+
fi
64+
65+
exit 0

modules/battery-monitor.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
function installBatteryMonitor() {
4+
cd /home/robot
5+
wget https://github.com/ev3dev-lang-java/batteryMonitor/raw/develop/releases/batteryMonitor-0.2.0-SNAPSHOT.zip
6+
7+
isInstalled unzip
8+
if [ "$INSTALLED" == "$INSTALLED_NO" ]; then
9+
if [ "$PLATFORM" == "$EV3" ]; then
10+
11+
mkdir -p packages
12+
cd packages
13+
wget http://ftp.us.debian.org/debian/pool/main/u/unzip/unzip_6.0-16+deb8u3_armel.deb
14+
sudo dpkg -i unzip_6.0-16+deb8u3_armel.deb
15+
cd ..
16+
else
17+
apt-get install unzip
18+
fi
19+
20+
fi
21+
22+
unzip batteryMonitor-0.2.0-SNAPSHOT.zip
23+
mv batteryMonitor-0.2.0-SNAPSHOT batteryMonitor
24+
cd batteryMonitor
25+
chmod +x ./start.sh
26+
chmod +x ./stop.sh
27+
cp batteryMonitor-service.sh /etc/init.d
28+
cd /etc/init.d
29+
chmod +x batteryMonitor-service.sh
30+
update-rc.d batteryMonitor-service.sh defaults
31+
cd /home/robot/batteryMonitor
32+
./start.sh
33+
ps aux | grep java
34+
}
35+
36+
if [ "$PLATFORM" == "$UNKNOWN" ]; then
37+
echo "This platform: $PLATFORM is not suitable for Battery Monitor."
38+
echo
39+
else
40+
41+
if [ -d "/home/robot/batteryMonitor" ]; then
42+
echo "We have detected a previous installation."
43+
echo "We will skip this step."
44+
else
45+
installBatteryMonitor
46+
fi
47+
48+
fi
49+
50+
createHeader "END $MODULE"

modules/copy-installer.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
if [ -e "/home/robot/installer/installer.sh" ]; then
4+
echo $CREDENTIAL
5+
ssh $CREDENTIAL 'uptime'
6+
ssh $CREDENTIAL 'sudo mkdir /home/robot/installer/'
7+
scp "/home/robot/installer/installer.sh" "$CREDENTIAL:/home/robot/installer"
8+
ssh $CREDENTIAL 'sudo chmod +x /home/robot/installer.sh'
9+
exit
10+
else
11+
echo "Sorry, the installer didn´t detect the installer"
12+
echo "on /home/robot/installer"
13+
echo "try to review your installation on your EV3 Brick."
14+
echo
15+
exit 1
16+
fi

modules/copy-jdk.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
if [ -e "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" ]; then
4+
echo $CREDENTIAL
5+
scp "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" "$CREDENTIAL:/home/robot"
6+
exit
7+
else
8+
echo "Sorry, the installer didn´t detect ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz"
9+
echo "on /home/robot"
10+
echo "try to copy the file again to the EV3 Brick."
11+
echo
12+
exit 1
13+
fi

modules/experimental/bluetooth.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
echo "##############################"
5+
echo "# BLUETOOTH SECTION #"
6+
echo "##############################"
7+
echo ""
8+
9+
#2. Install Bluetooth
10+
if [ "$PLATFORM" == "$EV3" ];
11+
then
12+
echo $EV3
13+
#isInstalled libbluetooth-dev
14+
#wget http://ftp.us.debian.org/debian/pool/main/b/bluez/libbluetooth-dev_5.23-2+b1_armel.deb
15+
#dpkg --force-depends-version -i libbluetooth-dev_5.23-2+b1_armel.deb
16+
else
17+
echo $BRICKPI
18+
isInstalled libbluetooth-dev
19+
#apt-get install libbluetooth-dev
20+
fi

0 commit comments

Comments
 (0)