It looks like @Yurockkk has figured out a way to ssh via Bluetooth and laid it out in this document. Please read through this if you have not already.
I am working with a Raspberry Pi B+ model, and therefore do not have built-in bluetooth (as our end-users might also not have equipped on their machines), so I've been researching methods to connect through USB tethering.
Unfortunately, I could only get this to work when the RPi was connected to the actual wifi rather than the USB tethering. But I believe that this is a step in the right direction, by assigning a static name that adapts to dynamic IP. I believe that this has something to do with localization. The range for the name seems to only work on the RPi itself when it is USB tethered. I'm sure there is a way around this.
Set Up RaspberryPi for Headless Operation (USB Tethering WIP)
Following a suggestion on this Stack Overflow:
1. Turn on RaspberryPi and tether it to phone to use phone's internet connection seamlessly.
2. Following this guide on your RaspberryPi:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install avahi-daemon
sudo insserv avahi-daemon
3. Then we need to create a service and restart it. Create the service with:
sudo nano /etc/avahi/services/multiple.service
4. Place this text into the file you're creating:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=local</txt-record>
</service>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
5. Restart the service with
sudo /etc/init.d/avahi-daemon restart
Testing on a Windows machine
If you're testing on a windows machine, you might have to install Bonjour to test raspberrypi.local. If you're testing on a Unix machine, you can skip these steps.
Then we need to add an exception to the firewall to open the 5353 UDP port
. You can do this by looking at this guide and selecting UDP port and specifying 5353
.
After these steps, we must grant internet access to mDNSresponder.exe so that we can use multicast over the local subnet. You can do this a similar way by creating a rule for both inbound and outbound. Simply select Program
this time, and locate mDNSResponder.exe which I found in C:\Program Files (x86)\Bonjour
.
Test Connection
Try out ping raspberrypi.local
and it should return successful packets. If it does not, it's likely because of the issue of it being tethered via USB.
If this is the case, try turning off the USB tethering and connecting the RasberryPi to the wifi and attemping to ping and connect again. It should work this time around.
Additional Stuff
I feel like I am getting very close, I would appreciate anyone who wants to test this out themselves. Especially anyone with a very solid understanding of networks. I am afraid that I am a bit lacking in that regard, as far as complex connections go. As I stated before, I got everything to work perfectly when the RPi was connected to the wifi. I could simply use ssh [email protected]
on my Linux machines and in PuTTY on windows.
Is there a way for us to somehow "route" the SSH through the phone's IP first and then use raspberrypi.local
from there?
I thought that this link had an interesting concept. The LCD screen is not practical for our uses, nor is the audio component. But maybe we can use it to draw inspiration.
http://www.instructables.com/id/How-a-headless-Raspberry-Pi-can-tell-you-its-IP-ad/