The set-up

I set up a Pi Zero running Stretch Lite, and connected it via USB in OTG mode to a MacBook.

I successfully found it at raspberrypi.local from the Macintosh, was able to ssh in, install various packages and run a small Python application.

The problem

While the application was running, it seems to have dropped off the network with a broken pipe:

pi@raspberrypi:~ $ packet_write_wait: Connection to fe80::a648:c9cc:e29b:761e%bridge100 port 22: Broken pipe

Sequence of events

  • MacBook: Internet Sharing was on (as it has been for weeks).
  • Pi SD card was configured appropriately.
  • I connected the Pi via USB to the MacBook.
  • I immediately was able to ssh pi@raspberrypi.local.
  • I don't know what IP address the Pi had (I think the Mac gave it a 192.168.2.x address), but it was able to reach the Internet.
  • While on the Pi, I installed various packages using apt and pip.
  • I connected the servos and started using my Python application I downloaded from GitHub.
  • While executing the program, which was producing output in the terminal, the Pi appeared to lose all network connectivity to the MacBook.
  • The Pi continued for several minutes more until the program finished running.
  • While trying to reconnect, I could no longer resolve raspberrypi.local from the Macintosh.
  • The output of arp -a showed no sign of it:

    ➜  ~ arp -a   
     dsldevice.lan ( at c4:ea:1d:6c:bd:ae on en0 ifscope [ethernet]
     danieles-mbp.lan ( at b8:e8:56:34:97:12 on en0 ifscope permanent [ethernet]
     ? ( at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
     ? ( at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
     ? ( at 1:0:5e:6:7:8 on en0 ifscope permanent [ethernet]
     ? ( at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
     broadcasthost ( at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
  • After rebooting the Pi by disconnecting the power, I was once again able to reach it at raspberrypi.local.

  • However, the Pi now has a 169.254.x.x address and cannot resolve host names, nor can it reach remote IP addresses.
  • The Macintosh Network system preferences shows an RNDIS/Ethernet gadget attached, on a 169.254.x.x (not the one of the Pi - this is the address of that interface of the Mac).
  • So far, I think it was a power issue. Since adding a PSU to the Pi, all has been well and I have not been able to reproduce the problem. Perhaps the MacBook was unable to supply enough clean power for three servo motors and a Pi. – Daniele Procida Feb 12 at 17:17

169.254.x.x is a Link-local address and indicates no ipv4 address has been assigned, and will not unless you explicitly assign one.

macOS (I presume you aren't using a Macintosh) will ssh over a Link-local address, although from the error message appears to be using ipv6

I routinely ssh from macOS to my Pi and "Broken pipes" and timeouts are normal after periods of inactivity. If this concerns you you could enable keep-alive messages from the Pi.

Eventually you should be able to connect after timeout, but I usually find starting a fresh terminal session on the Mac enables a new connection to be established.

  • Thanks, though this didn't seem to be a timeout. As noted in the question, networking broke - the Mac was no longer able to resolve the raspberryi.local address. And even after rebooting the Pi, the Pi is unable to pick up an IP address and reach Internet hosts - which was previously possible. – Daniele Procida Feb 12 at 9:28
  • From your edit there seems to be some detail missing from your question. In general if the Mac has Internet Connection Sharing you can NOT access the Pi with ssh - if ICS is not on then you can't access the internet from the Pi. – Milliways Feb 12 at 11:30
  • Updated to include the full sequence of events. However, I did have both Internet sharing on, and was able to access the Pi with SSH (and have been able to in the past). I suspect the Mac has messed something up. @Milliways – Daniele Procida Feb 12 at 12:42
  • Well - I don't know what the problem was, but I turned Internet sharing off and on again, deleted the RNDIS/Ethernet gadget interface in Network preferences, and rebooted the Pi - and it now once again has picked up the a address and can network correctly. – Daniele Procida Feb 12 at 12:58

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.