dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Headless Boot with Laptop Ethernet Problems

Tue Jan 17, 2017 1:15 pm

Hello everybody,

New to Pis and just trying to get my feet wet. I'm trying to do a headless install on my Pi 3 Model B V1.2 I am following this tutorial: https://pihw.wordpress.com/guides/direc ... onnection/ and have formatted my SD card with the SDCardFormatter program, I have been successful (I think) in installing Rasbian on the Pi but have been unable to access it with my laptop. I am running Windows 10 32 bit and my problem comes up when trying to change the ethernet connection sharing under the ethernet properties tabs. The options are for Wifi and Wifi 2 (this is a USB wifi adapter for my laptop) but the ethernet option is not coming up.

Also, is Bonjour necessary to run the Pi off my laptop? In the tutorial I didn't really understand the need for it or if it was vital to the whole operation.

If this is vague please let me know what I can specify. Again, totally new to this stuff and just want to start playing with it.

Thanks in advance for the help!
d

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 17, 2017 1:28 pm

dealer1 wrote: Also, is Bonjour necessary to run the Pi off my laptop? In the tutorial I didn't really understand the need for it or if it was vital to the whole operation.
From the tutorial:
If you don’t want/can’t install Bonjour then you will have to find the IP address either directly on the Pi using “hostname -I” or using a network scanner such as Fingbox
Bonjour is just responsible for letting you access the pi as raspberrypi.local.

dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Re: Headless Boot with Laptop Ethernet Problems

Wed Jan 18, 2017 7:05 am

Okay, will Bonjour help recognize that the ethernet cable is connected to the pi?

Need to somehow get that connection established.

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

Re: Headless Boot with Laptop Ethernet Problems

Wed Jan 18, 2017 7:28 am

The basic idea in that guide is to just plug the Pi into your laptop and without mucking around with anything - be able to ssh into your Pi.

But since the Pi will assign itself a random IP in the range 169.254.0.0. to 169.254.255.255 then it would take a large number of attempts to guess what it is

That's why Bonjour is recommended so you can just use the name raspberrypi.local instead.

One other caveat, ssh is now disabled by default so you need to just make up a file called ssh (so suffix) and stick it on your sd card before putting it into the Pi

The file can have anything in it (or nothing in fact) but it needs to exist to allow access to your Pi (it was introduced as a security measure)

dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 7:10 am

Ok, I installed Fing to detect the ip instead of using Bonjour.

I'm pretty sure I have Rasbian installed on the pi but I cant access it through my network sharing. I have shared through my ethernet cable but when it is connected to the pi it shows 'cable unplugged'.

Don't know what to do about this or if I installed rasbian without the ssh file (I just added it) then I may need to start over. Is there another guide that I can try that I could try? Dont have a screen or keyboard to hook up to the pi. Only my laptop.

Thanks

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

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 10:18 am

I have shared through my ethernet cable but when it is connected to the pi it shows 'cable unplugged'.
The implication of that is that your cable is broken (which would be unlikely but its got to happen to someone sometime)

Are the 2 LEDs on the ethernet port on your Pi lighting up when you plug your cable in?

And are you able to try an alternative approach using WiFi instead of LAN to get going in the first place?

And not that it makes much diff, but why are you reluctant to install Bonjour - aversion to Apple? :)

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 10:25 am

dealer1 wrote:I'm pretty sure I have Rasbian installed on the pi but I cant access it through my network sharing.
Could you describe exactly how you try to access your pi?

dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 11:12 am

Alright, keep in mind that I'm really bad at this.

The LEDs are not lighting up with a plugged in ethernet cable.

I use a wifi adapter for my computer to catch a better signal. I dont have a wifi dongle for the pi.

Serious aversion to apple.

I haven't tried using Xming yet as I need the ethernet to work first. Right?

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

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 12:33 pm

The LEDs are not lighting up with a plugged in ethernet cable.
Either the cable is faulty, your Pi is faulty or the LAN port on your Windows machine is faulty

Can you plug your Laptop directly into your router?

if so can you disable the WiFi on your laptop and see if it can connect to Internet thru the cable

That would test out the cable and laptop

Other thing to try is plug Pi into your router via cable - do the lights light up?

Cheapest thing to change would be the cable

Next cheapest is to buy a cheap WiFI dongle for the Pi

HOLD ON
What sort of Power supply have you got for your Pi?
Can you read little writing on it? How many amps is it rated for?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 1:04 pm

-a- for a situation where you have a ethernet cable to router i just did a short new setup procedure
viewtopic.php?f=91&t=167108&p=1102008#p1102008

-b- for connecting a RPI with ethernet cable to laptop you should fix the RPI IP first
then force the laptop ethernet port to that IP range! ( i used win7 PC)

-b1- can fix IP in the /boot/cmdline.txt by adding ip=192.168.10.101::192.168.10.1
( RPI -IP :: laptop ethernet port IP )
this file is writable from a win PC on a RASPBIAN SD.

-b2- you could edit the wifi and IP related files of a installed RASPBIAN via a linux computer:
like for a test i just booted my laptop from RPI Debian PIXEL USB stick
https://www.raspberrypi.org/blog/pixel-pc-mac/
connected a SD card reader with SD from running RASPBIAN and see the
boot and the root partitions in 2 file manager windows.
open the /etc/dhcpcd.conf file with the context option: open with "sudo nano f%"
change and save successful.

-b3- there is a tricky pre edit option for a uninstalled noobs with RASPBIAN with the
/os/Raspbian/partition_setup.sh ( my NOOBS NOIR http://kll.engineering-news.org/kllfusi ... icle_id=94 )
( better not try if you can not fallback to a functional ethernet. )

-c- connecting laptop RPI with ethernet cable and SSH into
is only the first step, getting the RPI seeing the internet ( like for update... ) through that cable is
second step, need in /etc/network/interfaces a line:
dns-nameservers 8.8.8.8 8.8.4.4

better see next post, thanks to drgeoff
Last edited by KLL on Sun Jan 22, 2017 9:53 pm, edited 2 times in total.

drgeoff
Posts: 11946
Joined: Wed Jan 25, 2012 6:39 pm

Re: Headless Boot with Laptop Ethernet Problems

Sun Jan 22, 2017 5:28 pm

KLL wrote: need in /etc/network/interfaces a line:
dns-nameservers 8.8.8.8 8.8.4.4
No, if running Raspbian Jessie (which Pixel is) the the /etc/network/interfaces file should be left untouched and the DNS setting done in dhcpcd.conf with a line like

Code: Select all

static domain_name_servers=8.8.8.8 8.8.4.4
Quis custodiet ipsos custodes?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Headless Boot with Laptop Ethernet Problems

Mon Jan 23, 2017 7:17 am

i used the situation of a new setup uSD card ( for a RPI3 ) to try this
direct connect RPI to windows laptop, i call
headless, short wired

-1a- burn 2017-01-11-raspbian-jessie.img win32diskimager write (4..5 min) to 8 .. 32 GB uSD card
-1b- write empty file ssh to uSD card to enable SSH at first boot.
-1c- edit cmdline.txt add
ip=192.168.10.102::192.168.10.1
in first line with one space means RPI_IP::Laptop_IP
-2- put uSD in RPI and connect ethernet cable laptop RPI
and powerup RPI

-3a- on LAPTOP
windows7 / control panel / network and sharing center / change adapter settings /
wireless network connection
status / properties window / tab sharing
YES alllow connection sharing
select "local area connection" as what connection ( the ethernet cable ) can use this wifi internet.

windows now overwrites the ethernet port IP
manually force back:
-3b-
change adapter settings / local area connection
local area connection status window click properties
properties window click
tcp ip4 properties general
yes use the following IP address
192.168.10.1
255.255.255.0
close close
-3c-
try to reach RPI from CMD window
ping 192.168.10.102

putty 192.168.10.102
pi
raspberry
ifconfig
ping -c3 google.com ( fails )
ping -c3 8.8.8.8 ( ok )

-4a- now set fix IP in DHCPCD
sudo nano /etc/dhcpcd.conf
#add at end:

interface eth0
static ip_address=192.168.10.102/24
static routers=192.168.10.1
static domain_name_servers=8.8.8.8 8.8.4.4

interface wlan0
static ip_address=192.168.1.202/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

-4b- undo the ip setting in boot
sudo nano /boot/cmdline.txt
delete ip= setting

-4c- prepare wifi ( RP3 or RPI2 with adapter )
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
and add at end:

network={
ssid="YOUR-SSID"
psk="YOUR-SSID-PASSWORD"
key_mgmt=WPA-PSK
}

sudo reboot

# now the RPI can be connected from laptop with direct ethernet cable ( when you are at the beach )
or use wifi ( like when at home )
test: open 2 putty windows, and login with both IP, via cable and via wifi
http://kll.engineering-news.org/kllfusi ... haring.jpg
http://kll.engineering-news.org/kllfusi ... tfixip.jpg
http://kll.engineering-news.org/kllfusi ... ndwifi.jpg

dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 6:57 am

Alright, updates.

It was the cable. I tried a different cable and now the lights turn on the ethernet port and my computer recognizes it as connected to "unidentified network".

Don't have a router so I can't plug it in directly. I use wifi that is through the building.

I'm assuming the power supply is alright because the green is flashing, red is steady, and both ethernet lights are on.

Now I'm using puTTY to try and access the Pi but I'm unsuccessful. I use Fing to scan for the IPs and it shows me 192.168.137.1/24. When I put this as the IP for the Pi it shows that it is an invalid host address. Maybe I'm not getting the right IP?

Any ideas?

Thanks for all the help so far,

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

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 7:06 am

Right - you've enabled connection sharing which has caused me issues in the past myself but lets try it.

Try pinging 192.168.137.2 and see if you are lucky punk :)

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

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 7:12 am

If that doesn't work try taking sd card out and put back in pc and edit the file cmdline.txt and add in

Code: Select all

 ip=192.168.137.100 
to the end of it (don't add it in on new line - just add it to the line already there)

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 11:42 am

dealer1 wrote:192.168.137.1/24. When I put this as the IP for the Pi it shows that it is an invalid host address. Maybe I'm not getting the right IP?
i think that this is your own IP ( of the ethernet port ) after windows changed it after you enabled sharing. you can see it as your own ip4 IP.
see also the linked pictures of the windows network settings.

as i write above you can now force it back to any IP you want, so question is
did you fixed the IP of the RPI already (cmdline.txt) and enabled SHH with the ssh file?

User avatar
B.Goode
Posts: 12093
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 11:54 am

I use Fing to scan for the IPs and it shows me 192.168.137.1/24. When I put this as the IP for the Pi it shows that it is an invalid host address.
You have misunderstood the output from fing. That is not an IP address.

It is possible, but unlikely, that the IP address is 192.168.137.1

It is more likely to be some other value 192.168.137.something

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

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 12:36 pm

It is possible, but unlikely, that the IP address is 192.168.137.1
yep 192.168.137.1 is the IP that window gives to itself on the shared lan port
When you use connection sharing, windows runs a DHCP server on it which is why its likely that the Pi will get allocated 192.168.137.2 (but not certain)

dealer1
Posts: 6
Joined: Tue Jan 17, 2017 12:51 pm

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 2:46 pm

Alright, I used Ubuntu to write an 'empty document' titled 'ssh' on the sd card.

I also edited the cmdline.txt and added the ip=blah blah on there.

I try to access it with fing but it doesn't connect. I allow X11 forwarding but still nothing.

Reads: Connection Erroe:Session has timed out.

Any other things to check?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 2:55 pm

pls,
what is IP in RPI SD cmdline.txt
what is IP of windows Local area Connection Properties TCP/IP4

open cmd window and run
ping RPI:IP
if ok run
putty RPI:IP
pi
raspberry

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

Re: Headless Boot with Laptop Ethernet Problems

Tue Jan 24, 2017 4:06 pm

I think we are too far down the rabbit hole at this point :(

I suggest coming right back up and trying to connect via WiFi

So card out and back into PC - removed the IP in cmdline.txt

Create a file on the card called
wpa_supplicant.conf
and stick this in it

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB


network={
    ssid="YOUR_SSID"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}
But change the ssid and psk to your own WiFi settings (you can leave country alone for the moment)

Put it back into your pi and switch on and wait for 2 mins
Use Fing on a 'droid phone and scan your WiFi network to see if your can see a device named raspberrypi and get its IpAddress from there

If that fails, rewrite the SD card with the Pi image again and try the above again (and make an ssh file again)

Return to “Beginners”