OpenWrt OLED display for NanoHatOLED.
- i2c-tools
- python-pillow / python3-pillow
- python-smbus / python3-smbus
# Add NanoHatOLED feed to feeds.conf.default (Choose one of the following feeds)
# 请在feeds.conf.default中下方添加(二选一)
# For Python3.x:
src-git NanoHatOLED https://github.com/vinewx/NanoHatOLED.git
# For Python2.7:
src-git NanoHatOLED https://github.com/vinewx/NanoHatOLED.git^e3285a3b37c7c34048c0ea108fa4ec18b49c0bfd
# Update & Install
# 更新并安装feeds软件包
./scripts/feeds update NanoHatOLED && ./scripts/feeds install nanohatoled
# Select this list item
# 选择要编译的包
# Extra packages -> nanohatoled
make menuconfig
Enable weather info / 显示天气 (Python3)
- 按压一次
F2
: 天气信息 - 再次按压
F2
: 系统信息
地区编码查询 -> citycode.json
# For depends / 安装依赖
opkg update && opkg install python3-requests
cd /usr/share/NanoHatOLED
wget -O Zpix.ttf https://github.com/vinewx/NanoHatOLED/raw/weather/nanohatoled/files/NanoHatOLED/Zpix.ttf
wget -O bakebit_nanohat_oled.py https://github.com/vinewx/NanoHatOLED/raw/weather/nanohatoled/files/NanoHatOLED/bakebit_nanohat_oled.py
# 先修改地区编码,再执行命令
# 例如:sed -i 's/101010100/101020100/g' bakebit_nanohat_oled.py
sed -i 's/101010100/修改为九位地区编码/g' bakebit_nanohat_oled.py
/etc/init.d/nanohatoled restart