Octave device configuring using dhub CLI: inconsistency with Octave's web app

Hello All,

We have a fleet of Octave-based devices, where each device being deployed requires detailed custom configuration (e.g. changing the Modbus TCP addresses, the number of Modbus servers and other properties). The devices are pre-configured with some ‘standard’ blueprint thus, we only want to modify the above-mentioned properties per device. Therefore, changing via SSH connection to each device seems to be a good solution.
Thanks to this topic I discovered dhub CLI tool proposed for similar purpose. And it indeed works for submitting a configuration containing different IP address than the preconfigured one:
dhub push /app/modbus/config --json "some JSONifyed config"

Reading it back using dhub list /app/modbus/config returns exactly the config I programmed.
Nevertheless, Octave’s web app doesn’t reflect these changes (e.g. shows old Modbus TCP IP address) even after rebooting the device. Why is that? Can that be ignored?

I tried same sort of excercise with a virtual resource and a dummy variable (pre-initialized using the Octave web app) and I do confirm while dhub accepts new values Octave web app shows the old one. Interestingly, if I change the variable in the web app, dhub tool returns the new value.

Another little issue I wanted to address is when trying to use dhub push from json file it returns an error. For instance this call:

dhub push /app/modbus/config --file --json test_config.json

where test_config.json contents is:

{"buses":[{"ethname":"eth0","ipport":502,"name":"CCR5","ipaddr":"192.168.10.15","config":[{"slaves":[{"address":1,"name":"CCR5"}],"period":30,"groups":[{"number":14,"address":64,"name":"status","type":"HLD"}]}]},{"ethname":"eth0","ipport":502,"name":"CCR2","ipaddr":"192.168.10.12","config":[{"slaves":[{"address":1,"name":"CCR2"}],"period":30,"groups":[{"number":14,"address":64,"name":"status","type":"HLD"}]}]}]}

returns

Error failed to get file size test_config.json (LE_BAD_PARAMETER)

What could possibly be wrong here?

My system is:

  • Device: FX30
  • Firmware: 3.5.0

Thanks in advance,
Alex

Hi Alex,

I will spend some time today testing your issues. You might try to use the full file path for test_config.json Example /root/home/test_config.json.

Hi Alex,

Don’t use dhub tool to change your Octave configuration. All what you will do will not be persistent: at next device power on, the Cloud configuration (blueprint) will overwrite your local changes.

To customize the device configuration I recommend to use the Device end point see Octave REST API Documentation

And as David indicates, dhub with --file option takes an absolute path, not a relative one.

HTH,
Nicolas

@djudkins , @njoyeux thanks for swift reply!

Good to know changes made with dhub are not persistent. I tried REST API functionality and it seems I can indeed realize everything I need with it. Thanks!

By the way I tried the full path when asking dhub to load value from JSON file, it still yields an error (different though):

root@fx30:~# dhub push /app/modbus/config --file --json /home/root/test_config.json
Error failed to get file size /home/root/test_config.json (LE_FAULT)

It’s no longer important for me but maybe will be useful for someone else.
Again thanks for your help!