span8
span4
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 thelittleBits API.These everyday 'bits' are LEDs,mp3 player with speakers or an AC switch.
To use littleBits with FME you will need some littleBits,a cloudBit and a Device ID and Access Token available fromhttp://control.littlebitscloud.cc/
For instructions on using FME and littleBits,follow theFME and littleBits Tutorial.
Using the HTTPCaller you can connect to your littleBit using the API.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.On FME Server,the URL endpoint could be a Topic POST URL.You can then monitor this topic in the FME Server Web UI and view the notifications arrive in real time from the 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,a soundBit is connected to the cloudBit.When triggered,a sound 'amplitude' value is sent to any registered URL endpoints.
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,in this case playing a song from the MP3 player through the speakers.
You can also combine inputs and outputs.In this case,every button press would send a notification to any registered URL endpoints.Any post requests to the cloudBit would turn on the 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/provide an easy way to determine the requirements.
They are in this format,which can easily be translated into the HTTPCaller:
Curl "requestURL"
-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
HTTP POST Requests to FME Server from Node.js
Streaming features from PostGIS to Amazon SQS - Process in FME
© 2019 亚搏在线Safe Software Inc |Legal