We are almost ready for releasing version 1.0 of the QuipuKit library for JSF. To give you a sneak peek at it, we have made it available as a Release Candidate. Download and evaluate the features that will be available in the final version of QuipuKit.
RC1 comes with numerous bug fixes, changes in API and many other improvements. For more details, see Release Notes page.
Last week during re:Invent, Amazon announced AWS IoT. If you ignore all the fluff on the product page, the service is essentially a message broker. You throw messages over MQTT to Amazon, and you can set up rules to act upon those messages, for example to store the messages in a database. In Telenor Digital we’re working quite a lot with LoRa, Semtech’s wide area network solution, and we figured it would be worth an experiment to see how we can integrate our network with AWS IoT.
First step is to make sure that authentication works. Contrary to AWS IoT predecessor ThingFabric, authentication does not happen through username/password, but rather via certificates. It might be safer, and allows you to revoke certificates easily, but not all tools support it (f.e. node-red); or just crash when trying to use certificates (hello MQTT.js). Even worse, Amazon did not get it’s sh*@ straight and is sending the wrong hostname in the certificate, causing tools like mosquitto to have to be called with the --insecure flag (which was not mentioned in the manual).
Find out the MQTT endpoint. This used to be in the UI, but they removed. Very annoying. To find it, first create a ‘Thing’, then select it and check the details tab, the host name that shows is your endpoint.
Now that we know that AWS works, we can start pumping the incoming messages on our LoRa network into AWS IoT. On our network side we use Semtech LoRaWAN Server, so if you’re using another platform, your mileage may vary. If we want to act on the data we can create a ‘customer server’, which is a program which listens on a socket that receives JSON messages whenever a device sends data over the network. This sounds like a great place of hacking our AWS middleware. To map from a LoRa device to a MQTT topic we want to use the applicationId and the deviceId, but unfortunately the applicationId is not included in the messages sent to the customer server. So if you want to go further, first apply this patch (the next major version of the server will include this patch).
Now we need to tell the Semtech server that our server needs to receive messages as well. Run loracmd (with all services running), and type (need to repeat this for every application ID you have):
AWS IoT is ‘just’ a message broker, and does not store historical data. But it also contains a rules engine, and thus we can create a rule which will store the data in a DynamoDB database. First go into the DynamoDB dashboard and create a new table with the following properties.
You might realize that timestamp is a string here, which seems weird, but unfortunately due to a bug in AWS IoT, the range key has to be of type string. Annoying.
Next, we’ll need to create a IAM role which is allowed to read / write data to this table. Go to IAM, and create a new Role.
Now go back to AWS IoT and choose to create a new role. We said before that we publish messages under lora/APPID/DEVICEID, so subscribe to all messages under lora/. We then publish to DynamoDB under APPID/DEVICEID.
Now we have all the bits and pieces in place. We use AWS IoT as our MQTT broker and DynamoDB to store our historical data. When we want to consume the data we can take any MQTT library to get events from our sensor, and we can use the AWS SDK to get historical data from DynamoDB. For an example of how to integrate everything in node.js, take a look here.
In general I think that AWS has a nice product, but setting it up is a big PITA, and when something goes wrong you’re basically in the dark, as I couldn’t manage to set up log files either. When everything runs it’s a nice experience, and a great fit for IoT developers, so let’s hope Amazon gets their onboarding experience straight.
Jan Jongboom is a Strategic Engineer for Telenor Digital, working on the Internet of Things. He’s also a Google Developer Expert for web.
Artificial Intelligence is eating the world, but how can we use this new power for good (and profit)? And should we be worried about the killer robots?
In AS3 you can simply smooth an image when resized, in Flex you can’t : this feature was not added to the component, so when the Image is resized it gets pixelated.
This is even more frustrating when you know that the component share the same low level class than the AS3 equivalent.
For your convenience i have built a SWC that you just have to put in your Flex project’s “libs” folder to get a new “SmoothImage” component.