2016年4月27日 星期三

MQTT + LinkIt ONE

MQTT協定

參考此網址
http://www.instructables.com/id/LinkIt-One-MQTT-First-Step-to-IoT/?ALLSTEPS#step1

Step 1: Install MQTT Library in Arduino

First thing you require is to install an MQTT library. In this instructable, I will be using the PubSub client by knollery.
There is also an AWS IoT officially supported library, but i found it a little hard for the beginners to use. So I decided to use PubSub client library, which is well known in arduino circles :)
To install library
1. Goto https://github.com/knolleary/pubsubclient and download the zip file.
2. Now open your arduino IDE : Sketch -> Include Library -> Add ZIP library
3. Now browse to the downloaded ZIP file and click OK.
This will install 'PubSub' library in your arduino IDE.

Step 2: Sketch you LinkIt One

Once you installed the library, you will be able to compile the sketch I attached in this step.
This sketch read the analog pins and publishes it to network every 5 seconds.
Some important things to remember while using this sketch:
1. Change WifI settings in the sketch to match to your WiFI settings
2. Change the client name to some unique name. Otherwise you may have conflict if you are using a public broker.
3. Sketch publishes a message to "outTopic" once connected(and reconnection) and subscribe to "inTopic".
4. Analog pin readings are published on topic "analogData".
5. Change the broker settings as required. You can either use a public broker such as iot.eclipse.org:1883 or setup your own (see step 3)

Step 3: Installing a local Broker

In case you don't want to use a public broker, you can install one of the many broker softwares available to your local PC and use it. Don't forget to configure this in your sketch.
I recommend using mosquitto broker. You can go to http://mosquitto.org/ and get a binary installation for your OS.
Important things to notice are:
1. By default, MQTT brokers runs at port 1883. This is what is configured in the sketch. In case you want to change it, update the sketch also.
2. You can change these settings in mosquitto.conf file

Step 4: Installing MQTT Lens

Picture of Installing MQTT Lens
IMG_20151110_180643.jpg
Screenshot from 2015-11-08 14:45:04.png
So great!! If all the above steps went well, you would be successfully communicating with a broker by now and streaming your analog data. Now how I can view all these messages which are bouncing back and forth?? In this step, we will use MQTTLens to see all these communications.
MQTTLens is a chrome plugin. You can download it and add it to your chrome using the chrome store.
Once installed, connect to the same broker as your linkit one is connected to. Then subscribe to topics "inTopic", "outTopic", and "analogData". You can see the messages from your LinkIt One now. If you are lucky, you may be seeing some other maker's data who is trying this tutorial also. ;)
You can also publish to "inTopic" using MQTTLens. Then your linkit one will receive the message :)
With that I'm winding up this instuctable.
Happy Making,
vish


2016年4月13日 星期三

創意發想 感測器積木

第一階段 -> 使用LinkIt ONE 讓感測器模組可以經由手機 GET/POST

第二階段 -> 使用嵌入式系統製作

第三階段 -> 提高感測器難度 如示波器、電表




可能需要使用技術

MQTT

參考技術

LASS

MCS https://github.com/Mediatek-Cloud/MCS/tree/master/source_code

2016年4月6日 星期三

創意發想 車用Beacon接收器

預想可以在

車上裝置Beacon訊號接收裝置

應用於

一、高速公路上接收未來行車資訊

二、停泊的地方接收商家廣告、新聞等

三、紅燈時接收對應長度之廣告



目前的藍芽技術有速度的限制,儘可以文字傳輸

未來速度技術突破,加入影像,更有效果。