Okay so this all started because my buddy Dave kept bugging me about getting his stupid Raspberry Pi server to talk to his old NAS box. The thing kept crashing when you tried moving files around and he kept whining “Why can’t they just work together man?” Honestly, Dave is annoying, but he had a point. It should just work. So I figured, screw it, I’ll try getting two of my own random gadgets chatting – my dusty Arduino kit and that WiFi router I flashed last year. That’s what became “united ko”. Kinda dumb name, but whatever.

united ko

The Stupid Beginning

First thing I did was drag both boxes outta the closet. Man, they were dusty. Blew on ’em like an old Nintendo cartridge. Plugged the Arduino into my laptop with that crusty USB cable – you know the one chewed by the dog? Yeah, that one. Flashed the most basic “hello world” blink code just to see if it still breathed. Light blinked. Good. Still alive.

Then came the router:

That thing was already running some weird custom firmware I put on ages ago. Couldn’t even remember the login. Had to reset the damn thing – held a pin in the hole for like ten minutes praying it’d flash. Finally got back in. Felt like breaking into my own house.

  • Hooked up the Arduino: Took an Ethernet shield I found buried under Lego pieces. Slapped it onto the Arduino. Plugged an ethernet cable from the shield into one of the router’s LAN ports. The router LED blinked. Promising sign. Or maybe it was just yelling at me.
  • Code vomit: Started trying to send a simple message from the Arduino to the router. Basic like “HEY ROUTER!” Wrote some C++ garbage. Compiled. Errors. Always errors. Fixed typos. More errors. Compiler basically calling me an idiot. Coffee happened here. Lots of coffee.
  • First “success”?: After maybe an hour? Finally uploaded the sketch. Arduino lit up. Ran over to check the router’s logs via SSH. Scrolled… scrolled… nothing. Nada. Zilch. The Arduino was shouting into the void. Checked cables. Wiggled ’em. Still nothing. Wanted to kick something.

The Lightbulb Moment (Kinda)

Right. So maybe just screaming “HEY” isn’t obvious. Maybe the router is ignoring it like junk mail. Decided to try sending just a single number. Like 42. Obvious reasons. Duh. Tweaked the code real quick – literally just made it spit out “42” over the network every few seconds. Compiled again. Uploaded.

united ko

Jumped back to the router terminal tailing the system log:

tail -f /var/log/messages

Scrolled… waited… Held my breath… Suddenly:

[Timestamp] kernel: Some weird byte garbage! X%@!

united ko

[Timestamp] kernel: Ah crap, not this again...

[Timestamp] kernel: 42

HOLY CRAP. It saw the ’42’! Sitting right there in the router log! It was messy like hell around it, like the router was choking, but it freaking saw it! The Arduino yelled “42” and the router heard it, burped, and kinda acknowledged it!

Making It Actually Useful (Mostly)

Okay, proof of concept worked. Now what? Dave wanted file transfers? Fine. But way too ambitious for my leftover pizza brain right then. Started small. Made the Arduino read the value from a light sensor taped crookedly to it. Just sent the number value constantly to the router.

united ko

Router’s job:

Made a tiny script on the router using cron. Every minute, peek at the latest log, scrape that number from the Arduino’s message (ignoring all the garbage), and if the light level dropped below some number I picked arbitrarily? Blink the darn WiFi LED.

It worked! Sorta! I waved my hand over the sensor taped to the Arduino – saw the light value drop in the Arduino IDE monitor. Minute later? Poof! The router’s little blue WiFi LED flickered off then back on. Meaning the low-light event triggered the router!

Was it pretty? Absolutely not. Was it efficient? Nope, log scraping is dumb. Did those two things kind of, sorta, work together? Heck yes. My Arduino could kinda-sorta tell my router to do things. United KO. TKO by sheer stubbornness.

Disclaimer: All content on this site is submitted by users. If you believe any content infringes upon your rights, please contact us for removal.