20190103_jeffrey - silenceuncrio/diary GitHub Wiki

0900

web module 每次開機會收到兩次 BOOTINIT_DONE

這是目前系統的 workaround 方式

我要想個方法忽略第二次的 BOOTINIT_DONE

先改在 v1.75-mfg

這個 branch 明天要 release 給 DQA 測試

git pull 遇到 trouble

➜  M300 git:(v1.75-mfg) ✗ git pull
First, rewinding head to replay your work on top of it...
Applying: update the release note:
Using index info to reconstruct a base tree...
M       M30x-ReleaseNotes_Azuretec.txt
M       M30x-ReleaseNotes_WIDE.txt
M       M30x-ReleaseNotes_Xentino.txt
Falling back to patching base and 3-way merge...
Auto-merging M30x-ReleaseNotes_Xentino.txt
CONFLICT (content): Merge conflict in M30x-ReleaseNotes_Xentino.txt
Auto-merging M30x-ReleaseNotes_WIDE.txt
CONFLICT (content): Merge conflict in M30x-ReleaseNotes_WIDE.txt
Auto-merging M30x-ReleaseNotes_Azuretec.txt
CONFLICT (content): Merge conflict in M30x-ReleaseNotes_Azuretec.txt
error: Failed to merge in the changes.
Patch failed at 0001 update the release note:
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

選擇 git rebase --skip - 不知道會有什麼影響

➜  M300 git:(00add9a) ✗ git rebase --skip
➜  M300 git:(v1.75-mfg) ✗ git pull
Current branch v1.75-mfg is up to date.

先 build 個 image 先

利用 mfgtool 燒錄

1000

修改前

root@Cellular Router:~# cat /home/log/web.log
...
[20190103 01:42:52] [_notify:870]ICOS_BOOTINIT_DONE
...
[20190103 01:42:53] [daemon_event:1152]Starting HTTP success
...
[20190103 01:43:01] [daemon_event:1159]Starting HTTPS success
[20190103 01:43:44] [_notify:870]ICOS_BOOTINIT_DONE
...
[20190103 01:43:46] [daemon_event:1152]Starting HTTP success
...
[20190103 01:43:56] [daemon_event:1159]Starting HTTPS success
root@Cellular Router:~#

兩次的 ICOS_BOOTINIT_DONE 都會讓 HTTP 與 HTTPS 重啟

作以下修改

diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 80701da..eeed50e 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -165,6 +165,12 @@ static sAttStringSet secure_set[] =
     { "select",     WEB_ATTVAL_BTN_SELECTED             },
 };

+
+
+int Is_icos_bootinit_done_received = 0;
+
+
+
 static int LocalString2Value(int attID, char *pAttValue, int *pValue)
 {
     int res = ICOS_FAILURE;
@@ -868,6 +874,15 @@ static int _notify(PRO_EVENT *pevent)

         case ICOS_BOOTINIT_DONE:
             WEB_INFO("ICOS_BOOTINIT_DONE\n");
+
+            if (Is_icos_bootinit_done_received == 1)
+            {
+                WEB_INFO("ICOS_BOOTINIT_DONE is received already, break!\n");
+                break;
+            }
+
+            Is_icos_bootinit_done_received = 1;
+
             web_dump(DUMP_ALL,"init config");
             for(i=0; MAX_DAEMON_NUM>i; i++)
             {
(END)

build code

mfgtool 燒錄

root@Cellular Router:~# cat /home/log/web.log
...
[20190103 02:12:58] [_notify:876]ICOS_BOOTINIT_DONE
...
[20190103 02:12:58] [daemon_event:1167]Starting HTTP success
...
[20190103 02:13:23] [daemon_event:1174]Starting HTTPS success
[20190103 02:13:49] [_notify:876]ICOS_BOOTINIT_DONE
[20190103 02:13:49] [_notify:880]ICOS_BOOTINIT_DONE is received already, break!

上 code

commit 1a2fb93fbbf56aeae87fd71bb8380629207f5ce8
Refs: [v1.75-mfg], {origin/v1.75-mfg}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 10:23:04 2019 +0800

    ignore the second ICOS_BOOTINIT_DONE event

 proscend/prosrc/icos/icoslib/web/webcfg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

1025

切回 branch hotfix/v1.76

build image

compile error

直接修正 jessy 針對 wifi host list 從 share memory 搬出的事宜做修正

確認 M300/0_GENERIC compile 沒問題之後

切換 Products/VendorM300/16_MTK_WIFI

build image

確認 build image 成功後先上 code 以免其他同仁 compile 非 wifi 版本時出錯

commit 71d1bec81ce07b4ad94dc9b48af03e8939149ccd
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 10:54:48 2019 +0800

    remove ap list from share memory

 proscend/prosrc/webcgi/icos_shm.c                | 28 ------------------
 proscend/prosrc/webcgi/wifi_apsta.c              | 36 ++++++++++++++++++++++++
 proscend/prosrc/www/app/feature/wifi_info.js     |  4 +--
 proscend/prosrc/www/app/services/icos.service.js |  6 ++--
 4 files changed, 41 insertions(+), 33 deletions(-)

mfgtool 燒錄

等一下 aaron 測試完成後再把有 wifi module 拿回來進行測試

1100

剛剛針對 M300 branch v1.75-mfg 的 commit ignore the second ICOS_BOOTINIT_DONE event

除了要 sync 到 M300 branch hotfix/v1.76 之外

還要 sunc 到 M360

等 wifi 板子的同時先來 sync 到 M360

先 build 一版最新的 M360 branch develop

root@M360-P:/home/admin# cat /home/log/web.log
...
1546484910[20190103 3:8:30] [notify_web:858]IN(E72|S00|D44)
1546484910[20190103 3:8:30] [notify_web:892]boot init done
...
1546484911[20190103 3:8:31] [msgcb_web:1205]IN(DID0,pid 2238)
<--
failed to load the session from binary
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting iweb on port 80, serving /www
-->
...
1546484931[20190103 3:8:51] [msgcb_web:1205]IN(DID1,pid 3551)
<--
failed to load the session from binary
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting SSL iweb on port 443, cert from /tmp/icos/web/iweb_cert.pem, key from /tmp/icos/web/iweb_key.pem, serving /www
-->
1546484933[20190103 3:8:53] [notify_web:858]IN(E72|S64|D00)
1546484933[20190103 3:8:53] [notify_web:892]boot init done
...
1546484936[20190103 3:8:56] [msgcb_web:1205]IN(DID0,pid 3802)
<--
failed to load the session from binary
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting iweb on port 80, serving /www
-->
1546484936[20190103 3:8:56] [msgcb_web:1205]IN(DID1,pid 3801)
<--
failed to load the session from binary
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting SSL iweb on port 443, cert from /tmp/icos/web/iweb_cert.pem, key from /tmp/icos/web/iweb_key.pem, serving /www
-->
...

可以發現 boot init done 一樣收到了兩次

作以下修改

diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 8093b96..b56233a 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -164,6 +164,12 @@ static sAttStringSet secure_set[] =
     { "select",     WEB_ATTVAL_BTN_SELECTED             },
 };

+
+
+int Is_icos_bootinit_done_received = 0;
+
+
+
 static int LocalString2Value(int attID, char *pAttValue, int *pValue)
 {
     int res = ICOS_FAILURE;
@@ -890,6 +896,15 @@ static int notify_web(PRO_EVENT *pevent)

         case ICOS_BOOTINIT_DONE:
             WEB_INFO("boot init done\n");
+
+            if (Is_icos_bootinit_done_received == 1)
+            {
+                WEB_INFO("ICOS_BOOTINIT_DONE is received already, break!\n");
+                break;
+            }
+
+            Is_icos_bootinit_done_received = 1;
+
             web_dump(DUMP_ALL,"init config");
             for(i=0; MAX_DAEMON_NUM>i; i++)
             {
(END)

build image

upgrade via uboot

root@M360-P:/home/admin# cat /home/log/web.log
...
1546485616[20190103 3:20:16] [notify_web:864]IN(E72|S00|D44)
1546485616[20190103 3:20:16] [notify_web:898]boot init done
...
1546485617[20190103 3:20:17] [msgcb_web:1220]IN(DID0,pid 2226)
<--
failed to load the session from binary
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting iweb on port 80, serving /www
-->
...
1546485625[20190103 3:20:25] [msgcb_web:1220]IN(DID1,pid 2717)
<--
Icos_user_root.session_ttl: 300 sec
Icos_user_root.user: admin
Icos_user_root.pass: $1$$CoERg7ynjYLsj2j4glJ34.
Starting SSL iweb on port 443, cert from /tmp/icos/web/iweb_cert.pem, key from /tmp/icos/web/iweb_key.pem, serving /www
-->
1546485639[20190103 3:20:39] [notify_web:864]IN(E72|S64|D00)
1546485639[20190103 3:20:39] [notify_web:898]boot init done
1546485639[20190103 3:20:39] [notify_web:902]ICOS_BOOTINIT_DONE is received already, break!

成功忽略了第二次的 ICOS_BOOTINIT_DONE

上 code

commit 30d10347bb920a23434858b1f8d06a3aad8bbd14
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 11:23:29 2019 +0800

    ignore the second ICOS_BOOTINIT_DONE event

 proscend/prosrc/icos/icoslib/web/webcfg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

1125

直接把 ignore the second ICOS_BOOTINIT_DONE event 套到 M300 branch hotfix/v1.76

commit 5b215cf6da1fd5af9a4482c602b03ace2ff32ba6
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 11:27:35 2019 +0800

    ignore the second ICOS_BOOTINIT_DONE event

 proscend/prosrc/icos/icoslib/web/webcfg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

build image

mfgtool 燒錄

check ignore the second ICOS_BOOTINIT_DONE event

root@M301-GW:~# cat /home/log/web.log
...
[20190103 03:36:30] [_notify:896]ICOS_BOOTINIT_DONE
...
[20190103 03:36:31] [daemon_event:1187]Starting HTTP success
...
[20190103 03:36:43] [daemon_event:1194]Starting HTTPS success
[20190103 03:37:23] [_notify:896]ICOS_BOOTINIT_DONE
[20190103 03:37:23] [_notify:900]ICOS_BOOTINIT_DONE is received already, break!

check 成功

wifi ap list 也沒問題

不過要記得把 WIFI AP 從 status page 的 Connected VPN Connections panel 移出去

下午來做這件事

1315

commit 2ec811f2f1214073500ee3ee6c5852f54aa8272d
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 13:11:22 2019 +0800

    add the following panel at 'Status' web page:
    - WIFI - control by compile flag PROSRC_WIFI_APSTA
    - System
    - Connected VPN Connections

 proscend/prosrc/www/app/locale-en.json             |  2 +
 proscend/prosrc/www/app/locale-fr.json             |  2 +
 proscend/prosrc/www/app/locale-zh-tw.json          |  2 +
 .../www/brand_advice/app/feature/status.html.src   | 82 ++++++++++++++++++++--
 .../www/brand_ctcu/app/feature/status.html.src     | 82 ++++++++++++++++++++--
 .../www/brand_cxr/app/feature/status.html.src      | 82 ++++++++++++++++++++--
 .../www/brand_digicomm/app/feature/status.html.src | 82 ++++++++++++++++++++--
 .../www/brand_hytec/app/feature/status.html.src    | 82 ++++++++++++++++++++--
 .../www/brand_nobrand/app/feature/status.html.src  | 82 ++++++++++++++++++++--
 .../www/brand_planet/app/feature/status.html.src   | 82 ++++++++++++++++++++--
 10 files changed, 538 insertions(+), 42 deletions(-)

1320

來做 Web UI: WiFi LED configuration

build image

mfgtool 燒錄

兩個問題

  • MENU_LED 忘了加到多國語言檔
  • iweb 的 _register_http_endpoint() 忘了把 System > LED 相關 CGI 加上去
  • /cgi-bin/connmgr.cgi?act=chg_led_config
  • /cgi-bin/connmgr.cgi?act=chg_led_apply

趕緊再改一下

再 build 來試試

測試 PASS

上 code

commit 766c7ee84799debfb6534a8e8082f3b85e20a942
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 14:44:03 2019 +0800

    add 'System > LED' web page

 proscend/prosrc/icos/iweb/iweb.c                 |  4 ++
 proscend/prosrc/webcgi/connmgr.c                 | 57 +++++++++++++++++++++++
 proscend/prosrc/www/app/feature/led.html         | 55 ++++++++++++++++++++++
 proscend/prosrc/www/app/feature/led.js           | 59 ++++++++++++++++++++++++
 proscend/prosrc/www/app/locale-en.json           | 14 ++++++
 proscend/prosrc/www/app/locale-fr.json           | 14 ++++++
 proscend/prosrc/www/app/locale-zh-tw.json        | 14 ++++++
 proscend/prosrc/www/app/services/icos.service.js |  7 +++
 proscend/prosrc/www/src/index.html.src           |  1 +
 proscend/prosrc/www/src/menu.html.src            |  3 ++
 10 files changed, 228 insertions(+)

1445

盤一下 hotfix/v1.76 的 online manual

上 code

commit 13315043ce79e94f13cb3efe5e3b7578f6ecba94
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 15:04:48 2019 +0800

    add the following online manaul:
    - System > LED
    - WIFI > Config
    - WIFI > Information

    note 1: that these 3 sections all control by compile flag PROSRC_WIFI_APSTA

    todo: 1. 'WIFI > Config' and 'WIFI > Information' need content

 proscend/prosrc/www/src/manual.html.src            | 10 ++++++
 proscend/prosrc/www/src/manual/sidebar.h.html      | 18 ++++++++++
 proscend/prosrc/www/src/manual/system_led.h.html   | 41 ++++++++++++++++++++++
 proscend/prosrc/www/src/manual/wifi_config.h.html  | 13 +++++++
 .../prosrc/www/src/manual/wifi_infomation.h.html   | 13 +++++++
 5 files changed, 95 insertions(+)

1510

盤一下待作事項

M300

  • WiFi: Country Code - target version: V1.76
  • WiFi: Bandwidth - target version: V1.76
  • Cisco DMVPN - target version: V2.0
  • WiFi: hidden page (ATE) - target version: NA
  • wizard
  • mfgtool with ubi

M360

  • web ui for upgrade uboot (uboot need version information: 1.0)
  • schedule reboot

繼續 M300 - wizard

切換到 M300 branch develop

Products/Vendor 選擇 M300/0_GENERIC

build image

mfgtool 燒錄

1610

commit b0cc7c8c209a915151efcfd582dcc06503141488
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 16:07:52 2019 +0800

    after firmware upgrade and user press the reboot button, use wizard.cgi?act=reset to set the wizard not finished

 proscend/prosrc/www/app/feature/firmware.js | 3 +++
 1 file changed, 3 insertions(+)

1615

hotfix/v1.76 wifi 的一些字眼 ariel 想修改

改在 M300 branch hotfix/v1.76

commit 8921e8da6cc657d8e6e6d7fb7160e803526b7ff6
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 16:35:51 2019 +0800

    modify some word for 'WiFi' related web pages

 proscend/prosrc/www/app/locale-en.json               | 20 ++++++++++----------
 proscend/prosrc/www/app/locale-fr.json               | 16 ++++++++--------
 proscend/prosrc/www/app/locale-zh-tw.json            | 16 ++++++++--------
 proscend/prosrc/www/src/manual/wifi_config.h.html    |  6 +++---
 .../prosrc/www/src/manual/wifi_infomation.h.html     |  6 +++---
 5 files changed, 32 insertions(+), 32 deletions(-)

1650

fix M300 hotfix/v1.76 compile error

commit ef0d24fc2f1ea7fbce9d6ee21e106d8c6454f7bb
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Thu Jan 3 16:44:53 2019 +0800

    use compile flag PROSRC_WIFI_APSTA to control the following CGIs:
    - connmgr.cgi?act=chg_led_config
    - connmgr.cgi?act=chg_led_apply

 proscend/prosrc/webcgi/connmgr.c | 6 ++++++
 1 file changed, 6 insertions(+)

1720

繼續 wizard

回到 branch develop

切換 Products/VendorM300/16_MTK_WIFI

build image

mfgtool 燒錄

明天 M300 週會有需要的話先利用 wan ethernet 簡單作個 demo

進度可能還要再延一下