MacOS not Discovering Raspberry Pi Zero using Re4son Firmware

Overview Forums Sticky Finger’s Kali-Pi MacOS not Discovering Raspberry Pi Zero using Re4son Firmware

Tagged: , , , ,

Viewing 20 reply threads
  • Author
    Posts
    • #11412
      NicholasAdamou
      Participant

      I flashed my Raspberry Pi Zero with the ARMEL firmware, linked on the page re4son-kernel.

      After flashing the firmware, I opened the /boot/ partition, I modified cmdline.txt and, because config.txt was not created I created config.txt.

      Inside cmdline.txt I added: modules-load=dwc2,g_ether after rootwait.
      Inside config.txt I added: dtoverlay=dwc2 to the bottom of the file.

      I also, added a file w/o an extension called: ssh to enable SSH on the device.

      I plugged the Micro-USB male header into the port on the Pi0 that gives DATA + PWR and then connected the male USB 2.0 header into the USB port on my Mac. After waiting a few minutes, I did’t see the Pi come up as a USB Ethernet Device.

      Please Note: I followed the tutorial, Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way! by gbaman, however, instead of flashing Raspbian Jessie onto my Micro-SD card I flashed re4son-kali-linux.

      Why doesn’t my Mac discover my Pi0? What am I doing wrong? Is there specific settings I missed?

      Thanks for any help that is offered, it’s much appreciated!

    • #11413
      NicholasAdamou
      Participant

      I flashed my Raspberry Pi Zero with the ARMEL firmware, linked on the page re4son-kernel.

      After flashing the firmware, I opened the /boot/ partition, I modified cmdline.txt and, because config.txt was not created I created config.txt.

      Inside cmdline.txt I added: modules-load=dwc2,g_ether after rootwait.
      Inside config.txt I added: dtoverlay=dwc2 to the bottom of the file.

      I also, added a file w/o an extension called: ssh to enable SSH on the device.

      I plugged the Micro-USB male header into the port on the Pi0 that gives DATA + PWR and then connected the male USB 2.0 header into the USB port on my Mac. After waiting a few minutes, I did’t see the Pi come up as a USB Ethernet Device.

      Please Note: I followed the tutorial, Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way! by gbaman, however, instead of flashing Raspbian Jessie onto my Micro-SD card I flashed re4son-kali-linux.

      Why doesn’t my Mac discover my Pi0? What am I doing wrong? Is there specific settings I missed?

      Thanks for any help that is offered, it’s much appreciated!

    • #11416
      Re4son
      Keymaster

      Hi Nicholas,

      I’ll look into it

      • #11417
        NicholasAdamou
        Participant

        Thanks! I don’t know why my post got posted twice in this same thread, but let me know what you find out!

    • #11423
      Re4son
      Keymaster

      Hi Nicholas,

      Just enable usb0 in /etc/network/interfaces and that’ll fix it.
      I’ve updated the kali+re4son armel image to enable the interface out of the box.

      Hope that helps,
      Re4son

      • #11424
        NicholasAdamou
        Participant

        Thanks dude! That helps, however, I am still unable to connect via SSH to the Pi0. What IP am I supposed to use to get connected? I am currently getting a “Self-Assigned IP” from the Pi0. To combat that, I tried setting a static IP in the /etc/network/interface file for usb0 instead of using DHCP. That fixed the “Self-Assigned IP” problem, however, I am still not able to connect to the Pi0 via SSH. I made sure to make a file w/o any extension called, ssh in the boot partition. I tried pinging the IP that I statically set on the Pi0 and I get no response, which is odd because my Mac says the Pi0 is connected using that IP.

    • #11427
      Re4son
      Keymaster

      I usually use Internet Connection Sharing, which uses DHCP.
      I either ping kali.mshome.net to get the IP address or I run “fping -a -g 192.168.137.0/24”

      I only have to remember to define the new network interface as “trusted” in my windows firewall.

      • #11433
        NicholasAdamou
        Participant

        Okay so, I have been able to SSH into the Pi0 via setting a static address inside /etc/network/interfaces:

        allow-hotplug usb0
        iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.0
        network 192.168.7.0
        broadcast 192.168.7.255
        gateway 192.168.7.1

        I then made sure to manually set that information into my Mac’s Raspberry Pi Zero interface:

        RPi0 Interface Configurations on my Mac

        From there I was able to SSH into the Pi0 using:

        ssh root@192.168.7.2 (Notice it’s not 192.168.7.1)

        I then try pinging 8.8.8.8 from the Pi0 via SSH, I get no response from the server, see below:

        However, I made sure to turn on ICS on my Mac to route internet from WiFi to the Raspberry Pi Zero interface, so the Pi0 should be connected to the internet, see below:

        ICS on my Mac

        Re4son, why do you think this is occurring?

        Keep in mind that, When I use dhcp instead of static, the Pi0 gets a self-assigned IP Address. I make sure to have ICS turned on and routing internet from WiFi to the Raspberry Pi Zero.

        • #11434
          NicholasAdamou
          Participant

          Please Note: I made sure to add a file in the boot partition (mmcblk0p1) w/o an extension called: ssh.

          Do you need this file inside the boot partition (mmcblk0p1) to enable SSH? I ask because inside you steps shown under Ethernet Gadget on the page: re4son-kernel > Ethernet Gadget, you don’t list this as a step.

    • #11435
      Re4son
      Keymaster

      No ssh file needed.
      That’s for Raspbian as the ssh service is disabled by default and the raspberry guys implemented this hack to avoid a chicken and egg situation.

      What’s the output of a traceroute to 8.8.8.8? Is it using the usb0 interface as default route?

      I’ve never used a mac but I’ll pinch one off my colleagues today to play with ics. I’ll get back to you on that.

      • #11442
        NicholasAdamou
        Participant

        Okay, good to know.

        The output of traceroute 8.8.8.8 is shown below:

        I don’t know why the command traceroute is not found. It should be installed by default?

        Let me know what your colleagues say about the ICS.

    • #11464
      Re4son
      Keymaster

      MAC’s a pain in the a%!e.

      I’ve created a new Sticky Fingers image with avahi-daemon installed but disabled and a service called “avahiswitch”.
      Avahiswitch checks if a file called “/boot/avahi” exists and if it does, enables and starts avahi-daemon.
      That allows you to ssh to “kali-pi.local”. Works like a charm.

      So in a nutshell:

      Write Sticky-Fingers to an sd card
      Enable ethernet gadget by editing /boot/config.txt and /boot/cmdline.txt
      Create /boot/avahi
      Insert sd card into your pi, connect to your MAC, enable ICS
      ssh root@kali-pi.local

      Setup your network and disable avahi-daemon again.

      • #11475
        NicholasAdamou
        Participant

        Yeah sometimes a Mac can be a pain in the a%!e.

        Okay cool, that worked to get SSH connection via avahi @ kali-pi.local, however, my Pi0 is not obtaining an IP from the network, see below:

        https://gyazo.com/a5d99ca63085c07ac166bc612ad118fe

        I do have ICS turned on, as seen below:

        https://gyazo.com/786a6174004eae53aa0448d5a090d9e8

        Does this have anything to do with my Pi0?

        I recently bought a Pi0W and I preloaded the StickyFingers Armel image onto it. I configured /boot/config.txt and /boot/cmdline.txt and added /boot/avahi. I modified the contents of the /etc/network/interface file to connect to my network on wlan0, see below:

        auto wlan0
        allow-hotplug wlan0
        iface wlan0 inet dhcp
        wpa-ssid "MyNetworkName"
        wpa-psk "MyNetworkPassword"

        To enable wlan0 I did the following:

        mount /dev/mmcblk0p1 /boot
        cd re4son_kali-pi-tft_kernel_4*
        ./install.sh

        I then rebooted and it connected to my network using the on-board WiFi.

        However, the issue of ICS to Ethernet Gadget on the Pi0 Non-WiFi edition still remains, as shown above. Any idea last ideas about that?

    • #11484
      Re4son
      Keymaster

      Hi Nicholas,

      ICS seems to be working fine. Avahi only provides a local name resolution so that you don’t have to do a ping sweep to get the Pi’s IP address. Being able to ssh into it means that ICS is working.

      I’ve just compared the image of the network status you posted above with both my Sticky Fingers Pi and my Raspbian Pi and they are all identical. I guess displaying an amber light with “Self-Assigned IP” is Apples way of saying all OK 😉

      • #11494
        NicholasAdamou
        Participant

        Hi Re4son,

        Ahh okay, so then, I guess it can’t obtain an internet connection via ICS while avahi is enabled? In order for the Pi0 to obtain a valid IP address and display a green light instead of an amber light with “Self-Assigned IP” is to disable avahi? Or is it not possible at all? That wouldn’t make sense in my opinion, but like you said, because I am able to SSH into the Pi0 with avahi that would indicate that ICS is working? I thought if ICS was working it would display a green light instead of an amber light. What are you thoughts?

        Please note: both the Pi0 and Pi0W cannot obtain a valid IP address using ICS with g_ether module enabled. As you saw, it appears as an amber light with “Self-Assigned IP” instead of a green light with a valid IP address. The only way for the Pi0W to obtain a valid IP address is to enable wlan0 as I did above and tell it to connect to a given AP.

    • #11504
      Re4son
      Keymaster

      Hi Nicholas,

      Your Pi is getting a valid IP address. SSH into it and try to ping 8.8.8.8

      I don’t know why Apple decided to go with an amber light instead of green but amber seems to mean “All ok, this macbook assigned an ip address to your pi, you are ready to rock’n’roll”

      • #11510
        NicholasAdamou
        Participant

        Yeah that would make sense, but if you take a look below, you will see that apparently it is not working.

        Below is the interface, Raspberry Pi Zero, in System Preferences>Network:

        https://gyazo.com/94ffd8effcbfdc92f80c5ccb4734f4d4

    • #11511
      Re4son
      Keymaster

      Can you post a screenshot of your sharing settings please? I’m gonna compare it with mine.

      In the video you posted, you try to ssh into your macbook.
      Pinging kali-pi.local will give you the IP address of the pi.

    • #11522
      Re4son
      Keymaster

      You can ssh to kali-pi.local but not ping?
      I had a similar issue with our work mac when it refused to share the corporate wifi via ICS always came up with an error message when I enabled ICS, complaining about 802.1x protection.
      Connecting via a different wifi works. One of those weird Mac things.

      A sure way to get the Pi’s IP address is to ssh into it and get it via “ifconfig -a”.

      I wouldn’t worry about it too much. E_Gadget is about the initial connection to set up your ethernet or wifi. I’d ssh into it and set up your wifi and forget about the Mac.

      • #11525
        NicholasAdamou
        Participant

        yeah, that is correct. I can ssh into kali-pi.local, but cannot ping.

        I also do not get an IP address like I am supposed too. I issue the ifconfig -a command on the Pi0 and I do not get an inet address even though ICS is working just fine as you’ve seen. Take a look:

        https://gyazo.com/5e0bb591d542449e8c0e461f1f23742d

        The only issue is that this Pi I’m using doesn’t have built-in wifi, thus, I cannot connect to the internet unless ICS is working. I’m at college at the moment and the WiFi here is 802.1x protected, so I am forced to use my iPhone’s hotspot to allow ICS, which has been the network I have been using and showcasing in this thread.

    • #11526
      Re4son
      Keymaster

      There is your IP address: inet6 fe80:…….
      It’s an IP v6 address. Disable IPv6 in your advanced sharing settings and you should get an IP4 address. Might fix your Internet as well

      • #11527
        NicholasAdamou
        Participant

        Ahh, awesome! That make’s a lot of sense.

        However, I do not see an option in the preference pane for Sharing on the mac to disable IPv6; how do I go about disabling IPv6 addresses?

    • #11528
      Re4son
      Keymaster

      Use the most restrictive setting. From memory it’s something like “Use IP6 for point to point only” or something along those lines

    • #11529
      Re4son
      Keymaster

      Sorry it’s not under sharing but in the network settings for the RNDIS/Ethernet Gadget interface.

      Click advanced and select “Link-local only” in the “Configure IPv6” drop-down box

      • #11530
        NicholasAdamou
        Participant

        Okay, I did that and I still get a IPv6 address:

        https://gyazo.com/a27dc76088090f1bd96165f1aaa3643c

        https://gyazo.com/6135fc9c7e7dfb5ad1f74068cd665f46

    • #11531
      Re4son
      Keymaster

      Just borrowed my friends Mac and here are my observations:

      1. Configure IPv6 “Link-local only”
      2. Connect Mac’s wifi to mobile hotspot to avoid 802.1x protection issues
      3. Connect Pi and wait a minute
      4. Enable Internet connection sharing
      5. Wait a few minutes
      6. ssh kali-pi.local
      7. ifconfig will list an IPv4 address, if not:
      – ifup usb0 && ifdown usb0
      This will reset the interface and renew the DHCP leases obtaining an IPv4 address and allowing Internet access
      8. ping 8.8.8.8 is successful

      Please let me know how you go

      • #11532
        NicholasAdamou
        Participant

        After following your steps, I get the following output:

        https://gyazo.com/e1f7e6b2b673d78c007c8063de6cb32b

        It returns:

        No DHCPOFFERS received.
        No working leases in persistent database - sleeping.

        Why?

    • #11533
      Re4son
      Keymaster

      I missed the “enable ICS bit”. Have you enabled it?

      • #11534
        NicholasAdamou
        Participant

        Yeah, I did enable it, not noticing that you forgot that step.

        So what you read in my previous reply had “ICS” enabled.

    • #11535
      Re4son
      Keymaster

      Are you connecting to your mobile phone via usb cable or wifi?

    • #11537
      Re4son
      Keymaster

      iphone?

    • #11538
      NicholasAdamou
      Participant

      Yes. I connected to my iPhone’s hotspot via WiFi on my Mac.

      https://gyazo.com/af7bbddeffd7e40e8e07abfdccae1136

    • #11539
      Re4son
      Keymaster

      Just borrowed somebody’s iphone and mac and it worked out of the box.
      I made sure that under “advanced network settings” for RNDIS and Wifi the setting “Configure IPv4” is set to DHCP. Under RNDIS the IPv6 option is set to “Link-local only”
      Same on yours?

      • #11540
        NicholasAdamou
        Participant

        Yeah everything is the same as yours.

        So, I decided to delete the interface on my Mac and reinstall the RNDIS drivers from: HoRNDIS for Mac.

        After, installing, I unplugged the Pi0 and reconfigured the interface to set IPv6 to “Link-local only”.

        Then I plugged in the Pi0 into the Mac and ssh’ed to kali-pi.local and ran:

        ifdown usb0 && ifup usb0 && ifconfig usb0

        I then obtained the correct IP address. See below:

        So, I guess this was just a case of a bad interface and just needed to reinstall and reconfigure the interface as you’ve said.

        Anyways, thanks for your help! I really appreciate it. Keep up the good work with your Kali Linux Raspberry Pi kernel.

    • #11541
      Re4son
      Keymaster

      I’m glad its working

Viewing 20 reply threads
  • You must be logged in to reply to this topic.