Installing mini gateway
In order to install Rhiot mini gateway on our Raspberry Pi with Raspbian use Rhiot cmd tool
rhiot cmd section describes how to install Rhiot cmd).
After Rhiot cmd tool is installed, connect your device to your local network
(using WiFi or the ethernet cable) and execute the following command on a laptop connected to the same network as your
From this point forward Rhiot gateway will be installed on your device as
rhiot-gateway service and started
whenever the device boots up. Under the hood, gateway deployer performs the simple port scanning in the local network
and attempts to connect to supported devices using the default SSH credentials.
Configuration of the gateway
The gateway configuration file is
/etc/default/rhiot-gateway. This file is loaded by the gateway
starting script. It means that all the configuration environment variables can be added here. For example to set the
foo_bar_baz configuration property to value
qux, the following environment variable should be added to the
Camel gateway generates heartbeats indicating that the device is alive and optionally connected to the data center.
The default heartbeat rate is 5 seconds, which means that heartbeat events will be generated every 5 second. You
can change the heartbeat rate by setting the
camellabs_iot_gateway_heartbeat_rate environment variable to the desired
number of the rate miliseconds. The snippet below demonstrates how to change the heartbeat rate to 10 seconds:
The heartbeat events are broadcasted to the Vert.x event bus address
By default Camel gateway sends the heartbeat event to the application log (at the
INFO level). Logging heartbeats are
useful when verifying that gateway is still running - you can just take a look into the application log files. The name of the logger is
and the message is
Camel IoT gateway can send the heartbeat events to the data center using the MQTT protocol. MQTT heartbeats are useful when verifying that gateway is still running and connected to the backend services deployed into the data center.
In order to enable the
MQTT-based heartbeats set the
camellabs.iot.gateway.heartbeat.mqtt environment variable to
true. Just as
demonstrated on the snippet below:
The address of the target MQTT broker can be set using the
variable, just as demonstrated on the example below:
By default MQTT heartbeat sends events to the
heartbeat topic. You can change the name of the topic using the
camellabs.iot.gateway.heartbeat.mqtt.topic environment variable. For example to send the heartbeats to the
myheartbeats queue set the
camellabs.iot.gateway.heartbeat.mqtt.topic environment variable as follows:
The heartbeat message format is
hostname is the name of the device host and
the current time converted to the Java miliseconds.
Heartbeats can blink the LED node connected to the gateway device. This is great visual indication that the gateway
software is still up and running. For activating LED heartbeat set
camellabs.iot.gateway.heartbeat.led property to
The LED output port can be set via
camellabs.iot.gateway.heartbeat.led.gpioId environment variable, Default value is 0 wiring lib pin index
Change LED output port like this:
Please add resistor (220 Ohms) between LED and Mass (0v) to avoid excessive current through it.