Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: gavinmc42 on March 26, 2016, 07:24:36 PM

Title: Pi 3 WiFi setup
Post by: gavinmc42 on March 26, 2016, 07:24:36 PM
Putting this here in case I forget how:)
Thanks to Paul_123  and others for help.

After installing piCore-xx.img, you will/may need to increase mmcblk0p2 in size to make room for the extra files.

tce-load -wi firmware-brcmfmac43430.tcz
tce-load -wi wifi.tcz
filetool.s -b
sudo reboot
sudo wifi.sh

wifi.sh allows you to manually pick a router.
Still need to figure out automatic connection on boot.
Lots more testing/learning wifi stuff.

Bela, could make the standard piCore-xx.img a bit bigger to have room for the wifi and soon bluetooth files.
Maybe one day detect on boot if it is a Pi 3 and have wifi/ble in the kernel boot mmcblk0p1?




Title: Re: Pi 3 WiFi setup
Post by: Paul_123 on March 26, 2016, 08:41:55 PM
Putting this here in case I forget how:)
Thanks to Paul_123  and others for help.

After installing piCore-xx.img, you will/may need to increase mmcblk0p2 in size to make room for the extra files.

tce-load -wi firmware-brcmfmac43430.tcz
tce-load -wi wifi.tcz
filetool.s -b
sudo reboot
sudo wifi.sh

wifi.sh allows you to manually pick a router.
Still need to figure out automatic connection on boot.
Lots more testing/learning wifi stuff.

Bela, could make the standard piCore-xx.img a bit bigger to have room for the wifi and soon bluetooth files.
Maybe one day detect on boot if it is a Pi 3 and have wifi/ble in the kernel boot mmcblk0p1?

You are very close.   After you run wifi.sh and get your wifi setup.   You need to run a backup to save the wifi.db file that is saved in your home directory.

also put the command in /opt/bootlocal.sh to automatically connect at start.
Code: [Select]
wifi.sh -a

Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 26, 2016, 09:49:34 PM
Thanks Paul.

I did wonder what that wifi.db file was for.
Might need to edit wifi.sh, got a home network on 10.0.0.x not 192.168.x.x

Gavin
Title: Re: Pi 3 WiFi setup
Post by: Greg Erskine on March 26, 2016, 10:02:20 PM
Thanks Paul.

I did wonder what that wifi.db file was for.
Might need to edit wifi.sh, got a home network on 10.0.0.x not 192.168.x.x

Gavin

Hi Gavin,

I think wifi.sh will work with 10.0.0.x. The defaults might be 192.168.x.x but I don't think it stops 10.0.0.x working.

Please let me know if it breaks!

regards
Greg
Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 26, 2016, 10:08:36 PM
Hi Paul,

Got a NBN router, it has Telstra Air and Fon Air these are free access on 192.168.x.x.
Seems it found these first and not my home network.

Hmm seems to be going via the ethernet for openssh.
Still got something to sort out to make it wireless.

Gavin
Title: Re: Pi 3 WiFi setup
Post by: bmarkus on March 27, 2016, 02:54:08 AM
Bela, could make the standard piCore-xx.img a bit bigger to have room for the wifi and soon bluetooth files.
Maybe one day detect on boot if it is a Pi 3 and have wifi/ble in the kernel boot mmcblk0p1?

Just to make it bigger without adding new files to the image has no sense, as for sure you must resize it anyhow if you add applications, and you can not tell how much space is needed. Resize when it is really needed an easy procedure, safe and well documented.

Actually RPi3 is used as an RPi2 in 32-bit mode, sharing the RPi2 repo, kernel, etc. Just adding the WiFi kernel modules to initrd would be an unneded overhead for RPi2 while an RPi3 dedicated initrd would be an extra 5Mbyte. Also for RPi3 users need the WiFi tcz's to make it usable which is not needed by others, and also wifi kernel modules are different for RPi0/RPi1. Due to different WiFi adapters, firmware, etc. WiFi always need customization.

I do not want to reintroduce multiple SD card images as it was before which makes life more complicated for both users and maintainers. Please keep in mind that TC/piCore is not a distribution but a core system say a toolkit.

Of course if one is making an RPi3 special edition it is fine. We can discuss it, check and if it fits to piCore concept and implementation we can make it available as a community version, I appreciate it. But do not want to change the current SD card structure.





Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 27, 2016, 04:16:55 AM
Hi Bela,

Got a bit carried way:)
Yep no point wasting space just for the Pi 3.
If I can ever get any, my Pi 3's will be out numbered by Pi Zeros anyway.
Title: Re: Pi 3 WiFi setup
Post by: Paul_123 on March 27, 2016, 05:11:31 AM
Thanks Paul.

I did wonder what that wifi.db file was for.
Might need to edit wifi.sh, got a home network on 10.0.0.x not 192.168.x.x

Gavin

Are you trying to use a static IP address?  Wifi.sh will work with any address range with DHCP
Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 27, 2016, 07:31:18 PM
Tested static address before but not in current setup, it was a hack.
Messed about in bootlocal , pkill udhcpc ........
Searching forums now.

Official method?
nodhcp in boot and  ????

In Raspbian set ip addresses in /etc/network/interfaces
Not sure for piCore how to set static addresses

Got busybox-httpd serving a javascript enhanced web page over WiFi.
Can openssh into it.

Very close now to WiFi robots etc, software wise anyway:).
Time to get cameras hooked up and stream them.
Need to get a serious power supply, at limits of current one for the Pi 3.
Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 27, 2016, 07:50:12 PM
Interesting.
nodhcp in boot means I lost the wired ethernet.
Lucky I forgot to disable wifi.sh -a in bootlocal, could wifi back in to fix it.

Might have to set static eth0 and wlan0?

Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 27, 2016, 08:14:57 PM
removed nodhcp from boot

bootlocal.sh
....
ifconfig wlan0 10.0.0.x
#wifi.sh  -a

interesting  things happening
I can see the wifi webpage but got ntpd: bad address 'pool.nt.org' on boot
Helps if 10.0.0.x is not used on another device:(
Title: Re: Pi 3 WiFi setup
Post by: patrikg on March 28, 2016, 03:45:40 AM
You need to setup dns if you use static address.
Title: Re: Pi 3 WiFi setup
Post by: Paul_123 on March 28, 2016, 05:39:25 AM
Interesting.
nodhcp in boot means I lost the wired ethernet.
Lucky I forgot to disable wifi.sh -a in bootlocal, could wifi back in to fix it.

Might have to set static eth0 and wlan0?

I would recommend leaving everything DHCP.   If you want your pi to get the same IP address all the time, your DHCP server in your router should be able to be set to do that.

If you want to do static, as patrick mentioned you have to setup dns or set /etc/resolv.conf.   You will also need to set your default route.    Again, udhcpc does all this for you.  Let it.
Title: Re: Pi 3 WiFi setup
Post by: gavinmc42 on March 28, 2016, 06:30:11 AM
Yep leave things as they are.
WiFi is working, webserver is working.
Time to get it sending pics and getting it mobile.
Can start testing wifi on the model A's, A+'s putting the bot army together.

Putting nodhcp  in boot messes up wired eth0 which I need if WiFi goes haywire.
wifi.sh -a in bootlocal works too, boot does get slowed down a bit waiting for connection.

Got lots of gadgets on the home network, anyone can be used to find the wifi Pi's.
Especially if I change sethostname in bootsync to something distinctive. Hal, Huey, Dewey and Louie, No5 ?
Title: Re: Pi 3 WiFi setup
Post by: Paul_123 on March 28, 2016, 09:44:51 AM
Got lots of gadgets on the home network, anyone can be used to find the wifi Pi's.
Especially if I change sethostname in bootsync to something distinctive. Hal, Huey, Dewey and Louie, No5 ?

Actually setting hostname in bootsync.sh doesn't work most of the time.   The only sure fire way to set the hostname is to do it on the boot command line.
Title: Re: Pi 3 WiFi setup
Post by: jgrulich on March 28, 2016, 10:03:29 AM
I've spent a lot of time with the network stability and the only stable way seems to me to have fully static IP setup.

1) add "nodhcp" into cmdline.txt

2) add this at the beginning of the bootlocal.sh

Code: (bash) [Select]
# Start LAN and WiFi with fixed IP configuration
ifconfig eth0 down
ifconfig wlan0 down
ifconfig eth0 add 192.168.1.10 up
ifconfig wlan0 add 192.168.1.20 up
route add default gw 192.168.1.1
echo nameserver 192.168.1.1 >> /etc/resolv.conf

Than everything works well.