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

    GPY full flash erase

    Scheduled Pinned Locked Moved GPy
    45 Posts 7 Posters 4.5k Views 7 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.
    • K Offline
      kjm @robert-hh
      last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • K Offline
        kjm @robert-hh
        last edited by

        @robert-hh said in GPY full flash erase:

        @kjm I tested this short script, and it sets up the AP. Note, that you can set ssid, password, and IP address as you like. The DNS settings are more or less useless.

        Is this a way to setup an adhoc wifi that I can turn on/off with import pycom, machine; pycom.wifi_on_boot(1); machine.reset() ?

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

          @kjm 1.16.1 is the version of the firmware updater itself. Whereas 1.20.1r1 is the latest revision of the firmware for the PyCom modules. Both the Dev and Release/ v1.20 have the revision number 1.20.1.r1, the differ in the pybytes revision. Dev shows pybytes 1.2.0, Release/v1.20 shows pybytes 1.1.3. The branch pybytes-master has the firmware revision 1.18.3. That's all in the file pycom_version.h in the repository.
          b.t.w.: I build my firmware w/o pybytes support.

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

            @kjm said in GPY full flash erase:

            Is this a way to setup an adhoc wifi that I can turn on/off with import pycom, machine; pycom.wifi_on_boot(1); machine.reset() ?

            No. This little script will turn on an AP, configured to your needs, if you put it into boot.py or main.py

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              kjm @robert-hh
              last edited by

              No. This little script will turn on an AP, configured to your needs, if you put it into boot.py or main.py

              Do you know if there is flavour of LittleFS firmware that still has adhoc wifi? If so could I download it with the pycom updater with the 'legacy' option?

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

                @kjm LittleFS came with version 1.20.
                I just made a test about ad-hoc AP and firmware variants:

                • 1.20.1r1 without pybyte: ad-hoc AP comes
                • 1.20.1r1 with pybytes: no ad-hoc AP

                So it is the by pybytes option which chooses another way. Some Information may be found at https://docs.pycom.io/smart. That all looks for me like an endless source of trouble, because so many instances are involved: - your PC, Pycom servers & services, a smart phone IOS only(!) app, local access points, the Pycom devices, ... And if any of that fails, the process fails.

                BUT: at least I found a bypass, that worked on my device. If you copy a file named "pybytes_config.json" with the content below to your device, pybytes will not start and the ad-hoc AP comes up.

                {"wifi": {"ssid": "", "password": ""},
                         "wlan_antenna": 0,
                         "dump_ca": "FALSE",
                         "cfg_msg": "NULL",
                         "server": "",
                         "ssl": "FALSE",
                         "lte": {"apn": "NULL", "cid": 1, "reset": "FALSE", "carrier": "NULL", "band": "NULL", "type": "NULL"},
                         "device_id": "",
                         "network_preferences": [],
                         "ota_server": {"port": 443, "domain": "software.pycom.io"},
                         "pybytes_autostart": "FALSE",
                         "username": "",
                }
                

                Note: These are double quotes in the text. Strange also, that with pybytes Ctrl-D for soft reset does not work any more.

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

                  @kjm The json script for disabling pybytes can be shorter. This single line in the file /flash/pybytes_config.json is sufficient:

                  {"pybytes_autostart": false}
                  
                  K 1 Reply Last reply Reply Quote 0
                  • K Offline
                    kjm @robert-hh
                    last edited by kjm

                    @robert-hh said in GPY full flash erase:

                    The json script for disabling pybytes can be shorter. This single line in the file /flash/pybytes_config.json is sufficient:

                    I don't have the skills set to find & edit /flash/pybytes_config.json, Atom doesn't show it. It took me most of a day just to figure out how to do the full flash erase using the CLI! Can you not link me to the 1.20.1r.1 without pybyte firmware & I could download it with the pycom firmware downloader as legacy?

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

                      @kjm You can simple create that file locally and copy it to your device, either using atom or adafruit ampy. With ampy call:

                      ampy -p <your_com_port> put pybytes_config.json

                      /flash is the default directory of the GPY file system, with e.g. boot.py and main.py.
                      Edit: I can compile later today a non-pybytes GPY image and send the link.

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

                        @kjm There is a GPY package here: https://github.com/robert-hh/Shared-Stuff

                        K A 2 Replies Last reply Reply Quote 0
                        • K Offline
                          kjm @robert-hh
                          last edited by

                          /flash is the default directory of the GPY file system, with e.g. boot.py and main.py.
                          Edit: I can compile later today a non-pybytes GPY image and send the link.

                          Yeah I know what \flash is, but my 1.20.1.r1 does not have that file,

                          ['boot.py', 'cert', 'lib', 'main.py', 'sys']
                          

                          So there is no 1.20.1r1 without pybyte firmware?

                          1 Reply Last reply Reply Quote 0
                          • K Offline
                            kjm @robert-hh
                            last edited by

                            @robert-hh said in GPY full flash erase:

                            @kjm There is a GPY package here: https://github.com/robert-hh/Shared-Stuff

                            Much obliged I'll give it a try. As a matter of interest, does compiling your own firmware let you modify micropython? For example are you able to change the default 20s timeout micropython has for most OSErrors?

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

                              @kjm Most of the source code is available. There are only a few binary blobs for specific drivers. The espressif RTOS source is also provided. So yes, in theory you can change everything. But it is quite a pack of software. I do not agree that most OSErrors have a 20 s timeout. Only those which by its semantics require waiting, like the ones dedicated to communication.

                              K 1 Reply Last reply Reply Quote 1
                              • A Offline
                                andreas @robert-hh
                                last edited by andreas

                                @robert-hh said in GPY full flash erase:

                                There is a GPY package here: https://github.com/robert-hh/Shared-Stuff

                                Thanks, @robert-hh. We took a bunch of your builds scattered around the forum and gave them a canonical home on our page for Inofficial firmware images for Pycom devices in order to be able to find them back easier.

                                We hope that you and all others are fine with that.

                                To whom that may concern:
                                I've tried to reflect the copyright and license terms of Pycom as good as possible, please let me know if I missed something relevant.

                                it is quite a pack of software

                                True. Thanks to all software authors for your hard work on that!

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

                                  @andreas My build typicall include some utility scripts in frozen bytecode:

                                  • mount.py - Mount the SD card
                                  • pye_mp.py - A file editor which runs on the Pyxx device. Typically imported as from pye_mp import pye. Then you can type: pye("filename"). For the documentation look here: https://github.com/robert-hh/Micropython-Editor
                                  • uping.py - a ping utility
                                  • upysh.py - a small set of unix like commands, typically imported as from uping import *
                                  K 1 Reply Last reply Reply Quote 1
                                  • A Offline
                                    andreas
                                    last edited by

                                    @robert-hh I've updated the documentation accordingly [1]. Thanks a bunch and keep up the spirit.

                                    [1] https://packages.hiveeyes.org/hiveeyes/foss/pycom/#robert-hh


                                    P.S.: We might really want to divert that discussion into another thread ;]. Nevertheless, thanks for bringing us to these topics, finally making me build a humble hut for community-based firmware images.

                                    1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      kjm @robert-hh
                                      last edited by

                                      Only those which by its semantics require waiting, like the ones dedicated to communication.

                                      You're right the 20s wait when a DNS lookup fails at getaddrinfo in urequests really bugs me. In reality if a DNS server hasn't replied in a tenth of that time it's not going to. I'd kill to be able to tweak that value.

                                      1 Reply Last reply Reply Quote 1
                                      • A Offline
                                        andreas
                                        last edited by

                                        Now we are really getting things mixed up within this conversation.

                                        @kjm said in GPY full flash erase:

                                        the 20s wait when a DNS lookup fails at getaddrinfo in urequests really bugs me. In reality if a DNS server hasn't replied in a tenth of that time it's not going to. I'd kill to be able to tweak that value.

                                        Let's divert that to the thread where you already started this topic [1], right?

                                        [1] https://forum.pycom.io/topic/4932/urequests-timeouts

                                        1 Reply Last reply Reply Quote 0
                                        • K Offline
                                          kjm @robert-hh
                                          last edited by

                                          @robert-hh said in GPY full flash erase:

                                          @andreas My build typicall include some utility scripts in frozen bytecode:

                                          • mount.py - Mount the SD card
                                          • pye_mp.py - A file editor which runs on the Pyxx device. Typically imported as from pye_mp import pye. Then you can type: pye("filename"). For the documentation look here: https://github.com/robert-hh/Micropython-Editor
                                          • uping.py - a ping utility
                                          • upysh.py - a small set of unix like commands, typically imported as from uping import *

                                          Confirming adhoc wifi working in your 1.20.1.r1 firmware Robert. How do I use your utilities? For example what would I type in the Atom console to try uping? Is there a way to see the full extent of the flash memory in Atom/Filezilla? Do I need a new windows or unix program to see deeper into the gpy flash?

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

                                            @kjm for uping, type e.g.:

                                            from uping import ping. 
                                            ping(host_address, interval=<ms>)
                                            

                                            The host address can be numeric or symbolic. The 10 ms default for interval is a little bit short for the xxPy devices. I typically use 500. This is the def line:

                                            def ping(host, count=4, timeout=5000, interval=10, quiet=False, size=64):
                                            

                                            The git repor is here: https://gist.github.com/91cc8979e33e82af6d99ec34c38195fb.git

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

                                            Pycom on Twitter

                                            Pycom