Controlling an Air Conditioner Remotely with ESP32-C6 + IR LED and Installing OpenWrt on Lichee Zero Dock

5 min

language: ja bn en es hi pt ru zh-cn zh-tw

Hello, I'm useless.

Lately I've gotten the electronics bug...

Background

To begin with, this started when I was drinking and an acquaintance was remotely controlling their air conditioner. I thought that was nice and figured I could just build one myself.

As a result, an OpenWrt server somehow also got set up (blank stare).

ESP32-C6

HPtUxWNbUAEGtOf.jpeg

As for what I bought:

  • ESP32-C6

  • Breadboard

  • Resistors

  • Transistor (2N2222)

  • IR LED Emitter

    • Infrared transmission side

  • VS1838B IR Receiver

    • Reception side for analyzing the air conditioner's remote control

image.png

image.png

I checked that it lights up...

image.png

With this, it was done.

I'd never used a breadboard, so it's a hack job. The closest I'd come before was using an Arduino to convert an RJ45 keyboard to USB, and I managed.

First, I did some test flashing and figured out how it works while installing arduino-cli and flashing. I did also have arduino-ide, but the pinnacle of laziness is thinking that if you're going to throw everything at an LLM, it's better to be able to operate from the CLI.

https://github.com/haturatu/esp32c6/

As expected, analyzing the entire remote controller myself would have been a huge task, so I had Codex-kun check the logs one by one. Whenever Codex-kun handled one, I pressed the next button and analyzed it. By repeating this and implementing it, the remote client side implementation was completed.

Since the ESP36-C6 also has a Wi-Fi module, I eventually set up an HTTP server and made it so it could be operated as an API server.

image.png

https://github.com/haturatu/esp32c6/tree/main/daikin-an22nesj-w-http-api-server

Of course, it's restricted to the private network.

And with that, I made the client app side (please forgive how strongly LLM-flavored it is).

image.png

The only soldering was attaching the pins to the ESP32-C6 at first; the rest was just sticking pieces together like LEGO, so getting here only took 3 to 4 hours!

It's so convenient that I'm genuinely impressed.

Lichee Zero-Dock

A single-board computer I bought because it was being talked about a bit.

image.png

Believe it or not, it has an RJ-45 connector and was on special for 1,000 yen!

https://akizukidenshi.com/catalog/g/g115544/

It was so cheap that I bought two.

Since I'd lost my microSD card reader, I pulled out my ThinkPad X1 Gen1, had Codex create an OpenWrt flashing script, and flashed it immediately.

https://gist.github.com/haturatu/488a05b6bb59026c01ed1b493ebc04d4

image.png

Lately, it seems like more and more of these SoC-integrated devices are appearing, and they just keep getting more convenient...

What to use it for is still undecided. That said, since it has integrated DDR2 memory and an SoC, various binding costs should be reduced, so I think it would be good as a network relay device or something.

Also, uHTTPd, the HTTP server used in OpenWrt, is implemented as an incredibly small application—I was slightly moved by that.

https://github.com/openwrt/uhttpd

Related Posts