Camel Kura Wifi component
This component can be used both in the Kura server and in a regular gateway.
The common scenario for the mobile IoT Gateways, for example those mounted on the trucks or other vehicles, is to cache collected data locally on the device storage and synchronizing the data with the data center only when trusted WiFi access point is available near the gateway. Such trusted WiFi network could be localized near the truck fleet parking. Using this approach, less urgent data (like GPS coordinates stored for the further offline analysis) can be delivered to the data center without the additional cost related to the GPS transmission fees.
Camel Kura WiFi component can be used to retrieve the information about the WiFi access spots available within the device range. Under the hood Kura Wifi component uses Kura org.eclipse.kura.net.NetworkService
. Kura WiFi component supports both the consumer and producer endpoints.
Maven dependency
Maven users should add the following dependency to their POM file:
io.rhiotcamel-kura${rhiot.version}
Avaliable for rhiot.version >= 0.1.1
URI format
Where both networkInterface
and ssid
can be replaced with the *
wildcard matching respectively all the network interfaces and SSIDs.
For example to read all the SSID available near the device, the following route can be used:
The Kura WiFi consumer returns the list of the org.eclipse.kura.net.wifi.WifiAccessPoint
classes returned as a result of the WiFi scan:
You can also request the WiFi scanning using the producer endpoint:
Or using the producer template directly:
Options
Option | Default value | Description |
|
|
|
| 1000 | Milliseconds before the polling starts. |
| 500 | Delay between each access points scan. |
| false | Set to true to use a fixed delay between polls, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details. |
Detecting Kura NetworkService
In the first place io.rhiot.component.kura.wifi.KuraAccessPointsProvider
tries to locate org.eclipse.kura.net.NetworkService
in the Camel registry. If exactly one instance of the NetworkService
is found (this is usually the case when if you deploy the route into the Kura container), that instance will be used by the Kura component. Otherwise new instance of the org.eclipse.kura.linux.net.NetworkServiceImpl
will be created and cached by the KuraAccessPointsProvider
.
Last updated