I Fixed My Router or: How To Prevent Devices From Ending Up in The Ocean

I recently moved and I clumsily threw my router (a well-used Netgear R7000 that was a hand-me-down from roommates past which gathered dust in a garage for over a year before my acquisition of it) into a cardboard box with many other things. This was a Sunday, and work was staring me at the face so the first thing that I did when I finished getting all the boxes and furniture in was plug the router in and see how sweet the gigabit internet was (I didn't get gigabit in my previous place). It was great indeed. Done with the ancient router setup I started to unpack the mountain of the boxes.

After several hours I sat down for a well-deserved break to stare vacantly into my phone and lo-and-behold I was on 5G. Womp womp. No sweat, I thought, I turned the router on and off, saw the connection return, used the app formerly known as Twitter some more, and went about unpacking.

An hour later I wanted some more dopamine so I opened my phone and to my horror I was once again on 5G. I was now concerned. No stable internet connections meant my meme machine would not work for the 3 Teams calls I had lined up on Monday. I'll pretend I didn't repeat the power-cycle and prayer routine for a few more hours and say I went straight for the router's logs.

The owners of the router before me loaded a custom firmware called Advanced Tomatos on it, which updates the UI a bit and maybe(?) adds some security updates. A few years back I loaded FreshTomato, a fork that was more maintained. The WebUI had some logs and there I saw the following:

buttons[743]	WLAN button pushed for 2202000 ms - toggle radio

That is a 36 minute button press of the WiFi radio. I definitely didn't have my finger on the router for that long, and after a single quick click I saw 2 ms - toggle radio. I am assuming the router was damaged in transit and the button is firing off at odd times.

Panic started to set in. I didn't want to buy a new router, I was getting like 600 Mbps in the upstairs room. This thing worked FINE. I didn't want to pretend to recycle this router for it to only end up in the ocean in a few weeks slowly becoming micro plastics which end up nestled between my muscle fibers as a form of punishment.

I decided to take action. That looked like a very searchable string. I opened the FreshTomato project's BitBucket repo and searched for it. It came up instantly in this little snippet:

if (count >= 2) {  /* after 1 sec */
    logmsg(LOG_INFO, "WLAN button pushed for %d ms - toggle radio", count * 500);
    nvram_set("rrules_radio", "-1");
    eval("radio", "toggle");
}

Which roughly means 'If the button was pressed for 1 second then toggle the radio'.

This gave me a devious idea. What if this was instead 'If the button was pressed for 1 second and less than 240 seconds then toggle the radio'. 2 minutes is a long time to hold a button down, I'm no router QA person but I think this is a very reasonable assumption. But, alas, I'm no firmware expert. How could I burn an image without hassle and tears and...then I saw there was a Dockerfile to easily build an image. We truly do live in the future. I did a quick release locally, loaded it up onto my router, and to my great shock it actually worked. A 3 second fix and 30 minutes of compiling and my router was functional once again.

I opened a PR and it was gladly accepted. Maybe this will prevent some other of these routers from being needlessly thrown away.

Curious, I looked up 'WiFi turning off' and there are TONS of forum posts of people complaining about this issue. Now, I'm not saying that all of these people's radio buttons malfunctioned, but it did open my eyes. Most likely all of these people trashed their routers and bought new ones. Which is a bit of a tragedy if one thinks about all of the plastic devices that are constantly dying on us. I had a friend tell me that I 'just had to accept that consumer electronics only last 4 years'. This router is going on over 7 years, now I'm aiming for 10+ and all it took was a one line code change.

The modification of software, the ownership and ability to fix issues is a fix to not only consumerism, but to unnecessary consumption. Would Netgear build this feature into their routers? I highly highly doubt it, as it goes directly against their better interest. They sell routers, if a button breaks and could be fixed by a quick timing check then they would sell many fewer routers. It is up to us, as the owners of these complex little computers to keep them going for as long as we can. It didn't hurt I saved probably 70 bucks.

I didn't get this part of OSS before. I do now.

Huge huge shout-out to FreshTomato, pedro, M_ars and the team for their amazing, continued work on this. If you use this firmware I'd highly recommend that you donate to them.


910 Words

2024-04-10