NanoPi NEO2

Initial setting

  • /etc/rc.conf
gpio=YES
  • /etc/gpio.conf
gpio0 0 set in b1
gpio0 2 set in b2
gpio0 3 set in b3
  • /root/.profile
export PKG_PATH=http://www.invisible.ca/packages/NetBSD/earmv7hf/8.0/All
arm64# rm /etc/localtime
arm64# ln -s /usr/share/zoneinfo/Japan /etc/localtime

pkgs

armv7# pkg_add git tmux sudo

Nano Hat OLED

  • gpio.sh
armv7# cat gpio.sh
while true
do
 sysctl -wq hw.led.nanopi_blue_status=`gpioctl -s gpio0 b1`
 sysctl -wq hw.led.nanopi_green_pwr=`gpioctl -s gpio0 b2`
 if [ `gpioctl -s gpio0 b3` -eq 1 ] ; then
  echo "Shutdown button pressed"
  shutdown -h now
 fi
done
  • /etc/rc.local
GPIO=/root/gpio.sh     
if [ -x ${GPIO} ]; then       
        echo -n 'GPIO button'
        ${GPIO} &
        echo '.'
fi
Last modified: 2018-03-07
Post-it: New Post-it (help)

Text color: [_][_][_][_]

Background: [_][_][_][_][_][_]

Draw Line:

x: y: