Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Unable to upload project code to LoPy

    Scheduled Pinned Locked Moved Issues & Bugs
    15 Posts 3 Posters 1.1k Views 3 Watching
    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.
    • robert-hhR Offline
      robert-hh @ac113142
      last edited by robert-hh

      @ac113142 What is the size of the python scripts you try to upload? Line of code for instance.

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        ac113142 @robert-hh
        last edited by

        @robert-hh I've tried uploading a script with just print('hello') with the same result. The LoRa code I'm trying to upload has about 20 lines of code.

        robert-hhR 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @ac113142
          last edited by robert-hh

          @ac113142 Did you try to upload using other tools? Like ftp or ampy from adafruit? Or rshell from Dave Hylands (https://github.com/dhylands/rshell). Or pyboard.py from Damien George, the creator of Micropython? (https://github.com/micropython/micropython/blob/master/tools/pyboard.py). The latter three also upload via USB.

          1 Reply Last reply Reply Quote 0
          • R Offline
            Ralph
            last edited by

            hi @ac113142, the error you are posting looks like it's right after connecting to your device. It says 'connecting to com14..' and then an error from file "main.py", line 37. So it's just started up and reporting an error in your main.py code. .
            Can you post the output when you are connected to the board, stopped all running code (just to be sure for this test) and then hit 'upload'?

            The core dump is never a good thing, usually means there is some low level bug. I've seen that happen when running a ton of things at the same time and the board running out of memory. But keep in mind 1.20.0.rc11 is the unstable release, so try it on the stable 1.18.2.r8 first.

            A 1 Reply Last reply Reply Quote 0
            • A Offline
              ac113142 @Ralph
              last edited by

              @Ralph I reflashed using 1.18.2.r7 (I didn't see an r8?). Below is the output when I tried to upload print('Hello this is a test') right after I reflashed the firmware. When I reconnect, the same line 37 AttributeError: 'NoneType' object has no attribute 'mac' pops up before I even try to upload, and again once I try to upload.

              AutoConnect enabled, ignoring 'address' setting (see Global Settings)
              Searching for PyCom boards on serial...
              Connecting to COM14...
              
              >>>
              Uploading project (main folder)...
              Not safe booting, disabled in settings
              
              Uploading to /flash...
              Reading file status
              No files to upload
              Upload done, resetting board...
              OKets Jun  8 2016 00:22:57
              
              rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
              configsip: 0, SPIWP:0xee
              clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
              mode:DIO, clock div:1
              load:0x3fff8028,len:8
              load:0x3fff8030,len:1688
              load:0x4009fa00,len:0
              load:0x4009fa00,len:14592
              entry 0x400a059c
              Traceback (most recent call last):
                File "main.py", line 37, in <module>
              AttributeError: 'NoneType' object has no attribute 'mac'
              Pycom MicroPython 1.18.2.r7 [v1.8.6-849-df9f237] on 2019-05-14; LoPy with ESP32
              Type "help()" for more information.
              >>>
              

              The core dump only seems to happen if I'm using 1.20.0.rc11.

              @robert-hh I've been trying to upload using the alternative methods you described, just having issues getting things installed due to being on a work machine.

              R 1 Reply Last reply Reply Quote 0
              • R Offline
                Ralph @ac113142
                last edited by

                @ac113142 Well that's very clear and expected output I would say.

                'Uploading to /flash...
                Reading file status
                No files to upload
                Upload done, resetting board...'

                The above part tells you that there are no changed files to upload, so it aborts the upload and reboots the board (standard procedure, you can disable the reboot after upload in the config if you want).
                Then it reboots, executes the boot.py and main.py files, as always. You clearly have an actual bug on line 36 in main.py.

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  ac113142 @Ralph
                  last edited by

                  @Ralph That's what it looks like... but my main.py file literally only has one line of code (the print('hello this is a test')), and I haven't changed boot.py from whatever the default is. And it works fine if I try to run it, the error only pops up when I try to upload.

                  I'm just confused as to where this error is coming from.

                  robert-hhR R 2 Replies Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @ac113142
                    last edited by

                    @ac113142 That's why i said: forget VCS/ATom pymakr for now. use ftp or the like to upload a test program. Since the dump complains about a bug in line 37, but you tried to upload a very short main.py, this upload failed. So there are two problems:

                    1. Uploading a script
                    2. An existing script that causes a core dump - which should not happen. If a script has a problem, it should simply stop.
                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      Ralph @ac113142
                      last edited by

                      @ac113142 Aha ok, that means something went wrong with the status file on the board. It thinks your main.py file hasn't changed, but actually it has, and an old version of the main.py file is still on your board (with an error on line 37). As soon as you change something on the main.py file, save the file, then press upload, it should upload it.

                      Make sure you only have one project open in atom, since multi-projects can become confusing when working with pymakr and you end up uploading the wrong project. Also check that if you add or change any other files than main.py, those do get uploaded as well. If not, you might not be working in the right folder.

                      A 1 Reply Last reply Reply Quote 1
                      • A Offline
                        ac113142 @Ralph
                        last edited by

                        @Ralph I just tried closing all the files/folders I had open and uploading and it worked! About to try uploading the code I was originally trying to upload. Thank you for the help!!

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post

                        Pycom on Twitter

                        Pycom