2017年5月15日 星期一

iBeacon: 用RSSI 如何推算距離?



Beacon 相對距離

而到底多近的距離才算近,這是所有Beacon應用開發者須要考慮的問題。實際上,這須要根據實際情況決定。對一些應用來說,只要有一兩個Beacon(多個Beacon即可定義區域)的信號,就可以觸發動作,例如針對走進商場或店鋪的顧客、機場裡走近值機櫃檯的旅客等。而對於某些應用,可能需要使用者十分靠近特定的Beacon時,才會提示用戶。比如占地較小、陳列物密集的博物館或美術館的導覽系統,就需要在參觀者十分靠近特定的展品時才會提示相應的展品資訊。
通過Beacon可以推算用戶的相對距離。因為廣告資料包中包含距離與信號強度的對照資料,比如距離為一公尺時,信號強度是多少,因此使用者們就可以通過接收器,如手機,從測量到的信號強度推算出相對應的距離。距離是推算的,而非精確計算的結果。
對於商場的Beacon應用,根據店鋪ID規劃Beacon ID會更合適,這樣APP就能夠判斷出用戶是走進左邊或是右邊的商家。

iBeacon Payload中的TX power (Measured Power

Measured Power
Measured Power is a factory-calibrated, read-only constant which indicates what's the expected RSSI at a distance of 1 meter to the beacon. Combined with RSSI, it allows you to estimate the distance between the device and the beacon.
發送Beacon的裝置要設定其內部的TX Power功率, 該設為多少呢? 以ibeacon協定而言, TX Power要設定成: 預期接收端(如手機)距離我1公尺時, 所得到RSS值(dbm) 如-59 dbm. 然後配合接收端實際的RSSI 值, 便可以估算出接收端到Beacon裝置之間的距離。

RSSI 如何計算距離?

Reference:

  1. 通訊名詞-RSSI、SNR、dbm
  2. https://community.estimote.com/hc/en-us/articles/201636913-What-are-Broadcasting-Power-RSSI-and-other-characteristics-of-a-beacon-s-signal-




2017年5月13日 星期六

LinkIt Smart 7688 Duo 試玩



預設為AP Mode: 連接後它LinkIt_Smart_7688_1B2934
1B2934為MAC Address, 每個機器不同

PC連接上後, 可以連線到http://192.168.100.1 進入控制頁面
進行Firmware Upgrade 到V0.93 (此為當下最新版)

預設帳密為root/arduino

也可以用SSH登入LinkIt_Smart_7688
root/arduino



IOT








Get Started with the 7688 Duo Board


· Install Arduino IDE 1.6.4 or later.


· For Arduino IDE to recognize the LinkIt Smart 7688 Duo development board, you need to install a board support package







http://download.labs.mediatek.com/package_mtk_linkit_smart_7688_index.json






// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(200);                       // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second
}



  • https://labs.mediatek.com/site/global/developer_tools/mediatek_linkit_smart_7688/get_started/7688_duo/arduino/
References

https://labs.mediatek.com/site/global/developer_tools/mediatek_linkit_smart_7688/get_started/7688_duo/arduino/


參考資料


  1. MediaTek Labs  Dev Tools & Resources  


2017年5月11日 星期四

VM 虛擬化概念(一)



只有一顆 CPU,同時執行多個作業系統, 而讓每一個作業系統以為他使用到全部CPU資源,然而這是 CPU 虛擬化得來的結果。(類似Multi-thread, 每個thread以為自己是CPU唯一的使用者,然而這是OS 進行排程scheduling的結果 ,使得每一個 thread 感覺同時執行中)\

實現VM的軟體稱之VMM (Virtual Machine Monitor),它伴演一個Virtual Machine Manager 的角色。它是虛擬化技術的實踐者,對Guest OS 作出一個抽象化(虛擬化)的架構,使得Guest OS 看不到真正的硬體,只看得到VMM,而把CPU、Memory、I/O全部抽象化。


虛擬化CPU:

  • 讓每一個Guest OS 以為只有一個CPU, 並且完全擁有系統所有資源。 這須要存在一個Virtual Machine Monitor (Hypervisor) 來實現,讓 Guest OS 跑Hypervisor上。所有 Guest OS 產生的Exception 都送到Hypervisor上來處理。