🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Read Program back from Core?

    Cores
    4
    6
    822
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sirtet
      last edited by

      I have a StickC Plus with a working program on it, but i lost the source file.
      Is there a way to read a blockly/python script from a Core device?

      1. I assume the python source code is on the Core Device and being run through a MicroPython interpreter.
        Is that correct, or is the Soruce being compiled down to something else before it is downloaded to the Core?

      2. Assuming 1. is correct, is there a way to read back the python script?
        (appart from reading it back directly from the flash chip with a programmer and extracting from there)

      kurikoK C 2 Replies Last reply Reply Quote 0
      • kurikoK
        kuriko @sirtet
        last edited by

        @sirtet
        Yes, the code is in the Core's /flash/main.py, and can be read directly using the UiFlow2.0 terminal.

        Good morning, and welcome to the Black Mesa Transit System.

        1 Reply Last reply Reply Quote 0
        • C
          Cognitive5525 @sirtet
          last edited by

          @sirtet You can also use Thonny

          1 Reply Last reply Reply Quote 0
          • S
            sirtet
            last edited by

            Thanks.

            @kuriko, i did not get UiFlow2 to work yet on my StickCPlus (With Firmware 1.13.8). Trying the UiFlow2 Firmware, i only get a blank screen.
            But i see i can connect to my Stick in UIFlow1.0 too.
            I get to the REPL interface, with os.getcwd() i can see that i am in /flash.
            Yes. main.py is what i was looking for.
            But i have some questions:
            If i use the APPList from the boot menu, some .py scripts are listed, temp, main, test and MyCustomCode.py
            in /flash, there is main and temp.
            Then, there's a DIR named apps. In it, there's again main.py and MyCustomCode.py.
            What's the logic here, how did all the scripts end up where they are?
            I guess the "current" one is always copied to main.py, but what's with temp.py and test.py? I am not aware of ever using these names.
            Maybe there's a help doc. on the topic that i should read?

            @Cognitive5525, with Thonny, i don't see how to get to the file i need. I guess i would need to connect to my Stick first, but don't see anything about it in the menus...

            ajb2k3A 1 Reply Last reply Reply Quote 0
            • ajb2k3A
              ajb2k3 @sirtet
              last edited by

              @sirtet Are you using the correct Stick C UIFlow firmware?
              There are 3 different StickC revisions. the blank screen suggest that you have the wrong version loaded.

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              S 1 Reply Last reply Reply Quote 1
              • S
                sirtet @ajb2k3
                last edited by sirtet

                @ajb2k3 Thanks. Yes, i am aware of StickC/plus/2plus, should be on the right one, will check again.

                As for loading a script from device, i found the solution. It behaves just like what i was expecting:

                e6dabbda-0f77-4204-b1d7-9f728bf337dc-image.png

                What's not entirely clear to me yet is how scripts are saved on the device. I mean, will it be every new project name? Easy to test, but i did not yet...

                If anybody from M5Stack is reading here:
                The Fact that i did not find the solution and then 3 People answering without finding the correct answer is a strong indicator that the UI is not self-explanatory enough.
                It's not logical that there's a LOAD Icon (load from PC), with the LOAD (from device) is hidden in a different icon's submenu.
                I think the LOAD Button should lead to an options-dialogue "-from host / -fromdevice"

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post