Page 1 of 1

Headless connection with a laptop - please help to set up

Posted: Fri Jan 29, 2016 3:08 pm
by ketochka
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?

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

Posted: Fri Jan 29, 2016 11:29 pm
by Navyscourge

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

Posted: Fri Jan 29, 2016 11:51 pm
by mattmiller
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

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

Posted: Fri Jan 29, 2016 11:57 pm
by ketochka
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

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

Posted: Sat Jan 30, 2016 12:08 am
by rurwin
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.

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

Posted: Sat Jan 30, 2016 12:29 am
by ketochka
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.

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

Posted: Sat Jan 30, 2016 12:40 am
by ketochka
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.

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

Posted: Sat Jan 30, 2016 12:47 am
by mattmiller
JFI You should be using 255.255.0.0 for 169.254.xxx.yyy addresses

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

Posted: Sat Jan 30, 2016 12:48 am
by mattmiller
What does ifconfig show on your Linux machine with Pi plugged in then ?

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

Posted: Sat Jan 30, 2016 12:49 am
by mattmiller
How/where have you setup your Pi for 169.254.1.1 ?
Please paste the file here :)

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

Posted: Sat Jan 30, 2016 12:56 am
by ketochka
Here are both files

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

Posted: Sat Jan 30, 2016 12:56 am
by mattmiller
@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

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

Posted: Sat Jan 30, 2016 12:57 am
by mattmiller
I'm getting an error trying to open your zip :(

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

Posted: Sat Jan 30, 2016 1:05 am
by ketochka
once again

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

Posted: Sat Jan 30, 2016 1:11 am
by ketochka
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

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

Posted: Sat Jan 30, 2016 1:21 am
by stderr
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?

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

Posted: Sat Jan 30, 2016 1:23 am
by mattmiller
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

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

Posted: Sat Jan 30, 2016 1:26 am
by mattmiller
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

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

Posted: Sat Jan 30, 2016 1:33 am
by ketochka
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)

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

Posted: Sat Jan 30, 2016 1:35 am
by mattmiller
try

Code: Select all

ifup eth0
from terminal

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

Posted: Sat Jan 30, 2016 1:37 am
by mattmiller
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

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

Posted: Sat Jan 30, 2016 1:39 am
by ketochka
ketka ketka # ifup eth0
ifup: interface eth0 already configured
ketka ketka #

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

Posted: Sat Jan 30, 2016 1:43 am
by ketochka
oh, yeah!
you are a master!
it works :)

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

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

Posted: Sat Jan 30, 2016 1:46 am
by mattmiller
Phew :)
Good night :)

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

Posted: Sat Jan 30, 2016 1:47 am
by ketochka
Good night :)