Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: heiheshang on January 07, 2024, 11:02:45 AM
-
I can't understand how to set up Wi-Fi without a monitor for Raspberry Pi. I loaded the tinycore 14 image onto an SD card, changed the second partition, downloaded the Wi-Fi files, but I can't understand where the wpa_supplicant.conf file should be, where on the SD card should this file be located.
-
You can tell wpa_supplicant where to find the conf file, for example:
sudo cp /mnt/mmcblk0p2/conf/wpa_configure.conf /etc/wpa_configure.conf
sudo wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_configure.conf
-
You can tell wpa_supplicant where to find the conf file, for example: sudo cp /mnt/mmcblk0p2/conf/wpa_configure.conf /etc/wpa_configure.conf
sudo wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_configure.conf
I don't understand. I don't have such a folder on my card.
-
It was just an example - you can save files anywhere you like.
-
It was just an example - you can save files anywhere you like.
You probably didn't understand me. I can't get to the computer itself. I can do all the monipulations only on the SD card. Your scenario suggests that I am on the device. The device has neither the keyboard nor the monitor.
-
You have 2 options
1) connect a keyboard and monitor to configure WiFi. Then disconnect everything.
2) connect using Ethernet, setup WiFi, then disconnect the Ethernet and reboot.
-
You have 2 options
1) connect a keyboard and monitor to configure WiFi. Then disconnect everything.
2) connect using Ethernet, setup WiFi, then disconnect the Ethernet and reboot.
It seems to me to be a way to write down the settings on the SD card. I do this with Raspberry OS, probably the same can be done with Tinycore
-
@heiheshang: Welcome to the forum!
Maybe if we knew a few additional details we'd be able to assist you better.
1. Which Raspberry Pi (Pi4, Pi0-W, Pi0-2W, etc.) are you working with?
2. Which PiCore (version) are you working with?
3. What reason(s) prevent you from being able to use a keyboard and a monitor on the Raspberry Pi?
If we could visualize the environment you're working with, there may be a quick and reasonably painless solution.
-
@heiheshang: Welcome to the forum!
Maybe if we knew a few additional details we'd be able to assist you better.
1. Which Raspberry Pi (Pi4, Pi0-W, Pi0-2W, etc.) are you working with?
2. Which PiCore (version) are you working with?
3. What reason(s) prevent you from being able to use a keyboard and a monitor on the Raspberry Pi?
If we could visualize the environment you're working with, there may be a quick and reasonably painless solution.
1. raspberry pi 3b
2. 14.0.1
3. I have no HDMI cable to connect. There is LCD screen, but it is difficult to connect it
-
Connected to the router with a cable. I accessed the device via ssh. I see that the driver for the Wi-Fi card has not loaded. Which driver and how should I download it?
tc@box:/etc$ sudo /usr/local/bin/wifi.sh
No wifi devices found!
-
The picore isn't built what you expect.
First you need to connect to a screen with hdmi and usb keyboard, and then you can expand the sd card, and set the configurations like you want and save that, so next time you boot the system your settings will be populated with example with ssid and password, and so on.
And then you can disconnect the screen and keyboard and just connect with ssh from the network.
And i found this...you may use this..But you need some linux machine to do this:
Dont' know why this is not imported into the new wiki.. some web pages missing from the old wiki.
https://web.archive.org/web/20191011060430/http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi (https://web.archive.org/web/20191011060430/http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi)
-
And when searching in this forum, you may find some another users asked the same question.
https://forum.tinycorelinux.net/index.php/topic,21134.msg145053.html (https://forum.tinycorelinux.net/index.php/topic,21134.msg145053.html)
-
@heiheshang: Since you can SSH into the device, let's get you set up.
1. Partition and Format your SD card's remaining, unused space (which will become mmcblk0p2)
2. Enter blkid | grep mmcblk and you should see mmcblk0p2 listed; the UUID number here is required below where it says [YourUUID]
3. Edit /mnt/mmcblk0p1/cmdline.txt and add this to the end of the existing string of text:
tce=UUID="[YourUUID]" opt=UUID="[YourUUID]" home=UUID="[YourUUID]"
Once finished, reboot and then log back into the device.
Run the program tce-ab and Search (one at a time) for each of the following extensions and Install them:
wifi
wireless_tools
wireless (and select wireless-#.#.#-piCore-v#.tcz)
wpa_supplicant
...and I think RasPi3's had a special firmware package, so search for
rpi3b
...it will begin with firmware-rpi3b-something if it still exists.
You should now be able to test for wifi connectivity. If everything done above is successful, your extensions should be available automatically after you reboot again. IF SO, return here to the forum - there have to be plenty of RasPi posts on how to set up and PERSIST your wpa settings for every time you reboot.
-
And when searching in this forum, you may find some another users asked the same question.
https://forum.tinycorelinux.net/index.php/topic,21134.msg145053.html (https://forum.tinycorelinux.net/index.php/topic,21134.msg145053.html)
my question is not how to turn on wifi, but how to do it on the sd card, and not on the device itself. All recipes work if you are connected to the device.
-
@heiheshang: Since you can SSH into the device, let's get you set up.
1. Partition and Format your SD card's remaining, unused space (which will become mmcblk0p2)
2. Enter blkid | grep mmcblk and you should see mmcblk0p2 listed; the UUID number here is required below where it says [YourUUID]
3. Edit /mnt/mmcblk0p1/cmdline.txt and add this to the end of the existing string of text:
tce=UUID="[YourUUID]" opt=UUID="[YourUUID]" home=UUID="[YourUUID]"
Once finished, reboot and then log back into the device.
Run the program tce-ab and Search (one at a time) for each of the following extensions and Install them:
wifi
wireless_tools
wireless (and select wireless-#.#.#-piCore-v#.tcz)
wpa_supplicant
...and I think RasPi3's had a special firmware package, so search for
rpi3b
...it will begin with firmware-rpi3b-something if it still exists.
You should now be able to test for wifi connectivity. If everything done above is successful, your extensions should be available automatically after you reboot again. IF SO, return here to the forum - there have to be plenty of RasPi posts on how to set up and PERSIST your wpa settings for every time you reboot.
I have no problems with this.
-
my question is not how to turn on wifi, but how to do it on the sd card, and not on the device itself. All recipes work if you are connected to the device.
Set the required extensions onboot and add the required commands to /opt/bootlocal.sh
-
my question is not how to turn on wifi, but how to do it on the sd card, and not on the device itself. All recipes work if you are connected to the device.
Set the required extensions onboot and add the required commands to /opt/bootlocal.sh
how will this help me? How do you save the SSID and password in this file?
-
I'm sure language is a bit of a barrier, but you need to understand, that what you are asking is not possible.
Wifi needs to be configured from a local ssh session. Either with a keyboard/monitor, or using a ethernet cable.
-
so, I tried to do this as well.
Its possible BTW, picoreplayer is based on ipCore and has it documented: https://docs.picoreplayer.org/how-to/setup_wifi_on_pcp_without_ethernet/
However, I don't want picoreplayer but piCore.
Here is what I did:
1. wget http://www.tinycorelinux.net/14.x/armv6/releases/RPi/piCore-14.1.0.zip
2. unzip and flash the image
3. on the second partition, go into `tce/optional`
4. Download the firmware and WiFi extensions with all dependencies
for pkg in $(string trim $(wget -qO - http://www.tinycorelinux.net/14.x/armv6/tcz/wifi.tcz.tree)); for f in $pkg{,.dep,.md5.txt}; wget "http://www.tinycorelinux.net/14.x/armv6/tcz/$f"; end;end
for f in firmware-rpi-wifi.tcz{,.dep,.md5.txt}; wget "http://www.tinycorelinux.net/14.x/armv6/tcz/$f"; end
5. Mark them for autostart
echo "firmware-rpi-wifi.tcz" >> onboot.lst
echo "wifi.tcz" >> onboot.lst
6. I first added my wpa_supplicant.conf to the `mydata.tgz` and modified the contained `bootlocal.sh`, however this did not work,
so I added the bootcode `opt=mmcblk0p2` and created an `opt` directory on mmcblk0p2.
7. I did what `wifi.sh -aw` does in `bootlocal.sh`:
wpa_supplicant -iwlan0 -c/opt/wpa_supplicant.conf -B -Dnl80211,wext >/dev/null 2>&1
udhcpc -i wlan0 -x hostname:your_hostname 2>/dev/null
This did not work, so I read picoreplayer startup.
In the end they do the same but also start the if `ifconfig $INTERFACE up`
and add more firmware (atheros, brcmwifi, mediatek, ralinkwifi, rtlwifi).
I did some print debuging by piping output to /opt/output.txt and can see that `ifconfig wlan0 up` gives me "No such device"
as does udhcpc.
iwconfig lists nothing, and the wait loop from wifi.sh
CNT = 0
until [ -n "$WIFI" ]
do
[ $((CNT++)) -gt 10 ] && break || sleep 1
WIFI="$(iwconfig 2>/dev/null | awk '{if (NR==1)print $1}')"
done
is unable to set the variable WIFI to anything.
feels like the dirver is not started?
-
What board do you have? Make sure you have the the package wireless-KERNEL.tcz where KERNEL matches the output of `uname -r`
run dmesg. Does it show the wifi drivers loading?
-
Oh Man!
That was it!
I even wondered why wireless_tools.tcz depends on wireless-6.1.25-piCore.tcz and some other posts in the forum added wireless-6.1.68-piCore.tcz
Thanks!
For reference:
"ifconfig wlan0 up" is not nessecary, other wireless firmware is also not needed
bootlocal.sh
#!/bin/sh
CNT = 0
until [ -n "$WIFI" ]
do
[ $((CNT++)) -gt 10 ] && break || sleep 1
WIFI="$(iwconfig 2>/dev/null | awk '{if (NR==1)print $1}')"
done
# Set CPU frequency governor to ondemand (default is performance)
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# Load modules - i2c-dev needs manually loaded even if enabled in config.txt
/sbin/modprobe i2c-dev
chmod u=rw,g=,o= /opt/wpa_supplicant.conf
/usr/local/sbin/wpa_supplicant -i$WIFI -c/opt/wpa_supplicant.conf -Dnl80211,wext -B >/dev/null 2>&1
/sbin/udhcpc -i $WIFI -x hostname:ipcore 2>/dev/null
# Start openssh daemon
/usr/local/etc/init.d/openssh start
onboot.lst
wireless-6.1.68-piCore.tcz
openssh.tcz
wifi.tcz
firmware-rpi-wifi.tcz