Direct Connect SSH from Android Tablet

I was wondering if there are any recommendations for connecting directly to a Raspberry Shake directly from an Android tablet (or phone) without internet connection. Essentially, I am able to connect directly from my desktop and/or laptop following instructions here. However, I would like to be able to use the same ssh functionality from an Android tablet (or phone), if this even possible. Right now, I am using an ethernet-USB-C converter (the same one I use when I connect via ssh from my computer’s USB-C port).

I have tried Juice SSH and Termius, with essentially the ssh shakeme@rs.local command (it’s slightly different than computer access in that there is no terminal per se. Using these apps, you set your username (shakeme) and the hostname (rs.local) beforehand. You also input the password and port, for which I have been using port 22). I get an error of “connection error (1005): Failed to resolve hostname rs.local (No address associated with hostname)” when I try using the rs.local hostname, and when I use the IP address that is listed when I had connected via my computer (for example, myshake@192.168.1.42), both applications time out.

Perhaps the issue is the Discovery IP, which I have not set up on the Android device, however I’m not sure if this is even possible (or if it is, how to do it).

This is for access to a raspberry shake where there is no internet. A tablet would make things easier for sure!

Riley

The problem is that the IP you have (assigned by your router/firewall) is in a private address range - not accessible from the Internet. This is partially for security and partially because IPs are a limited resource.

The R-Shake is designed to work behind a firewall, and relies upon that for security. It would be quite dangerous to expose your shake directly on the Internet.

The best way, if you want to access it remotely, via the Internet, is to set up a VPN on your network and use that to connect your iPad/phone then connect directly to your shake via it’s internal IP (192.168.1.42).

I use WireGuard running on a R-Pi on my network, to connect to any device on my internal network - including my R-Shake from my laptop of phone when away from home.

Thank you for your reply. This is helpful information about the IP, I did not realize that is what that indicated. Right now, I am only accessing it using SSH from an offline laptop or from my local network, so that makes sense.

I am trying to access the shake when I do not have internet (probably using that IP address as a hostname was a bad route to go). Basically, I want to have a shake set up in a relatively remote location, then physically go to the site and access/transfer the data every x number of days.

I can do this no problem with a laptop at the moment but being able to use a (android) tablet would greatly simplify things! I would like to just use the SSH connection with (the android equivalent of?) an scp command to copy data rather than trying to do anything wirelessly. If it’s much easier with an iPad, that works too.

Sounds like you want to run it in “off-line mode”. There is a section of the manual that covers that.

For ssh on Android, I suggest looking at Termux. It is not an ssh client in itself, it is more of a terminal emulator, but it does have a fairly wide selection of “packages” that you can add, one of which is openssl, which includes the ssh client.

Thanks for the tip. I tried that (it needed the openssh package), but I end up with same error: “ssh: Could not resolve hostname rs.local: No address associated with hostname.” The command I ran was ssh myshake@rs.local

Not sure if this is the right route to go, but I have been going through the Android settings and there is Settings > Connections > More connection settings > Ethernet which only allows me to click it when I have my Ethernet cable from the Raspberry shake (via a USB-C OTG adapter) plugged into the tablet. There is an option to “Connect to Ethernet network.” When I push that toggle, it does not work.

There is also an option to “Configure Ethernet device.” The only available device (with the shake plugged into the tablet) is eth0. It asks for Connection type (DHCP or Static IP). I have been doing the above steps with DHCP set (which is the default) without it working. I tried the last code block of the Raspberry Shake SSH page, but I cannot run sudo on termux without a package called tsu (according to termux), which I cannot install due to bad mirrors. (it may be a rooting issue…would like to not root the device if at all possible).

but there are several fields that need to be filled in for the Static IP option that I am not sure what to do with:

  • IP Address
  • Netmask
  • DNS address
  • Default gateway

There is also a dropdown for a “Proxy,” by default this is None, but can also be set up Manually or use “auto-config.” For auto-config, it needs a PAC web address. Options under manual:

  • Proxy host name
  • Proxy port
  • Bypass proxy for:
  • Authenticate server (checkbox)

If you want to run the shake disconnected from the Internet, your first problem is setting the data and time, which is normally done by querying NTP servers on the Internet. If you don’t have Internet, you have to set it some other way. You can set it manually (see the manual for off-line/classroom use). That will work, but the (software) clock on the R-PI will drift, maybe a lot.

The alternative is to add a GPS receiver to sync the time from the GPS satellites.

Next, connecting to the Shake … since there is no DHCP server to assign an address, you can use its “discovery” address. See this manual section:

https://manual.raspberryshake.org/discoveryIP.html

Thank you again for your response.

I am using a GPS receiver for timing purposes, that has not been an issue. (I have been able to get this all to work and have been able to download and analyze data via a computer…it’s just the tablet issue that I am trying to get figured out at the moment).

I tried using the advice from that page, but neither sudo nor ifconfig seem to work in termux. From what I can tell, it is because all of the mirrors that termux tries to use to download the appropriate packages for those particular commands do not work. These instructions are for linux too…not sure if that would work in Android even if I could get the proper packages installed.

Yes … Android tends to want a DHCP assigned address, either from a WiFi network or Wireless connection. There may be a way to do this … but you would probably have to root the device … you might spend a bit of time on Google to see what turns up.

A laptop would be a better/easier option, I think…

Something like Pagekite will provide a reverse tunnel so that the pi can be accessed securely from anywhere, there are many others some designed specifically for the pi.

Shellinabox will give you command line access from a browser so no need for ssh clients on the tablet.

bonne chance Strebor

1 Like

Ok, so with an Android tablet, I think I have found a pretty good solution!

I have installed a wifi dongle and have that connected to a hotspot (not connected to the internet, just to create a local network). I am connecting the android tablet to the same network. The key seems to be that the standard SSH apps do not seem to work (i.e., JuiceSSH, ConnectBot, Termius, etc. I cannot get to work).

If you use the AndFTP app, though, you can setup an SCP command that will transfer data to the tablet! And it works for me!

I am then transferring the data (one folder at a time) to a cloud folder on the tablet (e.g., Google Drive or OneDrive). Then, when I’m back with internet again, the tablet syncs that downloaded data automatically.

I have not tried this with wired/OTG ethernet adapter yet, but I may try that soon.

1 Like

That’s a great combination rbalik! Great to hear that you have managed to find a way to make it work, and thank you for sharing it with all of us in the community!