20151215_jeffrey - silenceuncrio/diary GitHub Wiki

Index

  • 0830 review yesterday
  • 0840 CGI - #include <json-c/json.h>
  • 0910 CGI - implement event.cgi
  • 0945 CGI - implement event.cgi
  • 1005 關心一下 Lun 的狀況
  • 1015 CGI - 測試 - JMeter 入門
  • 1055 CGI - 測試
  • 1115 CGI - 測試 - OpenWrt web service 異常 - 懷疑是 cgiFree 的問題
  • 1140 CGI - 寫一隻沒有用到 cgi library 的 cgi 來測試
  • 1220 CGI - 寫一隻用到 libcgi 的 helloWithLibcgi.cgi 來測試
  • 1310 CGI - 加重 loading(POST with JSON response) - OpenWrt web service 異常
  • 1345 Nginx - 安裝
  • 1440 Nginx - 怎麼用呢?
  • 1445 Mail - Eric - Fwd: Fwd: RE: AStar IoT Platform and iRetail Solution
  • 1510 Nginx - the configuration file /etc/nginx/nginx.conf
  • 1545 Meeting - IoT Platform
    • 禮拜四看數據
  • 1600 Nginx - FastCGI ???
  • 1700 Nginx - ???
  • 1720 Nginx - Serving Static Content
  • 1755 Nginx - JS9331 開發環境 Ubuntu
    • make menuconfig and include libfcgi
    • 透過 web 刷写 JS9331 新的固件
  • 1815 Nginx - 明天繼續研究 fcgi

0830

再回顧自己昨天作的

做得很好

0840

再來是 #include <json-c/json.h>

#include <stdio.h>
#include <cgi.h>
#include <json-c/json.h>

#define STRCMP(a,b) (strcmp(a,b) == 0)

s_cgi *cgi;

int main(void) {
    char info[256];
    json_object *obj = json_object_new_object();

    cgi = cgiInit();
    cgiSetType("application/json");
    cgiHeader();

    char *act = cgiGetValue(cgi, "act");
    if (!act) {
        json_object_object_add(obj, "fail", json_object_new_boolean(TRUE));
        sprintf(info, "act needed");
        json_object_object_add(obj, "info", json_object_new_string(info));
        goto end;
    }

    if (STRCMP(act, "hello")) {
        json_object_object_add(obj, "ok", json_object_new_boolean(TRUE));
        sprintf(info, "hi, %s develpment team, nice to meet you.", "579X");
        json_object_object_add(obj, "info", json_object_new_string(info));
        goto end;
    }

    json_object_object_add(obj, "fail", json_object_new_boolean(TRUE));
    sprintf(info, "unknown act: %s", act);
    json_object_object_add(obj, "info", json_object_new_string(info));

end:
    printf("%s", json_object_to_json_string(obj));
    json_object_put(obj);
//    cgiFree (cgi);

    return 0;
}

一樣是不要去呼叫 cgiFree()

需要告知 mips-openwrt-linux-gcc 四件事

  1. -I/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/
  2. -L/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/
  3. -lcgi
  4. -ljson-c

command 如下

mips-openwrt-linux-uclibc-gcc -I/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/ -L/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/ -lcgi -ljson-c -o event.cgi main.c

網址列輸入 http://192.168.1.251/cgi-bin/event.cgi?act=hello

出現熟悉的畫面 { "ok": true, "info": "hi, IoT Platform development team, nice to meet you." }

太感動了

0910

試著 implement 自己定義的 control center 的 event

  • POST /event

    • 何時使用
      • Control Box 平常用來更新自己的 Things 狀態給 Control Center 的時候
      • Control Box 有緊急或重要的事情要告訴 Control Center 的時候
    • 那些 event 可以用
      • normal event
      • emergency event
      • important event
      • critical evane
    • 內容(JSON 格式)
      • box - Control Box 的名子
      • location - Control Box 所在的位置
      • thing - thing 的名子
      • type - 是什麼 event
        • normal
        • important
        • emergency
        • critical
      • info - 具體的內容
        • 不同的 thing 有不同的內容格式

0945

看來真的進入我的專業領域了
掌握度非常好

#include <stdio.h>
#include <cgi.h>
#include <json-c/json.h>

#define STRCMP(a,b) (strcmp(a,b) == 0)

s_cgi       *cgi;
json_object *obj;

static void _fail(const char *info) {
    json_object_object_add(obj, "fail", json_object_new_boolean(TRUE));
    json_object_object_add(obj, "info", json_object_new_string(info));
    printf("%s", json_object_to_json_string(obj));
    json_object_put(obj);
    exit(0);
}

static void _ok(void) {
    json_object_object_add(obj, "ok", json_object_new_boolean(TRUE));
    printf("%s", json_object_to_json_string(obj));
    json_object_put(obj);
    exit(0);
}


static void _event_normal(void) {
    char *_info = cgiGetValue(cgi, "info");
    if (!_info) _fail("info needed");

    json_object *info = json_tokener_parse(_info);
    if (info == NULL) _fail("json_tokener_parse(info) fail");

    json_object_object_add(obj, "type", json_object_new_string("normal"));

    json_object_object_add(obj, "info", info);
    _ok();
}


static void _event_important(void) {
    char *_info = cgiGetValue(cgi, "info");
    if (!_info) _fail("info needed");

    json_object *info = json_tokener_parse(_info);
    if (info == NULL) _fail("json_tokener_parse(info) fail");

    json_object_object_add(obj, "type", json_object_new_string("important"));

    json_object_object_add(obj, "info", info);
    _ok();
}


static void _event_emergency(void) {
    char *_info = cgiGetValue(cgi, "info");
    if (!_info) _fail("info needed");

    json_object *info = json_tokener_parse(_info);
    if (info == NULL) _fail("json_tokener_parse(info) fail");

    json_object_object_add(obj, "type", json_object_new_string("emergency"));

    json_object_object_add(obj, "info", info);
    _ok();
}


static void _event_critical(void) {
    char *_info = cgiGetValue(cgi, "info");
    if (!_info) _fail("info needed");

    json_object *info = json_tokener_parse(_info);
    if (info == NULL) _fail("json_tokener_parse(info) fail");

    json_object_object_add(obj, "type", json_object_new_string("critical"));

    json_object_object_add(obj, "info", info);
    _ok();
}


int main(void) {

    cgi = cgiInit();
    cgiSetType("application/json");
    cgiHeader();

    obj = json_object_new_object();

    char *box = cgiGetValue(cgi, "box");
    if (!box) _fail("box needed");

    char *location = cgiGetValue(cgi, "location");
    if (!location) _fail("location needed");

    char *thing = cgiGetValue(cgi, "thing");
    if (!thing) _fail("thing needed");

    char *type = cgiGetValue(cgi, "type");
    if (!type) _fail("type needed");

    if (STRCMP(type, "normal"))     _event_normal();
    if (STRCMP(type, "important"))  _event_important();
    if (STRCMP(type, "emergency"))  _event_emergency();
    if (STRCMP(type, "critical"))   _event_critical();

    char info[256];
    sprintf(info, "unknown event type: %s", type);
    _fail(info);

}

就這樣的 event.cgi 已經可以做測試了

1005

禮拜二早上
關心一下 Lun 的狀況
Lun 將他的 source code - 一隻 c code 壓縮打包
上傳到 mantis wiki 上去

我很快就會面臨 source code commit 的問題了
這最好在 禮拜四開會的時候討論

1015

做測試吧

先照著這一篇玩玩看

很棒的軟體呢! 真方便

要技壓群雄就要把這一套玩熟才行

1055

  • 執行緒群組

    • 執行緒屬性
      • 執行緒數量 - 100
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
  • HTTP 要求

    • Web 伺服器
      • 主機 IP - 192.168.1.251
      • 端口號碼 - 80
    • HTTP 要求
      • 方法 - POST
      • 路徑 - /cgi-bin/event.cgi
      • Parameters
        • box : jeffrey
        • location : room
        • thing : sound
        • type : normal
        • info : {"intensity": 100}

1115

使用下面的條件就把 openWrt 搞掛了

  • 執行緒群組
    • 執行緒屬性
      • 執行緒數量 - 200
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5

| Lable | 取樣數 | 平均值 | 中間值 | 最小值 | 最大值 | 錯誤率 | |---|---|---|---|---|---|---|---| | 總計 |1104|50263|14|11|286079|23.19%|

Mem: 22064K used, 39436K free, 0K shrd, 2192K buff, 6348K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.01 0.05 1/34 1924
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
  981     1 nobody   S      928   2%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq
 1918   384 root     R     1364   2%   0% top
  835     1 root     S     2976   5%   0% /usr/sbin/uhttpd -f -h /www -r JoySin
                                          ...
 1922   835 root     S      948   2%   0% /www/cgi-bin/event.cgi
 1924   835 root     S      948   2%   0% /www/cgi-bin/event.cgi
 1923   835 root     S      948   2%   0% /www/cgi-bin/event.cgi
                                          ...

browser 不會有回應

這三個 event.cgi process 卡死了

有點懷疑是 cgiFree 的問題

1140

寫一隻沒有用到 cgi library 的 cgi 來測試

  • main_0.c
#include <stdio.h>

int main(void) {
    printf("Content-Type: text/html\n\n");
    printf("<h1>Hello World</h1>\n");
    return 0;
}
jeffrey@jeffrey-virtual-machine:/mnt/hgfs/share/js9331_event_cgi$ mips-openwrt-linux-uclibc-gcc -I/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/ -L/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/ -lcgi -ljson-c -o hello.cgi main_0.c
  • 執行緒群組

    • 執行緒屬性
      • 執行緒數量 - 100
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
  • HTTP 要求

    • Web 伺服器
      • 主機 IP - 192.168.1.251
      • 端口號碼 - 80
    • HTTP 要求
      • 方法 - GET
      • 路徑 - /cgi-bin/hello.cgi
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量 每秒千位元組
總計 500 569 564 576 599 694 559 767 0.00% 40.3 6.0
  • 執行緒群組
    • 執行緒屬性
      • 執行緒數量 - 200
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量 每秒千位元組
總計 1000 828 602 713 1011 7349 559 9946 0.00% 67.5 10.0

1220

故意寫一隻用到 libcgi 的 helloWithLibcgi.cgi 來測試

  • main_1.c
#include <stdio.h>
#include <cgi.h>

s_cgi *cgi;

int main(void) {
    cgi = cgiInit();
    cgiHeader();
    printf("<h1>Hello World with libcgi</h1>\n");
//    cgiFree (cgi);
    return 0;
}
jeffrey@jeffrey-virtual-machine:/mnt/hgfs/share/js9331_event_cgi$ mips-openwrt-linux-uclibc-gcc -I/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/ -L/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/ -lcgi -ljson-c -o helloWithLibcgi.cgi main_1.c
  • 執行緒群組

    • 執行緒屬性
      • 執行緒數量 - 100
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
  • HTTP 要求

    • Web 伺服器
      • 主機 IP - 192.168.1.251
      • 端口號碼 - 80
    • HTTP 要求
      • 方法 - GET
      • 路徑 - /cgi-bin/helloWithLibcgi.cgi
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量 每秒千位元組
總計 500 565 563 572 578 600 559 612 0.00% 39.3 6.3
  • 執行緒群組
    • 執行緒屬性
      • 執行緒數量 - 200
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量 每秒千位元組
總計 1000 868 604 709 1079 8555 559 10203 0.00% 65.8 10.5

1310

慢慢加重 loading

  • event_01.c
#include <stdio.h>
#include <cgi.h>
#include <json-c/json.h>

#define STRCMP(a,b) (strcmp(a,b) == 0)

s_cgi       *cgi;
json_object *obj;

static void _fail(const char *info) {
    json_object_object_add(obj, "fail", json_object_new_boolean(TRUE));
    json_object_object_add(obj, "info", json_object_new_string(info));
    printf("%s", json_object_to_json_string(obj));
    json_object_put(obj);
    exit(0);
}
static void _ok(void) {
    json_object_object_add(obj, "ok", json_object_new_boolean(TRUE));
    printf("%s", json_object_to_json_string(obj));
    json_object_put(obj);
    exit(0);
}

static void _event_normal(void) {
    json_object_object_add(obj, "type", json_object_new_string("normal"));
    _ok();
}
static void _event_important(void) {
    json_object_object_add(obj, "type", json_object_new_string("important"));
    _ok();
}
static void _event_emergency(void) {
    json_object_object_add(obj, "type", json_object_new_string("emergency"));
    _ok();
}
static void _event_critical(void) {
    json_object_object_add(obj, "type", json_object_new_string("critical"));
    _ok();
}

int main(void) {
    cgi = cgiInit();
    cgiSetType("application/json");
    cgiHeader();

    obj = json_object_new_object();

    char *type = cgiGetValue(cgi, "type");
    if (!type) _fail("type needed");

    if (STRCMP(type, "normal"))     _event_normal();
    if (STRCMP(type, "important"))  _event_important();
    if (STRCMP(type, "emergency"))  _event_emergency();
    if (STRCMP(type, "critical"))   _event_critical();

    char info[256];
    sprintf(info, "unknown event type: %s", type);
    _fail(info);
}
jeffrey@jeffrey-virtual-machine:/mnt/hgfs/share/js9331_event_cgi$ mips-openwrt-linux-uclibc-gcc -I/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/ -L/home/jeffrey/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/ -lcgi -ljson-c -o event_01.cgi event_01.c
  • 執行緒群組

    • 執行緒屬性
      • 執行緒數量 - 100
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
  • HTTP 要求

    • Web 伺服器
      • 主機 IP - 192.168.1.251
      • 端口號碼 - 80
    • HTTP 要求
      • 方法 - POST
      • 路徑 - /cgi-bin/event_01.cgi
      • Parameters
        • type : normal
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量/sec 每秒千位元組
總計 500 1441 13 9012 9014 9027 10 21003 0.60% 20.0 3.0

開始產生錯誤了
錯誤率 0.60%
平均值(平均响应时间) 1441 ms, 超過 1 秒了

  • 執行緒群組
    • 執行緒屬性
      • 執行緒數量 - 150
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5
Label 取樣數 平均值 中間值 90% Line 95% Line 99% Line 最小值 最大值 錯誤率 處理量/sec 每秒千位元組
總計 750 2985 14 9014 9018 21002 10 21007 3.60% 22.5 4.8

這樣的數據看來不太行阿

  • 執行緒群組
    • 執行緒屬性
      • 執行緒數量 - 200
      • 啟動延遲(秒) - 10
      • 迴圈次數 - 5

OpenWrt web 掛了

Mem: 23072K used, 38428K free, 0K shrd, 2192K buff, 6388K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.01 0.05 1/36 6018
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
  ...
  835     1 root     S     2968   5%   0% /usr/sbin/uhttpd -f -h /www -r JoySin
  ...
 6016   835 root     S      948   2%   0% /www/cgi-bin/event_01.cgi
 6018   835 root     S      948   2%   0% /www/cgi-bin/event_01.cgi
 6017   835 root     S      948   2%   0% /www/cgi-bin/event_01.cgi
  ...

每秒超過 22.5 的處理量就掛了
這也太遜了吧

1345

來裝 nginx

參考官網 OpenWrt Wiki » Documentation » HOWTOs » Nginx

opkg update
opkg install php5-fastcgi nginx

直接敲了

root@JoySince:/# opkg update
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony/Packages.gz, wget returned 1.

看來是要讓 JS9331 連到公司網路才行

  • opkg update
root@JoySince:/www/cgi-bin# opkg update
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_base.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_luci.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_management.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_oldpackages.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_packages.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_routing.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker_telephony.
  • opkg install php5-fastcgi nginx
root@JoySince:/www/cgi-bin# opkg install php5-fastcgi nginx
Installing php5-fastcgi (5.4.27-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/php5-fastcgi_5.4.27-1_ar71xx.ipk.
Installing php5 (5.4.27-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/php5_5.4.27-1_ar71xx.ipk.
Installing libpcre (8.35-2) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/libpcre_8.35-2_ar71xx.ipk.
Installing zlib (1.2.8-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/zlib_1.2.8-1_ar71xx.ipk.
Installing libxml2 (2.9.2-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/libxml2_2.9.2-1_ar71xx.ipk.
Installing libpthread (0.9.33.2-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/libpthread_0.9.33.2-1_ar71xx.ipk.
Installing php5-cgi (5.4.27-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/php5-cgi_5.4.27-1_ar71xx.ipk.
Installing nginx (1.4.7-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/nginx_1.4.7-1_ar71xx.ipk.
Installing libopenssl (1.0.2e-1) to root...
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/libopenssl_1.0.2e-1_ar71xx.ipk.
Configuring libpthread.
Configuring libpcre.
Configuring zlib.
Configuring libxml2.
Configuring php5.
Configuring php5-cgi.
Configuring php5-fastcgi.
Configuring libopenssl.
Configuring nginx.

1440

怎麼用呢?

The way nginx and its modules work is determined in the configuration file. By default, the configuration file is named nginx.conf and placed in the directory /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx.

JS9331 是在 /etc/nginx

1445

Eric 轉寄一封 mail 給我

  • Fwd: Fwd: RE: AStar IoT Platform and iRetail Solution

Eric 於 2015/12/15 下午 02:36 寫道:
F. Y. I.

-------- 轉寄郵件 --------
從:Proscend/Jim Chen (陳金勇) [email protected]
Dear All,
FYI!

-------- 轉寄郵件 --------
從: Chiyang Lin [email protected]
Hi Jim:
Our system product and software manu. !

From: Chiyang Lin [mailto:[email protected]]
Hi Jim:
Have nice weekend !

From: Proscend/Jim Chen (陳金勇) [mailto:[email protected]]
Hi Chiyang,
We would study it recently.
Have a nice weekend!

From: Proscend/Jim Chen (陳金勇) [mailto:[email protected]]
Hi Louis,
Thank you for your feedback. Looking forward to receiving your update in the future!

Louis 於 2015/12/8 下 午 05:38 寫 道:
Hi Jim,
Currently, we are discuss with customer for more detail technical issue.
I will let you know our detail requirement after customer agree all system function.
Thanks.

From: jim [mailto:[email protected]]
Hi Louis,
Could we clarify the technical requirements?

Chiyang Lin [email protected] 於 2015年12月6日 下 午5:21 寫 道:
Hi Jim:
The technical side of This case is charged by Louis !
Shannon is Sales , so keep her into mail loop !

Proscend/Jim Chen (陳 金勇) 於 2015/12/1 下 午 07:03 寫 道:
Hi Chiyang,
Thank you for your time to visit us yesterday. We are pleased to know your PoE project in Hong Kong. Please kindly let us know your technical contact person/technical requirements.
Have a nice weekend!

Chiyang Lin 於 2015/12/1 下 午 01:41 寫道:
Hi Jim:
Please see our introduction !

整包附件我放在 20151215_att01 有空在看

1510

回來 nginx

看一下 the configuration file /etc/nginx/nginx.conf

root@JoySince:/tmp# cat /etc/nginx/nginx.conf

user nobody nogroup;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    #default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

1545

處長找我跟 Jammy 開會
其實是針對我的 mail 啦

10 分鐘解決
我告知了 openWrt 原生的 uhttpd 一秒鐘 22 個 POST 以上就掛了
我目前再試 nginx

反正禮拜四就看數據吧

透過處長的談話我得到的情報有

  • 他不知道我的 IoT Platform 會不會用到 openHAB
  • 他沒有認真看我的 mantis wiki
  • 他只是看到二月底的 schedule 會飄掉所以來關心
  • 他覺得自己給的效能建議很讚
  • 他不知道怎麼測效能
  • 他不知道 CoAP 和 MQTT
  • 他只在乎如果用到 open source, 那授權是啥

1600

這會得到一些我目前需要的

1700

nginx 難搞阿

1720

耐著性子再看一次官方的 Beginner’s Guide
終於搞懂了 Serving Static Content

1755

在 JS9331 開發環境 Ubuntu 中的 openwrt 目錄下

jeffrey@jeffrey-virtual-machine:~/openwrt$ make menuconfig

Y 選擇 libfcgi

然後 make

透過 web 刷写新的固件

1815

明天繼續研究 fcgi 是啥

⚠️ **GitHub.com Fallback** ⚠️