MCU單晶片韌體設計

2016年11月18日 星期五

LPWAN 長距離低功耗通信技術 : NB-IoT vs LoRa



IoT 遠距離通信技術 : NB-IoT、LoRa均為 LPWAN (Low Power Wide Area Network), 主要應用都在智慧城市、智慧交通(如停車場)管理,智能電錶、水錶抄表、智能農業等低數據量的採集。
WiFi和BTLE主要應用於個人設備相關的應用。蜂窩技術主要應用於需要高數據吞吐量,以及需要供電的應用場景。LPWAN的應用場景包括:長電池壽命,並且傳感器和應用在長距離下,只需要每小時只要傳遞幾次數據。

「NB-IOT LTE-M」的圖片搜尋結果

IOT

NB-IoT
LoRa



聯盟
3GPP 20166月標準提出

20138月,Semtech公司發表一顆Lora 晶片
LoRa Alliance (20153) IBM主導
技術特點
蜂巢
同步協議 (節點必須定期地連到基地台)
線性展頻
非同步協議
網路佈署
運用原本的4G/LTE基地台(升級現有)
獨立建構自家的LoRa網路, 節點構通都必須同屬LoRa網路 (不同於Internet門派)
頻段
電信營運商頻段
1GHz以下的授權頻段, 建置成本高
150MHz~1GHz的非授權頻段, 建置成本低
傳輸距離

1~20Km
速率
<100kbps
<50kbps
連接數量
200k/cell
200k~300k/hub
終端電池工作時間
10
10
模組成本
$5~$10
$5

電信營運商
可由企業自行搭建




IOT

References:

  1. The Fundamentals Of Short-Range Wireless Technology
  2. WiMedia Beaconing Protocol Test Considerations
  3. https://read01.com/5xzLQE.html



2016年11月16日 星期三

ARM mbed 系統架構(1)



 ARM mbed 系統架構, 基本類似於OIC/OCF的參考實作 ,任何sensor或硬體都是以抽象的資源來定義(也就是OIC的Resource Oriented Architecture 的實作架構, 遠端存取這些資源則使用Restful API (採OMA LWM2M的Resource path) 方式, 存取不同的硬體資源, 就是給不同的資源路徑.

物聯網目前協定就是要走IP-Based , 所以基本上不論底層協定是什麼, 如短距離 Bluetooth、Wi-Fi、 Zigbee、 Thread, 或長距離 Cellular 3G/LTE 最終都必須是IP或透過 6LoWPAN介接成IP (IPv4或IPv6).

在應用層協定使用

MQTT、HTTP--> TCP--> TLS (如須加密)
CoAP-->UDP--> DTLS  (如須加密)

其資源描述使用OMA LWM2M的架構, 對資源存取的行為包含CRUDN

C: create
R: read   --> GET
U:update--> PUT
D:delete
N:notify
「arm mbed architecture」的圖片搜尋結果
mbed device (mbed os)


「arm mbed architecture」的圖片搜尋結果
mbed connector service


https://goo.gl/wzIHdR

物聯網規格標準四大陣營



The challenge for the IoT ecosystem is to ensure these emerging IoT devices can connect securely and reliably to the Internet and to each other.

陣營的目的在推動IoT裝置互連標準, 統合晶片、軟體、平台、成品, 制定相容性的標準
AllSeen與OIC均在訂立一個互通性的框架,遵循此框架可讓應用程式、作業系統、通訊技術與協定、硬體裝置等各層次互通,避免不相容的問題及重複開發的浪費等。

Thread Gourp
  • Nest(Goolge)、ARM、Freescale、Silicon Lab
  • 主推智慧家庭
  • Thread比較類似家用物聯網需求的升級版ZigBee
  • 支持IPv6(IPv6 over Wireless Personal Area Network, 6LoWPAN)
  • 追求與ZigBee、Bluetooth一樣的省電性
    



OIC (Open Interconnect constorium)
  • 「iotivity architecture」的圖片搜尋結果
  • Intel、Samsung、Dell、Broadcom、Atmel、Wind River 等6家成立
  • .2014年7月成立,旨在定義一個通用的通訊框架,以強化物聯網(IoT)裝置及服務的連結與互連。
  • 改為OCF (Open connectivity Foundation): Cisco、Intel、Microsoft 集結了來自AllSeen的成員, 聯發科、宏碁都是陣營成員
  • OCF創始會員涵括OIC及AllSeen陣營
  • OIC定義的參考實作 : 開放原始碼專案 IoTivity (https://www.iotivity.org/)
  • IoTivity is an open source software framework enabling seamless device-to-device connectivity to address the emerging needs of the Internet of Things.
  • Resocure-orientd Architecture
  • Restful Architecture
  • Common Platform
  • CoAP for Constrained Devices、HTTP
  • Certificaton program
「oic full stack」的圖片搜尋結果

AllSeen Alliance
  • Qualcomm、Microsoft、LG、海爾、松下、夏普、HTC、D-link、Samsung
  • 2013年底成立
  • AllSeen定義的參考實作(開放原始碼專案) : Alljoyn
Homekit
  • Apple
Thread技術方面,Thread是一種新的物聯網無線網路,與Wi-Fi、Bluetooth等屬相同層次,相對的,AllSeen與OIC追求廣泛支援各種網路技術,不僅支援Wi-Fi、Bluetooth,也支援ZigBee、Z-Wave、ANT+等。

有ZigBee為何還需要Thread?


Thread技術與ZigBee技術最相近,然已有ZigBee為何還需要Thread?估在於ZigBee的支援面太廣,ZigBee在網路層就分成ZigBee/ZigBee PRO、RF4CE、ZigBee IP等三大類,在三大類之上又有10種以上的應用型態(Application Profile),雖已有偏智慧家庭層面的應用型態,如ZHA(ZigBee Home Automation)、ZLL(ZigBee Light Link)、ZRC(ZigBee Remote Control),但也要兼顧產業用、零售用等發展,家用物聯網恐難全心投入。
Thread 設定家庭使用,因此Thread只要能支援200多個裝置(節點)即可,ZigBee的多數家用情境也在255個(8-bit)裝置內,ZigBee PRO的65,536個(16-bit)裝置多屬產業應用,如極長運輸路徑的油管壓力監控,智慧電網(Smart Grid)的大面積用電情形監控等。Z-Wave同樣屬家用訴求,最多僅支援236個裝置。













參考

2016年11月13日 星期日

gnuplot



唸書時期畫的, 工程圖表就是用gnuplot

Gnuplot is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

    # Gnuplot script file for plotting data in file "force.dat"
      # This file is called   force.p
      set   autoscale                        # scale axes automatically
      unset log                              # remove any log-scaling
      unset label                            # remove any previous labels
      set xtic auto                          # set xtics automatically
      set ytic auto                          # set ytics automatically
      set title "Force Deflection Data for a Beam and a Column"
      set xlabel "Deflection (meters)"
      set ylabel "Force (kN)"
      set key 0.01,100
      set label "Yield Point" at 0.003,260
      set arrow from 0.0028,250 to 0.003,280
      set xr [0.0:0.022]
      set yr [0:325]
      plot    "force.dat" using 1:2 title 'Column' with linespoints , \
            "force.dat" using 1:3 title 'Beam' with points


===================

Gnuplot - for loop iteration 產生多個不同檔案
windows gnuplot產生 png


#set terminal postscript eps
#set output 'myfigure.eps'
#set term png
set autoscale
set title 'P-persistent Simulation (Channel=3)'  font ",28"       # plot title
set xlabel 'Probability' font ",16"                                  # x-axis label
set ylabel 'Throughput' font ",16"                         # y-axis label
#set yrange [0:1]
#set xrange [1:8]

set label 'ittraining' at 12,8
#N_CHANNEL,N_user,prob,total_T/MAX_N_Round);

do for [t=0:5] {
    set terminal pngcairo
    outfile = sprintf('test%03.0f.png',t)
    set output outfile
plot \
'C3U1.txt' using 3:4 w lp t "U=1",\
'C3U3.txt' using 3:4 w lp t "U=3",\
'C3U5.txt' using 3:4 w lp t "U=5",\
'C3U7.txt' using 3:4 w lp t "U=7",\
'C3U9.txt' using 3:4 w lp t "U=9",\
'C3U11.txt' using 3:4 w lp t "U=11",\
'C3U13.txt' using 3:4 w lp t "U=13",\
'C3U15.txt' using 3:4 w lp t "U=15",\
'C3U17.txt' using 3:4 w lp t "U=17",\
'C3U19.txt' using 3:4 w lp t "U=19"


}


References:

  1. https://sourceforge.net/projects/gnuplot/?source=typ_redirect
  2. DEMO Gnuplot http://gnuplot.sourceforge.net/demo/
  3. http://www.maths.manchester.ac.uk/~pjohnson/Gnuplot/windows_gnuplot.html