0

What is the simplest way to connect directly to a raspberry pi 4 wirelessly so that I can run commands in a terminal, equivalent to SSH'ing to it but without an ethernet cable or an Access Point? The Pi might be in the middle of a field and I will just be around it with a laptop running linux (ubuntu), no routers or any other infrastructure near it. Security is not really a priority so even an un-encrypted channel would be ok if it simplifies things.

I tried rfcomm but had multiple issues:

  • rfcomm is now deprecated. This makes me think there's a newer alternative but I haven't found what it is
  • I followed this guide but on the client (ubuntu laptop) I don't have the serial device that's supposed to be under /dev/cu.*
  • For some reason, most guides I find using rfcomm talk about using android as a client so using a special rfcomm client App, not connecting from linux. Not sure why. having a terminal to type commands in a tiny phone screen seems useless to me
  • I would also like to send files via this connection e.g. to deploy the application that I develop for it in my laptop. If it were ssh, I can just scp. But it seems that rfcomm being a serial console is more like a local than a remote terminal

I currently connect to the Pi via SSH but obviously both the pi and the client need to connect to an external Access Point so that won't work for my real application since the connection needs to be direct from laptop to pi

I'm open to Wifi-direct, bluetooth or any other wireless channel as long as the client can run in linux and it gives me access to a terminal in the pi where I can run commands

Hilikus
  • 101
  • 3
  • what do you mean? i haven't excluded anything yet – Hilikus Feb 24 '22 at 05:56
  • For Bluetooth rfcomm serial connection can be done with the standard Python Socket library: https://blog.kevindoran.co/bluetooth-programming-with-python-3/ File exchange with Bluetooth can be done with obexd: https://raspberrypi.stackexchange.com/a/119818/121848 – ukBaz Feb 24 '22 at 06:39
  • 1
    From your question, it is unclear why you need a wireless solution, Nor is it clear why you can't set up an access point on the Pi or your laptop. – Steve Robillard Feb 24 '22 at 07:18
  • @SteveRobillard. i didn't think it was relevant why it needs to be wireless since that was just a requirement for the solution, but the reason is that the Pi will be mounted on a cart or maybe a drone. in both cases, a wired solution to connect to it is not possible. It will also be in the middle of a field away from any infrastructure. an access point on the pi or the laptop is definitely an option, how would i get a terminal though? ssh? – Hilikus Feb 24 '22 at 15:39
  • @ukBaz with the python socket library how exactly do i get a terminal? what i understand from the tutorial is that i can just send arbitrary text from client to server, but i don't have any kind of shell to execute my commands – Hilikus Feb 24 '22 at 16:49
  • Sounds like you want to set up the Bluetooth networking so you can have IP over bluetooth. Maybe take a look at: http://manpages.ubuntu.com/manpages/impish/man1/bt-network.1.html . I think the following is out of date but the intro might be of use: http://bluez.sourceforge.net/contrib/HOWTO-PAN I did try to get it working with Python but was unsuccessful: https://raspberrypi.stackexchange.com/a/114551/121848 – ukBaz Feb 24 '22 at 16:59
  • May I suggest using the WiFi access point (AP) using a guide like this. You can ignore the parts about traffic forwarding and enabling internet connection. You don't even need to set up WiFi security. Once set up you can connect to the Pi's "WiFi hotspot" from your laptop and then ssh into the Pi. – user68186 Feb 25 '22 at 00:30

0 Answers0