switch to dhcp to work ez peazy
vi /etc/config/network
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
option netmask '255.255.255.0'
option ip6assign '60'
resize / to take full size of the micro SD
1. ssh in the openwrt device
2. Install the required packages
opkg update && opkg install cfdisk resize2fs tune2fs
3. Resize the partition
cfdisk /dev/mmcblk0
Resize the /dev/mmcblk0p2 partition (enter desired space)
Write the changes
Quit
reboot
4. remount root as RO (if fails, reboot and remount as ro)
mount -o remount,ro /
5. Remove reserved GDT blocks
tune2fs -O^resize_inode /dev/mmcblk0p2
fsck.ext4 /dev/mmcblk0p2 (this will probably fail, doesn't seem to effect anything though)
reboot
7. Resize the f2fs file-system
resize2fs /dev/mmcblk0p2
8. Check new root partition size with:
df -h
9. reboot
setup luci webinterface
opkg update && opkg install lighttpd lighttpd-mod-cgi luci-mod-admin-full lighttpd-mod-openssl luci-theme-bootstrap lighttpd-mod-redirect luci-app-statistics collectd-mod-thermal
vi /etc/lighttpd/conf.d/30-cgi.conf
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".rb" => "/usr/bin/ruby",
".erb" => "/usr/bin/eruby",
".py" => "/usr/bin/python",
"/cgi-bin/luci" => "",
"/cgi-bin/cgi-backup" => "",
"/cgi-bin/cgi-download" => "",
"/cgi-bin/cgi-exec" => "",
"/cgi-bin/cgi-upload" => "",
)
vi /etc/lighttpd/lighttpd.conf
#server.username := ""
#server.groupname := ""
vi /etc/lighttpd/50-http.conf
#Listen on ipv4
$SERVER["socket"] == ":80" {
}
#Listen on ipv6
$SERVER["socket"] == "[::]:80" {
server.use-ipv6 = "enable"
}
/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start
http://[host]/cgi-bin/luci/
add usb ethernet (TP-Link UE300 -USB 3.0 A Gigabit)
opkg update && opkg install kmod-usb-net-rtl8152
vi /etc/config/network
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
list ports 'eth1'
max speed (
https://forum.openwrt.org/t/raspberry-pi-4-slow-performance/125059)
Please, ensure that you have Packet Steering enabled (Global network options), and install irqbalance package.
opkg update && opkg install irqbalance
/etc/config/irqbalance
config irqbalance 'irqbalance'
option enabled '1'
# The default value is 10 seconds
#option interval '10'
# List of IRQ's to ignore
#list banirq '36'
#list banirq '69'
adruino mega 2560 + somfy antenna
opkg update && opkg install kmod-usb-serial kmod-usb-serial-simple kmod-usb-serial-ti-usb kmod-usb-acm kmod-usb-core kmod-usb-ohci kmod-usb2 coreutils-stty usbutils
/etc/rc.local
stty -F /dev/ttyACM0 57600 cs8 -cstopb -parenb
cat /dev/ttyACM0 &
home assistant docker
opkg update && opkg install dockerd luci-app-dockerman docker-compose
docker pull homeassistant/home-assistant
lan/wan pour le switch routeur
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd63:0267:030d::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '10.10.0.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option proto 'dhcp'
option device 'eth1'
home assistant container_name
mkdir -p /opt/homeassistant
vi docker-compose.yml (keep as is)
version: '3.3'
services:
homeassistant:
image: homeassistant/home-assistant:latest
container_name: homeassistant
network_mode: bridge
restart: unless-stopped
devices:
- "/dev/ttyACM0"
ports:
- "10.10.0.10:9009:8123"
- "6144:6144"
- "1443:1443"
volumes:
- ./config:/opt/homeassistant/userdata
environment:
- TZ=Europe/Amsterdam
- PUID=911
- PGID=911
- LOG_PATH=/opt/homeassistant/userdata/domoticz.log
networks:
default:
name: docker
docker-compose up -d
/etc/config/firewall
config redirect
option target 'DNAT'
option src 'lan'
option dest 'docker'
option proto 'tcp'
option src_dport '9009'
option dest_ip '172.17.0.2'
option dest_port '8123'
option enabled '1'
docker exec -it homeassistant bash
ajout du rflink
vi configuration.yaml
rflink:
port: /dev/ttyACM0
wait_for_ack: false
cover:
- platform: rflink
devices:
RTS_0F0F0F_0:
name: living_room_blind