Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Ethernet problems

Sun Mar 31, 2013 7:54 pm

Hi,

I'm experienced with networks and computing, apart from very limited Linux/Unix skills.

The new Raspberry has been plugged in today and everything seems fine except it won't pick up an IP address.

I have other devices that pick up IP addresses (connected into the same hub) fine and have swapped cables etc.

The 10MB link shows amber, and the TX/RX lights are green.

Ifconfig shows that the interface is up with no errors and is TX and RX ok.

The interfaces file is default, which is showing to configure eth0 with dhcp.

Forcing a manual IP address with ifconfig eth0 192.168.199 correctly applies the address to the interface and the default class C subnet mask.

I can ping the local adapter interface fine (and the loop back as well), but cannot ping anything on the local LAN.

Running a subnet ping 192.168.1.255 also doesn't have any replies.

I'm running a 1000 micro amp power supply and have also tried booting with the mouse disconnected.

Can someone please let me know how I troubleshoot the problem on the system locally. I'm 100% sure the problem is not with the network, as I'm very experienced in this area (10 year CCIE) , just unfortunately not with Unix and the Raspberry.

Thanks.

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

Re: Ethernet problems

Sun Mar 31, 2013 8:04 pm

It's worth trying a different power supply. Since USB and therefore Ethernet are the only direct users of 5V, problems seem to show up there before affecting anything else.

I once had a problem with a cheap "1000mA" charger where apt-get update worked very slowly and apt-get upgrade took ages and then failed. Swapping the power supply fixed it. Strangely, going back to the first supply didn't show the same problems. I can only suppose it is border-line acceptable.

The only power supply that I have tested that supplied more than 4.4V at its rated current is the RS one that they recommend for the RaspPi, and that still only produces 4.6V on full load. Several others give large transients on current steps.

In my experience, DHCP on Ethernet "just works"; I've never had a problem. So it is more than likely a hardware issue.

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Sun Mar 31, 2013 8:46 pm

From your details, it seems that the networking is not set correctly.

You need to set a gateway address when setting a static ip address.

Below is a sample setup that should be in your interfaces file. Adjust as needed.

auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
broadcast 192.168.0.255
dns-domain mydomainname
dns-search mydomainname
dns-nameserver 192.168.0.1

If you don't get the above right, then the file /etc/resolv.conf will be corrupted.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Sun Mar 31, 2013 9:55 pm

Thank you both.

I'm inclined to think it's the power supply rather than the local set up, because I can't even ping local hosts on the direct subnet. And the dhcp refuses to work.

I did add a default gateway, but that wouldn't make any difference locally, however thank you for the full local static configuration - that will come in handy in the future!

A couple of questions please:

1. Where does the dhcp logging go locally? Can I switch on debugging to capture and troubleshoot?
2. If I use another psu, it looks like I need to be careful with not overloading the board as I can't see any circuit protection. Therefore, what is the maximum volts and ampage I can apply. I'm presuming 5v and 1000ma. Or can I go to 9v?

Thanks.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6691
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Ethernet problems

Sun Mar 31, 2013 10:55 pm

Pvor wrote: ...
2. If I use another psu, it looks like I need to be careful with not overloading the board as I can't see any circuit protection. Therefore, what is the maximum volts and ampage I can apply. I'm presuming 5v and 1000ma. Or can I go to 9v?
...
For Model B1 (256Mb) & B2 (512Mb) boards recommended, stabilised PSU limits are 5.0V +/- 0.25V at 1000mA (min), Model A (256Mb) 700mA. There is a list of "verified" devices on the wiki at http://elinux.org/RPi_VerifiedPeriphera ... r_adapters . I personally use the Sony Ericcsohn, "FX" and "TCB" devices (loading measurements for which can be found within my webpages - follow the link on the right if you're curious). However, some "1000mA" devices may not supply a Pi's "minimum working voltage" at that current (it can be the "short-circuit protection current limit" ie. Vout is near 0 V at that current) - at least one I've measured had its "knee" at 500mA :( ). Also be wary of long thin USB cables since their resistance can cause too much of a voltage drop! A "good" cable should have a core resistance of less than 0.3 ohms. Some of the thin, flat, phone-charging cables can be 2 to 3 times that!
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Sun Mar 31, 2013 11:13 pm

Again based on your first description, it seems to be a network setting issue. Your use of the ip address was on the wrong subnet. If you don't get a dhcp assigned address, your dhcp server could be ignoring your request, if the dhcp is set to accept only known MAC addresses and doesn't know the Pi device's Mac address. If so, then add your Mac address to the config file. It is difficult for me to be specific since I can't see your network.

You can get a full set of system logs by doing this install, and the software will show up under `system tools' on the menu, as Log File Viewer.

sudo apt-get install gnome-system-log

5 volts 750 milliamps is what I read for the device.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 2:39 pm

Thanks for the information.

Reference the subnet, yes you're right, I made a typo.

I entered:

192.168.199

I should have typed:

192.168.1.199

....When posting on this forum.

I have used the right network subnet (192.168.1.199) on the Pi.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 3:00 pm

Hi,

Sorry to be more specific, I made a typo when posting on the forum, but not on the pi.

My dhcp server is definitely not configured to provide up addresses to known macs, and is 100% a problem with the pi, so will try the package as suggested above to troubleshoot and also see if this distribution includes tcpdump.

Looking at alternative plugs, I see the official iPhone charger is 5w, at 5v. So is 1amp. As long as I use the micro (or mini) USB connector (can never remember which is which), I'm presuming this will also work.

Thanks.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 3:57 pm

Update.

Tried a blackberry charger rated at 750ma, 5v, plus the apple iPhone 5w charger and all have the same issue.

Since I've been using the system today, I've noticed that something strange is going on with the keyboard very regularly.

For example, 'cartridge returns' appears at the prompt, even though I'm not pressing the keyboard (stops when I press enter), sometimes key strokes don't appear, eg typing ls -a, and only s -a appears.

Editing in vi is painful, as when I press a button, it sometimes repeats until I press Escape.

The keyboard was working absolutely fine yesterday, so I'm wondering if using one of the power supplies has caused the problem (highly unlikely as they are both within spec).

DHCP refuses to work and manually editing the etc/networks/interfaces file creates an error on boot up (it says wrong network, when it absolutely is the right netwok and entered 100% accurately).

So I now don't believe it's the power cable, and I don't believe it's the configuration.

I'm running distribution Pi 3.6.11+ #371, which I presume is fairly up to date. This was determined by typing uname -a.

I'm now wondering if the network adapter is faulty, but it does show on boot up.

Running the apt-get command doesn't wok, because it needs to be connected to the network.

This distribution doesn't come with tcpdump, and the only thing close appears to be netcat, which I've never used before.

Does anyone know where the boot and system logs are kept and also does anyone have any further ideas please? I'm starting to think I have a faulty board, especially with this keyboard problem starting up today.

Thanks.

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Ethernet problems

Mon Apr 01, 2013 4:32 pm

You are presuming a lot... ;-) 5V 1A is enough, but are you actually getting 5V? The dropped/repeated key presses is a classic (There could be other problems, but that seems likely) symptom of not enough power. Measure the voltage at TP1/TP2 and if it is less than about 4.8V, that is probably it. Thin power wires contribute to the problem. Don't assume the PSU is "within spec" because of what is printed on the label!

Logs are in /var/log and you can also type 'dmsg' to see what is going on.

Also 3.6.11+/371 is a few weeks old at least.
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Mon Apr 01, 2013 7:10 pm

Try a basic boot... only plug a keyboard and mouse into the usb, don't use a hub. See if the dhcp works in giving an address with this simple boot. This will confirm the networking.

Plug the Pi device into a USB plug on the back of a computer that can do atleast usb 2.0... if the Pi won't boot then it is because it doesn't do usb 2 or 3.0

Make sure the /etc/resolv.conf file says something like this
domain mydomain
search mydomain
nameserver 192.168.0.1

With the above being a real dns server. I have two Pi's... one runs as a dhcp/dns server, and does it headless, plugged into the back of a desktop that runs as a linux NAT router. The other runs as desktop machine.

If you are plugging the Pi into a hub, with other devices, that could be the problem, if the powered hub can't supply enough voltage. I had that problem with the Pi that I use as a desktop. By plugging the Pi into another (different) power source, the problem went away.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 7:29 pm

Hi,

Thanks, I very much appreciate all the replies.

It's quite embarrassing not being able to get this to work having a first class computer science degree and also working at one of the top global IT companies. :oops:

From the above, do I type 'mydomain', or do I need to replace with a local DNS assigned to me (as I don't have this).

The Ethernet itself is 100MB and I've powered up a very old PS2 (with Ethernet card), a new blue ray player, plus a Samsung tv. All of these have never been connected to my network, yet pick up dhcp easily.

From a raspberry perspective, the device itself is placed in a plastic case, has tried three different power sources (I'll put a voltmeter across one of them later) and the USB x2 are directly taking my keyboard and mouse.

I've removed the mouse so all I have plugged in is the SD card, the HDMI monitor (which looks amazing btw, much better than my 16k ZX Spectrum into the old CRT tele), the IBM 105 key keyboard and the network adapter.

When it loads, I see the SMC (not SMC, but something that resembles this) network card attached via USB (presumably this is how the model B network card works) with no errors, but when I type ifconfig, there's no IP address. The loopback is also up, but has the standard 172.0.0.1 address.

I have a BT homehub that willingly provides dhcp no problem to so many devices (unrestricted), eg multiple tv's, roku soundbridge, various MacBook's, various idevices, squeezebox, computers, set top boxes, sky+, ps3, wii, Cisco router, etc, etc. , so I'm comfortable with that side of thing.

I've played around with the dhcp timeout and retries on the raspberry, tried forcing local ip. I can see TX/RX packets on eth0, but netcat won't show anything (presumably requires IP at layer 3).

It's driving me nuts!

So will try the logs and see what they show, but the keyboard seems to have settled down after unplug/plugging back in.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 7:32 pm

Ps. Forget to say that the 10MB light is yellow, but the next two led's are green (one being link from memory).

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Mon Apr 01, 2013 9:19 pm

The `mydomain' is your ISP or a private domain name if you run your own domain.

The IP address should be the ISP's dns server or your own dns server if you run your own dns.

Did you read the boot log and see if it assigned the IP or said why not etc... It takes time to load because the software reads the log from day 1, rather than only the current day. Click syslog and select the current day after the original log loads. The network details should be near the end of the log.

Also check the log(s) for the other devices, see if something is complaining or rejected.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Mon Apr 01, 2013 9:35 pm

Thank you, I'll do that.

From this:

"If you are plugging the Pi into a hub, with other devices, that could be the problem, if the powered hub can't supply enough voltage. I had that problem with the Pi that I use as a desktop. By plugging the Pi into another (different) power source, the problem went away."

Did you mean network hub or USB hub?

Thanks.

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

Re: Ethernet problems

Mon Apr 01, 2013 10:54 pm

He's talking about powering the Pi from a USB hub through the USB (A) sockets rather than the power (micro-B USB) socket. USB hubs should not supply power that way, but many do. Worse, if they do they can end up fighting the Pi power supply and causing more problems. So disconnect any USB hubs for now, just in case.

The iPhone charger is one of the ones that has good reports, so I'd tend to trust that. However, if you were using an iPhone charger, you were not using the USB cable that came with it. Some USB cables have resistances measured in whole ohms and are useless for supplying power. If you've tried alternative chargers, have you tried alternative cables? The best choice is one that was supplied for charging something; is the Blackberry one suitable?

The symptoms you have are, as has been said, very characteristic of low voltage. The only way to disprove that is to measure the voltage across TP1 and TP2 on the board. If that is below 4.75V, measure the voltage on the input connector. If that is low, then it's the power-supply/cable. If it is OK, then it might be the fuse.

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Tue Apr 02, 2013 12:07 am

I was referencing a usb hub. My usb powered hub can do 10 devices, with four switched. I had plugged the Pi into a switched port on the hub, and plugged the hub usb connector to the Pi. This eventually caused the voltage to vary because all the other devices in the hub were sucking power. I took the Pi power cable and plugged it into the back of a desktop usb port and the issues went away.

As example, every time I would open a file on a memory stick, the usb device driver would un-install, and then re-install.... this turned up in the logs... the keyboard would do strange things when the hard disk ran on the hub... all because the hub power was being maxed out.

When I suggested that you plug the Pi into the back of desktop, it was to verify that the networking was working. A recent desktop (2-3 years old) would have usb 2.0 and provide the power for the Pi device. By having only the keyboard and mouse, eliminating a hub, gives a better view of what is happening.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Tue Apr 02, 2013 12:26 pm

Thank you all.

I've run a voltmeter across T1 and T2 and it is just over 5v, even though the keyboard is still playing up. The keyboard behaves itself if I use the top USB port though.

From a network perspective, it refuses to pick up a dhcp address and I can see in the logs that its requesting a dhcp address, but has no response.

Unfortunately the BT hub doesn't have any logs to review from that end.

However, after a lot of plugging and unplugging, I've finally managed to force a manual IP address and get it connected.

I can't believe that there's a compatibility issue with the BT hub, but the fact that it is requesting dhcp, and there's no reply, then it can't be the raspberry as the manual method now works.

Thanks for all your replies, it's been very helpful.

Thanks.

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

Re: Ethernet problems

Tue Apr 02, 2013 2:21 pm

That's ringing a bell. I seem to remember experiencing an ISP-supplied router that refused to give out more than one IP address... or maybe only allowed one device to connect to it at once... seemingly to enforce T&Cs that said you could only connect one computer. In these days of smart phones, smart TVs, games consoles and Sky boxes, I wouldn't expect them to still be doing that, but I thought I'd throw it in for what it is worth.

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

Re: Ethernet problems

Tue Apr 02, 2013 2:49 pm

I can't speak for BTHomeHub3s but I have plenty of experience with the 1.0, 1.5, 2A and 2B and never ran into any DHCP anomalies with them.
Quis custodiet ipsos custodes?

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

Re: Ethernet problems

Tue Apr 02, 2013 3:14 pm

It's never a good idea to trust an interested party, in this case the RaspPi; you can't be certain those DHCP requests ever got out of the network port.

You could always put a 10Mb hub (or a managed switch if you're very well endowed) between the RaspPi and the BTHub, connect a laptop to the 10Mb hub and run Wireshark on it.

(10M hubs mirror all ports to all ports. Managed hubs can be instructed to mirror ports)

On the other hand, seeing that it works when manually configured, there can't be too much wrong.

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Tue Apr 02, 2013 10:23 pm

Read your bit on your BT modem... can't help you there... I am seven time zones away :)

This may be a silly question, what desktop are you using ? Is it the LXDE with the menu bar on the bottom or did you install the android with the menu bar on the top. I ask because I installed the android front end on a spare SD card, by installing gnome-system-tools. This was a mistake !!! The networking doesn't work in that flavour.

If you have done this, then rebuild your SD card as new with Raspbian only, and it should work properly.

Pvor
Posts: 10
Joined: Sun Mar 31, 2013 7:45 pm

Re: Ethernet problems

Wed Apr 03, 2013 9:57 am

Hi,

Thanks for the replies. I'm running a standard Debian environment, but it was preloaded, so I might give this another format and go.

I have a BT Homehub 2A and and a quick mental count has about 20 devices working off it all fine (yes the dhcp scope range is big enough to take them all), so is just the raspberry device.

There's no limit to the number of devices, or rather, my BT package doesn't artificially limit it.

Thanks.

pmc
Posts: 36
Joined: Sun Mar 31, 2013 8:07 pm

Re: Ethernet problems

Thu Apr 04, 2013 12:13 am

It isn't the device causing the problem. It is the flavour of the OS. Debian is NOT Raspbian. This forum could turn into chaos with non techies using the raw debian etc.

Return to “Troubleshooting”