pixxx
Posts: 25
Joined: Sun Oct 08, 2017 4:12 pm

Re: wlan0 disappears after Stretch 2017-09-07

Tue Nov 28, 2017 4:56 pm

To ShiftPlusOne,

Thank you very much for your instruction. Things like that are spontaneously coming out of your head but for me it is a world of difference. Certain thing that you said in a phrase or even word could potentially take me days to google and digest. At least now I have a starting point to begin with.

I know there is a way to boot the USB directly, however, due to the risk involved I am opted to run the USB with a SD card. I think long as I am able to comprehend the boot process the rest is just a piece of cake. Don't know when that day would arrive but for now I am glad to be off the hook after weeks of searching.

Is it possible to configure the sd card to instruct linux to load the kernel off the USB during the initial boot process? In other words, is there any way that we can do to the sd card making it tells the boot process where the real boot partition is?

Thanks for the time that you spent to help me. Good day.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: wlan0 disappears after Stretch 2017-09-07

Tue Nov 28, 2017 5:54 pm

pixxx wrote: I know there is a way to boot the USB directly, however, due to the risk involved
What risk?
pixxx wrote: Is it possible to configure the sd card to instruct linux to load the kernel off the USB during the initial boot process?
Anything linux does will happen after the kernel is loaded, because linux IS the kernel.

pixxx
Posts: 25
Joined: Sun Oct 08, 2017 4:12 pm

Re: wlan0 disappears after Stretch 2017-09-07

Wed Nov 29, 2017 12:57 pm

It is risky because it is a One Time Programmable memory deal. Looks like it is not reversible if later one changed his/her mind. I read the instruction here:

https://www.raspberrypi.org/documentati ... des/msd.md

My track record of flashing memory like this is not very good so I don't wanna take chances.

One quick question, with the current kernel 4.9.59, if my /etc/network/interfaces is empty (untouch) and my /etc/dhcpcd.conf is like this:

interface eth0
static ip_address=192.168.1.190/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

interface wlan0
static ip_address=192.168.2.1/24
static routers=192.168.2.1
static domain_name_servers=8.8.8.8

The pi can reliably connect to the router. However, to accomplish the same goal when I do this to the /etc/network/interfaces:

source-directory /etc/network/interfaces.d
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0


And for the /etc/dhcpcd.conf is either blank or same as above. The end result would cause the pi's network to shutdown completely. Do you have any idea why?

I don't know why so far Stretch only accept static settings from the dhcpcd.conf. Any modification to the /etc/network/interfaces would disable eth0 and wlan0 completely. For a headless setup this is a disaster.

Thanks.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: wlan0 disappears after Stretch 2017-09-07

Wed Nov 29, 2017 1:30 pm

pixxx wrote: It is risky because it is a One Time Programmable memory deal. Looks like it is not reversible if later one changed his/her mind. I read the instruction here:

https://www.raspberrypi.org/documentati ... des/msd.md

My track record of flashing memory like this is not very good so I don't wanna take chances.
Two points here:
1) It's a config.txt option and it makes sure you don't write to the wrong bits. Just remember to remove that line afterwards. It doesn't force you to boot from USB, it only enables the option when no SD card is found. On a pi3 this isn't risky at all. I don't know why you wouldn't want that bit set.
2) If the first point doesn't convince you, you can still boot off USB if your SD card only has a bootcode.bin on a fat32 partition and nothing else.
pixxx wrote: The end result would cause the pi's network to shutdown completely. Do you have any idea why?
pixxx wrote: I don't know why so far Stretch only accept static settings from the dhcpcd.conf.
Missing auto eth0 and auto wlan0 lines?
pixxx wrote:The pi can reliably connect to the router.
Why not just use dhcpcd then?

pixxx
Posts: 25
Joined: Sun Oct 08, 2017 4:12 pm

Re: wlan0 disappears after Stretch 2017-09-07

Thu Nov 30, 2017 1:17 am

To ShiftPlusOne,

If the author has said the same thing like you just did I would have done it in a heartbeat. It perfectly fits those in situation like mine now, why waste another sd card when the usb can be on its own? When I read about it, it was like reading a bible to me. Everything was like foreign language, too much info to absorb in a short period of time and I have only 1 pi to mess around with. At any rate, it would definitely be on the list of things to do for the next week.

For now, the only thing that I have used is /etc/dhcpcd.conf. It is more reliable and straightforward than the /etc/network/interfaces. I have spent so much time to research about it, but at the end of the day I still come up empty-handed about how to use /etc/network/interfaces correctly. Every time it hits I have no choice but to literally pull the plug on my headless pi, that is not a good thing to do.

Yesterday I am stuck with this scenario, I disable the internal Wifi through blacklist and plug in the pi with the usb dongle TL-WN722N v1. Just like I said earlier, I left the /etc/network/interfaces untouched. The content of my /etc/dhcpcd.conf is like this:

nterface eth0
static ip_address=192.168.1.190/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

interface wlan0
static ip_address=192.168.2.1/24
static routers=192.168.2.1
static domain_name_servers=8.8.8.8

The pi booted up fine however wlan0 (TL-WN722N) was listed but NOT associated with any address when it should be with 192.168.2.1. I then ran "sudo ifconfig wlan0 192.168.2.1" and it accepted it. Reboot the pi and wlan0 still behaved the same way.

I ran "lsusb" and this is the output of it:

Image

I then ran "lsmod" and this is the output of it:

Image

Based on what I have read from other people they said:
Bus 001 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n is the WN722N in lsusb output.
ath9k_htc is the name of the WN722N driver according to the lsmod output.

I needed wlan0 to associate itself with 192.168.2.1 automatically every time the pi reboot because I am trying to make an AP out of the pi from this tutorial: https://learn.adafruit.com/setting-up-a ... t?view=all

Every time when the wlan0 is blank the isc-dhcp-server would fail. At this point, I don't know what to do to make it accepted 192.168.2.1 so I tried to add "sudo ifconfig wlan0 192.168.2.1" to /etc/rc.local. Here is how it looks:

Image

To my expectation wlan0 did associate itself with 192.168.2.1 after reboot. The isc-dhcp-server is up and running. Hostapd is also up and running. However, the pi was not showing any sign that the AP is working at all.

I then edited driver=ath9k_htc in the /etc/hostapd/hostapd.conf file like this:

Image

And the AP is still not functioning at all. I tried the same method with the internal Wifi by commented out the driver in hostapd.conf and the AP worked fine.

In linux what do I need to do to find the right driver name of the usb device and how do I know if the right driver is loaded into the kernel at reboot? And last but not least what step did I miss to make this AP work?

Thank you very much.

Return to “Raspbian”