<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Michael,<div class=""><br class=""></div><div class="">Nice work. I like both options.</div><div class=""><br class=""></div><div class="">One suggestion:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">At the moment, you can do a ‘sd unmount’ and then hold the BOOT button to factory reset. It can even be mounted during this reset process.</div><div class=""><br class=""></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# sd unmount</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Unmounted SD CARD</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">W (1321564) ovms-module: SW2 pushed, factory reset in 9 seconds</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">W (1322564) ovms-module: SW2 pushed, factory reset in 8 seconds</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# sd mount</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Error: SD CARD could not be mounted</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">E (1323204) sdmmc_cmd: sdmmc_card_init: send_scr (1) returned 0x109</span></font></div></div></blockquote></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><br class=""></div><div class="">For safety, is it worth checking isinserted() as well as ismounted() and only allow this to factory reset if the SD is not actually inserted (as well as not mounted)? We’ve had so many troubles with SD CARD support in ESP IDF, I am terrified of going anywhere near it.</div></blockquote><div class=""><div><br class=""></div><div>Regards, Mark.</div><div><br class=""><blockquote type="cite" class=""><div class="">On 15 Apr 2018, at 11:24 PM, Michael Balzer <<a href="mailto:dexter@expeedo.de" class="">dexter@expeedo.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
  
  <div text="#000000" bgcolor="#FFFFFF" class="">
    Reality has proven we need some simple way to do a factory reset,
    we've got users that don't know how to use a serial USB terminal.<br class="">
    <br class="">
    I've implemented the button and SD card methods discussed earlier.<br class="">
    <br class="">
    To do a factory reset you can now alternatively to using "module
    factory reset"…<br class="">
    <ul class="">
      <li class="">a) Insert an SD card that has a file "factoryreset.txt" in the
        root directory. The file will be erased, as will be your
        configuration.<br class="">
      </li>
      <li class="">b) Open the module, remove any SD card, power the module up,
        wait for 2-3 seconds until boot has finished, then push and hold
        SW2 for 10 seconds.<br class="">
      </li>
    </ul>
    The SD card needs to be remove for method b because SW2 grounds
    SD_DATA0 as well. Besides the slight chance to trigger 10 false
    readings from a running transmission, I also found the SD driver to
    be unforgiving about pushing SW2 during a transfer. It will
    eventually lock up the module completely needing a hard reboot. So
    it's better to require SD removal for this method.<br class="">
    <br class="">
    Regards,<br class="">
    Michael<br class="">
    <br class="">
    <br class="">
    <div class="moz-cite-prefix">Am 22.02.2018 um 07:30 schrieb Greg D.:<br class="">
    </div>
    <blockquote type="cite" cite="mid:eec7772b-b475-e638-d814-aecd8a5dee68@gmail.com" class="">
      <pre wrap="" class="">Ha, good thought!  Put a text file in the root directory named
"factoryreset.txt" containing "OVMSv3" as a key, stick it in, and power
up.  Done.  Brilliant.

It probably should remove said file once the config is cleared, as a
fail-safe.  Don't want it to act as a poison pill.

Only "gotcha" is that finding things that can write to a micro SD card
is becoming harder.  No to the iPhone.  Also my latest Android, though
it does have an OTG adapter so I can get there with a USB reader.  The
ecosystem is trying to force storage to a (paid, data mine-able) cloud,
I think, using space and cost savings as a ruse.

Greg


Mark Webb-Johnson wrote:
</pre>
      <blockquote type="cite" class="">
        <pre wrap="" class="">The other option is SD CARD.

Firmware update can work that way. Put an ovms3.bin in the root of an SD card, plug it in, and it will be auto-flashed to update firmware.

We could have special files on SD CARD doing certain things. Like safe boot. Factory reset. Wifi AP. etc.

Can we write an SD CARD from an iPad? :-)

Regards, Mark.

</pre>
      </blockquote>
    </blockquote>
    <br class="">
    <div class="moz-cite-prefix">Am 22.02.2018 um 06:22 schrieb Greg D.:<br class="">
    </div>
    <blockquote type="cite" cite="mid:0256a229-23a7-71bb-58a4-82bf8fc90f87@gmail.com" class=""> We have
      two buttons:
      <blockquote type="cite" cite="mid:381BD9B8-E1AE-425A-BD22-44550737E7A7@webb-johnson.net" class="">
        <div class="">
          <ol class="MailOutline">
            <li class="">Hardwired RESET. That resets the chip.</li>
            <li class="">IO0 BOOT. If held during BOOT, that goes into
              firmware download mode.</li>
          </ol>
          So, only #2 is usable, and that only after boot. I guess we
          could have a boot delay to allow time for it to be pressed
          after power up. </div>
      </blockquote>
      Yes, something like that.  I've worked on products where holding
      button #2 after releasing #1 would first take the product into a
      reset-to-defaults mode for about 10 seconds, then if you kept
      holding it after that, would take you to the downloader.<br class="">
      <blockquote type="cite" cite="mid:381BD9B8-E1AE-425A-BD22-44550737E7A7@webb-johnson.net" class="">
        <div class="">
          <div class=""><br class="">
          </div>
          <div class="">But, that would require opening up the case to get to the
            button. Nasty. Plugging it into a PC is probably easier?</div>
        </div>
      </blockquote>
      Hooking to a PC wouldn't necessarily be easier, but certainly
      safer.  I take it that the buttons on the 3.1 hardware aren't
      anywhere that can be accessed through a proverbial paper
      clip-sized hole, nor in such a way that a metal paper clip
      wouldn't be in danger of hitting something live.  Opening my box,
      I see the 3.0 hardware is not set up that way.  The switches would
      need to be moved to the back side of the board for that, and the
      holes put in the case.  Are we too late?<br class="">
      <br class="">
      I guess we can assume that our customers are at least somewhat
      technology-literate, and in the event that they lose their AP pass
      key, a USB serial console might be a reasonable way to reset
      things.  But if the only "PCs" they own are a smart phone and
      tablet, or in the event that the module is password protected too,
      use of the buttons would still be required.  Or, they can cash in
      their "phone a friend" token.  :)  PCs aren't totally obsolete,
      yet.
    </blockquote>
    <br class="">
    <br class="">
    <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
  </div>

_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>