Camel GPS BU353 component

Deprecated: BU353 component is deprecated and will be removed soon on the behalf of the GPSD component.

BU353 is one of the most popular and cheapest GPS units on the market. It is connected to the device via the USB port. If you are looking for good and cheap GPS receiver for your IoT solution, definitely consider purchasing this unit.

Camel GPS BU353 component can be used to read current GPS information from that device. With Camel GPS BU353 you can just connect the receiver to your computer's USB port and read the GPS data - the component will make sure that GPS daemon is up, running and switched to the NMEA mode. The component also takes care of parsing the NMEA data read from the serial port, so you can enjoy the io.rhiot.component.gps.bu353.ClientGpsCoordinates instances received by your Camel routes.

Maven dependency

Maven users should add the following dependency to their POM file:

io.rhiotcamel-gps-bu353${rhiot.version}

Avaliable for rhiot.version >= 0.1.2

URI format

BU353 component supports only consumer endpoints. The BU353 consumer is the polling one, i.e. it periodically asks the GPS device for the current coordinates. The Camel endpoint URI format for the BU353 consumer is as follows:

gps-bu353:label

Where label can be replaced with any text label:

from("gps-bu353:current-position").
  convertBodyTo(String.class).
  to("file:///var/gps-coordinates");

BU353 consumer receives the io.rhiot.component.gps.bu353.ClientGpsCoordinates instances:

ClientGpsCoordinates currentPosition = consumerTemplate.receiveBody("gps-bu353:current-position", ClientGpsCoordinates.class);

ClientGpsCoordinates class name is prefixed with the Client to indicate that these coordinates have been created on the device, not on the server side of the IoT solution.

Options

Option

Default value

Description

consumer.initialDelay

1000

Milliseconds before the polling starts.

consumer.delay

5000

Delay between each GPS scan.

consumer.useFixedDelay

false

Set to true to use a fixed delay between polls, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details.

coordinatesSource

new SerialGpsCoordinatesSource()

reference to theio.rhiot.component.gps.bu353.GpsCoordinatesSource instance used to read the current GPS coordinates.

Process manager

Process manager is used by the BU353 component to execute Linux commands responsible for starting GPSD daemon or configuring the GPS receive to provide GPS coordinates in the NMEA mode. If for some reason you would like to change the default implementation of the process manager used by Camel (i.e. io.rhiot.utils.process.DefaultProcessManager), you can set it on the component level:

GpsBu353Component bu353 = new GpsBu353Component();
bu353.setProcessManager(new CustomProcessManager());
camelContext.addComponent("gps-bu353", bu353);

If custom process manager is not set on the component, Camel will try to find the manager instance in the registry. So for example for Spring application, you can just configure the manager as the bean:

@Bean
ProcessManager myProcessManager() {
    new CustomProcessManager();
}

Custom process manager may be useful if your Linux distribution requires executing some unusual commands in order to make the GPSD up and running.

BU353 type converters

BU353 component comes with the two type converters:

  • String => io.rhiot.component.gps.bu353.ClientGpsCoordinates

  • io.rhiot.component.gps.bu353.ClientGpsCoordinates => String

Last updated