Mr. Bit Pocket Lab – Developing on RPi3 using Android

Time is against us, PiWars 2017 is less than 5 weeks away. We didn’t realise that building a robot would be so involved. We need every minute we can find to work on Mr Bit and with travel and weekends away scheduled we’re going to need to use any downtime whilst not at home (on the train etc) to continue to develop our Pi based robot.

We’ve created a mobile lab, smaller than a laptop, so we can take our work with us anywhere in our pocket!. In it’s most basic form it’s our RPi3, a 5V power bank and an Android phone.

1. Tether the Pi to the Android using the phone’s “hotspot”

You’ll need to access the Pi to do this of course and turn on the phone’s hotspot. We used an ethernet cable connected to our laptop and then added our phone hotspot to the wifi device but it can easily be done connecting the Pi to a monitor/tv and using the wifi utility on the Pi’s desktop. Make sure the settings are saved, you can check this from a terminal:

and check for

Tethering the Pi in this way not only connects it to a mobile wifi network you can carry with you but also to the internet using the Phone’s data connection when available – mobile apt-get and git on the go!

2. Get the I.P. address of the tethered Pi:

Once tethered we’re going to need the Pi’s I.P. address. We used a network detection app called Network Discovery in the Play store. When using this app we found that it reported the wifi being disabled and wouldn’t scan when the hotspot was turned on. We needed to go into the settings and under General there’s a Network Interface option, here you can chose wlan0 which will allow scanning of the local and connected devices.

Screenshots of using Network Discovery app to find the Pi's I.P address

Screenshots of using Network Discovery app to find the Pi’s I.P. address

3. SSH into the Pi:

Install a terminal on the phone, we’re using Termux which is a linux environment emulator. It looks like we can do quite a lot with terms itself on the phone such as use git, nano and install using apt-get. However, we are just using SSH at the moment to tunnel into the Pi (using the discovered I.P. address in step 2).

4. Optional additions:

  • Get a bluetooth keyboard, we like the feel of hardware keyboards rather than software though either work. The keyboard connects to the phone via bluetooth and should just work out of the box, ours did anyway.
  • With an ethernet cable we can plug into our macbook’s thunderbolt port. Although laptops are mobile, they’re not as mobile as a phone so we just have this as a backup to ssh into the Pi from the Laptop when needed. (We haven’t actually needed it yet though!).
  • Github installed on the Pi – this is our comfort blanket. Whenever we work we commit our code to our repo from the Pi which uses the phone’s data connection.
  • Components – For our a lot of our development is hardware based of course. We tend to carry a small pot of components we are working on with us. And yes, this does get some funny and often interested looks on the train!

Leave a Reply

Your email address will not be published. Required fields are marked *