User Tools

Site Tools


admin:linux:pi

Raspberry Pi

Install

pv 2014-12-24-wheezy-raspbian.img | sudo dd bs=4M of=/dev/mmcblk0

#default password raspberry
ssh pi@192.168.0.110
sudo raspi-config
sudo apt-get install libnss-mdns htop screen vim ipython ack-grep openvpn nmap locate

WLAN on Boot

/etc/rc.local

/sbin/watch_wlan&

/sbin/restart_wlan

date >> /tmp/wlan.log

ifdown wlan0 
ifup wlan0 
ifdown wlan0 
ifup wlan0 

/etc/rc.local

#!/bin/sh -e

#_IP=$(hostname -I) || true
#if [ "$_IP" ]; then
#  printf "My IP address is %s\n" "$_IP"
#fi

echo `date` "start" >> /tmp/wlan.log
_AP=$(iwconfig |grep "Access Point") || true
#_AP=$(iwconfig 2>/dev/null |grep "Access Point: Not-Associated")
echo `date` "$_AP" >> /tmp/wlan.log
while [ "$_AP" == "" ]; do
  echo `date` "waiting for wlan0" >> /tmp/wlan.log
  sleep 10
done

_AP=$(iwconfig 2>/dev/null |grep "Access Point: Not-Associated") || true

while [ "true" ]; do
  echo `date` "$_AP" >> /tmp/wlan.log
  if [ "$_AP" ]; then
    /sbin/restart_wlan >> /tmp/wlan.log
  fi
  sleep 60
  _AP=$(iwconfig 2>/dev/null |grep "Access Point: Not-Associated") || true

done
echo `date` "stop" >> /tmp/wlan.log

Browser

admin/linux/pi.txt · Last modified: 2019/04/27 16:45 (external edit)