Send / Receive binary files to/from the device using Assets -> Manager UI

Hi,

I need to send binary file to my device and also get a binary file form my device.
Is there any way to achieve this directly using OpenRemote Manager UI?
I am looking for an interface where I can upload a file on OpenRemote UI that will send that file directly to the client device. And in case of received file and option to download that file.

Thank you.
- Hatim

Hi Hatim,

At the moment we don’t have that functionality out of the box.
Maybe someone has some creative ideas? :slight_smile:

Don

Hi Don,

Thank you for your reply and confirmation that the feature is not available yet.

Current, as a quick-simple-stupid workaround, I have planned to setup another ftp server to send and receive file. The trigger point will be from the an attribute though.
The workflow here will be:
In case of upload
- the user uploads a file on that ftp server.
- the user set the relative path with filename on upload attribute of the asset.
- the client on that asset fetches the file from that path.

In case of download
- the user sets the relative path with filename on download attribute of the asset.
- the client on that asset pushes the file to that path to the ftp server.
- the user downloads the file form that ftp server.

Regards,
Hatim

1 Like

Hi,

Assets and attributes really aren’t the tool for this; but you can easily extend the manager with a custom ContainerService that can use JAX-RS to expose a REST API for receiving such files.

You could even create a camel route that consumes files from an FTP server and does whatever processing you require.

Good to see you thinking out of the box, maybe if you share the higher level problem you want to solve then we can offer suggestions.

2 Likes

Hi,

Thanks for you input and suggestions.
I wasn’t aware that attribute is not intended for that.
However, the fact is that the attributes are made so generic, that will be open to interpretation of user. And people like me, without giving much thought about it, can and will (ab)use it. :wink:

There are a few use cases I can think of here.
Assuming that the end device is a SBC (Single board computer) with a display.

Use Case 1:
The display shows images that are loaded on the device.
Now, there are scenarios when the image needs to be changed.

Use Case 2:
There are some files genered on the end device. Those files needs to be download by admin. e.g a compressed log file or a binary core dump or any custom defined binary file downloaded for troubleshooting purpose.

Use Case 3:
Now, this one may be purely abuse of the feature - but Admin wants to push custom software packages to the end device install it on the end device. Though this won’t be a usual practice to push custom software or software upgrade, in certain rare scenario where addon software needs to be installed.

Use Case 4:
There are scenarios where a whole configuration file needs to be uploaded or downloaded instead of just single configuration attribute.

There can be quite a few solution to achieve this, I would like to reuse what is available and can be setup without much development effort involved.

Let me know what’s your thoughts.

Regards,
Hatim

1 Like

I am not exactly sure what the specifics are and how big/complex the files are, but there may be a botch to this that will get some use-cases working on the OpenRemote-side, but no promises. It would probably also require some very light coding and interfacing with the OpenRemote API:

You could make an attribute called “uploadToSBC”, where you can submit the file’s base64 string. When subscribed to the asset’s state, you detect the attribute changing. And using that, you will then retrieve the attribute’s value (the base64 string), decode it, and store it. After that, change the attribute back to empty, et voilà, you’re storing files transferred over OpenRemote.

Then, you do the same thing for downloading from the SBC, where you can select how and when to upload the encoded data to the attribute, and downloading them to then decode them.

With multiple files per upload, you can change the structure of the attributes to JSON and store multiple JSON objects.

I am not sure how much more difficult this is than just creating an FTP server and sending files through that, and managing some aspect of that through FTP, but it is something I came up with that may assist you.