User Tools

Site Tools


mobile_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mobile_linux [2019/03/31 06:18]
admin [Options]
mobile_linux [2019/06/27 12:51] (current)
admin [Raspberry Pi]
Line 1: Line 1:
 ===== Mobile Linux ===== ===== Mobile Linux =====
  
-The goal is to get a full Linux environment running on minimal power in something like a mobile phone package.+The goal is to get a full Linux environment running on minimal power in something like a mobile phone or very small tablet.
  
-Q:  What's a full Linux environment? ​ A:  For the purposes of this discussion, we'll say it's a well supported distribution running with a conventional window manager, good enough CPU, RAM, disk, screen, keyboard and mouse to do normal day-to-day task including development. ​+Q:  What's a full Linux environment? ​ A:  For the purposes of this discussion, we'll say it's a well supported distribution running with a conventional window manager, good enough CPU, RAM, disk, screen, keyboard and mouse to do normal day-to-day task including development.
  
-Q: What is minimal power? ​ A:  ​For the purposes ​of this discussion it is 5W, that is 1A at 5V.  Why?  Because that's the sort of power you can get from conventional Power Packs, so enabling long off-grid usage.+Q: So what is minimal power? ​ A:  ​Let's say a max of 5W, that is 1A at 5V.  Why?  Because that's the sort of power you can get from conventional Power Packs, so enabling long off-grid usage.
  
-Q: What is good enough CPU?  A: From playing with the full range of Raspberry Pis, anything fairly recent seems good enough. ​ Specifically,​ a single core running at 1GHz is good enough.+Q: So what is good enough CPU?  A: From playing with many devices, anything fairly recent seems good enough. ​ Specifically,​ a single core running at 1GHz is good enough ​to run Linux well.
  
-Q: What is good enough RAM?  A: At 512MB things can swap, 1MB or more is good.+Q: So what is good enough RAM?  A: At 512MB things can swap, 1MB or more is good.
  
-Q: What is good enough disk?  A: Enough to install a fully featured environment and have space to play.  Let's say that is at least 32GB, preferably ​128GB.+Q: So what is good enough disk?  A: Enough to install a fully featured environment and have space to play.  Let's say that is at least 8GB, preferably ​32B or more (200GB is now quite affordable but often unsupported).
  
-Q: What is good enough screen? ​ A:  I have 3.5" going, it's too small! ​ 5" is probably minimally acceptable, anything over 7" is probably going to take too much power+Q: So what is good enough screen? ​ A:  I have 3.5" going, it's too small! ​ 5" is probably minimally acceptable, anything over 7" is probably going to take too much power so 7" is probably the sweet spot.
  
-Q: What is good enough keyboard/​mouse? ​ A: Any conventional bluetooth keyboard is probably good enough.+Q: So what is good enough keyboard/​mouse? ​ A: Any conventional bluetooth keyboard is probably good enough.  There are a couple of links at the end for stuff I like.
  
-==== Design constraints ====+So let's go through all the options:
  
-It is commonly accepted that: +==== Kindle eReader Options ====
-  * Most of the power goes in the screen +
-  * ARM are lower power CPUs than Intel +
-  * The Raspberry Pi and Android devices are easily available starting points+
  
-==== Options ​====+=== Kindle Linux === 
 + 
 +I picked up a paperwhite 3 (7th generation) on eBay for £30 so this had to be worth a go.  The main instructions are [[http://​www.mobileread.com/​forums/​showthread.php?​t=275877|here]]. ​ They are pretty confusing as they are old and outdated, what's more the old system images have been removed. ​ However, for the paperwhite 3 there are other instructions [[https://​www.mobileread.com/​forums/​showthread.php?​t=275887|here]]. ​  This gets you to a rooted paperwhite running the latest software (currently 5.11.1.1). ​  The installation of KUAL is convoluted, but then quite a bit of other stuff is easy. 
 + 
 +This gets you to a root account you can ssh into/out from using kterm. ​ To complete the job I need to work out how to port standard Linux packages, others have done it quite a bit is it is possible but hard work... 
 + 
 +[[https://​www.mobileread.com/​forums/​showthread.php?​t=187146|nano]] 
 + 
 +=== Debian on Kindle === 
 + 
 +Being root you can set up a chrooted installation of Debian - I haven'​t had time to do this yet. 
 + 
 +==== Raspberry Pi ==== 
 + 
 +The Rasperry Pi is great, I love them and have lots.  The main choice is between the tiny and low powered Raspberry Pi Zero W and the top dog Raspberry Pi 4.  If you want all the specs then you want the [[https://​www.modmypi.com/​blog/​raspberry-pi-comparison-table|Raspberry Pi comparison table]] and [[https://​www.tomshardware.com/​reviews/​raspberry-pi-4-b,​6193.html|Raspberry Pi 4 comparison]]. ​ The development enviroment is great, all that is missing is the screen.
  
 === Raspberry Pi with GPIO 3.5" screen === === Raspberry Pi with GPIO 3.5" screen ===
  
-There are a number of 320x480 screens that work as a HAT on Pis with the GPIO header installed. ​  For example [[https://​www.robotshop.com/​uk/​35i-tft-lcd-320x480-touch-display-raspberry-pi.html|this for £23.62]] ​pr [[https://​www.ebay.co.uk/​itm/​3-5-inch-320-480-TFT-LCD-Display-Touch-Screen-for-Raspberry-Pi-3-B-2-Model-B/​281630179282|this for £9.80]].  ​+There are a number of 320x480 screens that work as a HAT on Pis with the GPIO header installed. ​  For example [[https://​www.robotshop.com/​uk/​35i-tft-lcd-320x480-touch-display-raspberry-pi.html|this for £23.62]] ​or [[https://​www.ebay.co.uk/​itm/​3-5-inch-320-480-TFT-LCD-Display-Touch-Screen-for-Raspberry-Pi-3-B-2-Model-B/​281630179282|this for £9.80]].  ​ 
 + 
 +They are fairly easy to set up, and they sit nicely over a model B.  Rasbian has defaults for small screens that are a good starting point. ​  ​However,​ the screen size is really small, it's a real strain to read and too small to do any work.  The screen update is also very slow, perhaps because it's via the GPIO.
  
-They are fairly easy to set up, and they sit nicely over a model B.  Rasbian has defaults for small screens that are a good starting point  However, the screen size is really small, it's a real strain to read and too small to do any work.  The screen update can be slow, perhaps because it's via the GPIO.+Conclusion: ​ 3.5" display ​is just too small.
  
 === Raspberry Pi with HDMI 5" screen === === Raspberry Pi with HDMI 5" screen ===
  
-The standard 5" is HDMA, such as [[https://​www.ebay.co.uk/​itm/​For-Raspberry-Pi-2-3-B-5-Inch-LCD-Display-800x480-Resistive-Touch-Screen-Kit-UK/​332618790105|this for £23.78]]. ​ The resolution is 800x480 which is just about acceptable, given all the constraints.  I found the power consumption quite high, but I don't have hard numbers yet.+The standard 5" is HDMA, such as [[https://​www.ebay.co.uk/​itm/​For-Raspberry-Pi-2-3-B-5-Inch-LCD-Display-800x480-Resistive-Touch-Screen-Kit-UK/​332618790105|this for £23.78]]. ​ The resolution is 800x480 which is just about acceptable, given all the constraints.
  
-=== Raspberry Pi with external Kindle terminal ===+TO DO: Reconfigure and measure power consumption. ​ Informally it seems to be too high.
  
-A basic kindle has a 6" eInk screen, potentially big enough.  The refresh rate on eInk is very poor (as it the colour) but it does have lower power consumption.   ​However,​ the oft quoted "30 days" of battery life for a Kindle is a misconception, it'​s ​30 * 30 mins, or 15 hours  The Kindle ​itself isn'​t ​powerful enough (not enough RAM or diskand it'really ​not clear that the extra life of eInk is worth the extra processor ​and comms and display slowness. ​  Here is what it looks like when working http://netbuffalo.doorblog.jp/archives/4609419.html+=== Raspberry Pi with external eInk Kindle VNC terminal === 
 + 
 +A basic kindle has a 6" eInk screen, potentially big enough ​and has very low power consumption, ​but it'​s ​black and white To match the power consumption I used a Raspberry Pi Zero W with a cheap OTG hub for a small keyboard/​mouse and for USBnet to connect the Kindle ​and Pi (this way we don'​t ​need wireless on either device, which keeps the power down)
 + 
 +== Install == 
 + 
 +On the Pi Zero W: 
 + 
 +  * Start by installing the latest raspbian, I'm using 2019-06-20-raspbian-buster-full 
 +  * enable SSH and VNC, e.g. using raspi-config 
 +  * swap is really ​useful, edit /​etc/​dphys-swapfile commenting out the derisory CONF_SWAPSIZE ​of 100k to get the default 2x RAM 
 +  * if your raspbian ​is pre-buster then enable usbnet. there are many guides, e.g. [[https://​www.thepolyglotdeveloper.com/​2016/​06/​connect-raspberry-pi-zero-usb-cable-ssh|this one]]. 
 +  * set the RPi VNC server to use VNC account not Unix account 
 +  * 'apt install calibre' ​and if you want to clone an existing system sync then use the Library->​Import/​Export 
 + 
 +On the Kindle Paperwhite 3: 
 +  * root the Kindle as above 
 +  * install usbnet ​and in usbnet/​etc/​config  
 +  * install [[https://www.mobileread.com/forums/showthread.php?​t=228167|kvncviewer]] (not the older kindlevncviewer) 
 +  * run cd /​mnt/​us/​kvncviewer && ./luajit vncviewer.lua -user user -password **** 169.254.185.103 
 +  * set the RPi VNC server to use VNC account not Unix account 
 + 
 +These bits I haven'​t finished: 
 +  * set the RPi resolution to match the Kindle (my PW3 is 1440×1080) 
 +  * write the rc.local script to bring usbnet on boot 
 +  * measure the total power consumption (the Kindle is powered from the RPi) 
 + 
 +This is likely to be the least power solution for a full on Linux distribution.
  
 === Raspberry Pi with external Android X display === === Raspberry Pi with external Android X display ===
  
-"apt install xrdp" on the Raspberry Pi and "RD Client"​ on Android gives a full independent ​desktop ​on Android. ​  ​However,​ it transmits bit images which are slow over WiFi.+== remote ​desktop ​==
  
-=== noroot Debian on Android ===+"apt install xrdp" on the Raspberry Pi and "RD Client"​ on Android gives a full independent desktop on Android. ​  ​However,​ it transmits bit images which are slow over WiFi.   There may be optimisations where only certain windows are displayed on Android, but that is not what I'm after. 
 + 
 +== VNC == 
 + 
 +This works well (I used VNC viewer from RealVNC). ​ As above, I haven'​t yet tweaked screen resolutions. 
 + 
 +==== Android ​Options ====
  
-The best app depends on what version ​of Android ​is running.  For modern Android (currently 9) https://userland.tech/ seems to be best.  ​As stands, ​it's not a full distribution,​ just a chroot environment for the standard Android kernel ​to make it look like a full Linux. Also there seems to be the need to use remote desktop ​app (such as VNC) to see a full desktop. ​  I haven'​t ruled this out yet, but it would seem to need a lot more work.+The main choice here is to root or not to root.  As a useful rule of thumb, if your device ​is capable of running ​[[https://twrp.me|TWRP]] then you should go that route.  ​If it's not then you can spend lot of time trying ​to root without sucess Also, if you can exploit a backdoor ​to get root then malicous ​app could do the same - worth thinking about if you are going to trust your Android device with you Google account credentials.
  
 === root and replace Android with Debian/​Ubuntu === === root and replace Android with Debian/​Ubuntu ===
  
-Whilst Android is based on the Linux kernel, from what I've found it's near impossible to get a custom kernel to boot, and if it does it is very unlikely to support all the hardware as is needed (e.g. USB, WiFi, touchscreen). ​  ​I'​ve given up on this unless I stumble across a completely working system.+Whilst Android is based on the Linux kernel, from what I've found it's near impossible to get a custom kernel to boot, and if it does it is very unlikely to support all the hardware as is needed (e.g. USB, WiFi, touchscreen). ​  ​I'​ve given up on this unless I stumble across a completely working system.  The state of the art in this direction is [[https://​lineageos.org|LineageOS]] which is still Android, but you have control over everything.
  
-=== Linux on x86 tablet ===+=== root and run a chroot Linux === 
 + 
 +I have a way to get a root shell on a Alcatel Joy 1, but don't know how to get a full "​rooted"​ environment from that.  TWRP isn't supported so this took a long time. 
 + 
 +I have a Nexus 7 (2012) and it was easy to install TWRP.  I haven'​t got any further yet. 
 + 
 +=== noroot Debian on Android === 
 + 
 +The best app depends on what version of Android is running. ​ For modern Android (currently 9) https://​userland.tech/​ seems to be best.  As stands, it's not a full distribution,​ just a chroot environment for the standard Android kernel to make it look like a full Linux. Also there seems to be the need to use a remote desktop app (such as VNC) to see a full desktop. ​  I haven'​t ruled this out yet, but it would seem to need a lot more work as may services need root access. 
 + 
 +==== Linux on x86 mini notebook ==== 
 + 
 +These are generally too heavy and power hungry. ​ The closest option seems to be the [[http://​www.toshiba.co.uk/​discontinued-products/​satellite-click-mini-l9w-b-100|Toshiba Satellite Mini l9w]] which is only 470g for the tablet, but all in comes to 980g.  It has the advantage that it is USB charged. 
 + 
 +==== Linux on x86 tablet ​====
  
 Some tablets run a x86 processor, commonly the baytrail chipset. ​ Linx and Acer seem to be the affordable choices: Some tablets run a x86 processor, commonly the baytrail chipset. ​ Linx and Acer seem to be the affordable choices:
-  * [[https://​www.clove.co.uk/​linx-7|Linx 7]]: 7" screen, 281g, 1 GB RAM, 32 GB internal, 64 GB external, 3500 mAh up to 6 hours. ​ [[https://​www.ebay.co.uk/​itm/​Linx-7-7-Inch-Tablet-Atom-1-33-GHz-1GB-RAM-16GB-Windows-Black/​323711452391|ebay ​£37.99]].+  * [[https://​www.clove.co.uk/​linx-7|Linx 7]]: 7" screen, 281g, 1 GB RAM, 32 GB internal, 64 GB external, 3500 mAh up to 6 hours. ​ [[https://​www.ebay.co.uk/​itm/​Linx-7-7-Inch-Tablet-Atom-1-33-GHz-1GB-RAM-16GB-Windows-Black/​323711452391|about £35 on ebay]].  I bought one but the build quality isn't great and the screen connection gave up.  USB OTG and charging don't work together as standard, there is a forum somewhere that claimed a couple of BIOS changes fix this, I never got to find out
   * [[http://​support.linxtablets.com/​Products/​Linx820/​|Linx 820]]/810: 8" screen, 460g, 1 or 2 GB RAM, 32 GB internal, 64 GB external, xxxx mAh up to 6 hours. ​ [[https://​www.ebay.co.uk/​itm/​192870317551|eBay £49.99]].   * [[http://​support.linxtablets.com/​Products/​Linx820/​|Linx 820]]/810: 8" screen, 460g, 1 or 2 GB RAM, 32 GB internal, 64 GB external, xxxx mAh up to 6 hours. ​ [[https://​www.ebay.co.uk/​itm/​192870317551|eBay £49.99]].
-  * [[https://​www.acer.com/​ac/​en/​KH/​content/​model/​NT.L4USC.001|Acer Iconia One 7 B1-730HD]] 330g. 8 GB internal, max 32GB external;+  * [[https://​www.acer.com/​ac/​en/​KH/​content/​model/​NT.L4USC.001|Acer Iconia One 7 B1-730HD]] 330g. 8 GB internal, max 32GB external 
 +  * [[https://​www.acer.com/​ac/​en/​GB/​content/​series/​iconiatab8w|Acer Iconia Tab 8w]] 406g.  32GB internal, tested with 200G SD card.
  
 a 8" screen is 30% bigger in area than an 7" and will presumably use 30% more power. ​ The 8" Linx is more than proportionally heavier, probably due to battery. a 8" screen is 30% bigger in area than an 7" and will presumably use 30% more power. ​ The 8" Linx is more than proportionally heavier, probably due to battery.
Line 63: Line 124:
 I mocked up the 7" Linx using xrdp and a Raspberry Pi.  Screen size was acceptable, refresh was terrible but that was xrdp over WiFi. I mocked up the 7" Linx using xrdp and a Raspberry Pi.  Screen size was acceptable, refresh was terrible but that was xrdp over WiFi.
  
-==== Decision ​x86 tablet ​(7" Linx) ====+=== Linux in a VM on x86 Windows ​tablet ===
  
-7" is big for "​mobile phone" size, but having everything in one light, compact and robust container is an improvement over the Raspberry Pi solutions I started with.   At £38 including delivery I can't go too far wrong.+This may seem like cheating, but it does tick the boxes and it's how my main latptop works. ​ The VM route has the huge advantage that Bluetooth, Wifi, screen rotation, etc should all work.
  
 +Thanks to eBay, I have a Acer tab 8 w for only £20 to try this out with.  Although the documentation says that it only supports SD cards up to 32GB, it took a 200GB Sandisk card.  VirtalBox was easy to get running once I'd updated Windows 10 to the current patch level. ​ Getting xubuntu booted is much harder, at the moment I allocate only 380 MB RAM to VirtalBox and it says "​Initramfs unpacking failed: write error" which I assume means it needs more space, at 400 MB RAM VirtalBox can boot if everything else has been cleaned out (i.e. just after a reboot). ​ So far I get as far as the keyboard selection screen, then it all goes blank.
  
 +Even if it does work then I'm under the minimum RAM I thought I needed.
  
-==== Install ​====+=== Native Linux on Atom tablet ​=== 
 + 
 +== Install ​==
  
   - Skim the guide by [[ http://​www.linuxium.com.au/​how-tos/​creatingpersonalizedubuntumintanddebianisosforintelminipcs|linuxium]] and download isorespin.sh   - Skim the guide by [[ http://​www.linuxium.com.au/​how-tos/​creatingpersonalizedubuntumintanddebianisosforintelminipcs|linuxium]] and download isorespin.sh
Line 75: Line 140:
   - Run ''​./​isorespin.sh -i xubuntu-18.04.2-desktop-amd64.iso --atom''​   - Run ''​./​isorespin.sh -i xubuntu-18.04.2-desktop-amd64.iso --atom''​
   - Write linuxium-atom-xubuntu-18.04.2-desktop-amd64.iso to a memory stick (I didn't get a TF card to boot)   - Write linuxium-atom-xubuntu-18.04.2-desktop-amd64.iso to a memory stick (I didn't get a TF card to boot)
-  - Plug a USB hub into the Linx7 tablet along with a keyboard, mouse and memory stick+  - Plug a USB hub into the tablet along with a keyboard, mouse and memory stick
   - Hit ASC or DEL at reboot for BIOS/UEFI - I disabled secure boot, quiet boot and fast boot (perhaps not needed) ​   - Hit ASC or DEL at reboot for BIOS/UEFI - I disabled secure boot, quiet boot and fast boot (perhaps not needed) ​
   - Hit F7 at reboot and select "Boot from flash" to run your distribution Live   - Hit F7 at reboot and select "Boot from flash" to run your distribution Live
Line 82: Line 147:
     - Back up everything, e.g. ''​dd if=/​dev/​mmcblk1 | gzip > /​mnt/​mmcblk1.img.gz''​     - Back up everything, e.g. ''​dd if=/​dev/​mmcblk1 | gzip > /​mnt/​mmcblk1.img.gz''​
   - Optional: Use gparted to split the big Windows partition so you can put Linux in the spare space   - Optional: Use gparted to split the big Windows partition so you can put Linux in the spare space
-  - Hit F7 at reboot and install+  - Hit F7 at reboot and install ​on SD card or new partition as desired
    
 That should get you to running system. ​ If it doesn'​t other useful resources are http://​www.linxtablet.co.uk/​viewtopic.php?​t=2784 [[https://​cd-rw.org/​t/​running-ubuntu-linux-on-intel-baytrail-windows-tablets-linx-lamina-and-others/​458|cd-rw.org]] and [[https://​www.techradar.com/​uk/​how-to/​computing/​how-to-install-ubuntu-onto-a-windows-tablet-1319489/​4|techradar]]. ​ Maybe of interest are old notes from [[https://​ubuntuforums.org/​showthread.php?​t=2259837|Feb 2015]]. That should get you to running system. ​ If it doesn'​t other useful resources are http://​www.linxtablet.co.uk/​viewtopic.php?​t=2784 [[https://​cd-rw.org/​t/​running-ubuntu-linux-on-intel-baytrail-windows-tablets-linx-lamina-and-others/​458|cd-rw.org]] and [[https://​www.techradar.com/​uk/​how-to/​computing/​how-to-install-ubuntu-onto-a-windows-tablet-1319489/​4|techradar]]. ​ Maybe of interest are old notes from [[https://​ubuntuforums.org/​showthread.php?​t=2259837|Feb 2015]].
  
-=== Xubuntu specific ​===+== Xubuntu specific ==
   * Rotate the screen: ​ Settings -> Display -> Rotation -> Right   * Rotate the screen: ​ Settings -> Display -> Rotation -> Right
  
-=== Currently not working ​=== +== Currently not working == 
-  * disk encryption ​(password without keyboard??) +  * disk encryption:  how to enter a password without ​keyboard?
-  * insufficient swap+
   * bluetooth   * bluetooth
-  * audio +  * audio 
 +  * suspend to swap - needed to keep state when using zero power 
 +  * USB hub and charging - this turns out to be both very important and difficult ([[wp>​USB_On-The-Go]],​ [[https://​superuser.com/​questions/​1124237/​windows-tablet-otg-simultaneously-charge|hack]]). ​ Unfortunately none of the Linx 7/810/820, Viglen/​Tesco Connect 8 or Acer-Iconia-Tab-8-W-W1-810 have separate power and USB OTG.  Next is to try these [[http://​www.linxtablet.co.uk/​viewtopic.php?​t=38&​p=48|BIOS changes]]. 
  
 ==== Extras ==== ==== Extras ====
Line 101: Line 168:
   * [[https://​www.ebay.co.uk/​itm/​Mini-2-4G-Wireless-Keyboard-with-Mouse-Touchpad-For-PC-TV-Android-Laptop-White-K/​282235775203|112g Mini Keyboard/​Mouse/​Touchpad £4.47]]   * [[https://​www.ebay.co.uk/​itm/​Mini-2-4G-Wireless-Keyboard-with-Mouse-Touchpad-For-PC-TV-Android-Laptop-White-K/​282235775203|112g Mini Keyboard/​Mouse/​Touchpad £4.47]]
  
-==== Stretch goals ==== 
  
-Suspend to swap would be cool. 
  
mobile_linux.1554013136.txt.gz · Last modified: 2019/03/31 06:18 by admin