span8
span4
littleBitsis a company that has made a
"platform of easy-to-use electronic building blocks empowering everyone to create inventions,large and small".
One of the electronic building blocks is a ‘cloud bit',which enables the device to communicate with the web.littleBits is an Internet of Things device,enabling people to connect and control everyday devices through the web,using the利特尔比特API.这些日常的“比特”是发光二极管,mp3 player with speakers or an AC switch.
要将LittleBits用于FME,您需要一些LittleBits,a cloudBit and a Device ID and Access Token available from网址:http://control.littlebitscloud.cc/
For instructions on using FME and littleBits,follow theFME和LittleBits教程.
使用httpcaller,您可以使用API连接到您的littlebit。However to make things easier,there is alittleBitsConnectortransformer available on FME Hub.This is acustom transformer.
The littleBitsConnector lets you:
Totrigger an eventon the littleBits,such as turning on an LED or a motor,run a workspace with the littleBitsConnector action set to 'writeToDevice' and specify the output duration and output percent.With an LED,this would control how long it is lit for and the brightness.
Toreceive a notificationfrom littleBits you give it a URL endpoint (webhook) that can receive a JSON message with details about the event that triggered the notification.在FME服务器上,the URL endpoint could be a Topic POST URL.然后,您可以在FME服务器Web UI中监视此主题,并查看从cloudbit实时到达的通知:
littleBits work like any other circuit,where input modules need to come first to affect output modules later in the circuit.
By connecting inputs before the cloudBit,this allows the cloudBit to let any subscribed services know about any event that happens.
In this circuit,声音比特与云比特相连。When triggered,声音“振幅”值发送到任何注册的URL端点。
In this circuit the output is an MP3 Player and a speaker.When a system posts to the cloudBit this will trigger the output bits in the circuit,在这种情况下,通过扬声器播放MP3播放器中的歌曲。
您还可以将输入和输出结合起来。在这种情况下,every button press would send a notification to any registered URL endpoints.任何对cloudbit的POST请求都会打开LED。
The interaction between FME and littleBits is done using the HTTPCaller.This enables FME to make requests to the littleBits API.
The HTTPCaller is used to make HTTP requests to a specified request URL.The HTTP Method,Headers and Body are determined using the API documentation.The shell examples athttp://developers.littlebitscloud.cc/提供一种简单的方法来确定需求。
They are in this format,可以很容易地转换为httpcaller:
curl“请求URL”
-X Method
-H "Header: header value"
-d "Body"
Posting to the littleBits cloudBit
FME Server as a WebHook for littleBits
Publish a littleBits workspace as an FME Server Workspace Subscription
Streaming features from PostGIS to FME using WebSockets
Streaming features from PostGIS to Amazon SQS - Process in FME
HTTP POST Requests to FME Server from Node.js
© 2019 亚搏在线Safe Software Inc |Legal