LinkIt Smart 7688を使ってみる

TimeZoneの変更

LinkIt(OpenWrt)のデフォルト時間はUTC(Universal Time, Coordinated)になっています。
dateコマンドで確認するとUTC時間が表示されます。
root@mylinkit:/etc/init.d# date
Tue Jan  8 13:04:32 UTC 2019

このようなシステム定数を変更するには「uci(Unified Configuration Interface)」コマンドを使います。
uciコマンドの詳細はこちらに 有りますが、現在の日時に関する設定は以下のコマンドで確認することができます。
root@mylinkit:/etc/init.d# uci show system
system.@system[0]=system
system.@system[0].timezone='UTC'
system.@system[0].hostname='mylinkit'
system.@system[0].firmware_version='v0.9.4'
system.@system[0].loader_version='v0.8.2'
system.@system[0].linkit_firstboot='1'
system.ntp=timeserver
system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
system.ntp.enabled='1'
system.ntp.enable_server='0'

これらの情報は以下のファイルに記録されています。
root@mylinkit:~# cat /etc/config/system

config system
        option timezone 'UTC'
        option hostname 'mylinkit'
        option firmware_version 'v0.9.4'
        option loader_version 'v0.8.2'
        option linkit_firstboot '1'

config timeserver 'ntp'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'
        option enabled '1'
        option enable_server '0'

そこで、uciコマンドを使ってtimezoneの値を変更します。
使用できるtimezoneの値はこ ちらに公開されています。
root@mylinkit:~# uci set system.@system[0].timezone=JST-9
root@mylinkit:~# uci commit system
root@mylinkit:~# poweroff

試しにcommitをせずにpoweroffしたら、設定は反映されませんでした。必ずcommitが必要です。
再起動後に確認すると、ちゃんと日本時間になっています。
root@mylinkit:~# date
Tue Jan  8 22:22:31 JST 2019

/etc/config/system にはNTPサーバーに関する情報も定義されていますが、定義できる内容はこ ちらに公開されています。
system.ntp.enable_server='0'

system.ntp.enable_server='1'
に変えると、自分自身がNTPサーバーになります。



uciコマンドで設定できる項目は以下の通りです。
root@mylinkit:~# uci show
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].localservice='1'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.start='100'
dhcp.lan.limit='150'
dhcp.lan.leasetime='12h'
dhcp.lan.dhcpv6='server'
dhcp.lan.ra='server'
dhcp.lan.ignore='0'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth='on'
dropbear.@dropbear[0].RootPasswordAuth='on'
dropbear.@dropbear[0].Port='22'
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].network='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
firewall.@zone[1].network='wan' 'wan6'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@zone[1].input='ACCEPT'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fe80::/10'
firewall.@rule[3].src_port='547'
firewall.@rule[3].dest_ip='fe80::/10'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@rule[7]=rule
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/mmcblk0p1'
fstab.@mount[0].uuid='22a9d0ce-7041-4f04-aaca-83ba836a25ab'
fstab.@mount[0].enabled='0'
luci.main=core
luci.main.lang='auto'
luci.main.resourcebase='/luci-static/resources'
luci.main.mediaurlbase='/luci-static/openwrt.org'
luci.flash_keep=extern
luci.flash_keep.uci='/etc/config/'
luci.flash_keep.dropbear='/etc/dropbear/'
luci.flash_keep.openvpn='/etc/openvpn/'
luci.flash_keep.passwd='/etc/passwd'
luci.flash_keep.opkg='/etc/opkg.conf'
luci.flash_keep.firewall='/etc/firewall.user'
luci.flash_keep.uploads='/lib/uci/upload/'
luci.languages=internal
luci.sauth=internal
luci.sauth.sessionpath='/tmp/luci-sessions'
luci.sauth.sessiontime='3600'
luci.ccache=internal
luci.ccache.enable='1'
luci.themes=internal
luci.themes.Bootstrap='/luci-static/bootstrap'
luci.themes.OpenWrt='/luci-static/openwrt.org'
mjpg-streamer.core=mjpg-streamer
mjpg-streamer.core.enabled='0'
mjpg-streamer.core.input='uvc'
mjpg-streamer.core.output='http'
mjpg-streamer.core.device='/dev/video0'
mjpg-streamer.core.resolution='640x480'
mjpg-streamer.core.yuv='0'
mjpg-streamer.core.quality='80'
mjpg-streamer.core.fps='5'
mjpg-streamer.core.led='auto'
mjpg-streamer.core.www='/www/webcam'
mjpg-streamer.core.port='8080'
mjpg-streamer.core.username='openwrt'
mjpg-streamer.core.password='openwrt'
mountd.mountd=mountd
mountd.mountd.timeout='60'
mountd.mountd.path='/Media/'
network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd7e:8c85:f7ee::/48'
network.lan=interface
network.lan.ifname='eth0'
network.lan.force_link='1'
network.lan.macaddr='9c:65:f9:28:f8:e6'
network.lan.type='bridge'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan.ipaddr='192.168.100.1'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='0'
network.wan=interface
network.wan.proto='dhcp'
rpcd.@login[0]=login
rpcd.@login[0].username='root'
rpcd.@login[0].password='$p$root'
rpcd.@login[0].read='*'
rpcd.@login[0].write='*'
samba.@samba[0]=samba
samba.@samba[0].workgroup='WORKGROUP'
samba.@samba[0].homes='1'
samba.@samba[0].name='LinkIt'
samba.@samba[0].description='LinkIt'
samba.media=sambashare
samba.media.name='Media'
samba.media.path='/Media'
samba.media.read_only='no'
samba.media.guest_ok='yes'
system.@system[0]=system
system.@system[0].hostname='mylinkit'
system.@system[0].firmware_version='v0.9.4'
system.@system[0].loader_version='v0.8.2'
system.@system[0].linkit_firstboot='1'
system.@system[0].timezone='UTC'
system.ntp=timeserver
system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
system.ntp.enabled='1'
system.ntp.enable_server='0'
ubootenv.@ubootenv[0]=ubootenv
ubootenv.@ubootenv[0].dev='/dev/mtd1'
ubootenv.@ubootenv[0].offset='0x0'
ubootenv.@ubootenv[0].envsize='0x1000'
ubootenv.@ubootenv[0].secsize='0x10000'
ucitrack.@network[0]=network
ucitrack.@network[0].init='network'
ucitrack.@network[0].affects='dhcp' 'radvd'
ucitrack.@wireless[0]=wireless
ucitrack.@wireless[0].affects='network'
ucitrack.@firewall[0]=firewall
ucitrack.@firewall[0].init='firewall'
ucitrack.@firewall[0].affects='luci-splash' 'qos' 'miniupnpd'
ucitrack.@olsr[0]=olsr
ucitrack.@olsr[0].init='olsrd'
ucitrack.@dhcp[0]=dhcp
ucitrack.@dhcp[0].init='dnsmasq'
ucitrack.@dhcp[0].affects='odhcpd'
ucitrack.@odhcpd[0]=odhcpd
ucitrack.@odhcpd[0].init='odhcpd'
ucitrack.@dropbear[0]=dropbear
ucitrack.@dropbear[0].init='dropbear'
ucitrack.@httpd[0]=httpd
ucitrack.@httpd[0].init='httpd'
ucitrack.@fstab[0]=fstab
ucitrack.@fstab[0].init='fstab'
ucitrack.@qos[0]=qos
ucitrack.@qos[0].init='qos'
ucitrack.@system[0]=system
ucitrack.@system[0].init='led'
ucitrack.@system[0].affects='luci_statistics'
ucitrack.@luci_splash[0]=luci_splash
ucitrack.@luci_splash[0].init='luci_splash'
ucitrack.@upnpd[0]=upnpd
ucitrack.@upnpd[0].init='miniupnpd'
ucitrack.@ntpclient[0]=ntpclient
ucitrack.@ntpclient[0].init='ntpclient'
ucitrack.@samba[0]=samba
ucitrack.@samba[0].init='samba'
ucitrack.@tinyproxy[0]=tinyproxy
ucitrack.@tinyproxy[0].init='tinyproxy'
ucitrack.@6relayd[0]=6relayd
ucitrack.@6relayd[0].init='6relayd'
ucitrack.@mjpg-streamer[0]=mjpg-streamer
ucitrack.@mjpg-streamer[0].init='mjpg-streamer'
uhttpd.main=uhttpd
uhttpd.main.listen_http='0.0.0.0:80' '[::]:80'
uhttpd.main.listen_https='0.0.0.0:443' '[::]:443'
uhttpd.main.redirect_https='1'
uhttpd.main.home='/www'
uhttpd.main.rfc1918_filter='1'
uhttpd.main.max_requests='3'
uhttpd.main.max_connections='100'
uhttpd.main.cert='/etc/uhttpd.crt'
uhttpd.main.key='/etc/uhttpd.key'
uhttpd.main.cgi_prefix='/cgi-bin'
uhttpd.main.script_timeout='60'
uhttpd.main.network_timeout='30'
uhttpd.main.http_keepalive='20'
uhttpd.main.tcp_keepalive='1'
uhttpd.main.ubus_prefix='/ubus'
uhttpd.px5g=cert
uhttpd.px5g.days='730'
uhttpd.px5g.bits='1024'
uhttpd.px5g.country='ZZ'
uhttpd.px5g.state='Somewhere'
uhttpd.px5g.location='Uknown'
uhttpd.px5g.commonname='OpenWrt'
wireless.radio0=wifi-device
wireless.radio0.type='ralink'
wireless.radio0.variant='mt7628'
wireless.radio0.country='TW'
wireless.radio0.hwmode='11g'
wireless.radio0.htmode='HT40'
wireless.radio0.channel='auto'
wireless.radio0.disabled='0'
wireless.radio0.linkit_mode='sta'
wireless.ap=wifi-iface
wireless.ap.device='radio0'
wireless.ap.mode='ap'
wireless.ap.network='lan'
wireless.ap.ifname='ra0'
wireless.ap.encryption='none'
wireless.ap.ssid='LinkIt_Smart_7688_28FE2C'
wireless.ap.seq='1'
wireless.sta=wifi-iface
wireless.sta.device='radio0'
wireless.sta.mode='sta'
wireless.sta.network='wan'
wireless.sta.ifname='apcli0'
wireless.sta.led='mediatek:orange:wifi'
wireless.sta.ssid='aterm-e625c0-g'
wireless.sta.key='05ecd1dcd39c6'
wireless.sta.encryption='psk2'
yunbridge.config=bridge
yunbridge.config.socket_timeout='5'
yunbridge.config.secure_rest_api='false'
yunbridge.config.disabled='1'
yunbridge.config.baudrate='2500000'

sambaに関する設定が有るのが気になります。いずれ試してみます。
なお、ファームウェアをアップデートすると、項目が変わる可能性が有ります。

続く....