20160705_jeffrey - silenceuncrio/diary GitHub Wiki

Index

  • 0915 - 看 昨天 build 的怎樣 沒裝 gawk
  • 0920 - 還是有錯 該裝的 Yocto Project host packages 裝一裝
  • 0935 - 順利 build image 中
  • 1025 - morris 麥可風 輸出端 加一顆電容
  • 1050 - M300 build 有錯誤 proscend make menuconfig 連不上 samba Ubuntu 14.04 問題 試 Ubuntu 15.10 samba
  • 1315 - ariel M300 demoboard web
  • 1320 - m300_ubuntu_15 samba 運作正常 shit! Ubuntu 14.04
  • 1355 - ariel 表示 NAND Flash boot 比較優先
  • 1400 - m300_ubuntu_15 checkout build image
  • 1620 - 大會議 alarm sensor 實驗
  • 1630 - M300 還再 build
  • 1705 - M300/fsl-release-bsp/proscend' 要先 make menuconfig 取消勾選 LTE` module
  • 1720 - 安裝 host packages
  • 1725 - build 過了 Source Insight trace code
  • 1830 - webcfg.c InitWeb() 找不到 mgmt_init_iptables

0915

來看昨天下班前 build 的怎樣...

...
| checking for arm-poky-linux-gnueabi-nm... arm-poky-linux-gnueabi-nm
| configure: error:
| *** These critical programs are missing or too old: gawk
| *** Check the INSTALL file for required versions.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/glibc-initial/2.21-r0/temp/log.do_configure.3260)
ERROR: Task 638 (/home/jeffrey/M300/fsl-release-bsp/sources/poky/meta/recipes-core/glibc/glibc-initial_2.21.bb, do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 437 tasks of which 332 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/jeffrey/M300/fsl-release-bsp/sources/poky/meta/recipes-core/glibc/glibc-initial_2.21.bb, do_configure
Summary: There were 3 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ 

看起來像是沒裝 gawk 的樣子, 裝吧 - sudo apt install gawk

0920

還是有錯

...
ERROR: Error executing a python function in /home/jeffrey/M300/fsl-release-bsp/sources/poky/meta/recipes-devtools/elfutils/elfutils_0.161.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: 'relocatable_binaries_preprocess', lineno: 6, function: <module>
     0002:def relocatable_binaries_preprocess(d):
     0003:    rpath_replace(d.expand('/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/i686-linux/elfutils-native/0.161-r0/sysroot-destdir/'), d)
     0004:
     0005:
 *** 0006:relocatable_binaries_preprocess(d)
     0007:
File: 'relocatable_binaries_preprocess', lineno: 3, function: relocatable_binaries_preprocess
     0001:
     0002:def relocatable_binaries_preprocess(d):
 *** 0003:    rpath_replace(d.expand('/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/i686-linux/elfutils-native/0.161-r0/sysroot-destdir/'), d)
     0004:
     0005:
     0006:relocatable_binaries_preprocess(d)
     0007:
File: 'chrpath.bbclass', lineno: 7, function: rpath_replace
     0003:
     0004:    for bindir in bindirs:
     0005:        #bb.note ("Processing directory " + bindir)
     0006:        directory = path + "/" + bindir
 *** 0007:        process_dir (path, directory, d)
     0008:
File: 'chrpath.bbclass', lineno: 44, function: process_dir
     0040:                perms = None
     0041:            else:
     0042:                # Temporarily make the file writeable so we can chrpath it
     0043:                os.chmod(fpath, perms|stat.S_IRWXU)
 *** 0044:            process_file(cmd, fpath, rootdir, baseprefix, tmpdir, d)
     0045:
     0046:            if perms:
     0047:                os.chmod(fpath, perms)
     0048:
File: 'chrpath.bbclass', lineno: 4, function: process_file_linux
  File "chrpath.bbclass", line 4, in process_file_linux

File: '/usr/lib/python2.7/subprocess.py', lineno: 710, function: __init__
     0706:                                cwd, env, universal_newlines,
     0707:                                startupinfo, creationflags, shell, to_close,
     0708:                                p2cread, p2cwrite,
     0709:                                c2pread, c2pwrite,
 *** 0710:                                errread, errwrite)
     0711:        except Exception:
     0712:            # Preserve original exception in case os.close raises.
     0713:            exc_type, exc_value, exc_trace = sys.exc_info()
     0714:
File: '/usr/lib/python2.7/subprocess.py', lineno: 1327, function: _execute_child
     1323:                except OSError as e:
     1324:                    if e.errno != errno.ECHILD:
     1325:                        raise
     1326:                child_exception = pickle.loads(data)
 *** 1327:                raise child_exception
     1328:
     1329:
     1330:        def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
     1331:                _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,
Exception: OSError: [Errno 2] No such file or directory

ERROR: Function failed: relocatable_binaries_preprocess
ERROR: Logfile of failure stored in: /home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/i686-linux/elfutils-native/0.161-r0/temp/log.do_populate_sysroot.25084
ERROR: Task 855 (virtual:native:/home/jeffrey/M300/fsl-release-bsp/sources/poky/meta/recipes-devtools/elfutils/elfutils_0.161.bb, do_populate_sysroot) failed with exit code '1'
NOTE: Tasks Summary: Attempted 466 tasks of which 453 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  virtual:native:/home/jeffrey/M300/fsl-release-bsp/sources/poky/meta/recipes-devtools/elfutils/elfutils_0.161.bb, do_populate_sysroot
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ 

算了... 該裝的 Yocto Project host packages 裝一裝吧

Essential Yocto Project host packages are:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev
i.MX layers host packages for a Ubuntu 12.04 or 14.04 host setup are:
$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
i.MX layers host packages for a Ubuntu 12.04 host setup only are:
$ sudo apt-get install uboot-mkimage
i.MX layers host packages for a Ubuntu 14.04 host setup only are:
$ sudo apt-get install u-boot-tools

0935

順利 build image 中...

整理一下目前的開發環境配置

基本配置

  • VirtualBox - 版本 5.0.24 r108355
  • Ubuntu - 14.04 - [ubuntu-14.04.4-desktop-i386.iso]

VirtualBox 設定

  • 名稱 - m300_develop
  • 存放裝置 - 80.00 GB - 固定大小存放裝置 - D:\m300\VirtualBox\m300_develop.vdi
  • username - jeffrey
  • password - proscend

host packages

  • Essential Yocto Project host packages are:
    $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
    build-essential chrpath socat libsdl1.2-dev
  • i.MX layers host packages
    $ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
    docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
    libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
  • i.MX layers host packages for a Ubuntu 14.04 host setup only are:
    $ sudo apt-get install u-boot-tools

1025

morris 表示 昨天的麥可風的輸出端還要加一顆電阻
加了以後在示波器上效果真的不錯
靈敏非常多

最後的 code 如下

iot_alarm_sensor_v1.0.lua

require("base64")

-- The email and password from the account you want to send emails from
local MY_EMAIL = "[email protected]"
local EMAIL_PASSWORD = "abc456"

-- The SMTP server and port of your email provider.
-- If you don't know it google [my email provider] SMTP settings
local SMTP_SERVER = "mail.proscend.com"
local SMTP_PORT = "25"

-- The account you want to send email to
local mail_to = "[email protected]"

-- Your access point's SSID and password
local SSID = "ISMS-2G"
local SSID_PASSWORD = "proscendisms"

-- configure ESP as a station
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID,SSID_PASSWORD)
wifi.sta.autoconnect(1)

-- These are global variables. Don't change their values
-- they will be changed in the functions below
local email_subject = ""
local email_body = ""
local count = 0


local smtp_socket = nil -- will be used as socket to email server

-- The display() function will be used to print the SMTP server's response
function display(sck,response)
     print(response)
end

-- The do_next() function is used to send the SMTP commands to the SMTP server in the required sequence.
-- I was going to use socket callbacks but the code would not run callbacks after the first 3.
function do_next()
            if(count == 0)then
                count = count+1
                local IP_ADDRESS = wifi.sta.getip()
                smtp_socket:send("HELO "..IP_ADDRESS.."\r\n")
            elseif(count==1) then
                count = count+1
                smtp_socket:send("AUTH LOGIN\r\n")
            elseif(count == 2) then
                count = count + 1
                smtp_socket:send(base64.enc(MY_EMAIL).."\r\n")
            elseif(count == 3) then
                count = count + 1
                smtp_socket:send(base64.enc(EMAIL_PASSWORD).."\r\n")
            elseif(count==4) then
                count = count+1
               smtp_socket:send("MAIL FROM:<" .. MY_EMAIL .. ">\r\n")
            elseif(count==5) then
                count = count+1
               smtp_socket:send("RCPT TO:<" .. mail_to ..">\r\n")
            elseif(count==6) then
                count = count+1
               smtp_socket:send("DATA\r\n")
            elseif(count==7) then
                count = count+1
                local message = string.gsub(
                "From: \"".. MY_EMAIL .."\"<"..MY_EMAIL..">\r\n" ..
                "To: \"".. mail_to .. "\"<".. mail_to..">\r\n"..
                "Subject: ".. email_subject .. "\r\n\r\n"  ..
                email_body,"\r\n.\r\n","")

                smtp_socket:send(message.."\r\n.\r\n")
            elseif(count==8) then
               count = count+1
                 smtp_socket:send("QUIT\r\n")
            else
               smtp_socket:close()
               tmr.stop(0)
            end
end

function connected(sck)
    tmr.alarm(0,600,1,do_next)
end

function send_email(subject,body)
     count = 0
     email_subject = subject
     email_body = body
     smtp_socket = net.createConnection(net.TCP,0)
     smtp_socket:on("connection",connected)
     --smtp_socket:on("receive",display)
     smtp_socket:connect(SMTP_PORT,SMTP_SERVER)
end



x = 0
v = 0

send_once = 0

sound_level = 123

sound_duration = 5
sound_cnt = 0

sound_dbg = 0

tmr.alarm(1, 100, tmr.ALARM_AUTO, function()
  if x < 10 then
    x = x + 1
    a = adc.read(0)
    v = v + a
  else
    sound = v/10
    if sound_dbg == 1 then
      print(sound)
    end
    if sound > sound_level then
      sound_cnt = sound_cnt + 1
      print("#"..sound_cnt..": sound("..sound..") more than "..sound_level)
      if sound_cnt >= sound_duration then
        print("send mail")
        -- Send an email
        send_email(
          "detect alarm - sound level: " .. sound,
          "alarm level: "..sound_level
        )
        sound_cnt = 0
      end
    else
      sound_cnt = 0
    end      
    x = 0
    v = 0
  end  
end)

function split(str, pat)
   local t = {}  -- NOTE: use {n = 0} in Lua-5.0
   local fpat = "(.-)" .. pat
   local last_end = 1
   local s, e, cap = str:find(fpat, 1)
   while s do
      if s ~= 1 or cap ~= "" then
     table.insert(t,cap)
      end
      last_end = e+1
      s, e, cap = str:find(fpat, last_end)
   end
   if last_end <= #str then
      cap = str:sub(last_end)
      table.insert(t, cap)
   end
   return t
end



-- when '\r' is received.
uart.on("data", "\r",
  function(data)
    if data=="quit\r" then
      uart.on("data") -- unregister callback function
    end

    cmd = split(data, " ")

    if cmd[1] == "set" then
      if cmd[2] == "level" then
        sound_level = tonumber(cmd[3])
        print("set sound level to "..sound_level)
      end
      if cmd[2] == "duration" then
        sound_duration = tonumber(cmd[3])
        print("set sound duration to "..sound_duration)
      end

      if cmd[2] == "debug" then
        sound_dbg = tonumber(cmd[3])
        print("set sound debug to "..sound_dbg)
      end

    end

    if cmd[1] == "info" then
        print("sound level:    "..sound_level)
        print("sound duration: "..sound_duration)
        print("sound debug:    "..sound_dbg)
    end

end, 0)

看一下跟取樣有關的部分

...
x = 0
v = 0

send_once = 0

sound_level = 123

sound_duration = 5
sound_cnt = 0

sound_dbg = 0

tmr.alarm(1, 100, tmr.ALARM_AUTO, function()
  if x < 10 then
    x = x + 1
    a = adc.read(0)
    v = v + a
  else
    sound = v/10
    if sound_dbg == 1 then
      print(sound)
    end
    if sound > sound_level then
      sound_cnt = sound_cnt + 1
      print("#"..sound_cnt..": sound("..sound..") more than "..sound_level)
      if sound_cnt >= sound_duration then
        print("send mail")
        -- Send an email
        send_email(
          "detect alarm - sound level: " .. sound,
          "alarm level: "..sound_level
        )
        sound_cnt = 0
      end
    else
      sound_cnt = 0
    end      
    x = 0
    v = 0
  end  
end)
...

之前是每秒取樣 10 次然後作平均

不過這顆 MIC 蠻敏感的
先改成每秒取樣 100 次然後作平均

mail 就先不發了

...
x = 0
v = 0

send_once = 0

sound_level = 123

sound_duration = 5
sound_cnt = 0

sound_dbg = 0

tmr.alarm(1, 10, tmr.ALARM_AUTO, function()
  if x < 100 then
    x = x + 1
    a = adc.read(0)
    v = v + a
  else
    sound = v/100
    if sound_dbg == 1 then
      print(sound)
    end
    if sound > sound_level then
      sound_cnt = sound_cnt + 1
      print("#"..sound_cnt..": sound("..sound..") more than "..sound_level)
      if sound_cnt >= sound_duration then
        print("send mail")
        -- Send an email
--        send_email(
--          "detect alarm - sound level: " .. sound,
--          "alarm level: "..sound_level
--        )
        sound_cnt = 0
      end
    else
      sound_cnt = 0
    end      
    x = 0
    v = 0
  end  
end)
...

1050

M300 的 build 還是有錯誤

Log data follows:
| DEBUG: Executing python function externalsrc_compile_prefunc
| WARNING: Compiling prosrc from external source /home/jeffrey/M300/fsl-release-bsp/proscend
| DEBUG: Python function externalsrc_compile_prefunc finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'arm-32', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 prebuild
| Build Environment Check....
| .config Not Found!! Please "cd proscend; make menuconfig" first
| crosscmpl_vars/env_vars setup...
| make: *** [buildenv_check] Error 1
| make: *** Waiting for unfinished jobs....
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/prosrc/0.1-r0/temp/log.do_compile.20188)
ERROR: Task 472 (/home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1308 tasks of which 724 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ 

看起來是要先進 proscend 的目錄作 make menuconfig

jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend$ make menuconfig
make -C /home/jeffrey/M300/fsl-release-bsp/proscend/mconfig pmcfg_all
make[1]: Entering directory `/home/jeffrey/M300/fsl-release-bsp/proscend/mconfig'
make -C /home/jeffrey/M300/fsl-release-bsp/proscend/mconfig/lxdialog HOSTCC=gcc
make[2]: Entering directory `/home/jeffrey/M300/fsl-release-bsp/proscend/mconfig/lxdialog'
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
-e 
>> Unable to find the Ncurses libraries.
>>
>> You must have Ncurses installed in order
>> to use 'make menuconfig'

make[2]: *** [ncurses] Error 1
make[2]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/mconfig/lxdialog'
make[1]: *** [pmcfg_all] Error 2
make[1]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/mconfig'
make: *** [pconfig] Error 2
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend$ 

忘了裝 Ncurses libraries - sudo apt install libncurses5-dev

使用 make menuconfig 後, 存了 configuration

再回到 build_small 目錄下打 source bimage.sh 繼續 build image

| make[2]: Entering directory `/home/jeffrey/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615'
| if [ ! -e ./Makefile ]; then \
| 		echo "ac_cv_func_setpgrp_void=yes" > config.cache ; \
| 		./configure --host=arm-linux --build=arm-linux-gnu  --config-cache ; \
| 	fi
| /bin/sh: 3: ./configure: not found
| make[2]: *** [prebuild] Error 127
| make[2]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615'
| make[1]: *** [build] Error 1
| make[1]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/opensrc'
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/prosrc/0.1-r0/temp/log.do_compile.1580)
ERROR: Task 472 (/home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 964 tasks of which 948 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ 

找不到 M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615/configure

先裝個 samba - sudo apt install samba

Samba 設定 - /etc/samba/smb.conf

...
[m300_develop]
path = /home/jeffrey
writable = yes
guest account = root
force user = root
public = yes
force group = root
create mask = 0660
browseable = yes

重新啟動 samba - sudo service smbd restart and sudo service nmbd restart

window 又連不上 samba 了... 莫非是 Ubuntu 14.04 的問題
重開機
還是不行

算了

jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615$ ls
addrconf.c    config.h            dhcp6c_script.c      if.c
addrconf.h    config.log          dhcp6ctl.8           install-sh
auth.c        config.status       dhcp6_ctl.c          lease.c
auth.h        configure.in        dhcp6_ctlclient.c    lease.h
base64.c      control.h           dhcp6_ctl.h          Makefile.in
base64.h      COPYRIGHT           dhcp6.h              Make.pro
cfparse.y     dhcp6c.8            dhcp6relay.8         missing
cftoken.l     dhcp6c.c            dhcp6relay.c         prefixconf.c
CHANGES       dhcp6c.conf.5       dhcp6relay_script.c  prefixconf.h
common.c      dhcp6c.conf.sample  dhcp6s.8             README
common.h      dhcp6c.h            dhcp6s.c             timer.c
config.c      dhcp6c_ia.c         dhcp6s.conf.5        timer.h
config.cache  dhcp6c_ia.h         dhcp6s.conf.sample
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615$ svn up
Updating '.':
Restored 'configure'
At revision 158.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615$ ls
addrconf.c    config.h            dhcp6c_ia.h          dhcp6s.conf.sample
addrconf.h    config.log          dhcp6c_script.c      if.c
auth.c        config.status       dhcp6ctl.8           install-sh
auth.h        configure           dhcp6_ctl.c          lease.c
base64.c      configure.in        dhcp6_ctlclient.c    lease.h
base64.h      control.h           dhcp6_ctl.h          Makefile.in
cfparse.y     COPYRIGHT           dhcp6.h              Make.pro
cftoken.l     dhcp6c.8            dhcp6relay.8         missing
CHANGES       dhcp6c.c            dhcp6relay.c         prefixconf.c
common.c      dhcp6c.conf.5       dhcp6relay_script.c  prefixconf.h
common.h      dhcp6c.conf.sample  dhcp6s.8             README
config.c      dhcp6c.h            dhcp6s.c             timer.c
config.cache  dhcp6c_ia.c         dhcp6s.conf.5        timer.h
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615$ 

M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615 目錄下使用 svn up 就把 configure 載下來了

繼續 build image 吧

...
| make -C switch
| make[4]: Entering directory `/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc/icos/icoslib/switch'
| arm-poky-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/sysroots/imx6ulevk -fPIC -std=gnu99 -Wall -I/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc/icos/include -I/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/sysroots/imx6ulevk/usr/include -I/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/sysroots/i686-linux/usr/include  -O2 -pipe -g -feliminate-unused-debug-types   -c -o switchcfg.o switchcfg.c
| switchcfg.c: In function 'ApplySwitchSetting':
| switchcfg.c:191:19: error: 'mediaMode' undeclared (first use in this function)
|            switch (mediaMode[ pCfg->mediaMode[ii] ]){
|                    ^
| switchcfg.c:191:19: note: each undeclared identifier is reported only once for each function it appears in
| switchcfg.c:163:22: warning: unused variable 'fd' [-Wunused-variable]
|    int            ii, fd, res;
|                       ^
| switchcfg.c: In function 'GetSwitchStatus':
| switchcfg.c:289:35: warning: passing argument 3 of 'GetEthSpeedDuplex' from incompatible pointer type
|      GetEthSpeedDuplex(ii, &speed, &duplex);
|                                    ^
| In file included from switchcfg.c:11:0:
| eth_io.h:22:12: note: expected 'unsigned char *' but argument is of type 'unsigned int *'
|  extern int GetEthSpeedDuplex(int if_n, unsigned int *speed, unsigned char *duplex);
|             ^
| make[4]: *** [switchcfg.o] Error 1
| make[4]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc/icos/icoslib/switch'
| make[3]: *** [switch] Error 2
| make[3]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc/icos/icoslib'
| make[2]: *** [default] Error 2
| make[2]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc/icos'
| make[1]: *** [icos] Error 2
| make[1]: Leaving directory `/home/jeffrey/M300/fsl-release-bsp/proscend/prosrc'
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/prosrc/0.1-r0/temp/log.do_compile.2957)
ERROR: Task 472 (/home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1095 tasks of which 1037 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/jeffrey/M300/fsl-release-bsp/sources/meta-proscend/recipes-proscend/prosrc/prosrc_0.1.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ 

這個錯誤應該就是人為的了
再告知 M300 組員之前
再來試一下 Ubuntu 15.10 的 samba 行不行

1315

ariel 把她的 M300 demoboard 先拿給我說讓我先看一下 web 的部分

禮拜五再作討論

我告知 icos 的 switch module build 的時候有問題
jammy 說昨晚有上 code

然後換 lte module build 不過
jammy 告知從 proscend 目錄 make menuconfig 先把 LTE module 取消勾選

build 過了

1320

VirtualBox 設定

  • name - m300_ubuntu_15
  • 存放裝置 - 動態配置的存放裝置 - D:\m300\VirtualBox\m300_ubuntu_15.vdi
  • username - jeffrey
  • password - proscend

安裝 samba - sudo apt install samba

Samba 設定 - /etc/samba/smb.conf

...
[m300_develop]
path = /home/jeffrey
writable = yes
guest account = root
force user = root
public = yes
force group = root
create mask = 0660
browseable = yes

重新啟動 samba - sudo service smbd restart and sudo service nmbd restart

samba 運作正常... shit! Ubuntu 14.04

checkout M300 source code 先

安裝 subversion - sudo apt install subversion checkout source code - svn checkout http://192.168.0.221/svn/M300

1355

跟 ariel 聊了一下
ariel 表示 NAND Flash boot 還是比較優先
不過請我看一下要怎樣把 web module 帶起來

目前看到的開機訊息

evel: 5
Running local boot scripts (/etc/rc.local)### module <system> init
### module <switch> init
### module <dns6> init
### module <web> init
 Error: Module web cfg init failure
...
### module <dhcp6c> init
Lan MAC , IP 0.0.0.0/0.0.0.0
Wan MAC , Bridge modes
Default Gateway 0.0.0.0
.

Freescale i.MX Release Distro 3.14.52-1.1.1 M300 /dev/ttymxc0

M300 login: root
Password:

可以發現 Error: Module web cfg init failure

至於是怎樣的 error 就要去看 code 了

1400

當然是希望 samba 起來後直接在 window 用 source insight trace code 才會快

m300_ubuntu_15 還在努力 checkout 當中

checkout 完畢

安裝 host packages

  • Essential Yocto Project host packages are:
    $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
    build-essential chrpath socat libsdl1.2-dev
  • i.MX layers host packages
    $ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
    docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
    libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
  • i.MX layers host packages for a Ubuntu 14.04 host setup only are:
    $ sudo apt-get install u-boot-tools
  • Ncurses libraries - make menuconfig 需要
    $ sudo apt install libncurses5-dev

build image

  • source proenv.sh
  • source bimage.sh

雖然看到 Ubuntu-15.10 has not been validated with this version of the build system

jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small$ source bimage.sh WARNING: Host distribution "Ubuntu-15.10" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.

還是抱著希望吧...

目前還沒看到昨天在 Ubuntu 16 上出現的錯誤訊息
搞不好是我 Ubuntu 16 配的 RAM 只有 1 GB 的關係

祈禱吧

1620

剛剛和 morris 還有 charlie 進了大會議室作 alarm sensor 的實驗

這次的 MIC 真的靈敏許多
不過我們對聲音的特性了解越多
就覺得要偵測出什麼是警報聲實在沒那麼簡單

像目前每秒抓 100 次再取平均來當作是聲音的大小聲就不夠作為偵測警報聲的依據

一坨波型過去假設我取樣的十次
大概有一半我抓到都是 0
一平均就更低了

得再思考更好的判斷方式

1630

M300 還再 build... 是好消息

1705

解決一定會遇到的兩個問題

  • `M300/fsl-release-bsp/proscend' 要先 make menuconfig
    • 順便取消勾選 LTE module
  • 缺少 M300/fsl-release-bsp/proscend/opensrc/wide-dhcpv6-20080615/configure

繼續 build image...

1720

出現錯誤訊息, 因該跟我們 proscend 自己有關

安裝 host packages - sudo apt install build-essential libssl-dev libboost-all-dev libdb++-dev git openssl

1725

build 過了

目前已經可以在 window 上使用 Source Insight 來 trace Ubuntu 上的 source code

1830

M300\fsl-release-bsp\proscend\prosrc\icos\icoslib\web\webcfg.c

static int InitWeb(char *pCfgStr) {
    ...
    /* initialized iptables for mgmt */
    system("mgmt_init_iptables 2>/dev/null");
    ...
}

InitWeb() 的 system("mgmt_init_iptables 2>/dev/null"); 需要在 shell 可以找到 mgmt_init_iptables 這個 command

不過 M300 的 shell 下找不到該 command

root@M300:~# mgmt_init_iptables
-sh: mgmt_init_iptables: command not found
root@M300:~#

明天繼續

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