Receiving Images From Raspberry

Hi again friends, this is my problem. I'm trying to send an image from raspberry pi to MIT app. I converted the image to base 64 from raspberry and I've been able to send that to firebase.

The problem now is when i open the app and i recieve it from firebase, i don't know why it crashes and don't show anything. Can anyone help me?

I'm trying to put the image on the app and make it change everytime raspberry sends a new image(and obviously firebase is gonna change and resend new coding). Sorry for my bad blocks, i'm new doing this.

*The second block is to send something to firebase.
*The third is suppose to get from firebase, save an image and show it to the screen.
*I noticed the coding is too long to and make the app crashes

Are you setting the filescope to Legacy ?

You appear to be trying to save to /mnt/sdcard/.. which will not work otherwise.

Why not save to your app's ASD, then all becomes simple.

i fixed that, but the app still closes. I think it's something about the recieving, the app can't recieve all the code packet. and i don't know how to show it.

What file size is the original image, and what resolution ? Is this important ?


I've tried with a small image, and the coding that i got on firebase from raspberry works when i convert it online.But i don't know what's the matter recieving it to mit app inventor :frowning:

Testing in companion, this works OK, with a 500kb image.

Takes an image from the assets, converts to base64, saves to firebase, gets from firebase, converts to file in the ASD.

it's so bad for me, the problem still continues with recieving the coding. It makes the app close. :(, i will try to prove in another device

You may need to url encode the base64String before you send it to Firebase ?

Show your current blocks

This is my code from Raspberry, it works fine:
1

When i run this, i get this on Firebase:

And this is what i've modify on Mit
1

and it still closes, i proved it on two mobile phones and happens the same.

To find out more about the runtime error, use logcat...

Taifun

Have you tested the base64 string?

Set it as a data uri in your browser:

data:image/png;base64,/94AAQSkZ.....

Do you get your image ?

Sorry, i don't know where to set up that. Can you tell me where?

Should have asked this earlier, are you using Android or iOS companion for testing ?

Android, mine is version 9

Have you been able to test your base64 string in a browser?

Yes, i told you before. In an online converter, It does correctly

Really not sure what is happening.

Could you share your aia project (you can use Private Message if you prefer) so that I can test ?

Base64_Simple (2).aia (488.0 KB)

This is my file, it closes because on firebase is base64 pic uploaded, if i change for any other value the app doesn't close.

Thanks i will test it out :slight_smile: