The MonoBrick Tunnel for Android allows you to control a LEGO Mindstorms Brick over a Wi-Fi or 3G connection from the MonoBrick Remote while streaming live video. The tunnel works by placing the phone on the robot and connecting to the LEGO Mindstorms Brick via Bluetooth. Then from the MonoBrick Remote you connect to the Tunnel which then forwards messages from TCP/IP to Bluetooth and vice versa.
All features from the MonoBrick communication library and the MonoBrick Remote can be used with the Tunnel. This includes reading sensors, starting a program, upload a file and controlling a vehicle – the tunnel can be downloaded from Google Play. With the MonoBrick Android Tunnel you can:
- Control a vehicle over Wi-Fi or 3G
- Stream live video using VLC (needs to be installed)
- Connect to the phone when it is NAT’ed (when the phone is using 3G)
- Select between three different resolutions and bitrates to match the bandwidth of your connection
In order to stream video you need to download and install VLC.
Pairing your phone with the LEGO Brick
The first time you run MonoBrick Tunnel you will be guided through the process of pairing you phone with your LEGO Brick. This is shown on the screenshots below.
Once the phone and LEGO Brick has been paired use the settings to determine what port to use for TCP/IP communication and video streaming. This is described below.
Running the tunnel on a Wi-Fi network
Make sure that the phone is only connected to the Wi-Fi network and not a 3G network before starting the tunnel. To start the tunnel and create a connection from the MonoBrick Remote simply follow the procedure as shown below.
You should now be able control the brick over a Wi-Fi network. To start video streaming go to the tunnel tab and press start streaming. Note that it is only necessary to set the RTSP port and video port on the phone. If you are not able to establish a connection please make sure to disable any firewalls that you might have running.
Running the tunnel over a 3G network
Make sure that the phone is only connected to the 3G network and not a Wi-Fi network before starting the tunnel. You also need to make sure that traffic to your PC is forwarded – normally this involves setting up port forwarding on your router. Once you have made sure that traffic on the Tunnel port, RTSP port and video port is forwarded establishing a connection from the phone to a PC running the MonoBrick Remote is done as shown below.
Following this procedure you should now be able control the brick over a 3G network.
Questions related to the MonoBrick Tunnel for Android can be found in the MonoBrick communication library forum.