Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 4.00 average. Display Modes
Old 15-06-2015, 15:37   #376
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Marqus View Post
Yes, keeping in mind that this thread was launched as an "enduring" thread for aiding CHROOT linux installation rather than one of the million transient ones, I should probably not have drawn the conversation to tablet brightness. Sorry 'bout that gents.

I'm still interested in that conversation, but I will start a thread about outdoor viewable tablets in an appropriate sub-forum (hope you take a look that one, RhythmDoctor). Tablet brightness is not really a CHroot or even Linux issue.

Back to the core business of CHROOT - when I installed LinuxDeploy, there was an option called "Installation Type" and I went with the default value being "File" (the others were Partition and Custom).

So my current understanding is that my entire Linux Root-and-below directory structure ended up as a 'virtual' structure living inside a big IMG file in an Android directory (I can see the file in path storage/sdcard/0/linuxdeploy/ in my case).

This means an app like FX Explorer cannot "see" inside that directory structure (inside the IMG file).

So question: How does one go about getting LinuxDeploy to install such that it establishes the Linux root-and-below directory structure as a 'normal' folder structure hanging off a branch of the standard Android folder structure? You'd think that to be the simplest form of "chroot".

Is it by choosing "Partition" or "Custom" instead of "File" in the Installation Type config?
Marqus,

Regarding the linux.img file. Two ways to access the linux files.

1.) Use Linux Deploy to 'start' the process of mounting the partitions contained in the image file as you normally do when wanting to use OpenCPN. Once mounted the partitions and files are accessible with FX. No need to launch the VNC viewer.

2.) Using the android terminal 'su' <enter> Then mount the system with this command. '/data/local/linux/bin/linuxdeploy shell' <enter> The linux partitions and files are now accessible with FX.

If you want to install linux using Linux Deploy as a 'partition' I suggest you use a fresh external sdcard for the purpose. 16 Gb will suffice, but 32 Gb gives you more room in both the primary partition (VFAT up to 4 Gb) and second linux partition (ext3 or ext4) using all remaining space. Use a linux box if you have one to partition and format the extsdcard. 'Gparted' is a good GUI program for the purpose.

Once properly partitioned and formatted the card is ready for you to install linux with Linux Deploy.

You'll need to create an empty file with FX then copy in the following code:

#!/system/bin/sh
REALMNT=/mnt/fuse/sdcard1_real
if ! [ -d "$REALMNT" ]; then
mkdir "$REALMNT" || exit 1
fi
mount -t ext3 /dev/block/mmcblk0p2 "$REALMNT"
sdcard "$REALMNT" /storage/sdcard1 1023 1023 &

One caveat. your external sdcard may not be mmcblk0p2. Run 'cat /proc/partitions' to see what android partitions show up. You can try mmcblk0p2....

Save as 'userinit.sh' and copy to /use/local in the android system. This will automatically mount the ExtSdcard on boot.

Set up Linux Deploy to install to /mnt/fuse/sdcard1_real.

Proceed with installation.
__________________

__________________
Wrong is offline   Reply With Quote
Old 15-06-2015, 17:13   #377
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Marqus,

One further note: To access your newly installed linux system on the sdcard1_real go to '/mnt/fuse/sdcard1_real' in the android system...
__________________

__________________
Wrong is offline   Reply With Quote
Old 16-06-2015, 10:13   #378
Registered User

Join Date: Feb 2011
Location: South-East Australia coast
Boat: 40ft fibreglass sloop
Posts: 163
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Wrong View Post

Regarding the linux.img file. Two ways to access the linux files.

1.) Use Linux Deploy to 'start' the process of mounting the partitions contained in the image file as you normally do when wanting to use OpenCPN. Once mounted the partitions and files are accessible with FX. No need to launch the VNC viewer.

2.) Using the android terminal 'su' <enter> Then mount the system with this command. '/data/local/linux/bin/linuxdeploy shell' <enter> The linux partitions and files are now accessible with FX.

I've tried both procedures 1) and 2) and seem unsuccessful with both.

To explain where I am, I've attached three screenshots:

a) Shows my Linux startup log, with partitions being mounted

b) Shows the folders in the root/data/local/ folder using a file explorer app - there is no "/data/local/linux/..." to be found at all, only a TMP folder. (There's also no "local' folder inside the /data/data/ path visible on the screenshot).

c) Shows my Terminal history, where I log in as Superuser, then try to execute the ".../bin/linuxdeploy shell" command. The command fails. I then do a couple of directory navigations and show the contents of a "bin" directory I find under the root.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_linuxdeploy_start.jpg
Views:	116
Size:	308.1 KB
ID:	103823   Click image for larger version

Name:	Screenshot_folders.jpg
Views:	112
Size:	100.7 KB
ID:	103824  

Click image for larger version

Name:	Screenshot_terminal.jpg
Views:	109
Size:	227.8 KB
ID:	103825  
__________________
Marqus is offline   Reply With Quote
Old 16-06-2015, 11:50   #379
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Marqus,

You use either Linux Deploy to mount the linux system OR the android terminal.

Please provide from Linux Deploy 'Settings':

1.) Environment path.
2.) Install path from the downward pointing arrow.

You should use an android terminal downloadable from Google Play.

Looks to me like tou were using a terminal integral to Linux Deploy, AFTER you'd already 'started' Linux Deploy. So, you were issuing the /data/local/linux/bin/linuxdeploy shell from within the mounted linux system, not from the android side...
__________________
Wrong is offline   Reply With Quote
Old 16-06-2015, 14:08   #380
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Marqus,

Jumping ahead a bit.

In most android file managers for rooted devices you need to go into settings and enable root access and operations. It is not enabled by default and you'll typically get a warning message of the type "are you sure?" when enabling root file access and operations. Until this is done you may not see /data/local/linux.

Some recent custom ROMS also have this requirement. So, don't expect just because you've rooted your device and installed a custom ROM there will automatically be root permissions granted. If SuperUser is not included with your custom ROM and is installed seperately, with a SuperUser icon on the android desktop, you must open the SuperUser application. Scroll waaay down and enable SuperUser Pro. If Super is included with your custom ROM, the android settings module is where you go to make an important change. #Superuser>Settings (three vertical dots), Multiuser policy>All users can request superuser.

Not saying this is Marqus' problem, just useful information...

Finally, developer options are made visible by tapping on "build number" in "About Tablet" 5 times or so..."
__________________
Wrong is offline   Reply With Quote
Old 17-06-2015, 09:39   #381
Registered User

Join Date: Feb 2011
Location: South-East Australia coast
Boat: 40ft fibreglass sloop
Posts: 163
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Wrong View Post
Looks to me like tou were using a terminal integral to Linux Deploy, AFTER you'd already 'started' Linux Deploy.
Sharp observation, and when you said that, the penny dropped for me.
When I encountered an issue installing LinuxDeploy, I googled to find solutions and found a post in some tech forum where the poster had installed LinuxDeploy on the same Nexus 7 hardware as I have. He also mentioned that he set up his terminal session using ConnectBot (android app) so I used that too, thinking if that worked on Nexus I'll stick to the same.

Now I checked and see that ConnectBot creates a terminal session via LinuxDeploy's SSH service, whereas Terminal Emulator does not.

So it sounds like my OpenCPN install was not using the right Terminal, although surprisingly the compiled OpenCPN works pretty well, including GPS.

The SSH Terminal's host name is "localhost", whereas Terminal Emulator's host name is "Android". So I asked "localhost" to compile and install OpenCPN instead of asking "Android".

At least I'm learning about Linux along the way, which may enable me to drop Windows as a desktop o/s in the medium term.

Since my LinuxDeploy is fine, I'm considering the option of uninstalling OpenCPN (using apt-get remove with purge) to then re-install and build using the Android host. What do you think?
__________________
Marqus is offline   Reply With Quote
Old 18-06-2015, 04:40   #382
Registered User

Join Date: Feb 2011
Location: South-East Australia coast
Boat: 40ft fibreglass sloop
Posts: 163
Re: OpenCpn Install on Android Tablets Easier Now.

Just an explanation of the context of this (and preceding) post - I followed the CHroot install procedure on my Nexus 7 and have OpenCPN successfully running with GPS location. So my tablet chartplotting is fine.

Purely in the interests of understanding things beneath the covers am I asking a few questions regarding Terminal apps and file structures used by Android vs LinuxDeploy.

Here's some environment variables when I run the Terminal Emulator app:

HOSTNAME = android
PATH = /data/local/bin;/system/bin;/system/xbin
MHSH = /system/bin/sh
SHELL = /system/bin/sh
USER = u0_a46
HOME = /data
TERM = screen
ANDROID_DATA = /data
ANDROID_ROOT = /system
EXTERNAL _STORAGE = /storage/sdcard0

Regarding the installation procedure that downloads and compiles OpenCPN:
Since OpenCPN runs on the Linux Debian machine, and not the Android machine, I imagine that one would have to change the Host of the Terminal Emulator from "Android" to the Debian machine before you compile and install the OpenCPN application and its associated support packages.

If that host-swapping action is actually done via the Motorola Xoom procedure step where you execute "/data/local/linux/bin/linuxdeploy shell", then it's tricky for me because my /data/local/ directory does not contain a "/linux" subdirectory, no matter what tool I use to look at the folders - Terminal Emulator, FX Explorer or another android file manager - they all concur that the only child of /data/local/ is a /tmp folder.

Is the /data/local/linux/bin path created during the LinuxDeploy install, or does it pre-exist on an Android device?
__________________
Marqus is offline   Reply With Quote
Old 18-06-2015, 07:37   #383
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Marqus View Post
Sharp observation, and when you said that, the penny dropped for me.
When I encountered an issue installing LinuxDeploy, I googled to find solutions and found a post in some tech forum where the poster had installed LinuxDeploy on the same Nexus 7 hardware as I have. He also mentioned that he set up his terminal session using ConnectBot (android app) so I used that too, thinking if that worked on Nexus I'll stick to the same.

Now I checked and see that ConnectBot creates a terminal session via LinuxDeploy's SSH service, whereas Terminal Emulator does not.

So it sounds like my OpenCPN install was not using the right Terminal, although surprisingly the compiled OpenCPN works pretty well, including GPS.

The SSH Terminal's host name is "localhost", whereas Terminal Emulator's host name is "Android". So I asked "localhost" to compile and install OpenCPN instead of asking "Android".

At least I'm learning about Linux along the way, which may enable me to drop Windows as a desktop o/s in the medium term.

Since my LinuxDeploy is fine, I'm considering the option of uninstalling OpenCPN (using apt-get remove with purge) to then re-install and build using the Android host. What do you think?
Wiki definition: "In computer networking, 'localhost' is a hostname that means this computer and may be used to access the computer's own network services via its loopback network interface."

Typically, 'localhost' has a network interface 127.0.0.1 which is also used by Connectbot. So, whichever name you use, Connectbot's 'Android' or 'localhost' the result is the same.

Connectbot is not a 'terminal' in the same sense as the android terminal.

"ConnectBot is a Secure Shell client for the Android platform. Its ultimate goal is to create a secure connection through which you can use a shell on a remote machine and transfer files back and forth to your phone."

More later... Gotta catch a bus!
__________________
Wrong is offline   Reply With Quote
Old 18-06-2015, 08:53   #384
Registered User

Join Date: Feb 2011
Location: South-East Australia coast
Boat: 40ft fibreglass sloop
Posts: 163
Re: OpenCpn Install on Android Tablets Easier Now.

In an above post I listed the environment variables when running Terminal Emulator.

Below are the environment variables when running the ConnectBot client (LinuxDeploy username at install is "usermm"):

HOSTNAME = localhost
TERM=screen
SHELL=/bin/bash
SSH_CLIENT=127.0.0.1 47827 22
SSH_TTY=/dev/pts/4
USER=usermm
MAIL=/var/mail/usermm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/home/usermm
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/usermm
LOGNAME=usermm

A few differences in paths, home folder and shell path.
__________________
Marqus is offline   Reply With Quote
Old 18-06-2015, 19:18   #385
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Getting back to your original question. How to access the linux system with FX? Disregarding everything you've done and said for the moment;

1.) In Linux Deploy 'Settings' what is the environment path? Normally it is /data/local/linux
2.) We already know the install path is /storage/sdcard0 because that's where you say linux.img is found.

Provided you are using the android terminal, 'su', '/data/local/linux/bin/linuxdeploy shell' you'll see this output:

u0_a110@everest:/ $ su
root@everest:/ # /data/local/linux/bin/linuxdeploy shell
>>> begin: shell
Mounting partitions:
/ ... done
/proc ... done
/sys ... done
/sys/fs/selinux ... skip
/dev ... done
/dev/tty ... done
/dev/pts ... done
/dev/shm ... done
/proc/sys/fs/binfmt_misc ... skip
/mnt/sdcard ... done
Updating configuration:
dns ... done
mtab ... done
Debian GNU/Linux wheezy/sid [running on Android via Linux Deploy]
root@localhost:/#

Notice that ssh is not started because viewing the linux desktop is not our objective. It is simply to mount the partitions so the filesystem is visible and files can be installed using yum, source code can be compiled and once finished programs like OpenCPN installed, copied, deleted, renamed, etc...

You could use a command to start ssh too, but why, when using Linux Deploy makes things so much easier for most users? You're more the tinkerer than I am, but look at the difficulties you've encountered by diverging from my instructions. ConnectBot may start ssh and mount partitions but it knows nothing about the Linux Deploy configuration and executable files. You can still use Free bVNC to view the linux desktop because it's settings specify localhost or Android because it and ConnectBot use the same 127.0.0.1 network... However ConnectBot does not use 'linuxdeploy' which is a script that performs steps ConnectBot knows nothing about.

Notice when Linux Deploy says 'updating configuration' or 'updating environment'. It is actually creating /data/local/linux when this is happening.

So, either use Linux Deploy or the android terminal. Not ConnectBot...
__________________
Wrong is offline   Reply With Quote
Old 19-06-2015, 08:26   #386
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Marqus said:

"Since my LinuxDeploy is fine, I'm considering the option of uninstalling OpenCPN (using apt-get remove with purge) to then re-install and build using the Android host. What do you think?"

Well, it's not absolutely clear to me when the Connectbot "Android" app entered the picture re: installation of linux and OpenCPN.

The linux.img is where Linux Deploy expects it to be. So, I'd recommend you simply have Linux Deploy update the environment and configuration files..

Regarding OpenCPN installed from source. To remove simply delete /usr/bin/opencpn, /usr/share/opencpn, and /usr/lib/opencpn. 'cd' /home/android/Downloads/OpenCPN/build then run 'clean'. Recompile and install using a version of an android terminal from Google Play. Terminal Emulator works for me.

Wouldn't use ConnectBot at all...
__________________
Wrong is offline   Reply With Quote
Old 20-06-2015, 07:13   #387
Registered User

Join Date: Feb 2011
Location: South-East Australia coast
Boat: 40ft fibreglass sloop
Posts: 163
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Wrong View Post

1.) In Linux Deploy 'Settings' what is the environment path? Normally it is /data/local/linux
2.) We already know the install path is /storage/sdcard0 because that's where you say linux.img is found.

Provided you are using the android terminal, 'su', '/data/local/linux/bin/linuxdeploy shell' you'll see this output:

u0_a110@everest:/ $ su
root@everest:/ # /data/local/linux/bin/linuxdeploy shell
>>> begin: shell
Mounting partitions:
/ ... done
/proc ... done
/sys ... done
/sys/fs/selinux ... skip
/dev ... done
/dev/tty ... done
/dev/pts ... done
/dev/shm ... done
/proc/sys/fs/binfmt_misc ... skip
/mnt/sdcard ... done
Updating configuration:
dns ... done
mtab ... done
Debian GNU/Linux wheezy/sid [running on Android via Linux Deploy]
root@localhost:/#
Thanks, I learned a lot from all your comments in this post.

My LinuxDeploy "settings" environment path is:
"/data/data/ru.meefik.linuxdeploy/linux"

Don't know how or why it defaulted to that setting - I never set it thus.

However, when I use Android Terminal Emulator to run the "shell" command via that path, I get the partition mounting list mirroring yours above. That's the first time I was able to execute that "shell" command successfully (thanks for help with that).

That's probably why I resorted to trying ConnectBot to do the OpenCPN install - simply because I did not know my environment path setting had NOT defaulted to "/data/local/linux/".

I'd like to change my Environment path to "/data/local/linux". To do that, do I simply update the path in LinuxDeploy Settings, and then do a:
1) Reconfigure, or
2) an entire repeat of the Install of LinuxDeploy?
__________________
Marqus is offline   Reply With Quote
Old 20-06-2015, 08:16   #388
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Marqus View Post
Thanks, I learned a lot from all your comments in this post.

My LinuxDeploy "settings" environment path is:
"/data/data/ru.meefik.linuxdeploy/linux"

Don't know how or why it defaulted to that setting - I never set it thus.

However, when I use Android Terminal Emulator to run the "shell" command via that path, I get the partition mounting list mirroring yours above. That's the first time I was able to execute that "shell" command successfully (thanks for help with that).

That's probably why I resorted to trying ConnectBot to do the OpenCPN install - simply because I did not know my environment path setting had NOT defaulted to "/data/local/linux/".

I'd like to change my Environment path to "/data/local/linux". To do that, do I simply update the path in LinuxDeploy Settings, and then do a:
1) Reconfigure, or
2) an entire repeat of the Install of LinuxDeploy?
It is very possible the developer has changed the environment location to "/data/data/ru.meefik.linuxdeploy/linux". I believe I saw that once in a changelog on his Google Play page. However, anyone with the environment set to /data/local/linux is unlikely to see anything change on a Linux Deploy update. Only first timers will possibly see "/data/data/ru.meefik.linuxdeploy/linux" as the environment variable. I'll add this warning to my instructions.

I don't believe changing the environment variable in Linux Deploy to /data/local/linux will hurt. Certainly easier to remember & type! Change then update the environment in Linux Deploy.

Were you successful viewing the linux filesystem with FX?
__________________
Wrong is offline   Reply With Quote
Old 20-06-2015, 10:45   #389
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

Quote:
Originally Posted by Wrong View Post
Marqus said:

"Since my LinuxDeploy is fine, I'm considering the option of uninstalling OpenCPN (using apt-get remove with purge) to then re-install and build using the Android host. What do you think?"

Well, it's not absolutely clear to me when the Connectbot "Android" app entered the picture re: installation of linux and OpenCPN.

The linux.img is where Linux Deploy expects it to be. So, I'd recommend you simply have Linux Deploy update the environment and configuration files..

Regarding OpenCPN installed from source. To remove simply delete /usr/bin/opencpn, /usr/share/opencpn, and /usr/lib/opencpn. 'cd' /home/android/Downloads/OpenCPN/build then run 'make clean'. Recompile and install using a version of an android terminal from Google Play. Terminal Emulator works for me.

Wouldn't use ConnectBot at all...
Note edit in bold type.....
__________________
Wrong is offline   Reply With Quote
Old 12-08-2015, 11:57   #390
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OpenCpn Install on Android Tablets Easier Now.

As of today current version of OpenCPN downloading from git is 4.1.718

If you don't know what this means refer to my instructions here: Building on Motorola Xoom | Official OpenCPN Homepage

Once your device has been rooted the instructions are mostly copy and paste.

This version compiles, installs and runs without any apparent problems. Linux flavour is Debian Wheezy/Sid.

Be aware that in order for your gps to work in OpenCPN you must still use either GPS Share WIFI or GPS Turbo. See this thread for full discussion: GPS Working with OpenCPN on Androids

Problems? Post in this thread to request help.
__________________

__________________
Wrong is offline   Reply With Quote
Reply

Tags
opencpn

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Xoom Quad Band Int'l Armel Running OpenCPN armido OpenCPN 25 03-11-2012 07:44
Open CPN and Google Earth bgrimwade OpenCPN 19 09-12-2011 16:32
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 05:31



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 06:59.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.