Arduino Function: Ciao XMPP Connector


Ciao is designed to be easily configurable and modular: it aims to make MCU "talk" with most common communication protocol, such as XMPP.

Ciao provides a connector to communicate with XMPP. It can be used by setting up few parameters on LininoOS side and few lines on a Arduino sketch.

Here the steps to follow to let MCU communicate over XMPP:

  1. setup XMPP connector
  2. enable the connector
  3. write a simple sketch
  4. upload the sketch and enjoy

Setup connector

Before using Ciao XMPP connector you have to configure it properly, this can be done by editing its configuration file.

You can find XMPP conf at the following path: /usr/lib/python2.7/ciao/connectors/xmpp/xmpp.json.conf

"name" : "xmpp",
"description" : "XMPP connector for the Ciao Core",
"version" : "0.0.1",
"ciao": {
"host" : "",
"port" : 8900
"params" : {
"domain" : "ACCOUNT_DOMAIN",
"port" : 5222,
"username" : "USERNAME",
"password" : "PASSWORD",
"tls" : false,
"ssl" : false

The parameters at the beginning are for internal use, do NOT edit them (name, description, version, ciao) unless you know exactly what you are doing.

The configurable part is the one identified by "params" key:

  • host (required): the IP or the hostname of the XMPP server you want to use (must be a string)
  • domain: specifies the domain for the user you want the board to use, really useful if you are using an XMPP server that support multiple domains (must be a string)
  • port (required): specifies the port your XMPP server is listening to (must be an integer)
  • username and password (both required): provide username - without domain - to use on the board and its password (must be string)
  • tls: establishes if TLS must be used (boolean)
  • ssl: establishes if SSL must be used (boolean)

Enable connector

Each Ciao connector must have a configuration file for the Ciao Core, this simple file is mandatory to enable the connector.

To enable XMPP connector please edit the file at the following path: /usr/lib/python2.7/ciao/conf/xmpp.ciao.json.conf

"name" : "xmpp",
"enabled": true,
"type" : "managed",
The key enabled must be set to true (boolean value).

This is the only parameter you are required to edit in order to enable the XMPP connector. Once done your LininoOS will be ready and configured to use Ciao Core and XMPP connector.

Let's write a simple Arduino sketch to use it.


Arduino Ciao example

This sketch uses ciao xmpp connector. It sends back “hello world” message to the xmpp client when receives “ciao” from it.

Be sure to set the xmpp client in the "USER" field used to receive the response by MCU.

Possible commands to send from the xmpp client:
* "ciao" -> random answers in 5 different languages

#include <Ciao.h>

#define LED 13
String USER="user@domain";;

void setup() {

void loop() {

CiaoData data ="xmpp");

if(!data.isEmpty() && !data.isError()){

String id = data.get(0);
String sender = data.get(1);
String message = data.get(2);


if(message == "ciao" )
Ciao.write("xmpp", USER,"Hello, i'm Arduino :-) ");
else if ( message == "led on"){
Ciao.writeResponse("xmpp", id,"LED ON");
else if ( message == "led off"){
Ciao.writeResponse("xmpp", id,"LED OFF");
Ciao.write("xmpp", USER,"Sorry i don't understand :-( ");

Written by