Is it possible to connect to a Pi3, over Bluetooth for SSH, for iOS? I know you can connect to it with BlueZ, and SSH is possible over wifi, but I can't find anything about doing both. The advantage would be to do it in an area without wifi. Maybe it is possible, but there is not an app for it on iOS?
3 Answers
No, it is impossible to set up SSH over Bluetooth. Even more so with Apple's Bluetooth implementation on iOS.
SSH works over a regular TCP/IP stack implemented on Ethernet or WiFi family of protocols. Bluetooth implements its own protocols with different purpose.
You can however configure either the Raspberry Pi or the iOS device to serve as a hotspot and connect to it with the other device(s).
for Raspberry Pi you need to install `hostapd and configure it to enable WiFi network. There's a good guide Using your new Raspberry Pi 3 as a WiFi access point with hostapd
for iOS go to Settings -> Cellular -> Personal Hotspot, turn it on, set the password
After you connected two devices you can use regular network tools (including SSH) in your ad-hoc network. You could then use an SSH client application on iOS.
With a hotspot on an iOS device you need just to take care not to (over)use your data plan for Raspberry Pi communications (like updates).
-
1
-
1@William The article you posted refers to a connection between a RPi and a Mac, not an iOS device. It might be worth a try but there is reason for doubts. Commented Oct 7, 2018 at 9:41
-
@William the difference is that article sets up a serial over Bluetooth connection to give you a terminal. It's the same use-case as an SSH session, but doesn't use the SSH protocol. I'm still looking for an SSH solution, but a wireless serial connection is good enough for me. Commented Mar 9, 2019 at 15:17
-
It's not generally impossible to set up SSH over Bluetooth, it's just highly involved. Or was; things on the Pi might be more automated than they were a few years ago. Commented Mar 9, 2019 at 15:20
-
Well, I managed to get SSH over bluetooth working in roughly 30 minutes on a Pi Zero before I had to away for the weekend (although it was on a Windows PC). I'll detail how in an answer.– DanCommented Oct 7, 2019 at 20:38
I don't know about iOS but you definitively can with do SSH over BLuetooth on a laptop. You just need to setup a PAN (Personal Area Network) which is emulating an Ethernet-Connection. There you get a virtual NIC (Network Interface Card) and then you can SSH into your Raspberry Pi.
See Bluetooth Network on eLinux. I'm not sure if this is the most up to date version. I can provide more links if you want to give it a try.
EDIT:
Bluetooth PAN Network Setup with BlueZ 5.X (Use Pi as host)
Raspberry Pi 3 Bluetooth Networking (Using macOS as gateway to the internet)
Warning: This overrides your wifi connection somehow
I configured Bluetooth over SSH following the instructions from Instructables Bluetooth to Putty and then bits from the headless pi over bluetooth tutorial
If your image is already running on your Pi, you only need to follow the Editing the image
section of the tutorial.
And the important part of connecting the Bluetooth is following the procedure noted in the instructable where it says use the current computer's Bluetooth properties to connect rather than adding the Pi directly.
Github Gists of the important parts
Raspberry Pi Config: https://gist.github.com/deeja/83f50fb893383ba328e06769a1e6d44d Windows Setup: https://gist.github.com/deeja/840cf52206f0aa3fb82e435f29e19a95
-
The important parts should really be in the answer itself, not on a github page. Commented Oct 8, 2019 at 6:55