Tiny Core Base > Raspberry Pi
ifconfig in bootsync.sh doens't work as expected (Pi zero W as Access Point)
Twist:
Hi all, still very new to tiny core, and even newer to this forum.
I'm in the process of setting up a raspi zero W as an access point. Partly using the instruction at http://brezular.com/wp-content/uploads/2017/12/router-manual.txt to get going.
My bootsynch.sh reads:
--- Code: ---/usr/bin/sethostname FluxMux
ifconfig wlan0 192.168.127.1 netmask 255.255.255.0
dnsmasq -C /etc/dnsmasq.conf
/opt/bootlocal.sh &
--- End code ---
And in bootlocal.sh I have:
hostapd /etc/hostapd.conf
Once booted my wlan0 has an IP6 but not the configured IP4 address... When I then manually issue
--- Quote ---ifconfig wlan0 192.168.127.1 netmask 255.255.255.0
--- End quote ---
and restart hostapd things work fine.
Am I missing something?
Twist:
I managed to fix this by inserting a sleep 1s between sethostname and ifconfig
Paul_123:
For what it is worth, you need to set the the hostname on the kernel commandline. Setting it where you are doing it is not reliable.
Also, network configuration is done in the background, so your sleep command is just enough delay to let the network finish configuring before launch. It might be better to actually check for network configuration rather than just a blind sleep.
Twist:
Thanks for your reply Paul_123
I'd be keen to do this 'the proper way', but I don't know how.
I don't know what I need to put into the command.txt file to set a hostname. When googling I just find it is not possible...
How do I check if the network config is done? (Started at sleep 10s, then 5, then 2, 1 still worked...)
patrikg:
I think you need to read the bootcodes for tinycore.
http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes
host=
Navigation
[0] Message Index
[#] Next page
Go to full version