WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Raspberry pi zero w : autoconnect to wifi at first boot fails.  (Read 3197 times)

Offline damlatien

  • Newbie
  • *
  • Posts: 3
Raspberry pi zero w : autoconnect to wifi at first boot fails.
« on: September 02, 2018, 10:04:19 AM »
I am very new to tinycore, and I would like to set up a tinycore os on my raspberry pi zero w. I do not have a keyboard nor a monitor that I can connect through HDMI. So I'm trying to autoconnect to the wifi so that I can ssh at the very first boot. But it never connects on the network. I have put the following files on /tce/optional/

ca_certificates.tcz
firmware-rpi3-wireless.tcz
libiw.tcz
libnl.tcz
ncurses.tcz
openssl.tcz
readline.tcz
wifi.tcz
wireless_tools.tcz
wireless-4.9.22-piCore.tcz
wpa_supplicant.tcz

plus the corresponding .md5.txt and .dep files

Here is my tce/onboot.lst

mc.tcz
openssh.tcz
firmare-rpi3-wireless.tcz
wireless_tools.tcz
wireless-4.9.22-piCore.tcz
wpa_supplicant.tcz
wifi.tcz

Here is my bootlocal.sh

#!/bin/sh
wpa_supplicant -iwlan0 -Dwext -c/opt/wpa_configure.conf -B &

I have set my wpa_credentials.conf as it should

ctrl_interface=/var/run/wpa_supplicant
network={
         ssid=MyBox
         psk=MyPassword
         proto=WPA
         pairwise=TKIP
         group=TKIP
         key_mgmt=WPA-PSK
}

Besides, I cannot read any persistent log file that would be written after the boot in order to debug. I tried to run the script opt_save_varlogs.sh as described in http://forum.tinycorelinux.net/index.php?topic=13075.0, but without success. So I'm wondering if the booting itself is failing, but I have no way to check that hypothesis...
I could set up a DietPi on my rpi that autoconnects to the wifi, so that I know that this is not a hardware problem.

Could anyone help me ?
« Last Edit: September 02, 2018, 10:28:00 AM by damlatien »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11591
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #1 on: September 02, 2018, 10:12:46 AM »
Hi damlatien
Quote
... I have put the following files on /opt/ ...
Extensions belong in  /tce/optional. Also, did you read this:
http://tinycorelinux.net/9.x/armv6/releases/RPi/README
and this:
http://tinycorelinux.net/9.x/armv6/releases/RPi/IMPORTANT

Offline damlatien

  • Newbie
  • *
  • Posts: 3
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #2 on: September 02, 2018, 10:31:26 AM »
Hi Rich, thanks for your reply.
I have put the extensions files in /tce/optional/ but it does not alter the behaviour. I edited the post

I followed the instructions from IMPORTANT, but the problem is that I cannot execute 'filetool.sh -b' shell command, since I have no access to the shell.
« Last Edit: September 02, 2018, 10:34:04 AM by damlatien »

Offline TimJ

  • Jr. Member
  • **
  • Posts: 57
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #3 on: September 02, 2018, 07:06:34 PM »
Are you trying to setup an sd card on another linux machine so that it will boot the pi Zero-W and auto connect to wifi?

Can you describe your setup

I am sure that we can he[p.

Tim

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #4 on: September 02, 2018, 08:33:27 PM »
ssid="MyBox"
psk="MyPassword"

I think without doing a backup, edits to files in /opt are lost.

You only need in your onboot.lst:

firmware-rpi3-wireless.tcz
wifi.tcz

as the rest are dependencies of wifi.tcz and will be loaded.

What you are trying to do will be difficult because one little error and it won't work and you will be getting no feedback.

regards
Greg

Offline damlatien

  • Newbie
  • *
  • Posts: 3
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #5 on: September 03, 2018, 03:51:42 PM »
@ TimJ : yes this is exactly what I am trying to achieve. I am writing the files on the SD card directly from my laptop. I did follow the instructions of the file IMPORTANT untill the point where I should boot using a screen and keyboard. Please tell me what you would like to know from my setup besides what I have written in my first post.

@Greg: thanks for pointing this out; I edited onboot.lst, but no change still.

Offline TimJ

  • Jr. Member
  • **
  • Posts: 57
Re: Raspberry pi zero w : autoconnect to wifi at first boot fails.
« Reply #6 on: September 03, 2018, 06:20:35 PM »
I am assuming you have written the .img, increased the partition and written the needed tcz to tce/optional

Code: [Select]
filetool.sh -b backs up files to tce/mydata.tgz so you have to simulate this function.

i think what you need to do is to untar tce/mydata.tgz to a suitable empty directory on your laptop.
In the extracted files, edit the file ./opt/bootlocal.sh and add this line at the end.
Code: [Select]
/usr/local/bin/wifi.sh -acreate a file ./home/tc/wifi.db which has the following line in it with the fields tab separated
Code: [Select]
Wifi_SSID    Wifi_Password  WPA tar back up to ./tce/mydata.tgz and you should be good to go.
(wifi.sh creates the needed wpa config files)
For some level of debugging from bootlocal.sh you can write to the sdcard at /mnt/mmcblk0p2/ and later look at that from your laptop.