GPY full flash erase



  • @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.



  • 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?



  • @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



  • @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.



  • @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() ?



  • This post is deleted!


  • @robert-hh I don't think I'm smart enough to roll my own firmware. When I run the latest Windows pycom firmware updater it starts by telling me the latest firmware is 1.16.1 but then later it says it downloaded & used 1.20.1.r1 I assume that's the Oct 5th pybytes-master in your list, with no adhoc wifi? How is this different from Oct7th Release/v1.20?



  • @kjm As @andreas told, the firmware builds I make are not that special. They include only my favorite scripts as frozen bytecode, and I have tailored the build scripts to support my build environment. Sometimes I try special variants, like a version the supports Lora EU433, or an option to invert UART, .....,
    It is not explained by PyCom, which of the various branches in the PyCom repository is the recent "official" one. By convention, it should be 'master'. But the actual development seems to happen at Dev (tagged as default), which seems to include the pybytes code. But there is also a branch called 'pybytes-master'.
    Edit: This is the list of actual branches with their most recent update times:

    Dev (default)           Oct 30, 2019
    Release/v1.20           Oct 7, 2019
    pybytes-master          Oct 5, 2019
    OTA_1_20_Prep/master    Sep 15, 2019
    fw_fixes                Sep 10, 2019
    release-candidate       Aug 22, 2019
    Release/v1.18           May 15, 2019
    master                  May 14, 2019
    bug_fixes               Apr 15, 2019
    pypic_pid_fix           Mar 1, 2019
    development             Nov 12, 2018
    spi_bitorder            Nov 7, 2017
    


  • @kjm Anyone can build firmware images from the sources. Pycom is obviously featuring their offical firmware builds stronger with respect to features of their product platform while we are aiming to freeze our foundation modules into different builds in order to brew customized firmware images better fitting the requirements of our community.



  • @robert-hh I'm still confused. Am I right in thinking there are two 1.20.1.r1 firmwares now? The pybytes version (which has no adhoc wifi) that the pycom updater will install and your version that I have to assemble on a linux machine before I can install it?



  • @kjm Looking at the source code I can see, that the WiFi settings for boot are now taken from a flash configuration data set. I did not dig further about how this data is set. The intention may be to set that in the pybytes configuration dashboard. Since my devices start that AP with software implementing that property, and these have been erased, It may be that the default is: start the AP.



  • Hi there,

    we might want to divert that to a different forum thread, but just for the sake of completeness we also started brewing our own firmware images and publish them to [1]. Please let us know if we can be helpful for the community in any way on this topic.

    Cheers,
    Andreas.

    P.S.: Disclaimer: @Clemens and me are on the same team working on a datalogger software called Terkin for MicroPython [2]. We learned many things from @robert-hh and are taking different kinds of deep-dives into things we wouldn't better not have known about [3].

    [1] https://packages.hiveeyes.org/hiveeyes/foss/pycom/
    [2] https://community.hiveeyes.org/t/developing-terkin-for-micropython/233
    [3] https://community.hiveeyes.org/t/random-memory-corruption-faults-on-esp32-wrover-rev-1-and-rev-2-when-running-in-dual-core-mode/2515



  • @robert-hh said in GPY full flash erase:

    I think pycom refuses to do so, promoting pybytes as their entry into a service business.

    Pycom marked the "normal" firmware as legacy. So I do not think, that they will update this branch.



  • @kjm You can always build the firmware from the sources. That's easiest done on a Linux system. A virtual machine or WSL of Windows 10 also works. The latest version of the Dev branch creates the tar bundles, which can installed using the Pycom updater. On Linux system, you can do that also w/o the pycom updater. Using the Pycom updater has the advantage, that ot resets the Lora and Sigfox MAC, if that was lost after a full flash erase.

    Nevertheless, going that way is a big initial step, if you are not used to it. For Linux, any old system is sufficient, which many people may have around. Using Xubuntu or Mint xfce is an easy install process. Setting up the build environment is documented, but there are quite a few chances to omit things.

    b.t.w: I could update my pre-built bundles.
    b.t.w.2: I asked several times also to update the "official" non-pybytes variant. I think pycom refuses to do so, promoting pybytes as their entry into a service business.



  • @Clemens I'm confused now. Are there two different 1.20.1.r1, the official pycom one & Rob's? We don't use pybytes so I'd be keen to try Rob's. Where can I get a copy & what do I use to load it if the pycom updater only does the pybytes variant?



  • @robert-hh we at hiveeyes use and promote your firmware build as a good medicine in case the official version makes problems. So many thanks for this. It's a bit pity that you have to do the work pycom should jump in normally!



  • @kjm I do not assume that GPY and the other board behave different with respect to WiFi.



  • @Clemens In my homebrew 1.20.0.r1 this feature is still present. It could be related to the fact, that the version 1.20.1 you can install via the pycom updater is a pybytes variant. For that, the automatic AP setup my be not useful, since that prevent access to the internet.



  • @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.

    #
    # set device in AP mode
    #
    from network import WLAN
    wlan=WLAN(mode=WLAN.AP, ssid="my_wlan_1", auth=(WLAN.WPA2, "wlan_password"))
    wlan.ifconfig(id=1, config=("192.168.4.1", "255.255.255.0", "0.0.0.0", "0.0.0.0"))
    


  • It was a nice feature before that a new (firmware flashed) device was accessible by WiFi this is gone with the 1.20.1 release and makes the setup for some scenarios more complicated. I fear this feature was switched off to be replaced by PyCom's own setup wizard via pybytes in the future.


Log in to reply
 

Pycom on Twitter