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

Getting script by download or export failed (on Ubuntu, Fixed) #30

Open ghvau opened 1 year ago

ghvau commented 1 year ago

I play a little bit with the jama-gui and get the following situations:

  1. Creation mpy script, store it on device, can run it in the expected way, but the DOWNLOAD function general get message: "An error has occurred"
  2. Use different Jama Funcs as expected, but the EXPORT function general get message: "An error occurred while exporting this function"

Ubuntu 22.04, source code running (github), ESP32+CP2102

jczic commented 1 year ago

Hello @ghvau and thank you for using the soft and for your comment! I understand that the software opens a dialog box to "load" or "save" a file is a problem for you. In my opinion it is a problem of access rights to the default folder on which the dialog box opens. Try to launch the software with more rights? It is probably too restricted.

ghvau commented 1 year ago

Hi Jean,

after some "chmod's" w/o succsess i do the extreme test and run the program as ROOT: -> same behavior.

It's not a problem, it is unlovely. But i have a workaround: copy and paste :-)

On 26.03.23 03:48, Jean-Christophe Bos wrote:

Hello @ghvau https://github.com/ghvau and thank you for using the soft and for your comment! I understand that the software opens a dialog box to "load" or "save" a file is a problem for you. In my opinion it is a problem of access rights to the default folder on which the dialog box opens. Try to launch the software with more rights? It is probably too restricted.

— Reply to this email directly, view it on GitHub https://github.com/jczic/ESP32-MPY-Jama/issues/30#issuecomment-1483969133, or unsubscribe https://github.com/notifications/unsubscribe-auth/A56V3ZS53MP7V6RXLN4AFVLW56U75ANCNFSM6AAAAAAWHSBZJU. You are receiving this because you were mentioned.Message ID: @.***>

jczic commented 1 year ago

@ghvau, maybe I found the cause of the rights problem for the default folder on your Linux. Just telle me, do you see the save dialog box correctly if you click on the "this template" button in the "Jama Funcs" page?

Also, I added a default directory for all dialog boxes : https://github.com/jczic/ESP32-MPY-Jama/commit/9d59fe33b869625107ad73b3fd5bfc6ea493220f Can you try the latest sources of the repository? Then you tell me. 👍🏻 Thank you @ghvau

ghvau commented 1 year ago

@ghvau https://github.com/ghvau,

see private mail.

The "copyfile" function crashed because of different parameter type.

Different "string" handling in Window/Linux ???

On 26.03.23 15:25, Jean-Christophe Bos wrote:

@ghvau https://github.com/ghvau, maybe I found the cause of the rights problem for the default folder on your Linux. Just telle me, do you see the save dialog box correctly if you click on the "this template" button in the "Jama Funcs" page?

— Reply to this email directly, view it on GitHub https://github.com/jczic/ESP32-MPY-Jama/issues/30#issuecomment-1484096105, or unsubscribe https://github.com/notifications/unsubscribe-auth/A56V3ZRUKC57ZFEBFXLUYOLW6BGUVANCNFSM6AAAAAAWHSBZJU. You are receiving this because you were mentioned.Message ID: @.***>

jczic commented 1 year ago

I did not receive any particular private email? Strings are used in copyfile function.

To tell the truth, I never tested it directly under Linux but maybe @happenpappen can help us?

It is strange that it plants in this place. Does the modification I made allow you to see all the dialogs at least? (Also, if you export the template from the top of page Jama Funcs, that's works?)

So, if I see well, it is important that I understand how the Python copyfile works under Linux.

ghvau commented 1 year ago

... send private mail again !

ghvau commented 1 year ago

... "Does the modification I made allow you to see all the dialogs at least? .." For me, there is no change inside the EXPORT dialog and function.

Maybe there is a different dialog depending used os ?

My sended modification (string modification inside Export Jama Funcs) works for me. Maybe there is an equal situation inside DOWNLOAD Code Editor.

jczic commented 1 year ago

Ok, I seen your mail and I fixed that, thank you! I've just used "str()" to transtype the objc -> https://github.com/jczic/ESP32-MPY-Jama/commit/340b421112e1d2755fd0be72e67a37955517281a Can you retry with latest sources please? Thank you again 👍🏻

ghvau commented 1 year ago

I am sorry but this "easy" type conversion don't work, i get the same error/situation. I try it also before i found the other solution, maybe not the best way, but working in Ubuntu environment.

a = ('/', 'h', 'o', 'm', 'e', '/', 'n', 'o', 'd', 'e', 'm', 'c', 'u', '/') print(a) ('/', 'h', 'o', 'm', 'e', '/', 'n', 'o', 'd', 'e', 'm', 'c', 'u', '/') print(str(a)) ('/', 'h', 'o', 'm', 'e', '/', 'n', 'o', 'd', 'e', 'm', 'c', 'u', '/') an=''.join(str(x) for x in a) print(an) /home/nodemcu/

ghvau commented 1 year ago

This will be the smallest modification, which run in my env: copyfile(filename, ''.join(r))

ghvau commented 1 year ago

A other approach maybe to find out, why the target file name for disk writing was a type "tuple" and not "string" ?!

jczic commented 1 year ago

Ok @ghvau it's done with join(). Indeed, it's very strange that the return of the file dialogs is a Tuple on your Linux distribution. I have to report this to the pywebview developer. So the source update should work on you now. Thanks to you. 👍🏻

ghvau commented 1 year ago

... downloaded, used, solution confirmed ! Thank you also

jczic commented 1 year ago

Thanks for your interest in this software, I hope you like it and that it displays well on your OS (animations etc) 😊

happenpappen commented 1 year ago

Is this resolved or does it need further testing? I could look after this this evening, yesterday has been quite busy 😁 .

jczic commented 1 year ago

Hello @happenpappen, yes it's ok thanks. Have you been able to test the latest features?

happenpappen commented 1 year ago

Hello @happenpappen, yes it's ok thanks. Have you been able to test the latest features?

Yesterday evening i fetched the current version and tried it using a Seeed Studio XIAO ESP32C3 which worked very good. I tried to step through all major functions and did not encounter any errors. Do you have a specific feature in mind which needs testing?

jczic commented 1 year ago

Hi @happenpappen, that's great, thanks a lot 👍🏻 There are mostly new features like last Jama funcs, SD card, Ethernet connection and now I just updated a new feature to allow to retrieve the state of some configurations automatically at boot (autonomously in the chip) :)