Raspberry PI (wifi AP) setup

display device version

Model: Raspberry Pi 3 Model B Rev 1.2

pinout
// or
cat /proc/cpuinfo

Auto post IP to slack

touch ~/autostart.sh

#!/bin/bash

myip=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
msg="{\"text\":\"Pamcy PI ip:\\n $myip \"}"

curl -X POST -H 'Content-type: application/json' --data "$msg" https://hooks.slack.com/services/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

modify
~/.config/autostart $ cat ip.desktop

[Desktop Entry]
Name=example
Comment=My Python Program
Exec=/bin/bash /home/pi/autostart.sh
Terminal=false
MultipleArgs=false
Type=Application
Categories=Application;Development;
StartupNotify=true

install raspberry Os

before, you install raspberry os… (requirement)

  • SD card reader
  • internet cable or wifi (anyway to get local IP to ssh into raspberry); you can find raspberry PI local IP in wifi (router) AP admin panel

Raspberry PI 映像檔建議從官網下載新的,imager 拉到的不一定是最新的

ssh pi@[local ip]
  • ssh: default user pi, with password raspberry
    • mkdir ~/.ssh
    • chmod 700 ~/.ssh
    • touch ~/.ssh/authorized_keys
    • chmod 600 ~/.ssh/authorized_keys
    • modify authorized_keys, paste you are ssh pub key e.g. id_rsa.pub

config

sudo raspi-config

font family, size

disable native wifi

modify /boot/config.txt

add line

dtoverlay=disable-wifi

ref.

Wifi AP

RaspAP
https://raspap.com/

USB device status

lsusb

https://help.ubuntu.com/stable/ubuntu-help/net-wireless-troubleshooting-hardware-check.html.en

internet

ifconfig
iwconfig
iw list
iw dev
rfkill list
rfkill block 0

note

可能問題
RaspAP 在使用 wlan 的時候預設使用 wlan 0
比較建議先停用內建 wlan

建議不要插太多 USB 裝置,據說有干擾問題
唯一的外接 USB WIFI 可以用短延長線更