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

    Firmware update, not possible on either windows or mac osx...

    Scheduled Pinned Locked Moved LoPy
    lopyfirmwarefirmware updatefirmware upgradusb
    32 Posts 5 Posters 14.2k Views 5 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.
    • sorenS Offline
      soren @jmarcelino
      last edited by

      @jmarcelino Hey, OK so I think I got serial working now, but I still can't sync my project from pymakr... just keeps saying "syncing failed".. is this because there is already bootleader on the lopy? remember, I can't get into ftp because I tried changing wlan password which didn't work and now I can't connect to it.

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

        @soren If serial is working in a sense that you get a REPL prompt with a serial terminal like screen, then you could try Adafruit's ampy tool or Dave Hylands' rshell (https://github.com/dhylands/rshell). They both are pretty generic and allow to exchange scripts with the board and run them. This way, you can also set your board again for ftp. The script I use on my LoPy to set it to station mode is:

        import network
        import time
        # setup as a station
        wlan = network.WLAN(mode=network.WLAN.STA)
        wlan.connect(ssid=MY_SSID, auth=(network.WLAN.WPA2, MY_PASSWD))
        while not wlan.isconnected():
            time.sleep_ms(50)
        wlan.ifconfig(config=(MY_FIXED_IP, "255.255.255.0", MY_GATEWAY,  MY_DNS))
        print(wlan.ifconfig())
        

        Obviously, you have to set the proper values for MY_xxx. If you do not need a fixed address, you can skip the line with wlan.ifconfig()

        sorenS 1 Reply Last reply Reply Quote 1
        • sorenS Offline
          soren @robert-hh
          last edited by soren

          @robert-hh thanks for the tip robert!

          trying to connect my board with rshell now, and stuck at not knowing what "TYPE" or "TYPE_PARAMS" is supposed to mean in rshell.. the help method for connect method only says:

          connect TYPE TYPE_PARAMS
          connect serial port [baud]
          connect telnet ip-address-or-name

          EDIT:
          Or the other parameters as well for that sake. I really don't understand when you make something like this, why not also make a good description and examples of everything.

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

            @soren
            e.g.
            connect serial /dev/cu.xxxxx 115200
            or
            rshell -p /dev/cu.xxxx -b 115200
            /dev/cu.xxxx ist the name of your serial port. On my linux machine, it's /dev/ttyUSB0
            Once connected, /flash shows the TLD of WiPY or Lopy.
            It works OK for file transfer and management. That should bring you back to the point where ftp works.

            sorenS 1 Reply Last reply Reply Quote 0
            • sorenS Offline
              soren @robert-hh
              last edited by

              @robert-hh it just keeps saying "connecting..." forever..
              wondering if, because i put the wlan stuff in boot.py if this could have hampered the ability to connect to the board ? I mean if what I wrote was wrong and also placed before the uart is initialized?

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

                Both rshell and ampy rely on a REPL prompt to be available. Did you try to connect with a simple serial terminal program like screen?

                screen /dev/cu.xxxx 115200
                Do you get the REPL prompt?
                If not, then coding errors in boot.py before activating the UART may stop boot.py, and REPL on UART does not get active. Then, the step I would take is safe boot, which skips boot.py and main.py. Maybe that will set WiFi back to the initial state.

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

                  @soren If you are able to update the firmware via USB, then you can co the hard way: : erasing the flash and reflashing the image. I just tried that with my LoPy. That works, erases everything in the device and brings back the REPL prompt on UART, which is set active in a hidden
                  _boot.py in flash, which is executed before boot.py. All that requires, that you can reflash your device. Erasing the flash is easy, of you have the source tree installed. Then just call:
                  make erase
                  But all it needs is esptool.py form the repository, and the command.
                  python3 ./esptool.py --chip esp32 --port /dev/cu.xxxx --baud 480800 erase_flash
                  Then you could reload the software, connect through UART and a simple terminal program and setup WiFi manually step by step, e.g. using the first four statement of my sample script below.
                  I have placed an esptool.zip archive here, which is just a copy of the tree from esp-idf. https://github.com/robert-hh/Shared-Stuff

                  sorenS 1 Reply Last reply Reply Quote 0
                  • sorenS Offline
                    soren @robert-hh
                    last edited by

                    @robert-hh

                    thanks

                    but safe boot doesn't set anything back, only goes into a temporary state where it bypasses boot.py and main.py as far as I can read. also the factory reset filesystem only seems possible when you have UART access...

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

                      @soren See my revived post below about erase & reflash

                      1 Reply Last reply Reply Quote 0
                      • sorenS Offline
                        soren @robert-hh
                        last edited by soren

                        @robert-hh hello robert, thanks for all the great help - it's really awesome!!

                        I managed to figure out, when booting in safe mode - that i can temporarily connect via ftp again (because the boot.py is bypassed).. and thus make changes to the boot.py.

                        soo.. the thing is though, that it seems the lopy does not care AT ALL about what I put into the boot.py script now, even after unplugging the short between G28 and 3v (which I assume should make it go back to loading boot and main).

                        EDIT
                        tinkering more about, it turned out I had to set the heartbeat to false in order to use the rgbled onboard the lopy. well done soren. anyway, it is indeed responding now, but setting up the thing with custom wlan configuration is really difficult. this topic has become pretty messy. I tried to change the topic name, but got a message that i couldn't.. it is pretty misleading atm. are there any admins on here?

                        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
                        • 2
                        • 2 / 2
                        • First post
                          Last post

                        Pycom on Twitter

                        Pycom