Wow …time is running fast! I can’t believe it’s been three months and no blogs in 2017! …Well the wait is over…
So, what am I up to recently… Well you must have read about my ‘Hobby
Stack’ last year… Now this stack is great if I want to host a tiny Hobby app but becomes problematic for development as it is too reliant on Internet…
Hobby Stack unfortunately does not help me much when I’m in a 10-hour flight? I could run Docker in my laptop but what if I’m having a laptop where I don’t have admin rights and no Hyper-V/VirtualBox? To add to the problems, now Laptops are getting banned as carry-ons. That means, at best tablets and mobiles is all we will have from user side.
I may be taking up some long travel soon and the thought of building my Private Cloud ‘Server’ that I could easily carry in flight is what prompted me to build one and write this blog…
So here are what I would state as the ‘Requirements’ for PoPriCl…
- The Box Needs to be ‘Portable’ meaning small enough to fit without any problem in a laptop bag and ready for check-in. Also, when in ‘working’ state it should be able to fit comfortably within the confined space of the worst economy seats in a plane.
- ‘Portable Power’ for >10 Hours -> I don’t think I can code for more than 10 hours on long haul flights…So this looks reasonable. Also, It is reasonable to look for external power but not all flights have USB/AC Ports available in all seats.
- Portable Wireless Network -> Capability to host its own Wireless Network would eliminate the need for a wireless router and need for congesting Ethernet cables
- Inexpensive -> The whole Hardware + Software should come in a budget of around ₹5000 … No Monthly recurring costs
- Currency with my ‘Hobby Stack’ software features to the extent possible…
- Hosted WebIDE so that I don’t need any Software…even Portable Software on my laptop… Only a bunch of Modern Browsers
That’s it…I don’t ask for too much, right!
There are many Options here but to satisfy the Portable Power criteria I needed kits that can be powered using Power Banks that supply power over USB. This is usually 5V/2A …That rules out the Intel Edison based x86 IOT Kits which need 12V supply…The rest are just too slow and specifically meant for Low Power IOT and not desktop grade…Outside the x86 world, comes the arm based kits and are powered by mini-USB. Of these I found the Raspberry Pi 3 Model B to be the best fit in my budget and still being desktop grade to handle at least 2-3 small containers easily. This comes with A 1.2GHz 64-bit quad-core ARMv8 CPU,802.11n Wireless LAN and Bluetooth 4.1 / Bluetooth Low Energy (BLE).
I got a simple 32GB micro SD Card for use as both the OS/Firmware and the Storage.
For Portable power, I was not sure how much would be good enough so I got a 20AH Power Pack… As per my Test it easily lasts for more than 24 hours…. So, I guess I could have used a lower end Power Pack as well.
Total Hardware BoM
Raspberry Pi 3
With Case/SD-Card/Power Supply the kits may go to about ₹4,000
Better Deals as time passes by. By the time you read this the rates may have gone
down further. Also Lower Capacity is also fine….
The Price Ranges from ₹1500 to ₹2500 …Also considering the
24Hour+ Capacity for 20AH, Lower capacity could be opted for as well
Its slightly over 5K Budget but not too much so excused 😉
How do I make it work for me?
Now that I have the gear, let’s set it up for action…
The Boot Image Mystery
The most common boot image used in Raspberry is the Raspbian. It is small and efficient but I wanted more. I chose to go with Hypriot OS which is fundamentally a Raspbian modified to work well with the latest Docker, swarm and Kubernetes configurations. I found this appealing as I would like to move straight to Developing stuff that tinker with
the knobs in Docker/Kubernetes. I have tried other images but ultimately Hypriot wins.
I used etcher to burn the ISO downloaded from https://blog.hypriot.com/downloads/. Just remember that in the default image the username/password is pirate/hypriot (all small).
Plug the micro SD card into the slot in RasPi and power up the RasPi. Ensure you have a LAN connect, HDMI monitor and USB keyboard attached.
On Login used the pirate/Hypriot combination and login. Now we need to setup the wireless.
Power up your AP provider which in my case was my mobile phone with hotspot switched ‘on’.
Scan the local wlan networks using
iwlist wlan0 scan | grep SSID
Ensure that the AP is listed…if yes then ‘Great!’ , else find some other AP that is detectable by RasPi.
Do not Proceed if your AP is not visible in the scan.
This method below for wlan may change in future versions…(Please keep track of the latest instructions in https://github.com/hypriot/flash#occidentalistxt) to enable Wireless Accesspoint
Open the Hypriot config file
Sudo nano /boot/occidentalis.txt
Change the hostname, wifi ssid and password(plaintext) as needed
# hostname for your Hypriot Raspberry Pi:
hostname= < Your new hostname>
# basic wireless networking options:
wifi_ssid= < correct SSID Name>
wifi_password= <correct password>
Save and exit
Now install adafruit-Occidentalis…
curl -SLs https://apt.adafruit.com/bootstrap | bash
Now try ip addr and you shoud have connected to the AP. If not try rebooting.
Once connected, you are ready with a letting go off, the hdmi screen, keyboard and LAN cable. Now onward you can connect to your RasPi over ssh or using WebIDE….
Congratulations, your device is now a Headless Device 😀
Install the excellent Adafruit WebIDE using instructions from https://learn.adafruit.com/webide/installation Or in short download using the
| sudo sh
Then access the WebIDE by opening the IP address of the RasPi from chrome on mobile.
[Updated 18th May2017]
Another good WebIDE is the Codiad….And the URL has a very detailed a nd self-explanatory install procedure…
I find Codiad to be better than AdaFruit WebIDE… Check it out…
SSH client on mobile
WebIDE is fine but if you want a quick and dirty SSH connection, then try TerMux client or Terminal IDE on android. Its small and extremely fast.
I hope this helps in your long travels also to be more fun and productive…Bon Voyage!