20200120_jeffrey - silenceuncrio/diary GitHub Wiki

0900

review


回復 mantis issue 0000888: [WEB UI] M330 series, APN not APN1 on web 如下

雖然只有一個 APN 但還是顯示 APN1
這是 m330 一開始做 UI 的時候的選擇
並不是 bug
不過如果有客戶覺得不妥
還是可以提出需求

然後直接切 resolve 等 DQA 回應

0940

今天可以開始使用 m350 的板子了

git pull 最新的 m350[develop]

  • Vendor/Products = CTCU/1_CTCU_WIFI

follow 一下 jessy mail 出來的步驟

Hi all:

M350 upgrade firmware:

(1) build environment is 32 bit OS

(2) "git pull" and "make clean" in top directory

(3) Execute "build.sh" in top directory

(4) rebuild proscend code

(5) Execute "build-image.sh" in top directory,

(6)  Set tftp server 192.168.1.10 and specify "(top directory)/artifact" folder

(7) Enter M350 u-boot.  Press "s" enter u-boot in console.

(8) Execute follow command:

       tftpboot 0x84000000 nornand-ipq40xx-single.img
       imgaddr=0x84000000 && source $imgaddr:script
       reset

有些步驟我不見得要重做

(1) build environment is 32 bit OS

  • 我有 docker image
  • docker container 也 run 起來了

(2) "git pull" and "make clean" in top directory

  • 上禮拜五從最乾淨的環境出發

(3) Execute "build.sh" in top directory

  • 我是在最上層做 make
  • 先忽略這步驟

(4) rebuild proscend code

  • 已經做過

(5) Execute "build-image.sh" in top directory,

  • 照著做

(6) Set tftp server 192.168.1.10 and specify "(top directory)/artifact" folder

  • 我的 tftpd64 已將 Current Directory 指向 (top directory)/artifact
  • 該目錄下有兩個 image
    • ipq40xx-nornand-apps.img
    • nornand-ipq40xx-single.img

(7) Enter M350 u-boot. Press "s" enter u-boot in console.

  • 先看一下目前的 boot env
    (IPQ40xx) # print
    baudrate=115200
    bootcmd=bootipq
    bootdelay=2
    bootstopkey=s
    ethact=eth0
    flash_type=0
    fw_name=firmware.bin
    ipaddr=192.168.1.1
    lc=if ping $serverip; then tftpboot $loadaddr config.bin && updateconfig; fi
    lf=if ping $serverip; then tftpboot $loadaddr $fw_name && if checkfw; then burning_qsdk; else burning_lede; fi; fi
    loadaddr=0x84000000
    lu=if ping $serverip; then tftpboot $loadaddr $uboot_name && sf probe && sf erase 0xf0000 0x80000 && sf write $loadaddr 0xf0000 $filesize; fi
    machid=8010001
    serverip=192.168.1.10
    stderr=serial
    stdin=serial
    stdout=serial
    uboot_name=openwrt-ipq40xx-u-boot-stripped.elf
    version=20180419
    
    Environment size: 658/65532 bytes
    (IPQ40xx) #
    
  • 將 serverip 指向自己的 192.168.1.113 並 save
    (IPQ40xx) # set serverip 192.168.1.113
    (IPQ40xx) # save
    Saving Environment to NAND...
    Erasing Nand...
    Erasing at 0xe0000 -- 100% complete.
    Writing to Nand... done
    (IPQ40xx) # print serverip
    serverip=192.168.1.113
    (IPQ40xx) #
    

(8) Execute follow command:

  • tftpboot 0x84000000 nornand-ipq40xx-single.img

    (IPQ40xx) # tftpboot 0x84000000 nornand-ipq40xx-single.img
    eth0 PHY0 Down Speed :10 Half duplex
    eth0 PHY1 Down Speed :10 Half duplex
    eth0 PHY2 Down Speed :10 Half duplex
    eth0 PHY3 up Speed :100 Full duplex
    eth0 PHY4 Down Speed :10 Half duplex
    Using eth0 device
    TFTP from server 192.168.1.113; our IP address is 192.168.1.1
    Filename 'nornand-ipq40xx-single.img'.
    Load address: 0x84000000
    Loading: #################################################################
             #################################################################
             ...
             ##############
    done
    Bytes transferred = 30736596 (1d500d4 hex)
    (IPQ40xx) #
    
  • imgaddr=0x84000000 && source $imgaddr:script

    (IPQ40xx) # imgaddr=0x84000000 && source $imgaddr:script
    ## Executing script at 84000000
    crc32+ SF: Detected W25Q256 with page size 64 KiB, total 32 MiB
    Flashing mibib:                         ## Copying 'mibib-e1b8dae18137ae92508d2592f50a0cfca44215db' subimage from FIT image at 84000000 ...
    crc32+ [ done ]
    Flashing sbl1:                          ## Copying 'sbl1-a9831d8db37c18ebe43878fda3139605f6b0d448' subimage from FIT image at 84000000 ...
    crc32+ [ done ]
    Flashing ddr-AP-DK04.1-C1:              ## Copying 'ddr-AP-DK04.1-C1-395c2342c958f961d049afa2384659fb0709b0ce' subimage from FIT image at 84000000 ...
    crc32+ [ done ]
    Flashing tz:                            ## Copying 'tz-5371ff12800ec75037875b90289bbafe482dee9f' subimage from FIT image at 84000000 ...
    crc32+ [ done ]
    Flashing u-boot:                        ## Copying 'u-boot-b8bcbdc1998051e4fb46d4c339fa87b3d5ef9ea7' subimage from FIT image at 84000000 ...
    crc32+ [ done ]
    Flashing ubi:                           ## Copying 'ubi-2113e3f3cc2a94e31f40d2c220669cca1b7e2845' subimage from FIT image at 84000000 ...
    crc32+ SF: Detected W25Q256 with page size 64 KiB, total 32 MiB
    
    NAND erase: device 0 offset 0x0, size 0x2e00000
    Erasing at 0x2de0000 -- 100% complete.
    OK
    
    NAND erase: device 0 offset 0x2e00000, size 0x2e00000
    Erasing at 0x5be0000 -- 100% complete.
    OK
    
    NAND erase: device 0 offset 0x5c00000, size 0xa00000
    Erasing at 0x65e0000 -- 100% complete.
    OK
    
    NAND erase: device 0 offset 0x6600000, size 0x1600000
    Erasing at 0x7be0000 -- 100% complete.
    OK
    
    NAND write: device 0 offset 0x0, size 0x1c20000
     29491200 bytes written: OK
    
    NAND write: device 0 offset 0x2e00000, size 0x1c20000
     29491200 bytes written: OK
    [ done ]
    (IPQ40xx) #
    
  • reset

1100

目前的 web log

root@ICR-W401:/home/admin# cat /home/log/web.log
1579485128[20200120 01:52:08] [notify_web:1049]Recv bcast evt 14 before module init done.Ignore it.
1579485128[20200120 01:52:08] [_make_configuration_file:421]1579485128[20200120 01:52:08] [notify_web:1049]Recv bcast evt 3 before module init done.Ignore it.
1579485129[20200120 01:52:09] [notify_web:1057]IN(E182|S44|D44)
1579485129[20200120 01:52:09] [notify_web:1102]module init

參考一下 m330 的 log

1115

web 沒起來是因為沒有收到 ICOS_BOOTINIT_DONE 這個 event

開發階段先不要被誰卡住

diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 42b5a6f..70fd9e8 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -1102,6 +1102,10 @@ static int notify_web(PRO_EVENT *pevent)
                     WEB_INFO("module init\n");
                     web_init((sWebConfig *)pevent->msg);
                     gWebCtrl.mod_init_done=1;
+
+                    // trigger by myself for developing
+                    ICOS_msg_sendto(MODULE_WEB, MODULE_WEB, NULL, 0, ICOS_BOOTINIT_DONE);
+
                 }
                 else
                 {
(END)

自己發給自己先把 web 叫起來再說


掉入一個無限循環

1579490257[20200120 03:17:37] [termcb_web:1320]IN(1922)
1579490257[20200120 03:17:37] [daemon_restart:837][DID1] remain IP server retry for 6 times.
...

這個以前有遇過

root@ICR-W401:/home/admin# cat /home/log/web.log
1579490246[20200120 03:17:26] [notify_web:1049]Recv bcast evt 14 before module init done.Ignore it.
1579490246[20200120 03:17:26] [_make_configuration_file:421]1579490246[20200120 03:17:26] [notify_web:1049]Recv bcast evt 3 before module init done.Ignore it.
1579490247[20200120 03:17:27] [notify_web:1057]IN(E182|S44|D44)
1579490247[20200120 03:17:27] [notify_web:1102]module init
1579490247[20200120 03:17:27] [notify_web:1057]IN(E72|S44|D44)
1579490247[20200120 03:17:27] [notify_web:1131]boot init done
1579490247[20200120 03:17:27] [web_dump:656]===init config===
1579490247[20200120 03:17:27] [web_dump:666][COM]conn_mgr=1,mod_init_done:1.
1579490247[20200120 03:17:27] [web_dump:694][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1579490247[20200120 03:17:27] [web_dump:702][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1579490247[20200120 03:17:27] [web_dump:702][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1579490247[20200120 03:17:27] [web_dump:707][RTI]wan4_ifname=,wan6_ifname=.
1579490247[20200120 03:17:27] [reset_firewall:971]Allow all ips.
1579490247[20200120 03:17:27] [daemon_restart:837][DID0] remain IP server retry for 6 times.
1579490247[20200120 03:17:27] [create_daemon_conf:736]IN
1579490247[20200120 03:17:27] [create_daemon_conf:747]cmd_buf=>dir=/
1579490247[20200120 03:17:27] [create_daemon_conf:752]cmd_buf=>cgipat=cgi-bin/**
1579490247[20200120 03:17:27] [create_daemon_conf:757]cmd_buf=>chroot
1579490247[20200120 03:17:27] [create_daemon_conf:762]cmd_buf=>user=root
1579490247[20200120 03:17:27] [create_daemon_conf:767]cmd_buf=>max_age=0
1579490247[20200120 03:17:27] [create_daemon_conf:772]cmd_buf=>debug
1579490247[20200120 03:17:27] [daemon_restart:876][DMN]Do not start when did = DID_HTTPD
1579490247[20200120 03:17:27] [daemon_restart:837][DID1] remain IP server retry for 6 times.
1579490247[20200120 03:17:27] [gen_key_files:718]IN
1579490247[20200120 03:17:27] [gen_key_files:722]iweb genkey pid = 1176
1579490247[20200120 03:17:27] [gen_key_files:724]OUT
1579490247[20200120 03:17:27] [is_request_start:819][DMN]disabled cause key not ready.
1579490247[20200120 03:17:27] [web_dump:702][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1579490247[20200120 03:17:27] [web_dump:702][DMN1]active=1,pid=-1,status=0,flag=0x1,DID1
1579490247[20200120 03:17:27] [web_dump:656]===After daemon restart===
1579490247[20200120 03:17:27] [web_dump:666][COM]conn_mgr=1,mod_init_done:1.
1579490247[20200120 03:17:27] [web_dump:694][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1579490247[20200120 03:17:27] [web_dump:702][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1579490247[20200120 03:17:27] [web_dump:702][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1579490247[20200120 03:17:27] [web_dump:707][RTI]wan4_ifname=,wan6_ifname=.
1579490257[20200120 03:17:37] [termcb_web:1320]IN(1176)
1579490257[20200120 03:17:37] [termcb_web:1343]HTTPS key and cert generated done.
1579490257[20200120 03:17:37] [web_dump:656]===Key file generated done, daemon restart===
1579490257[20200120 03:17:37] [web_dump:702][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1579490257[20200120 03:17:37] [web_dump:702][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1579490257[20200120 03:17:37] [daemon_restart:837][DID1] remain IP server retry for 6 times.
1579490257[20200120 03:17:37] [gen_key_files:718]IN
1579490257[20200120 03:17:37] [gen_key_files:724]OUT
1579490257[20200120 03:17:37] [create_daemon_conf:736]IN
1579490257[20200120 03:17:37] [create_daemon_conf:747]cmd_buf=>dir=/
1579490257[20200120 03:17:37] [create_daemon_conf:752]cmd_buf=>cgipat=cgi-bin/**
1579490257[20200120 03:17:37] [create_daemon_conf:757]cmd_buf=>chroot
1579490257[20200120 03:17:37] [create_daemon_conf:762]cmd_buf=>user=root
1579490257[20200120 03:17:37] [create_daemon_conf:767]cmd_buf=>max_age=0
1579490257[20200120 03:17:37] [create_daemon_conf:772]cmd_buf=>debug
1579490257[20200120 03:17:37] [create_daemon_conf:779]cmd_buf=>ssl
1579490257[20200120 03:17:37] [create_daemon_conf:784]cmd_buf=>certfile=/etc/icos/ca/cert.pem
1579490257[20200120 03:17:37] [daemon_restart:881][DMN]Lanch=>/usr/sbin/lighttpd -D -f /tmp/icos/web/lighttpd.conf
1579490257[20200120 03:17:37] [termcb_web:1320]IN(1920)
1579490257[20200120 03:17:37] [daemon_restart:837][DID1] remain IP server retry for 6 times.
...
1579490257[20200120 03:17:37] [termcb_web:1320]IN(1921)
1579490257[20200120 03:17:37] [daemon_restart:837][DID1] remain IP server retry for 6 times.
...
1579490257[20200120 03:17:37] [termcb_web:1320]IN(1922)
1579490257[20200120 03:17:37] [daemon_restart:837][DID1] remain IP server retry for 6 times.
...

找一下是為什麼會掉入這個無限循環


或許是其他需要 ICOS_BOOTINIT_DONE event 觸發的環節還沒起來的關係

我還是不要搶快好了


不過印象當中之前遇過這樣的狀況其實是自己的 web 帶不起來

john 提供的機制只是很盡責的試著一起要把我帶起來

因為我沒有實作好 restart counter 才造成一直在重啟 web

下午來改一下

1305

發現 m350 根本沒有 lighttpd

參考 20190619_jeffrey

source code 下最外層利用 make menuconfigOpenWrt Configuration

lighttpd 在 Network > Web Servers/Proxies > lighttpd

lighttpd 還有很多 module 提供給我們做選擇

我們需要

  • lighttpd-mod-cgi - CGI module
  • lighttpd-mod-rewrite - URL rewriting module

另外從 source base 的 package/feeds/packages/lighttpd/Makefile 可以看到

PKG_NAME:=lighttpd
PKG_VERSION:=1.4.45
PKG_RELEASE:=3

不確定該版本有沒有 file upload 的問題

1415

優先處理 m300 兩個 mantis issue


build 最新的 M300[release/v2.02]

  • Products/Vendor = M300/11_PLANET2

注意到一開始為了 image 的 setup 不是 source proenv.sh

而是 source proenv.sh m300 planet-m300

1540

M300 因為 source proenv.sh m300 planet-m300 的關係

目前還在 compile 當中

整理一下過年前的三件急事

M300[release/v2.02] - Products/Vendor = M300/11_PLANET2

m330[release/v0.08]

m330[release/v0.08] - Products/Vendor = HYTEC/2_HYTEC_KOREA

  • 要把 web ui 一堆東西藏起來
    • online manual 來不及改的話就直接把 online manual 進入點藏起來
  • 比較麻煩的是 administration 頁面
    • 他們只要設定一個 user 就好
  • setting wizard 也先不要啟動

1630

M300[release/v2.02] - Products/Vendor = M300/11_PLANET2 終於 build 好了

感覺要修改的東西很簡單 直接改了


測試 PASS 上 code

M300[release/v2.02] - apply the same web ui to CID 80(PLANET2) with CID 2(PLANET)

commit 9ea281e20d76e181d10d7d0ee8c7dd8c273929f8
Refs: [release/v2.02], {origin/release/v2.02}
Author: jeffrey <[email protected]>
Date:   Mon Jan 20 17:07:20 2020 +0800

    apply the same web ui to CID 80(PLANET2) with CID 2(PLANET)

 proscend/prosrc/webcgi/status.c | 8 ++++++++
 proscend/prosrc/www/Makefile    | 2 ++
 2 files changed, 10 insertions(+)

1750

m330[release/v0.08] - 為了新客戶的 profile ALLNET/0_WIFI 套新的 logo

做好了也測好了

m330[release/v0.08] - add the brand logo for profile 'ALLNET/0_WIFI'

commit 6149665584a478c936d050d5a4b179cf5d737280
Refs: [release/v0.08], {origin/release/v0.08}
Author: jeffrey <[email protected]>
Date:   Mon Jan 20 17:49:50 2020 +0800

    add the brand logo for profile 'ALLNET/0_WIFI'

 proscend/mconfig/configs/ALLNET/0_WIFI/defconfig   |   2 +-
 proscend/prosrc/www/Makefile                       |   2 +
 .../app/images/lock_wifi_signal_0_in_content.png   | Bin 0 -> 10841 bytes
 .../app/images/lock_wifi_signal_1_in_content.png   | Bin 0 -> 9649 bytes
 .../app/images/lock_wifi_signal_2_in_content.png   | Bin 0 -> 8512 bytes
 .../app/images/lock_wifi_signal_3_in_content.png   | Bin 0 -> 7720 bytes
 .../app/images/lock_wifi_signal_4_in_content.png   | Bin 0 -> 6155 bytes
 .../www/brand_allnet/app/images/signal-0.png       | Bin 0 -> 9503 bytes
 .../www/brand_allnet/app/images/signal-1.png       | Bin 0 -> 5878 bytes
 .../www/brand_allnet/app/images/signal-2.png       | Bin 0 -> 6176 bytes
 .../www/brand_allnet/app/images/signal-3.png       | Bin 0 -> 6493 bytes
 .../www/brand_allnet/app/images/signal-4.png       | Bin 0 -> 6548 bytes
 .../app/images/wifi_signal_0_in_banner.png         | Bin 0 -> 10229 bytes
 .../app/images/wifi_signal_0_in_content.png        | Bin 0 -> 9593 bytes
 .../app/images/wifi_signal_1_in_banner.png         | Bin 0 -> 9969 bytes
 .../app/images/wifi_signal_1_in_content.png        | Bin 0 -> 10999 bytes
 .../app/images/wifi_signal_2_in_banner.png         | Bin 0 -> 9508 bytes
 .../app/images/wifi_signal_2_in_content.png        | Bin 0 -> 8344 bytes
 .../app/images/wifi_signal_3_in_banner.png         | Bin 0 -> 8713 bytes
 .../app/images/wifi_signal_3_in_content.png        | Bin 0 -> 7272 bytes
 .../app/images/wifi_signal_4_in_banner.png         | Bin 0 -> 6989 bytes
 .../app/images/wifi_signal_4_in_content.png        | Bin 0 -> 5562 bytes
 proscend/prosrc/www/brand_allnet/brand/bottom.html |   2 +
 proscend/prosrc/www/brand_allnet/brand/custom.css  |  53 ++++++++++++++++++
 proscend/prosrc/www/brand_allnet/brand/top.png     | Bin 0 -> 18826 bytes
 .../prosrc/www/brand_allnet/src/brand/top.html.src |  61 +++++++++++++++++++++
 26 files changed, 119 insertions(+), 1 deletion(-)