IoT Bytes

Bits and Bytes of IoT

Raspberry Pi 3 Built-in WiFi Module with piCore

Pradeep Singh | 1st Sep 2017


1. Prerequisites:

Before beginning with this article, you should have piCore up and running on your Raspberry Pi. If you need help with piCore installation you can go through the following article –

piCore (Tiny Core) Linux on Raspberry Pi

2. Hardware and Software Details:

Most of the piCore configurations are very specific to the hardware and software versions. Following are the details of piCore and Raspberry Pi, I am using for this article –

2.1 piCore Image – I am using “” piCore image downloaded from the following url –

2.3 Hardware – I am using Raspberry Pi 3 with built-in WiFi module.

3. Install Linux Packages:

To the WiFi module work you need to install the Firmware for built-in module and the CLI based wifi utility –

3.1 Install firmware for built-in wifi module using the “tce-load –wi firmware-rpi3-wireless.tcz” command –

tc@box:/usr/local/bin$ tce-load -wi firmware-rpi3-wireless.tcz 
Downloading: firmware-rpi3-wireless.tcz
Connecting to (
firmware-rpi3-wirele 100% |********************************************************| 248k 0:00:00 ETA
firmware-rpi3-wireless.tcz: OK

3.2 Install CLI based wifi tool module for piCore using the “tce-load -wi wifi.tcz” command –

tc@box:~$ tce-load -wi wifi.tcz
wifi.tcz.dep OK
wireless_tools.tcz.dep OK
wpa_supplicant.tcz.dep OK
readline.tcz.dep OK
Downloading: readline.tcz
Connecting to (
readline.tcz 100% |********************************************************| 116k 0:00:00 ETA
readline.tcz: OK
Downloading: libnl.tcz
Connecting to (
libnl.tcz 100% |********************************************************| 240k 0:00:00 ETA
libnl.tcz: OK
Downloading: wpa_supplicant.tcz
Connecting to (
wpa_supplicant.tcz 100% |********************************************************| 364k 0:00:00 ETA
wpa_supplicant.tcz: OK
Downloading: wireless-4.9.22-piCore-v7.tcz
Connecting to (
wireless-4.9.22-piCo 100% |********************************************************| 2544k 0:00:00 ETA
wireless-4.9.22-piCore-v7.tcz: OK
Downloading: libiw.tcz
Connecting to (
libiw.tcz 100% |********************************************************| 16384 0:00:00 ETA
libiw.tcz: OK
Downloading: wireless_tools.tcz
Connecting to (
wireless_tools.tcz 100% |********************************************************| 40960 0:00:00 ETA
wireless_tools.tcz: OK
Downloading: wifi.tcz
Connecting to (
wifi.tcz 100% |********************************************************| 8192 0:00:00 ETA
wifi.tcz: OK

4. Reboot Raspberry Pi:

Reboot your Raspberry Pi so that piCore can detect built-in WiFi module by installing the firmware and expose the wlan0 interface. You can use “sudo reboot” command to reboot the system.

5. Connect to WiFi Network:

After system boot up run WiFi CLI interface using the “sudo /usr/local/bin/” command. You will be prompted with a list of available WiFi Networks. Select your WiFi SSID and enter the password associated with that.

tc@box:~$ sudo /usr/local/bin/ 
Found wifi device wlan0
Standby for scan of available networks...
Set to try a few times to obtain a lease.

Select Wifi Network
    ESSID                 Enc Qual Channel Type 
 1. TP-LINK_POCKET_3020_6EFD56   on 70 11 WPA
 2. JOKER                  on 70 11 WPA
 3. koshln                 on 60   1 WPA
 4. Bagla                  on 46 11 WPA
 5. Tarazan                on 43   1 WPA
 6. HP-Print-65-Officejet 4630   off 42   6 
 7. khatrias               on 41   6 WPA
 8. stoury                 on 40   1 WP
 9. Sargun                 on 40   1 WPA
10. RAJ                    on 39   6 WPA
11. getit248               on 32 11 WPA

Enter selection ( 1 - 14 ) or (q)uit: 2
Enter password for JOKER (8 to 63 characters): myfunnypass
Sending credentials to requested access point JOKER..
deleting routers
adding dns
adding dns
adding dns

With this, you should be connected to your WiFi network. You can check the configuration of your “wlan0” interface using “ifconfig wlan0” command –

tc@box:~$ ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr B8:27:EB:90:31:C8 
inet addr: Bcast: Mask:
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:2086 (2.0 KiB) TX bytes:1028 (1.0 KiB)

The WiFi SSID and Password will be saved in “/home/tc/wifi.db” file, allowing you to reconnect to the same WiFi Network again without entering the password.

tc@box:~$ cat /home/tc/wifi.db 
JOKER myfunnypass WPA

6. Configure Auto-Connect at System Boot-up (Config Persistence):

6.1 To connect to the WiFi network automatically immediately after the system reboot execute the following command –

sudo echo '/usr/local/bin/ -a 2>&1 > /tmp/wifi.log' >> /opt/

This command will add an entry to “/opt/” file, that will get executed as soon as the system comes up after the boot process.

tc@box:~$ sudo echo '/usr/local/bin/ -a 2>&1 > /tmp/wifi.log' >> /opt/ 
tc@box:~$ cat /opt/ 

# Start serial terminal
/usr/sbin/startserialtty &

# Set CPU frequency governor to ondemand (default is performance)
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Load modules
/sbin/modprobe i2c-dev

# Start openssh daemon
/usr/local/etc/init.d/openssh start

# ------ Put other system startup commands below this line
/usr/local/bin/ -a 2>&1 > /tmp/wifi.log

6.2 After altering “/opt/” file, you need to save the changes. To do this you can execute the “ -b” command.

tc@box:~$ -b
Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz/

7. Reboot Raspberry Pi:

Reboot the Raspberry Pi using “sudo reboot” to test the configuration persistence.

Once the system boot process gets completed check “wlan0” configuration using the “ifconfig wlan0” command. You should notice that the wlan0 is now connected with WiFi network and has the IP Address assigned to it –

tc@box:~$ ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr B8:27:EB:90:31:C8 
inet addr: Bcast: Mask:
RX packets:84 errors:0 dropped:3 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:6058 (5.9 KiB) TX bytes:1028 (1.0 KiB)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: