0

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 [email protected].
  • 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 (192.168.1.1) at c4:ea:1d:6c:bd:ae on en0 ifscope [ethernet]
     danieles-mbp.lan (192.168.1.137) at b8:e8:56:34:97:12 on en0 ifscope permanent [ethernet]
     ? (192.168.1.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
     ? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
     ? (224.6.7.8) at 1:0:5e:6:7:8 on en0 ifscope permanent [ethernet]
     ? (239.255.255.250) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
     broadcasthost (255.255.255.255) 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).
1
  • 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. Commented Feb 12, 2019 at 17:17

1 Answer 1

0

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.

4
  • 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. Commented Feb 12, 2019 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
    Commented Feb 12, 2019 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 Commented Feb 12, 2019 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 192.168.2.16 address and can network correctly. Commented Feb 12, 2019 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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