Looking for a solution to record information I get from my device with ESP32

the error appears from the moment I request the connection with bluetooth and it starts reading and writing data.

At first I did as you had indicated earlier, unless I misunderstood.


Hi Anke, thanks for your attention.

In reality I did the permission request test to see if it worked on Android 8, but the error message was the same.

When running again on Android 10 with this permission request at the top of the screen, the same error appeared and the file did not write, that is, the permission did not work in either of the two versions I tested, so I removed it from the project.

I'm kind of lost, because at the beginning I had already researched about possible problems according to the android version, I wanted to find a way that would work on any system

To

means this


this is required to get the correct permissions in the manifest...

btw. there have been several requests to set the correct permissions to make life easier for everyone, for example here AI2 Files block - shared scope file storage cannot read / write text files to media folders - #21 by Anke or here Release nb187: Copy a text file / image from assets to shared storage (→ Android 10+) - #11 by Anke and I would like to take the opportunity again to ask @ewpatton about some feedback concerning this subject...

make sure, you first grant WRITE permission and then store the file...
you might want to provide a screenshot of how you are trying to store the file, so we also can see which directory you are using... remember... it should be /Download/yourFile.txt

Taifun

1 Like

WRITE permission must be declared on ALL Android versions, even Android 11+, which of course is a bug (which I've mentioned countless times already). However, your app does not declare WRITE in the manifest at all (on any Android version). If you dragged my AllFilesPermission extension into your project (Screen1), the WRITE permission on Android < 11 would have been declared in the Manifest. Then it would have worked on all Android versions < 11.

Note: It is not necessary to request storage permissions. These are automatically requested with the file component.

There are two ways to make your aia work (on all Android versions):

  1. Do what @Taifun suggested. However, the WRITE permission is then also requested on Android 11+ (which is of course nonsense, because firstly this permission is not necessary there and secondly it is no longer available on Android 11+.

  2. Use my MFile extension. This way no storage permissions are requested on Android 11+ (as it should be). Of course, you don't have to use AllFilesPermission ext. then, since the storage permission with the MFile extension is correctly declared in the Manifest.

Note: And use the correct path: /Download/... for this Shared folder.
(not /download/...).

2 Likes

That was exactly what was missing.
I had understood it the wrong way, now it works in both versions (8 and 10).

Sorry for the lack of experience, I'm trying to learn and age doesn't help much. :nerd_face:

Thank you very much for your enormous attention.

Anke thank you for the huge contribution.
I will continue studying the subject, thank you for clarifying my doubts.

I'm trying to learn little by little, I'm very grateful for the collaboration of all of you.
I am happy to be part of this beautiful community.

Thank you!

1 Like

hello,
you can save the .csv in the spiff of esp32
or add a sdcard to you're esp32.
the android app read the file on the esp32.

Thanks for the suggestion friend, but I'm doing it this way just to escape the sd card and I use minimal spiffs + ota.

Whats a spiff?

The ESP32 contains a Serial Peripheral Interface Flash File System (SPIFFS). SPIFFS is a lightweight filesystem created for microcontrollers with a flash chip, which is connected by SPI bus, like the ESP32 flash memory.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.