element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi Wired Ethernet Intermittent
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 17 replies
  • Answers 1 answer
  • Subscribers 676 subscribers
  • Views 4536 views
  • Users 0 members are here
Related

Raspberry Pi Wired Ethernet Intermittent

centipede
centipede over 9 years ago

I have been trying to solve this for a number of months with no success.  Nor can I find any posts where someone else has already found a solution.  If someone knows of an existing solution please point me to it.

 

My Raspberry Pi is setup such that the WIFI is a hot spot with port forwarding/NAT to the wired Ethernet port.  All is working great, except for this one weird problem. The problem is that the wired connection will stop working for a time, if a large amount of data is sent out at once.  For example. if a large web page (I am using lighty) is to be displayed, or a large file is to be transferred via ftp.  With the web page case, it will typically succeed 2/3 times.  With a file of a few megabytes, it fails every time.

 

Here are some specifics:

 

1)  The wired connection will usually recover on it's own after several minutes.

2)  This is weird, the wired connection will recover, right away, if I have the PI ping another machine on the LAN, and not appear to fail at all if ping is continuously running in another terminal., (it does fail but recovers right away, I can see brief pauses in ftp traffic)

3) The ARP table, and ifconfig both look the same when all is well and when the Ethernet is broken.

4) The WIFI port continues to work, communicating to lighty (port 80) even when Ethernet is broken.  The WIFI port does not have fail when sending out a large web page.

5)  IPtraf, observing eth0, shows that when broken, UDP packets are still being received, while TCP packets are not

6) I have seen this problem on both the PI-2 and PI-3, I am running Jessie

7) I can transfer large files into the PI (uploading), but not out of the PI (downloading), using FTP, over Ethernet.

8) When the PI is in a failed state, SSH is broken, and it appears that all other TCP traffic fails, even connections already established.

9) Wireshark and various /var/log files have not provided a clue, the PI just stops sending packets, with no clue I can find to explain it.

10) The problem exists whether Ethernet is set up as using dynamic addressing or static addressing.

11) ifdown eth0 then ifup eth0 will usually fix it, but they sometimes have to be done twice.

12) Not sure this is relevant, but I am using a hardware tree file to set the UART port back to the GPIO pins.

 

Perhaps I need more buffers, but free does not indicate this.  Perhaps I need to adjust the pacing of transmission, but I am not sure how to do this.  Also top does not indicate a CPU overload.

 

Please help if you can,

Robert

  • Sign in to reply
  • Cancel
Parents
  • clem57
    0 clem57 over 9 years ago

    Thanks centipede for the detailed facts. There are a few facts to understand:

     

    • The ethernet is 10/100 mb/s old style technology.
    • The chip that runs the ethernet also shares the bandwidth with USB. This means the FIFO stack is probable also shared(?)
    • Although the Pi is getting better in some aspects like CPU/GPU/RAM, they have NOT changed the USB/ethernet chip.
    • Because of the above, the Raspberry Pi is a nice to play with but not ready for heavy usage like you are seeing. Other players in the SBC arena are either better or encroaching on performance of the RPi. In my case I am using the RPi 3 only in daily operations using the WiFi constantly sending/receiving data. Except for one power outage, the system has been robust so far. I do not really tax it IMHO.

     

    Clem 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • centipede
    0 centipede over 9 years ago in reply to clem57

    Clem,

     

    Thank you for your reply.

     

    Yes, I suppose it's possible that the Raspberry PI is just not capable of sending out large amounts of data over the wired Ethernet connection, although if that were the case, I would think there would be many posts online about that limitation.  Rumors abound, and many posts online talk about using the Raspberry Pi as a web server, why has no one else already complained about this?

     

    So I am expecting this to be some kind of configuration issue, or a driver bug.  If there is a  FIFO which fills up, then there should be a log message about that someplace.  Also, when using a ping to recover, it's interesting to see that the transfer picks up where it left off, without any apparent error other than the delay. It is also interesting that inbound files, even huge ones are transferred very very quickly and without an issue.  If this is a FIFO issue, why does not inbound traffic get affected?  If a buffer is the issue with outbound traffic, it would seem the TCP stack could be adjusted to reduce the window size, smaller chunks could be sent at a time.

     

    One more interesting bit of information, I find that sending a ping towards the PI also 'wakes up' the wired Ethernet.

    Robert

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • centipede
    0 centipede over 9 years ago in reply to rew

    Roger, A good suggestion, thank you.

     

    I used the original jessie file which I downloaded on 6/2/2016 and imaged it onto an 8 gig SD card.  I then booted the PI, and without any changes at all, uploaded a 3 meg file to the /home/pi directory.  Next I tried to download the same file and got this result with FileZilla:

     

    Status:    Starting download of /home/pi/01 - Sgt. Pepper's Lonely Hearts Club Band.mp3

    Status:    remote:/home/pi/01 - Sgt. Pepper's Lonely Hearts Club Band.mp3 => local:E:\raspberry pi 3\var\music\down\01 - Sgt. Pepper's Lonely Hearts Club Band.mp3

    Error:    Network error: Software caused connection abort

    Error:    File transfer failed after transferring 32,768 bytes in 18 seconds

    Status:    Disconnected from server

     

    So the problem occurs with the standard software and an 'out of the box' PI-3B board.

     

    Robert

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to centipede

    Hi centipede

         I tried to setup a similar situation with my RPi 3 since I have one too. I installed Filezilla on my intel production box running Zorin (Ubuntu like) Linux. I installed the following FTP server:

    apt-get install proftpd

    Here is the file I used:

    image

    I copied the highlighted file from the Zorin to the Raspberry Pi 3 and back:

     

    Status:Starting download of /home/pi/Downloads/Revolution in the Valley - Andy Hertzfeld.epub
    Command:CWD /home/pi/Downloads
    Response:250 CWD command successful
    Command:TYPE I
    Response:200 Type set to I
    Command:PASV
    Response:227 Entering Passive Mode (192,168,1,235,154,36).
    Command:RETR Revolution in the Valley - Andy Hertzfeld.epub
    Response:150 Opening BINARY mode data connection for Revolution in the Valley - Andy Hertzfeld.epub (5239221 bytes)
    Response:226 Transfer complete
    Status:File transfer successful, transferred 5.3 MB in 3 seconds

     

    I had no problems running this on a local network within the same subnet.

    Here is the PI software level that is older than yours:

    pi@raspberrypi:~/Downloads $ uname -a

    Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux

    So you can compare yours to mine and tel me the difference. I may have a different ftp server than you.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to clem57

    Never mind I used the wireless.

    Ops!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to centipede

    Robert Laughlin wrote:

    Next I tried to download the same file and got this result with FileZilla:

     

    Filezilla is listed as an FTP client on raspbian. And such graphical clients don't stay single-protocol for long. So even if it starts out as an FTP client, it usually gains ssh support within a few release cycles. So what "server" are you using on the 'pi?

     

    I can copy a file of 15M in a few seconds using rsync over ssh.

    sent 30 bytes  received 15,673,683 bytes  4,478,203.71 bytes/sec

     

    By using rsh instead of ssh I can increase the transfer speed up to about 8Mbytes per second without any trouble. All this is on a pi 2, I'll test the PI 3 later today for you (but I expect the same results).

     

    Update: I now saw clem install proftpd, so I did too. proftpd increases the transferspeed of my 15Mb file to 11 Mbyte per second: almost line speed.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • centipede
    0 centipede over 9 years ago in reply to rew

    Not sure this makes a difference or not, but in my test, FileZilla, version 3.18.0, was running on my desktop machine, the ftp server was on the PI, and was what ever comes with the jessie file.  FileZilla was set for SFTP, using the default transfer mode.  Here is the version of jessie:

     

    pi@raspberrypi:~ $ uname -a

    Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to centipede

    When you use "sftp" that means you're using ssh. This uses encryption of the data on the line.
    that could slow things down. But still, I get 10+ Mbytes per second on my pi three. It seems that my first test with "rsync" had the most slowdown, probably in the rsync protocol (rsync was written for "slow links" so it behaves a bit suboptimal on fast links).

     

    On my pi three that I've now tested I can transfer a 15Mbyte file in sub-two-seconds. I tried ftp, scp and rsync (both over ssh and rsh).

     

    So your situation with transfer stopping or being slow is something specific to your situation. Have you tried another ethernet cable?

     

    (I had a client once who declined my offer of putting cat5 in their building.... Later on they asked why things were slower at 100mbps than at 10. Turns out they had wired all the cables wrong, 10mbs communication mostly worked even with the wrongly wired cables, 100mbps had too many transmission errors so things would grind to a halt....)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • centipede
    0 centipede over 9 years ago in reply to rew

    Roger,

     

    I am not concerned with the speed, I just wish the transfer did not stop after 32K.  I have tried different Ethernet cables. The cable between the pi and the switch is around 12 feet long and connects into a 10/100 switch from Netgear, which then connects to a 10/100/1000 switch shared with the desktop which is running the ftp client.  Something like this:

     

     

    PI---------Netgear 10/100---------------Netgear 10/100/1000-------------Desktop

                         |                                           |       |

                         ---other machines                  |      ------other machines

                                                                     |

                                                                    ----- global Internet via various switches & routers

     

    It's good to know you had success with your PI-2 and PI-3, that gives me hope.  Are you running the same version of the PI operating system?

    Is it possible we have PI's made by different manufacturers, that use a somewhat different design?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to centipede

    I have know problems with packets between two routers/switches not getting sent (it happens in my network and I end up resetting them!). Please try to connect the desktop temporarily to the router directly to eliminate one possible problem.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to centipede

    It is possible for different manufacturers but they are the same design but maybe different components. Check board and you should see the UK on the Pi.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • centipede
    0 centipede over 9 years ago in reply to clem57

    Clem,

     

    I connected the PI to the 10/100/1000 switch in my diagram, so both machines are on the same switch similar to what you suggested, and now my FTP transfers from the PI work perfectly every time with no errors!   I have other machines connected to the 10/100 and they seem to have no issues, so I do not know why PI does, but I am very happy to have followed your advice.  More testing to do, but this seems to have fixed my problem!  YEAH!

     

    Thank you both,

    Robert

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • centipede
    0 centipede over 9 years ago in reply to clem57

    Clem,

     

    I connected the PI to the 10/100/1000 switch in my diagram, so both machines are on the same switch similar to what you suggested, and now my FTP transfers from the PI work perfectly every time with no errors!   I have other machines connected to the 10/100 and they seem to have no issues, so I do not know why PI does, but I am very happy to have followed your advice.  More testing to do, but this seems to have fixed my problem!  YEAH!

     

    Thank you both,

    Robert

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • clem57
    0 clem57 over 9 years ago in reply to centipede

    Makes perfect sense to me. The router is buffer limited on the trip back to the switch and either "forgets" or more probably drops packets. Glad though you narrowed the problem outside the Pi.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to centipede

    My focus on speed is not because you would want "speed". But having proper speed means things are working correctly.

     

    My guess is that you have SOMETHING in your setup that is flaky. Either a bad networking cable (which after switching to the other router suddenly isn't broken, i.e. a flaky contact), or maybe the exact port in the switch. I've had switches develop "bad" ports.

     

    Clem, TCPIP was designed with "packet loss" in mind. An occasional dropped packet will NOT break a TCPIP connection. On the other hand, a continuous 10% packetloss will cause bigger transfers big problems: TCPIP thinks packets are dropped because too many packets are being sent. So it thinks that reducing the speed will improve things. A constantly overloaded link (e.g. because thousands of people are webbrowsing and the new connections that don't know to reduce speed are already overloading the link) or simply a flaky link (e.g. a percentage of packets have bad CRC and are dropped, independent of the amount of packets) will cause TCPIP big problems. But none of this would cause a connection to die after just 32kBytes of transferred data).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube