No AP After Flashing Tasmota to Sonoff Mini

I’m in the process of automating pretty much all I can in my house, and one piece of well known IOT hardware is eWelink’s Sonoff mini, which has the good taste of being flashable when set in DYI mode. This has multiple benefits, one of them is not to rely on a Chinese cloud to handle my house’s lights.

There are plenty of tutorials on how to achieve this, it is not the aim of this short article. I found this blog which sums up how to flash a Sonoff mini on GNU/Linux.
Everything went well, except the device was supposed to expose an access point named tasmota_xxx when flashed. And it didn’t. After various trials, I found out that the device needed to be recovered via the Fast Power Cycle Device Recovery, in short, plug the Sonoff on a power switch, power it off for 30 seconds, then alternate power-on and power-off 6 times, waiting 2 to 3 seconds for each cycle. On the seventh cycle, you’ll see the led doesn’t immediately flash, the reset worked, simply let powered-on and check for the tasmota_xxx AP, it should appear.

Bonus, here’s a small script I wrote to automate the process of flashing:

#!/bin/sh

avahi-browse -t _ewelink._tcp -r
echo -n "Enter IP and deviceid: "
read DIP DID
curl http://${DIP}:8081/zeroconf/ota_unlock -d \
	"{\"deviceid\":\"${DID}\",\"data\":{}}"
echo
echo -n "Now to flashing... "
sleep 2
echo
curl http://${DIP}:8081/zeroconf/ota_flash -d \
  "{\"deviceid\":\"${DID}\",\"data\":{ \"downloadUrl\":
  \"http://10.42.0.1/tasmota/tasmota-lite.bin\", \"sha256sum\":
  \"c759d04ca99bdbc6ec01846996b470d3b6ebc4a8ad171cd453847bdba85eaace\" }}"

Happy automation!