-------------------------------------------------------------------------- Homenet3D for OpenWRT (v0.3): Startup (released 22nd August 2014) -------------------------------------------------------------------------- This document is part of Homenet3D for OpenWRT: http://caia.swin.edu.au/urp/homenet3d/openwrt It provides instructions for installing OpenWRT firmware and Homenet3D package on the TP-Link WR-1043ND. For instructions on installing firmware, see: http://caia.swin.edu.au/urp/homenet3d/downloads/homenet3d-installing-firmware-v0.3.txt INTRODUCTION ------------ This guide provides instructions on how to start and access the Homenet3D virtual world after installing Homenet3D OpenWRT firmware on a router or a emulated embedded system. The Homenet3D server and it's helper scripts are triggered to start as daemons with the system start. The three executables are: - /bin/homenet3D-server - /bin/sys-state - /bin/datarate The 'homenet3D-server' executable is a C program that provides communication between to clients and the router over WebSockets(10001) as well as accepting constant updates about system state from the 'sys-state' script on UDP port 27960. The 'sys-state' script checks system state every second and sends the updates to 'homenet3D-server'. Every 5 seconds the script will send all system state information in full, in order to make sure all information is correct and up-to-date. The 'datarate' script calculates the average data being passed through the ethernet ports and writes this to files which are read by the system state script and in turn sent as an update to the homenet3d-server. STARTING THE SERVER ------------------- To run the firmware on the TP-Link WR-1043ND please see section STARTING THE SERVER on TP-Link WR-1043ND. To run the firmware in a QEMU emulated ARM or MIPS environment please see section STARTING THE ARM/MIPS SERVER under QEMU. MULTI-ROUTER ------------ For a multi router environment there needs to be one master Homenet3D server and the rest should be slaves. The difference between them is that the master is the only one that runs /bin/homenet3D-server. The others run /bin/sys-state and /bin/datarate and send their system updates to the IP address of the master. To set this up you will need to edit the homenet3D configuration file on each of the routers. Master ------ On the Master router edit the config file thus: Set the "host_ip" configuration for each of the systems to each of the IP addresses of the slaves. Once the configuration file has been edited the server will need to restarted: ~: /etc/init.d/homenet3D-server restart Slaves ------ On the slave routers edit the config files thus: Set the global "server" configuration to the IP address of the master. The slaves need to have homenet3d-server disabled. To do this stop the server and remove the rc.d file: ~: /etc/init.d/homenet3D-server stop ~: rm /etc/rc.d/S65homenet3D-server STARTING THE SERVER on TP-Link WR-1043ND ---------------------------------------- The Homenet3D world should be accessible on your router already. Use the router's IP: (e.g) http://192.168.1.1/hnet3d STARTING THE ARM/MIPS SERVER under QEMU --------------------------------------- In order to get an idea of how this server would run on embedded architecture you can use a emulation program called QEMU to run the firmware. For more information on QEMU, please visit: http://www.qemu.org You will need a QEMU version of 1.6.0 or later. From the command the following commands will give you a command line based emulation: For ARM: ~: qemu-system-arm -M realview-pbx-a9 -kernel openwrt-realview-vmlinux.elf \ -m 128m -nographic -redir tcp:2200::22 -redir tcp:8080::80 -redir tcp:10001::10001 For MIPS: ~: qemu-system-mipsel -M malta -kernel openwrt-malta-le-vmlinux-initramfs.elf \ -m 128m -nographic -redir tcp:2200::22 -redir tcp:8080::80 -redir tcp:10001::10001 If you have built your own image (rather than our pre-built ARM/MIPS images) you will need to run: ~: udhcpc -i br-lan (to bind the main network interface to a NAT once the system has started) Then the Homenet3D world will be accessible at: http://localhost:8080/hnet3d To simulate system state there is a Lua script located at /root/demo.lua (this script runs automatically when using our pre-built ARM/MIPS images) IF SOMETHING GOES WRONG ----------------------- To troubleshoot and resolve issues with Homenet3D you can first try using the OpenWrt web interface. If no objects are loaded try restarting the homenet3D-server by logging in the OpenWrt web interface and going to: System->Startup 'homenet3D-server' should be listed there. Click "Restart" and try to load http://[router ip or hostname]/hnet3d/ again. If you are stilling having trouble try stopping 'sys-state', then restarting 'homenet3D-server' and then starting 'sys-state' again. You can do all this through the 'System->Startup' page in the web interface. CONTRIBUTIONS ------------- We welcome your feedback and contributions! If you have discovered a bug, have a request for a new feature please contact us. CONTACT ------- The Homenet3D website is: http://www.caia.swin.edu.au/urp/homenet3d If you have any questions or want to report any bugs please contact: Primary developer: Dominic Allan (6513476@student.swin.edu.au) Project lead: Grenville Armitage (garmitage@swin.edu.au) Centre for Advanced Internet Architectures Swinburne University of Technology Melbourne, Australia CRICOS number 00111D http://www.caia.swin.edu.au