Building and Deploying SWiFiIC
Note that build system for SWiFiIC needs additional developer tools (like Android SDK etc.) while the deployment system has lesser needs.
Building SWiFiIC
This Sub-section will guide you through the set up process for Development of SWiFiIC Apps
Minimum System Requirements
- Ubuntu 16.04 LTS (Preffered, though you can work on Windows for development on android part making minor changes to the following instructions)
- Tocmcat-8 and JDK 1.8 OpenJDK is fine; use
sudo update-java-alternatives
to set it if default Java in not 1.8
- Android SDK Command Line Tools - Get it here.
The Build Setup
The following instructions assume you are working on Ubuntu 16.04(64-bit), modify them accordingly for your operating system.
SWiFiIC applications are based on Java and tomcat-user- the "Swilets". For which you would need to install Java SDK. Android application would require this too.
sudo apt-get install tomcat8 tomcat8-user tomcat8-common
Next, you download the official Android SDK. You can work without an IDE if you so wish.
To set up this up follow the instructions at Android Developers Website, or proceed further if you downloaded the official Android SDK
Create a directory where you are going to download the source code and change into it:
mkdir workarea && cd workarea
Download and build the source code:
git clone https://github.com/swifiic/repo.git
cd repo
bash build-all.sh build # or bash build-all.sh clean to remove output of old builds
Fix the android build dependencies if build fails
a. Ensure ANDROID_HOME
is setto correct path
b. Update the target SDK levels in andorid projects as required.
c. To build a specific sub project you can just invoke ./gradlew build
for android proejects and ./gradlew all
for hub projects
After the build completes you should see swifiic.tar.gz
in the repo folder. If errors are there, work on resolving them or contact the authors.
Deploying SWiFiIC
Minimum System Requirements
- Ubuntu 16.04 LTS
- Java Run Time (JRE) or JDK - 1.8 OpenJDK is fine; use
sudo update-java-alternatives
to set it if default Java in not 1.8
- Tomcat8-user and MySQL
sudo apt-get install tomcat8-user tomcat8-common mysql-server mysql-client
- IBR-DTN see below.
- Optionally you can have apache2, php and phpmyadmin for debugging.
sudo apt-get install apache2 php5 mysql-server phpmyadmin
Install IBR-DTN by following the instructions here.
extract script/deployscript.sh and dist/scripts/check_deployment.sh from swifiic.tar.gz and copy swifiic.tar.gz + check_deployment.sh + deployscript.sh to a temporary folder.
Run sudo bash check_deployment.sh
to check that deployment pre-requisites are met.
Run sudo bash deployscript.sh
to install.
- You can ignore errors on "mkdir: cannot create directory ....: File exists" or user exists
- You should not see any other Errors like access denied in above steps.
After the above script completes, edit /etc/ibrdtn/ibrdtnd.conf
for your environment
Following contents will already be there - you can modify if wlan0 is not the actual WiFi interface on your machine
local_uri = dtn://example-url.dtn # will be modified to PIN / area code
# other values removed ..
net_wlan0_interface = wlan0 # listen on interface eth0: Modify the value on RHS if needed
# other values removed ..
The Execution of HUB Components
use cd /opt/swifiic; sudo scripts/runSoaHub.sh
.
The SOA (SWiFiIC Operator App) is a Tomcat based servlet. Look at logs under /opt/swifiic/HubSrvr/logs for troubleshooting.
use cd /opt/swifiic; sudo scripts/runHublets.sh
.
The SUTA (SWiFiIC User Terminal App) is a Swilet for end user's to access SWiFiIC.
Msngr is another hublet to demo the messaging App.
To troubleshoot these apps look at logs under /opt/swifiic/log
.
If errors like "Unsupported major.minor version 52.0" show up, look at setting for java-alternatives during build
The Mobile phone Components
Install and run IBR-DTN service using Google's Play store.
The SOA (SWiFiIC Operator App) is a Tomcat based servlet for, editing and deleting the users to the SWiFiIC hub.and doing other management and monitoring activities.
It has an Android based package for the same (SOA-debug.apk). It is only installed on Operator's device.
In settings update address for Hub to something like "192.168.xx.yy:18090". Use ifconfig
on hub to get the ip address.
For SOA app default: login is 9876543210 and password is "simple".
The SUTA (SWiFiIC User Terminal App) is a Swilet for end user's to access SWiFiIC. Setup the hub adress and user name (not alias) in the SUTA App for each user's device.
The Messenger is a Swilet for end chat using SWiFiIC.