Since i struggled too long with installing this application to get everything right (and i definitely think it’s worth looking into it) i wrote this step by step how-to hoping to save someone else
s time. Although i found this sentence: “Mango Installations are usually very easy and we provide good instruction in the documentation section“, on this web site i actually couldnt find any for linux installation.
And somehow i got feeling that lack of installation documentation is not because of company’s trying to commercialize whole mango project (there is nothing wrong with that) and to make users pay for support (there is nothing wrong with that also but installation should be straight forward so more time can be spent on exploring application rather than troubleshooting linux issues) so if i
m right and not ruining someone’s business plan heres basic how-to for ubuntu installation:
I wanted to run this on clean install of ubuntu 12.04 server using old unused hardware. I needed headless cheap system for logging information from device with modbus capability and then automate things like mailing daily reports, connecting to it over internet to see real time values and similar. All that (and much more) is possible with mango. I installed this on old motherboard with serial port, amd barton PCU running at 2,8GHz and with 2GB RAM. I tried also on old P3 machine (700MHz) with 256 MB RAM but its painfully slow and actually not useable. I would like to see someone writes down minimum hardware specs for this application.
STEP 1: Install ubuntu 12.04 server edition** with only openssh package selected (i wanted to run this as headless server connected to my modbus device) - you will find this during installation setup.
Note: This installation is done with 32 bit ubuntu version - there are issues with librxtx-java (if you need serial port) if installed on 64-bit.
During installation define servers name, your user name, network etc. Be sure to have your server connected to your LAN during installation for automatic network setup (if you have DHCP) or do it manually during install or later.
After installation is finished and network configured you can connect to your new server over ssh (i use putty for that) from some other machine in your LAN.
To get audio signal from pc speaker that your system is up and ready after startup/reboot (since it will not have monitor connected to it) do following steps in your terminal window:
sudo apt-get install beep
- add line "pcspkr" in file "/etc/modules":
sudo pico /etc/modules
- add line "beep -l 900 -r 1 -f 500" in file "/etc/rc.local" before "exit 0":
sudo pico /etc/rc.local
(You can try your pc speaker with “beep” command)
STEP 2: Installing java from oracle.com **
I installed java according to these instructions with slight modifications (/etc/profile is not the recommended way for adding system variables but rather /etc/environment):
Following are mostly copy / paste commands from above site:
sudo mkdir -p /usr/local/java
Now download java sdk and jre from oracle (i used at the time latest 7u9 version from http://www.oracle.com/technetwork/java/javase/downloads/index.html).
(to do downloads over terminal window i use method of starting download in my firefox browser and then stopping it and copying download link with right clicking in downloads window and selecting “Copy Download Link”. Then in servers terminal window i use wget + paste. If downloaded file name is mixed up correct it with mv command or similar)
Copy the Oracle Java downloaded binaries into the /usr/local/java directory.
Write following to your terminal window:
sudo -s cp -r jdk-7u9-linux-i586.tar.gz /usr/local/java sudo -s cp -r jre-7u9-linux-i586.tar.gz /usr/local/java cd /usr/local/java sudo -s chmod a+x jdk-7u9-linux-i586.tar.gz sudo -s chmod a+x jre-7u9-linux-i586.tar.gz sudo -s tar xvzf jdk-7u9-linux-i586.tar.gz sudo -s tar xvzf jre-7u9-linux-i586.tar.gz ls –a
you should see two directories:
add system variables JAVA_HOME, JRE_HOME and M2M2_HOME to environment file:
sudo pico /etc/environment
add lines under PATH:
JAVA_HOME=/usr/local/java/jdk1.7.0_09 JRE_HOME=/usr/local/java/jre1.7.0_09 M2M2_HOME=/home/”your user name”/mango
add at the end of PATH following :/usr/local/java/jdk1.7.0_0_09/bin:/usr/local/java/jre1.7.0_09/bin”
save /etc/environment (ctrl+x in pico)
for this changes to take effect you need to logout/login to your user account
after login do following:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_09/bin/java" 1
• this command notifies the system that Oracle Java JRE is available for use
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_09/bin/javac" 1
• this command notifies the system that Oracle Java JDK is available for use
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jre1.7.0_09/bin/javaws" 1
• this command notifies the system that Oracle Java Web start is available for use
sudo update-alternatives --set java /usr/local/java/jre1.7.0_09/bin/java
• this command will set the java runtime environment for the system
sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_09/bin/javac
• this command will set the javac compiler for the system
sudo update-alternatives --set javaws /usr/local/java/jre1.7.0_09/bin/javaws
• this command will set Java Web start for the system
• This command displays the version of java running on your system
• You should receive a message which displays:
• java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b09)
Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)
• This command lets you know that you are now able to compile Java programs from the terminal.
• You should receive a message which displays:
• javac 1.7.0_09
STEP 3: Install librxtx-java
To use your serial port for connecting to (in my case) modbus device over rs232->rs485 adapter you need to do following:
according to this site: http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux install librxtx-java
sudo apt-get install librxtx-java
then copy files librxtxSerial.so and RXTXcomm.jar to following directories:
sudo cp /usr/lib/jni/librxtxSerial.so /usr/local/java/jdk1.7.0_09/jre/lib/i386 sudo cp /usr/share/java/RXTXcomm.jar /usr/local/java/jdk1.7.0_09/jre/lib/ext
STEP 4: Install mango automation
Now we can download mango automation full core and modbus ip & serial data source from here: http://infiniteautomation.com/index.php/download.html
after download finishes do following:
cd /home/”your user name”/ sudo mkdir mango sudo apt-get install unzip unzip ma-full-core-2.0.3.zip –d mango
copy “modbus IP & serial data source” module to mango/web/modules and start mango
sudo cp m2m2-modbus-1.4.1.zip mango/web/modules sudo chmod +x mango/ma-start.sh sudo ./mango/ma-start.sh
Now mango should start and you can connect to it with your browser on any computer inside LAN over address yourserversname:8080
You should be able to add serial modbus (RTU) data source, select appropriate serial port and add data points.
Explore and customize your system. Have fun.