Hello again.
Sucess! Following the adafruit tutorial
http://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-softwareAnd changing where it is needed I have been able to create a wifi access point with DHCP using tinycorelinux.
It is very straightforward using the adafruit tutorial, but I'm going to write down here all steps adapted for tcl.
1) Install software.1.1)install the dhcp.tzc package (instead of the isc-dhcp-server)
1.2) Also we are going to need the hostapd compiled binary from adafruit:
wget http://www.adafruit.com/downloads/adafruit_hostapd.zip
Uncompress it:
unzip adafruit_hostapd.zip
Move the version to a binary directory (I'm not sure here where is the best place on tce for this file)
sudo mv hostapd /usr/local/bin
Make it executable
sudo chmod 755 /usr/local/bin/hostapd
2)Set up DHCP serverCreate a new file /usr/local/etc/dhcp.conf with the following info:
authoritative;
subnet 192.168.42.0 netmask 255.255.255.0 {
range 192.168.42.10 192.168.42.50;
option broadcast-address 192.168.42.255;
option routers 192.168.42.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
(the ip addresses could be changed, but I mantain the adafruit ones)
3) Config hostapd for Access pointCreate a file /usr/local/etc/hostapd.conf and paste the following.
The ssid and password can be changed. Also the driver could be another. It depends of the wifi dongle. I have a 8192CU and it worked.
interface=wlan0
driver=rtl871xdrv
ssid=Pi_AP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
4) Put all together: Set up wlan0 for static IP, run dhcp and hostapd Create a file /opt/wlan0.sh with the following data:
ifconfig wlan0 down
ifconfig wlan0 192.168.42.1 netmask 255.255.255.0 up
/usr/sbin/hostapd /usr/local/etc/hostapd.conf &
touch /usr/local/etc/dhcp.leases
dhcpd wlan0 -cf /usr/local/etc/hcpd.conf -ls /usr/local/etc/dhcp.leases
make it executable
sudo chmod 755 /opt/wlan0.sh
4b) Optional. Before test the script, the wpa_supplicant daemon must be killed if it is running
Use ps to find it and sudo kill -9 pid
5) Run the scriptsudo /opt/wlan0.sh
Then try to connect using another wifi device. The SSID wifi PI_AP should be listed as available networks
After that, if all is working, all files must be persisted on tcl and if we want to run at boot add the /opt/wlan0.sh line to the fileboot.sh file.
The only thing I have to check is to avoid the wpa_supplicant to run at boot.
Also I'm not sure about where to place the config directories.
I hope this guide could be useful.
Final note: I haven't added the NAT part, as I don't need to pass through the eth0 interface to have "internet" capability. Anyone that needs such functionality, please refer to the adafruit post.