[General Topics] Matchlighter:
So, I found a bunch of these, box included - some used, some not, at a thrift store for $12 a pop and cursory research showed there was a way to make them work with Home Assistant. Well... not so much if they exhibit the Groundhog Day effect that I didn't learn about until later.

So hours later, I came up with a workaround that I figured I'd share for posterity. Probably ancient hardware that nobody else will use - I don't know if even I will - but here goes:

Notes:

Read all steps and notes before proceeding - some steps are optional and or have later implications. There are multiple ways to follow my steps, so try to understand and choose your path before beginning

I've tried to write short explanations where some Linux knowledge is required, but probably have not been perfect

These steps were performed on a device that seems to have been in use until the end of Wink. I'm guessing that they'll apply to all firmware versions, but I cannot be sure

You'll need a Linux machine

You'll need an SDHC card, 4GB+

Always unpower your Wink Relay when removing or returning the SD card

Note usages of `sdX` - replace `sdX` with the correct drive - note that numbers following (eg `sdX1`) should be if present

There's no warranties or guarantees here, if that somehow matters

If your device suffers from the "Groundhog Day" effect, I doubt you'll be able to firmware-brick it anymore than it already is.

Steps:

Gain serial access by soldering to the internal serial header

Top-to-bottom: GND, RX, TX, 5V

Baudrate is 115200

I recommend using 90 degree pin headers - they fit even when the back panel is re-installed

NB: You may need to power the device through the back-plate contact points to enable WiFi, but you should be able to perform all steps that require serial access before connecting to WiFi

Reboot the device and access the bootloader:

Connect to serial, and look for `Hit any key to stop autoboot:`

(Press a key)

Validate that these steps will work for your device

(I doubt that the bootloader config varies, but this is a good sanity check)

Run `printenv`

Look for `bootcmd` - it should looke like

```

setenv bootargs console=ttymxc0,115200 enable_wait_mode=off root=/dev/mmcblk1p1 rootwait rw video=mxcfb0:dev=lcd,mxcfb_dataimage_lcd,if=RGB666;mmc dev 2;mmc read ${loadaddr} 0x800 0x2600;bootm;setenv bootargs;booti mmc2;setenv bootargs;booti mmc3;

```

`booti mmc2` is probably the only part important to these steps. If your device is not "Groundhog Day"'d, you can probably also modify and persist a change

Connect a MicroSD card to the internal MicroSD pads

I'd recommend getting a uSD breakout or using a uSD to SD adapter (poor man's uSD breakout) instead of soldering directly to the uSD (even if you're just cloning the same image to multiple devices).

Note that SD cards have 9 pins, but uSD only have 8. 4th pin from the notched side is not used.

I used 1mm pitch, 28awg ribbon cable

Perform continuity checks to make sure your connections are good and that none are crossed or shorted - these are some small pads to hand solder, and the GND pad is particularly hard due to basically being a heatsink

If you're having a hard time, you may be able to glob solder across all the connections and use some copper braid to remove the excess - this usually removes any shorting solder, but leaves enough to keep the connection

You could also use a different GND connection

You may need to remove some protrusions on the back cover

Copy flash to SD: `dd if=/dev/block/mmcblk0 of=/dev/block/mmcblk1`

Transfer SD to a Linux computer

Backup the SD card to and img file - eg `dd if=sdX of=winkrelay.bin`

Disable development kernel by erasing (or the first few bytes of) Sector `0x800`

Sectors are `512` bytes, so Sector `0x800` is at byte offset `0x100000`

I used Imhex to `00` the first several bytes, but the below `dd` command should do so as well

`dd if=/dev/zero of=/dev/sdX bs=1 seek=0x100000 count=16 conv=notrunc`

Copy `boot` partition: `dd if=/dev/sdX1 of=./boot.img`

Split bootcfg, kernel, and initramdisk: `abootimg -x boot.img`

Extract initramdisk:

```

mkdir boot_ramdisk

cd boot_ramdisk

cat ../initrd.img | gunzip | cpio -vid --no-absolute-filenames

```

Modify `fstab.freescale`, replacing `mmcblk0` with `mmcblk1` for all except `mmcblk0p7`

(`p7` contains device serial and mac addr info, you can update it as well, but this makes using the image on multiple devices easier)

Remove the two lines with `/devices/`

Modify `init` to remove references to wink (`boot` only)

Optional, but it's nice to know that it isn't trying to phone home and closes a potential vulnerability if someone were to acquire Wink's domains

If you're going to use `wink-relay-manager`, you may choose to rename the `edisonwink` service in `init` instead of using it as is

Generate new Ramdisk and flash it to the SDCard:

```

find . ! -path . | cpio --create --format="newc" -R root:root | gzip > ../boot_initrd_mod.img

sudo abootimg -u /dev/sdX1 -r ../boot_initrd_mod.img

```

Repeat for the `recovery` partition (`sdX2`)

This (and later Data/Cache wipe) may be optional if your device is already wiped and/or isn't "Groundhog Day"'d

Mount the `system` partition (`sdX5`)

Delete Wink apps from `apps/`

Download and place APKs in `apps/`

A launcher - Nova v5.5.4 is the traditional recommendation

Multi-use Home Button (or alternative. technically optional)

`wallpanel-legacy` or some other dashboard

Any other desired apps

Edit: Some apps (including `wallpanel-legacy`) seem to have embedded libraries that make them not work when installed on the `system` partition. I'm sure there's a way to make them work, but I don't know it.

(Alternatively, you can download and install these later via `adb`. Installing them here like this makes them "builtin")

Boot into the recovery image:

Access the bootloader again

Run `booti mmc2 recovery`

Perform a factory reset

Reboot

Via serial console, run `setprop persist.edison.adbroot 1`

You can alternatively build this into the `system` image

Note that this gives anyone on your network adb root access, so either revoke it later or setup appropriate network restrictions

Configure device WiFi as you normally would on Android

If you did not add a launcher to the `system` image, run `am start -n com.android.launcher/com.android.launcher2.Launcher`

All further relay-side commands should be runnable by doing:

`adb connect 192.168.1.30:5554` (Replacing the IP with your Wink's IP address)

`adb shell`

Putting things back together, you should remove the 5 tabs/supports (1 circle + 4 short lines) from the back cover above where the SD card now is. I've found the best way is to use pliers to pinch and twist.

I want to just provide an `img` file that you can flash to an SD card and go, but 1) I'm a random person on the internet, and 2) Copyright law can be stupid and doesn't seem to have anything that forces firmware copyrights into the public when a company goes defunct

Once you perform the process once, you can image/clone the SD card for use with multiple devices.

Edit: I had some issues with cloning the SD cards - somehow the copy isn't perfect or there's some serial check making copies not work. Booting into recovery and doing a data/cache wipe on the duplicated SDs seems to do the trick though.

Edit Again: I found that if I do a data wipe, turn off the Wink, and then pull and image the SD card, I can re-flash that image to other SD cards just fine. Would be nice to copy the data partition over, but c'est la vie.