Command for safe boot

  • Is it possible to do a safe boot (or a soft reboot) from the command line? I know that you can accomplish these with Ctrl+F and Ctrl+D, respectively, but I would like to include a safe boot in my script so I need a command line option. machine.reset() is a command line reset but it does a hard reset and I don't want and to run.

  • @alexpul But if it's only about not executing and on boot, you can do similar with python scripts:

    from machine import reset
    # create a special and reset
        f= open("", "w")
        f.write('''import os\nos.remove("")\n''') 

    and then a specific, which checks for that special

    import machine
    import os
        f = open("")
    except OSError:
        # do the previous stuff here

    Or something similar in you regular and, which just checks for the existence of a flag for bypassing.

  • @alexpul No, but it would be easy to add something like machine.safe_boot(). It would more or less only consist of the name definition, and a function with a single statement, which just calls another function.

Pycom on Twitter