Overview › Forums › Sticky Finger’s Kali-Pi › MacOS not Discovering Raspberry Pi Zero using Re4son Firmware
- This topic has 36 replies, 2 voices, and was last updated 4 years, 10 months ago by
Re4son. This post has been viewed 4479 times
-
AuthorPosts
-
-
March 30, 2017 at 11:10 am #11412
NicholasAdamou
ParticipantI 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 modifiedcmdline.txt
and, becauseconfig.txt
was not created I createdconfig.txt
.Inside
cmdline.txt
I added:modules-load=dwc2,g_ether
afterrootwait
.
Insideconfig.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!
-
March 30, 2017 at 11:14 am #11413
NicholasAdamou
ParticipantI 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 modifiedcmdline.txt
and, becauseconfig.txt
was not created I createdconfig.txt
.Inside
cmdline.txt
I added:modules-load=dwc2,g_ether
afterrootwait
.
Insideconfig.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!
-
March 30, 2017 at 3:07 pm #11416
Re4son
KeymasterHi Nicholas,
I’ll look into it
-
March 30, 2017 at 9:22 pm #11417
NicholasAdamou
ParticipantThanks! I don’t know why my post got posted twice in this same thread, but let me know what you find out!
-
-
April 1, 2017 at 7:25 pm #11423
Re4son
KeymasterHi 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-
April 1, 2017 at 10:19 pm #11424
NicholasAdamou
ParticipantThanks 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 forusb0
instead of usingDHCP
. 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 triedpinging
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.
-
-
April 2, 2017 at 10:28 am #11427
Re4son
KeymasterI 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.
-
April 3, 2017 at 5:52 am #11433
NicholasAdamou
ParticipantOkay 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:
From there I was able to SSH into the Pi0 using:
ssh root@192.168.7.2
(Notice it’s not192.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:Re4son, why do you think this is occurring?
Keep in mind that, When I use
dhcp
instead ofstatic
, the Pi0 gets aself-assigned IP Address
. I make sure to haveICS
turned on and routing internet from WiFi to the Raspberry Pi Zero.-
April 3, 2017 at 6:18 am #11434
NicholasAdamou
ParticipantPlease 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 underEthernet Gadget
on the page: re4son-kernel > Ethernet Gadget, you don’t list this as a step.
-
-
-
April 3, 2017 at 8:18 am #11435
Re4son
KeymasterNo 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.
-
April 3, 2017 at 10:32 am #11442
NicholasAdamou
Participant
-
-
April 4, 2017 at 12:39 pm #11464
Re4son
KeymasterMAC’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.localSetup your network and disable avahi-daemon again.
-
April 4, 2017 at 9:11 pm #11475
NicholasAdamou
ParticipantYeah 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:I do have ICS turned on, as seen below:
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 onwlan0
, 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?
-
-
April 5, 2017 at 9:43 am #11484
Re4son
KeymasterHi 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 😉
-
April 5, 2017 at 12:45 pm #11494
NicholasAdamou
ParticipantHi 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 disableavahi
? 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 withavahi
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 enablewlan0
as I did above and tell it to connect to a given AP.
-
-
April 6, 2017 at 9:14 am #11504
Re4son
KeymasterHi 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”
-
April 6, 2017 at 12:33 pm #11510
NicholasAdamou
Participant
-
-
April 6, 2017 at 1:03 pm #11511
Re4son
KeymasterCan 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.-
April 6, 2017 at 10:04 pm #11519
NicholasAdamou
Participant
-
-
April 7, 2017 at 6:49 am #11522
Re4son
KeymasterYou 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.
-
April 7, 2017 at 8:44 am #11525
NicholasAdamou
Participantyeah, 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 aninet
address even though ICS is working just fine as you’ve seen. Take a look: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.
-
-
April 7, 2017 at 8:54 am #11526
Re4son
KeymasterThere 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-
April 7, 2017 at 8:57 am #11527
NicholasAdamou
ParticipantAhh, 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?
-
-
April 7, 2017 at 9:02 am #11528
Re4son
KeymasterUse the most restrictive setting. From memory it’s something like “Use IP6 for point to point only” or something along those lines
-
April 7, 2017 at 9:10 am #11529
Re4son
KeymasterSorry 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
-
April 7, 2017 at 9:17 am #11530
NicholasAdamou
Participant
-
-
April 7, 2017 at 9:21 am #11531
Re4son
KeymasterJust 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 successfulPlease let me know how you go
-
April 7, 2017 at 9:39 am #11532
NicholasAdamou
Participant
-
-
April 7, 2017 at 10:42 am #11533
Re4son
KeymasterI missed the “enable ICS bit”. Have you enabled it?
-
April 7, 2017 at 11:21 am #11534
NicholasAdamou
ParticipantYeah, I did enable it, not noticing that you forgot that step.
So what you read in my previous reply had “ICS” enabled.
-
-
April 7, 2017 at 11:31 am #11535
Re4son
KeymasterAre you connecting to your mobile phone via usb cable or wifi?
-
April 7, 2017 at 11:32 am #11536
NicholasAdamou
Participantvia WiFi.
-
-
April 7, 2017 at 11:32 am #11537
Re4son
Keymasteriphone?
-
April 7, 2017 at 11:35 am #11538
NicholasAdamou
Participant -
April 7, 2017 at 11:44 am #11539
Re4son
KeymasterJust 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?-
April 7, 2017 at 12:03 pm #11540
NicholasAdamou
ParticipantYeah 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.
-
-
April 7, 2017 at 1:59 pm #11541
Re4son
KeymasterI’m glad its working
-
-
AuthorPosts
- You must be logged in to reply to this topic.