OpenWrt

OpenWrt TL-MR10U and Arduino

Install OpenWrt, Luci on extra USB key

see root on external USB key

root@OpenWrt:~# v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUV 4:2:2 (YUYV)
echo "nameserver 212.27.40.240" > /etc/resolv.conf

opkg update

opkg install kmod-usb-storage block-mount kmod-fs-ext4 block-hotplug

mkdir /mnt/sda1 && touch  /mnt/sda1/USB_DISK_NOT_PRESENT && chown root:root -R  /mnt/sda1 &&  chmod 555 -R /mnt/sda1 && chmod 444  /mnt/sda1/USB_DISK_NOT_PRESENT
 

opkg install kmod-usb-serial-ftdi kmod-usb-serial-pl2303  kmod-usb-serial-cp210x kmod-usb-acm
 
opkg install kmod-usb-serial-ch341
root@JoduinoOpenWrt:~# cat /etc/config/fstab
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'



config mount
        option target        /overlay
        option device        /dev/sda1
        option fstype        ext4
        option options       rw,sync
        option enabled       1
        option enabled_fsck  0
root@JoduinoOpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fde3:38c8:009f::/48'

config interface 'lan'
        option ifname 'eth0'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.0.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.0.254'
root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        list server ' 212.27.40.240'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        list dhcp_option '3,192.168.0.254'
        list dhcp_option '6,212.27.40.240'


config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr10u-v1-squashfs-sysupgrade.bin
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/md5sums
md5sum -c md5sums 2> /dev/null | grep OK
sysupgrade -v openwrt-ar71xx-generic-tl-mr10u-v1-squashfs-sysupgrade.bin
root@OpenWrt:~# cat /mnt/sda1/etc/config/mjpg-streamer
config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '320x240'
        option fps '3'
        option www '/www/webcam'
        option port '8080'
  1. reset FTDI in crontab + check USB arduino
*/1 * * * * (/root/checkReadUSB.sh >> /dev/null)
*   * * * * * usbreset `/root/grepFTDI` >/dev/null 2>&1