The RAUC hawkBit client is a simple python-based library and demo application that runs on your target and operates as an interface between the RAUC D-Bus API and the hawkBit DDI API.
Important: This project is not intended for production use. Consider using rauc-hawkbit-updater instead.
Despite the rauc-hawkbit client is primarily meant to be used as a library, it also provides a simple example application that allows you to instantly start with a small configuration file.
To quickly build and start a hawkBit server, follow this instruction.
Then setup your configuration file:
[client]
hawkbit_server = 127.0.0.1:8080
ssl = false
tenant_id = DEFAULT
target_name = test-target
auth_token = bhVahL1Il1shie2aj2poojeChee6ahShu
mac_address = 12:34:56:78:9A:BC
bundle_download_location = /tmp/bundle.raucb
Finally start the client application:
./rauc-hawkbit-client -c config.cfg
Work on the RAUC hawkBit client started at Pengutronix in the middle of 2016 as part of a customer's project and for demonstration purposes. In May 2017 the decision was made to restructure and clean up the code and publish it as Open Source software.
The RaucDBUSDDIClient
class from the rauc_hawkbit
module allows you to
simply setup an interface between RAUC and hawkBit.
from rauc_hawkbit.rauc_dbus_ddi_client import RaucDBUSDDIClient
...
async with aiohttp.ClientSession() as session:
client = RaucDBUSDDIClient(session, HOST, SSL, TENANT_ID, TARGET_NAME,
AUTH_TOKEN, ATTRIBUTES, BUNDLE_DL_LOCATION,
result_callback, step_callback)
await client.start_polling()
If you only want use the hawkBit interface from your python project, you can use the DDIClient class.
from rauc_hawkbit.ddi.client import DDIClient
...
ddi = DDIClient(session, host, ssl, auth_token, tenant_id, target_name)
base = await self.ddi()
if '_links' in base:
if 'configData' in base['_links']:
await self.identify(base)
When setting the log level to 'debug' the RAUC hawkBit client will print API
URLs and JSON payload sent and received. This can be done either by setting
log_level
from the config file
[client]
...
log_level = debug
or by providing the -d
(--debug
) switch when calling the client.
./rauc-hawkbit-client -d