[Cloud] Read file with device explorer



  • Hi there,

    is it possible to read an image through the device explorer?

    I'm able to read small text files without a glitch. I've set base64 to true in the Command Editor and I get:

    {"message": "Endpoint request timed out"}

    Is there a size limit?
    Edit: it seems to work with files smaller than ~50kB

    Thanks in advance.


  • administrators

    @Christoph-Zembrowski
    I've actually never tried before!

    So I transferred a 38kB png image to my Omega:

    root@Omega-1302:~# ll -h /tmp/img.png 
    -rw-r--r--    1 501      20         37.5K Apr  9 01:48 /tmp/img.png
    

    I used the file read command in the Device Explorer and it gave me:

    {
        "data": "�PNG\r\n\u001a\n"
    }
    

    However, when I set base64 to true, the response was around 50,000 ascii characters.
    I assume that the characters correspond to the image data, I'm sure there are tools available that will allow you to rebuild the image from this ascii data.

    One question though, are you looking to read this image or upload it to a different place?



  • @Lazar-Demin
    I would like to read a saved webcam image (JPEG or PNG) from the Omega using a curl command. I would decode the base64 data into an image file after retrieving it. I would love to be able to trigger a new picture and then directly download it from a remote location.

    Do you know any better way?

    P.S.: For uploading a picture from the Omega to a remote location I'm using a simple shell script.


  • administrators

    @zembrowski You can probably have a script to trigger a new photo and use file exec to run the script. I think the method you outlined above will work, can't really think of a better way :)


Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.