User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Headless connection with a laptop - please help to set up

Fri Jan 29, 2016 3:08 pm

Can you please help me,
I have Raspberry PI model B and I set up it for the first time.
I don't have a monitor, neither a usb keyboard, so I need to connect it to my laptop through headless connection.
I used these how-to: https://www.youtube.com/watch?v=Ioih6MHNNqc and https://pihw.wordpress.com/guides/direc ... onnection/
I set ip address for Raspberry PI 169.254.1.1 and my laptop has no fixed IP (set up automatically).
(I have Linux Mint)

It can't set up direct connection -- I mean no network connection.
Can you please advice me what should I do to set it up?


mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Fri Jan 29, 2016 11:51 pm

Try adding

Code: Select all

auto eth0
iface eth0 inet 
static address 169.254.1.2
netmask 255.255.0.0
into /etc/network/interfaces on your Linux machine

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Fri Jan 29, 2016 11:57 pm

Thank you, I planned to use ssh, but at first I need just to set up a network connection, for now it doesn't work

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:08 am

The best way to set up a static IP address is to set it on your router. That way if you ever take the RaspPi away from home it will still work. If you set it on the RaspPi and you put it on a different network, you won't be able to talk to it.

Also, of course, it has to be wired Ethernet. Until you configure the SSID and password you can't use WiFi.

Are you using Raspbian? If so, ssh should just work; there's nothing to do to enable it. If you are using NOOBS, then I don't believe you can boot it headless the first time.

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:29 am

Yeah, I use Raspbian and I use wired Ethernet connection: Raspberry PI - laptop.
The thing is -- I don't have an access to the router.
I understand that if I take it somewhere else with these IP settings, it wouldn't work.

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:40 am

mattmiller wrote:Try adding

Code: Select all

auto eth0
iface eth0 inet 
static address 169.254.1.2
netmask 255.255.0.0
into /etc/network/interfaces on your Linux machine
I tried it, aslo tried with a closer mask: 255.255.255.0, but nothing. (I tried rebooting as well)
Anyway, thank you.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:47 am

JFI You should be using 255.255.0.0 for 169.254.xxx.yyy addresses

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:48 am

What does ifconfig show on your Linux machine with Pi plugged in then ?

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:49 am

How/where have you setup your Pi for 169.254.1.1 ?
Please paste the file here :)

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:56 am

Here are both files
Attachments
files.zip
(329 Bytes) Downloaded 29 times

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:56 am

@rurwin - I think you mis-read the OP
The best way to set up a static IP address is to set it on your router.
Well I call it reserved addressing not static when you do that on a router but tomato tomato :)
That way if you ever take the RaspPi away from home it will still work
em yes but that's not what the OP is trying to do
If you set it on the RaspPi and you put it on a different network, you won't be able to talk to it.
he is just trying to use link-local Ip addressing between a machine and a Pi - similar to my request for static fallback viewtopic.php?f=66&t=134138&p=895278#p895278

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 12:57 am

I'm getting an error trying to open your zip :(

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:05 am

once again
Attachments
files.tar.gz
(370 Bytes) Downloaded 27 times

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:11 am

And here's my ifconfig:

ketka@ketka:~ > ifconfig
eth0 Link encap:Ethernet HWaddr b8:88:e3:3b:03:e9
inet6 addr: fe80::ba88:e3ff:fe3b:3e9/64 Scope:Посилання
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Прийнято пакунків:37 помилок передачі:0 пропущено:0 перерозхід:0 кадри:0
TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Прийнято байтів:10489 (10,4 KB) Передано байтів:56650 (56,6 KB)

lo Link encap:Локальна петля (Loopback)
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Хост
UP LOOPBACK RUNNING MTU:65536 Metric:1
Прийнято пакунків:1075 помилок передачі:0 пропущено:0 перерозхід:0 кадри:0
TX packets:1075 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Прийнято байтів:91388 (91,3 KB) Передано байтів:91388 (91,3 KB)

wlan0 Link encap:Ethernet HWaddr c0:14:3d:dc:32:c3
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::c214:3dff:fedc:32c3/64 Scope:Посилання
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Прийнято пакунків:4989 помилок передачі:0 пропущено:0 перерозхід:0 кадри:0
TX packets:5024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Прийнято байтів:1829651 (1,8 MB) Передано байтів:1510792 (1,5 MB)

it's with ukrainian language, but the idea is: only errors in transmitting and no IPv4 is shown on eth0

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:21 am

ketochka wrote:
mattmiller wrote:Try adding

Code: Select all

auto eth0
iface eth0 inet 
static address 169.254.1.2
netmask 255.255.0.0
into /etc/network/interfaces on your Linux machine
I tried it, aslo tried with a closer mask: 255.255.255.0, but nothing. (I tried rebooting as well)
Anyway, thank you.
It's not clear to me what you are doing that isn't working. When you supposedly boot the pi, are you then going to the windows machine and attempting to ping the pi with the supposed address it has? I just tested this with 169.254 addresses on Ubuntu and Raspian Wheezy and they just automatically are there. How do you know that the pi has booted if you are headless?

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:23 am

Well we need to get your Linux machine to set the IP


try this in /etc/network/interfaces instead of my earlier suggestion

Code: Select all

iface eth0 inet static
address 169.254.1.2
netmask 255.255.0.0

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:26 am

It's not clear to me what you are doing that isn't working
no 1 - He's using Linux Mint on other computer - not windows

Lots of Linux machines don't default to a 169.254 address (they should - but they don't) :(

So he needs to force static on Linux Mint 1st before we get into what's happening on Pi

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:33 am

Oh, now eth0 just dissapeared.
________________________

And here's what in interfaces.txt:
# interfaces(5) file used by ifup(8) and ifdown(8)
iface eth0 inet static
address 169.254.1.2
netmask 255.255.0.0

___________________
ketka@ketka:~ > ifconfig
lo Link encap:Локальна петля (Loopback)
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Хост
UP LOOPBACK RUNNING MTU:65536 Metric:1
Прийнято пакунків:579 помилок передачі:0 пропущено:0 перерозхід:0 кадри:0
TX packets:579 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Прийнято байтів:46495 (46,4 KB) Передано байтів:46495 (46,4 KB)

wlan0 Link encap:Ethernet HWaddr c0:14:3d:dc:32:c3
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::c214:3dff:fedc:32c3/64 Scope:Посилання
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Прийнято пакунків:629 помилок передачі:0 пропущено:0 перерозхід:0 кадри:0
TX packets:821 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Прийнято байтів:187429 (187,4 KB) Передано байтів:122536 (122,5 KB)
Last edited by ketochka on Sat Jan 30, 2016 1:36 am, edited 1 time in total.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:35 am

try

Code: Select all

ifup eth0
from terminal

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:37 am

If that works try this in /etc/network/interfaces

Code: Select all

auto eth0
iface eth0 inet static
address 169.254.1.2
netmask 255.255.0.0

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:39 am

ketka ketka # ifup eth0
ifup: interface eth0 already configured
ketka ketka #

User avatar
ketochka
Posts: 16
Joined: Fri Jan 29, 2016 2:58 pm

Re: Headless connection with a laptop - please help to set u

Sat Jan 30, 2016 1:43 am

oh, yeah!
you are a master!
it works :)

Thank you so much,
and wish you all the best.



Return to “Troubleshooting”