2020年11月6日 星期五

[RPi] config setting tool

  • use RPi config tool
  • $sudo raspi-config

2020年11月4日 星期三

[Programming] void(p);

  • 今天 diff 兩個實作的程式碼, 某 function 的差異是多了一行
    void(p); 
    其中  p 是 function 參數
  • 這執行上完全沒有效果, 主要作用是避開有些 compiler 會有變數 unused 的 warning, 而 compiler 把 warning 也直接以 error 報錯時, 會 build error, 那可以用這方法避開.

2020年10月26日 星期一

[RPi] GPIO

  • Tutorial
  • tutorial slide
  • tutorial git 
  • homework
  • GPIO.setmode
  • register events callback
  • GPIO.add_event_detect(GPIO_num, event, callback, time)
  •  

    2020年10月23日 星期五

    [OpenCV G-API] Graph API

    [OpenVX] portal

    [OpenCL] Portal

    2020年10月16日 星期五

    [RPi] GPIO pin

    GPIO.setmode時搭配使用
    • GPIO.setmode(GPIO.BOARD)
      : 主要參考 pin#, Z字形編號
    • GPIO.setmode(GPIO.BCM)
      : 採 GPIO編號, e.g. GPPIO7

    2020年10月13日 星期二

    [SW] Feature development framework

    • Requirements (SRS) / Motivation
      • source (where)
        • internal
        • external
      • policy: inside-out, outside-in
      • non-feature requirements
        • performance
          • cpu usage, memory bandwidth, size, latency
          • preemption overhead
          • init, peak (when)
        • security
    • Design (HLD)
      • architecture design, cooperation model (protocol stack/SW stack)
        • HW/SW/ feature team / Project team
      • comparison with competitors
    • Maintenance
      • issue distribution / human resource estimation
    • Case study

         

    [RPi] Connection

    • Raspberry Pi (RPi) 連網路
      • Ethernet, 直接連接網路線到區網
      • WLAN, 需設定 AP (Access Point) 的 SSID/password
        • 可以編輯 /etc/wpa_supplicant/wpa_supplicant.conf  (Ethernet 連接後編輯, 或在 /boot partition下編輯)
          network={
              ssid="YOUR WIFI NETWORK NAME"
              psk="YOUR WIFI PASSWORD"
          }
        • 或可透過像 BIOS設定的 raspi-config 做設定
          sudo raspi-config 
    • 連接 RPi
      • Find RPi in LAN
      arp -na | grep -i b8:27:eb
      • Connect RPi (assume IP is found by previous script)
      ssh 192.168.1.111 -l pi
      • Connect RPi with GUI
      ssh -X 192.168.1.111 -l pi
      • Note: MaxOSX Lion 之後預設不支援 X11, 須自行安裝 Xquartz 
    • Copy files (scp)
      • // file tmp.txt on RPi home directory (192.168.1.111)
      •  scp pi@192.168.1.111:tmp.txt ./ 
    • Reference

    2020年10月12日 星期一

    [Python] 執行 executable binary

    • 透過 os package, 可以設定 environment variable 與執行的 binary
    • Sample: wrapper_call_executable
    • import sys
      import os
      
      lib_path = sys.argv[1]
      exe_path = sys.argv[2]
      bin_parameters = sys.argv[3]
      
      os.environ['LD_LIBRARY_PATH'] = lib_path
      os.system(exe_path + " " + bin_parameters)