Hi! I hope this is the right community to ask.
Next week I will be on the road for 5 Days for work. I have quite some spare time, so I thought I would dig up my raspberry project again and hopefully finish it.
I need it with me, because it controls some hardware, so a VPN to home does not work. So only option I could think of, is to connect the pi directly to my laptop via an ethernet cable. As far as I understood from some research is that I would need to install and run an DHCP server on my laptop, which they did not recommend. Alternatively they suggested to just take a router and plug both devices in there. I don’t really have a spare router, so that’s not an option either.
To be hones it confuses me a little, that there does not seem to be a standard for connecting to a device directly over a single cable and login with a user account.
Any recommendations how I can work on the pi like with ssh?
Thanks a lot!
What i usually do is set up a wifi hotspot from my phone, and connect the pi that way
This is neat solution, you’ll lose the laptop WiFi internet access though.
You can set the pi to connect to the phone WiFi by editing files on the SD card (using your laptop)
https://desertbot.io/blog/headless-raspberry-pi-4-ssh-wifi-setup-64-bit-mac-windows
Give each device a static address, and set the default gateway to whatever’s on the other end of the cable. You might need a crossover cable, but most NICs can work using a straight-through.
E.g. set the laptop’s address to
169.254.1.1/16
and default gateway to169.254.1.2
, and the RPi’s address to169.254.1.2/16
and default gateway to169.254.1.1
. They should be able to talk to each other then.If those addresses seem familiar - Windows uses the 169.254.0.0/16 subnet to automatically assign random addresses if DHCP fails, so that if there are several computers in the subnet, they’ll at least have addresses that can talk to each other. It’s called APIPA in Windows, and Zeroconf in the Unixverse.
You jump between 196 and 169 in your comment.It’s not just Windows that uses 169.254. That’s a special block used for self assigned link-local addresses.
oops, fixed. Caffeine withdrawal is hell.
Would the Pi automatically set an APIPA address if DHCP was not available? If so he need only connect the cable, and ask each machine what their address is.
No idea. It depends on what software it uses for network configuration, and how that software handles DHCP failure. I use NetworkManager and I’ve never gotten an APIPA address.
Does the raspberry pi have a wifi adapter, and is it unused for your project?
If so, you can use your pi as an access point — no need for cables, you just connect your laptop to the pi’s SSID.
Downside is that now your laptop doesn’t have Internet access, which may be a deal breaker (unless you can plug your pi into a router and get access through it). You could just get a cheap USB wifi dongle for your laptop and use one interface for Internet, one for pi.
Hostapd is probably how you would go about this of you’re interested ( https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-software )
Or they could connect their pi as well as their laptop to a hotspot created on their pocket computer masquerading as a phone. They won’t lose their internet on the laptop or pi that way.
As far as I understood from some research is that I would need to install and run an DHCP server on my laptop, which they did not recommend.
Or simply set up the Pi with a static IP.
there does not seem to be a standard for connecting to a device directly over a single cable and login with a user account.
There is. A cable. You just need two non-identical IPs from the same subnet, e.g. 10.0.0.1 and 10.0.0.2 or whichever you want from the private ranges.
I remember from back in the day that you need a
"twisted pair”edit: ”cross-over” cable though, or do modern ethernet ports automatically adapt to that now?You’re thinking of crossover cables, though I’m not sure if those are still necessary.
Twisted pair refers to the twisting of the wires in the cable to reduce crosstalk.
Crossover cables enable permit connecting two non-sensing ports together.
Right 🤦♂️ It has been a while. I corrected it in the original post now.
I hear ya. I know all this stuff, but dammit if it isn’t hard to access sometimes! Haha
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:
Fewer Letters More Letters IP Internet Protocol RPi Raspberry Pi brand of SBC SBC Single-Board Computer SSH Secure Shell for remote terminal access
3 acronyms in this thread; the most compressed thread commented on today has 5 acronyms.
[Thread #538 for this sub, first seen 23rd Feb 2024, 13:35] [FAQ] [Full list] [Contact] [Source code]
check out tailscale