Categories
Eclipse IoT Java

Eclipse IoT at JavaOne 2015

If you are attending JavaOne this week, I want to make sure you don’t miss out on the many opportunities to learn more about Eclipse IoT, and meet the people behind it.

Eclipse Foundation booth

You can find us at the Eclipse Foundation booth (#5710). There will be several IoT demos all week long, so it’s probably your best chance to learn about Eclipse IoT and meet the people behind our projects. There will also be an exciting announcement at the beginning of the week so you may want to drop by to learn more! 🙂

Tutorials

We’ll start the week with a CoAP tutorial that should be pretty fun, and an opportunity for you to learn more about this interesting IoT protocol.

  • Connecting Everything with CoAP [TUT5637] – Benjamin Cabé, Eclipse Foundation
    Monday, Oct 26, 8:30 a.m. | Hilton—Continental Ballroom 7/8/9

Conference sessions

There are lots of Eclipse IoT related talks this year, so please make sure your agenda is up-to-date if you want to learn more about Kura, SmartHome, MQTT, and much more…

  • End-to-End IoT Solutions with Java and Eclipse IoT Technology [CON5624] – Benjamin Cabé, Eclipse Foundation
    Monday, Oct 26, 2:30 p.m. | Hilton—Continental Ballroom 6
  • Taming the Nashorn to Rule the Smart Home [CON5375] – Kai Kreuzer, Deutsche Telekom
    Monday, Oct 26, 12:30 p.m. | Hilton—Continental Ballroom 7/8/9
  • Security for Java-Based IoT Gateways [CON5364] – Marco Carrer & Luca Dazi, Eurotech
    Tuesday, Oct 27, 12:30 p.m. | Hilton—Continental Ballroom 6
  • Plugging Configurability into Your IoT Application Gateway [CON4441] – Marco Carrer, Eurotech & Frank Alexander Kramer, bitreactive
    Tuesday, Oct 27, 2:30 p.m. | Hilton—Continental Ballroom 6
  • Visualize Your IoT in the Cloud (with Flying Drones) [CON2087] – Ville Ingman, Vaadin
    Tuesday, Oct 27, 4:00 p.m. | Hilton—Continental Ballroom 7/8/9

I hope to see many of you at the conference, please ping me if you want to have a chat!

Categories
Eclipse IoT

Tutorial: Connecting Eclipse Kura to AWS IoT

Just a few weeks ago, Amazon Web Services (AWS) announced that they added the ability for their customers to manage IoT solutions. More specifically, they are offering a managed IoT platform that allows to connect your devices using HTTP or MQTT, and that integrates with other AWS services to simplify things like message processing, persistence in S3 or DynamoDB, … you name it! And of course, this is meant to scale to billions of devices, although I have to admit I have not tested that just yet 🙂

In this article, I will show you how you can connect your Eclipse Kura gateway to AWS IoT. Since the authorization and overall security mechanisms in AWS IoT heavily rely on certificates, the only tricky bit will be for us to properly configure the Kura gateway so as it establishes a trusted connection to the AWS backend.

Categories
Eclipse IoT

How to run your web server and MQTT WebSockets broker on the same port

I was just asked how one can deploy a similar setup as the iot.eclipse.org MQTT sandbox, where MQTT over WebSockets is available on port 80, just like the rest of the website.

There are actually two ways of achieving this.

Mosquitto as the main frontend

It’s a little-known fact but together with built-in WebSockets support (added in version 1.4), Mosquitto also can act as basic HTTP server, and directly serve a bunch of static resources for you. The config option you’re looking for is “http_dir“, that will allow you to serve the content of a directory over HTTP.

Granted you are running a version of Mosquitto that has WebSockets support, here how your mosquitto.conf file should look like to enable WebSockets *and* regular HTTP connections:

listener 80
protocol websockets
http_dir /home/johndoe/htdocs

Of course, you will need to make sure that you do not have any other daemons (like Apache, nginx, …) already running and using port 80 🙂

Once Mosquitto is setup this way, you can use any MQTT client that supports WebSockets to connect to ws://yourhost URI.

[info]ws://yourhost/ws, or ws://yourhost:80/foobar would work just fine too – Mosquitto doesn’t care about the path at all![/info]

Apache front-end + mod_websocket_mosquitto

Since it’s likely you actually want a “real” HTTP server to serve your website (for security reasons, for being able to run PHP, etc.), another approach is to use Apache as the main HTTP front-end, as you would normally do, and configure it to tunnel WebSockets connections made on a given URI to your Mosquitto broker.

You can download an Apache module that does exactly that at https://github.com/willem4ever/mod_websocket_mosquitto. The instructions to compile and install it are pretty straightforward and you will end up with something like the following in your Apache configuration:

<IfModule mod_websocket.c>
Loadmodule mod_websocket_mosquitto /usr/lib/apache2/modules/mod_websocket_mosquitto.so
 <Location /mosquitto>
 MosBroker localhost
 MosPort 1883
 SetHandler websocket-handler
 WebSocketHandler /usr/lib/apache2/modules/mod_websocket_mosquitto.so mosquitto_init
 </Location>
</IfModule>