Skip to content

factory reset

Jack Shao edited this page Oct 9, 2017 · 5 revisions

We can do a factory reset through ssh, serial console or sd card autorun script. When a ssh session or the serial console is available, just run:

firstboot

SD card autorun script

The system will automatically run autorun file of the sd card's first part if the sd card is mounted. The start-up sequence is /etc/init.d/autorun -> /root/autorun.sh -> /root/sd_daemon.sh -> /tmp/run/mountd/mmcblk0p1/autorun. When a sd card is inserted, its first part will be mounted at /tmp/run/mountd/mmcblk0p1/. If your sd card is not automatically mounted, try to format it with sd card formatter.

We can add firstboot to sd card's autorun to perform a factory reset. For example, copy the following script and save it to the sd card's root directory with filename autorun.

#!/bin/sh

if [ ! -f /tmp/run/mountd/mmcblk0p1/reset_once ]; then
    firstboot
    touch /tmp/run/mountd/mmcblk0p1/reset_once
    reboot -f
fi

Serial console

If you re-program a new Arduino sketch to the ReSpeaker's ATmega32U4, you can get the serial console back by re-programming the default sketch

Install drivers

  1. Windows 10, Linux or macOS

    the serial port will be available and no extra driver is required.

  2. Windows XP/Vista/7

Get ReSpeaker's drivers from https://github.com/Seeed-Studio/Signed_USB_Serial_Driver and Arduino IDE's drivers.

If ATmega32U4 bootloader is broken :(

  1. Wi-Fi connection is available

Get it back through OpenWrt, run:

/etc/init.d/mopidy stop  # stop mopidy if it's running, mopidy-hallo plugin will use SPI
/etc/init.d/alexa stop      # stop alexa if it's running
mt7688_pinmux set ephy gpio
cd /etc/arduino
avrdude -c linuxgpio -p m32u4 -e -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xCB:m \
-U flash:w:Caterina-ReSpeaker.hex -u -U lock:w:0xEF:m
  1. the worst case - re-program a new bootloader via ICSP pins

Go to see https://github.com/respeaker/get_started_with_respeaker/issues/29#issuecomment-277914967

You can’t perform that action at this time.