Showing posts with label 8. OpenWrt Yun/CPU stuff. Show all posts
Showing posts with label 8. OpenWrt Yun/CPU stuff. Show all posts

Wednesday, July 23, 2014

Arduino Yun Wifi stuff (reset, access point mode, ...)

The Yun has 3 reset buttons: one of those is a Wifi reset button (WLAN Rst)

Depending on how long you press the button the following will happen (I think):


  • Pressing the WLAN Rst button for <5 sec does not do any reset at all, correct (it just lets a LED blink)
  • Pressing the Wifi Rst button for >=5 but <30 sec will run the wifi-reset-and-reboot script. This script will return the Yun in access point (AP) mode and will reboot the Yun. The Yun should then present its network SSID.
  • Pressing for >= 30 sec will restore some factory settings

If you just want to reset the Wifi, you can do this with the wifi script (should be in /sbin):

    root@Arduino:/tmp# wifi down && sleep 5 && wifi
    Successfully initialized wpa_supplicant

You probably can also do:

    ifconfig wlan0 down; ifconfig wlan0 up

Note that rc.local contains by default the entry wifi-live-or-reset. After the Yun boots, it will check for the configured Wifi network. If it is not found within 60sec, the Yun will go into access point mode.

Wednesday, January 1, 2014

ramdisk /tmp

The /tmp directory is a RAM based directory. Means that it doesn't wear out like an SD card, or so...
Obviously when rebooting, you lose all the content. It still is the most obvious place to put temporary files, etc...

To make it look like a seperate drive you can do:

mkdir /tmp/ramdisk

in rc.local.
If you want it to look like a mounted drive you can also

ln -s /tmp/ramdisk /mnt/ramdisk

Monday, December 30, 2013

Starting a script after the CPU Linino boot

Just add the script to the /etc/rc.local file

The stdout and stderr get redirected to a log file in /tmp (ramdisk)

My rc.local on the Arduino Yun now looks as follows:


touch /tmp/begin
wifi-live-or-reset
boot-complete-notify
sleep 5s
cd /mnt/sda1/arduino/Yafa
./main.py 1> /tmp/Yafa.log 2>&1 &
touch /tmp/end
exit 0