jczic / ESP32-MPY-Jama

v1.2 - UI tool for manage Espressif ESP32 microcontrollers with embedded MicroPython for MacOS, Windows and Linux: mini IDE, files manager, REPL, real time dashboards (sys/net), advanced features (gpio/mp3/leds/...)
https://github.com/jczic/ESP32-MPY-Jama
MIT License
424 stars 25 forks source link

Jama Func microSD test function #43

Open ghvau opened 1 year ago

ghvau commented 1 year ago

jama-func-sd.zip

I have problems the find the right connection data of the "SD Card" function in the main menu. Therefore I build a "quick and dirty" test for the Jama Funcs with some good segments from github. Maybe you are interested.

jczic commented 1 year ago

Hey, this is really cool! :)

You didn't have the SDCard library in your MicroPython Port, right ? (from machine import SDCard)

So here you can actually choose the SPI GPIOs for testing the particular ESP32 boards. But indeed, the SD Card menu in the software doesn't work for you I see, what exact message do you get when you try to activate it from this page ?

Also, in the information of the "Jama Func", you can put your mail (see the template) and your site or github in www :) I could add it to the repository without problem then with an info in the main readme!

ghvau commented 1 year ago

Hi,

when I try to start the SD Card function I get the error "No SD Card present".

The SDCard library is available, but (till now) I can't run it for my boards. I try to find the position in your prog. where you set or I can change some parameter. But I see also that there are prefferred slots (card wiring) and none of them hit my wiring.

If you like the JamFunc feel free to use/modify it, I am be silent in the background (no active repository).

On 05.05.23 21:59, Jean-Christophe Bos wrote:

Hey, this is really cool! :)

You didn't have the SDCard library in your MicroPython port right ?

So here you can actually choose the SPI GPIOs for testing the particular ESP32 boards. But indeed, the SD Card menu in the software doesn't work for you I see, what exact message do you get when you try to activate it from this page ?

Also, in the information of the "Jama Func", you can put your mail (see the template) and your site or github in www :) I could add it to the repository without problem then with an info in the main readme!

— Reply to this email directly, view it on GitHub https://github.com/jczic/ESP32-MPY-Jama/issues/43#issuecomment-1536713195, or unsubscribe https://github.com/notifications/unsubscribe-auth/A56V3ZQVJRKL2ADT7TEK2YDXEVLY7ANCNFSM6AAAAAAXXNI5CM. You are receiving this because you authored the thread.Message ID: @.***>

jczic commented 1 year ago

Hi @ghvau, in fact, the SD Card part of the program simply uses the default SD Card slot of the ESP32 which works on most boards. You have indeed particular boards that require different GPIOs.

However, if you get this error message, it means that the library is indeed supported on your MicroPython and in that case, it should be usable with your boards. Look at all the options available here : https://docs.micropython.org/en/latest/library/machine.SDCard.html

You could use it by proposing to configure these options instead of integrating another more restricted library in the Jama Func?

At what level did you manage to use this library? (there is the SLOT option which can be important too).

It would be a pleasure to add your code :)

ghvau commented 1 year ago

SDCard_var-native.zip (updated: final experimental, two versions)

Hi @jczic,

following your mind, I try the "native" SDCard Class, w/o any additional libs. The result you find in the attachment, as minimalist implementation.

I thing the native solution is not usable for each board config (exotic card wiring). Sometimes after repeated call of "sd = SDCard(slot=x ... " the function hang and my integrated reset() get a trigger. But principle it works.

jczic commented 1 year ago

Hello, yes I think it is more logical to use the built-in library and why not test if it's supported during the import instruction.

In fact, if sometimes the configuration crashes the board, it's simply because the selected GPIOSs are already used for something else and that causes a hardware error on the board. Do you think it is really necessary to reboot in case of a problem?

Also, slots 0 and 1 are, for the ESP32, the default slots without indication of GPIOs. Only slots 2 and 3 can be set via an SPI interface. Also, you may have a problem with the bus size in bits (argument width).

Your SD Card test is an excellent idea and actually, does it work well on your exotic cards? (eventually, you should delete the file created at the end of the test?)

ghvau commented 1 year ago

Hi @jczic,

good news for me, when I support

Line 1726: ' ___jama["sdCard"] = SDCard(xyz)\n'

with the parameter, I used in the above test prog. I have also "full" access to the SDCard via the main function. -> init, mount, file access, umount, release. I don't try format because I have no free microSD available.

Tested with the ESP32-CAM board/data.

Maybe this is an stimulation for you to make this point also variable. :-)

jczic commented 1 year ago

Yes, indeed, I had thought to tell you too, I use this variable to keep the instantiation of the SD Card object in memory :)