WireClaw masterfully bridges the gap between human intent and hardware execution, transforming the ESP32 into a truly intuitive edge device. It marks a significant shift from manual coding to intent-based hardware orchestration, making complex automation accessible to everyone.
Deep Dive
Voraussetzung
- Keine Daten verfügbar.
Nächste Schritte
- Keine Daten verfügbar.
Deep Dive
OpenClaw for ESP32 - Meet WireClaw!Hinzugefügt:
Today in the workshop, we're working with AI on the ESP32 using Wire Claw.
You'll see how to configure and control an ESP32 by chatting rather than programming. We'll also add a second microcontroller to the mix and get its data as well. We're chatting to microcontrollers today. So, welcome to the workshop.
Well, hello and welcome to the workshop.
And today we're going to be working with artificial intelligence and the ESP32.
Now, if you've been trying to keep track of the rapidly evolving world of AI, you have no doubt run into OpenClaw. And OpenClaw is a very exciting product that allows AI to be more than just a chatbot. It can actually interact with your file system, your email system, etc. It can do things on your computer.
Well, there have been a number of attempts to bring such a capability down to the microcontroller level. And today we're going to be looking at one of them, something called Wireclaw, which is made for the ESP32.
Wireclaw will allow you to use a chat.
We're going to be using a telegram chat to program your ESP32, to set up things on your ESP32 such as IO devices, to create rules on your ESP32, to basically do everything you were doing with the IDE just through a simple chat. And so, it's a really exciting new type of a product. Now, what we're going to do today is we're going to take a look at what Wireclaw is. We're going to install it onto an ESP32 and then we're going to connect a few devices to it and start playing with it.
We're even going to connect it up to a second microcontroller and have it communicate with that. So, let's begin by learning a bit more about WireClaw.
Wireclaw is a self-contained artificial intelligence agent. It'll run on an ESP32C6, S3, or C3.
You communicate with Wireclaw by chatting with it using Telegram, serial ornats, which is a high-performance open-source messaging protocol. You can use either a cloud or local LLM with WireClaw.
Let's get an idea of how WireClaw works.
We'll start with an ESP32 that's connected to an RGB LED and a temperature sensor.
Using telegram will communicate with the ESP32 and ask it to read the temperature. It will reply with the temperature reading. We can then tell it to set the LED to green and it will reply and turn the LED to green.
You can also tell it your preferences.
Over here I'm telling it that my favorite color is orange and it replies that it'll remember orange is my favorite color. It keeps this in persistent memory and this will be persistent even after rebooting. Now I can tell it to set the LED to my favorite color and it'll respond by setting it to orange.
You can also set up rules in wire claw.
Here I'm telling it to send me a telegram message and set the LED red whenever the temperature exceeds 25°.
It sets up a rule and responds with a confirmation message.
And when the temperature exceeds 25°, I get the red LED and a message on telegram. The architecture of wire clause is follows. As with any ESP32 architecture, we have a number of standard inputs. We also have a series of outputs, the conventional ones we use with the ESP32, plus things like a telegram alert, NATS publish, and a serial send. Wireclaw communicates with an external large language model. And you can either use a hosted API or run a local API. You communicate it through interfaces either a telegram bot through the serial UART connection or as a NAT subscriber. Wireclaw also has an extensive web gooey interface.
Now here's what's happening under the hood. In Wireclaw, there are two different loops. The rule loop and the AI loop. The rule loop runs every iteration of the main loop just as the loop does in the programming you're familiar with. The AI loop is only activated when a messenger arrives via telegram serial or NATS.
The rule loop reads the sensors, checks conditions, and fires actions. The AI loop makes calls to the large language model.
Conditions in the rule loop are edge triggered. They fire once and then they automatically reset. The AI loop uses an HTTP mode for local large language models, and this saves 40% of RAM utilization.
Rules are persisted to the ESP32's flash memory, and they will survive a reboot.
The AI loop contains all of the AI functions to create rules, register devices, read sensors, and configure the system.
You build rules using the rules engine and it has seven different conditions that it recognizes.
There are also six different action types.
The rules engine also uses message interpolation to make clear messages back to you. The device registry is where we register our sensors and there are seven different types of sensors that Wireclaw recognizes.
The device registry also includes clock values for hours and minutes.
and actuator types.
Today we're going to get started with WireClaw and there are four steps that we need to take. The first step is to flash the Wireclaw firmware using the web utility. In step two, we'll do the Wireclaw setup. Step three is where we configure all of our credentials. And in step four, we'll save, reboot, and we can start using WireClaw.
Now that we know a bit more about wire claw, we can start working with it. And we're just going to start with an ESP32 board. Now, you can use an ESP32C6, an ESP32S3, or an ESP32C3.
I'm going to be using a C6 board. And we're not going to connect anything up to the board at the beginning. We're just going to install Wireclaw and play with it for a little while. One decision we need to make though is the LLM or large language model that we're going to be using. Now, you have a choice of using a cloud-based one or a local one if you're running a local LLM. I'm going to be using a cloud-based one because the setup is easier, but of course, you're going to get the best performance and there's not going to be a cost if you're going to run a local LLM. I'm going to be using a cloud-based API from Open Router. And Open Router has a free plan that's going to be sufficient for what we're doing today. Open Router gives you access to a number of different commercial LLMs and it's going to be suitable for our use today. So, you're going to need to get an account up on Open Router. We're also going to be using Telegram to communicate with the ESP32.
And so, you're going to need to have a Telegram account as well. And so, here's what we need to do to get set up and working with WireClaw. Here's what we'll need to do to get started with wire claw. The first thing we need to do is get an API key from open router. Next, we need to set up a bot on Telegram. And finally, we'll need the flash and configure wire claw. So, let's get started.
Now, I'm starting off on the homepage for Open Router, and that's where you're going to need to go to get your API key.
Now, Open Router is a service that provides an API that allows you to attach to just about any LLM in existence. And so, you get a unified API that lets you explore all these different LLMs. And you'll need an account at Open Router. It's a very easy thing to do. I just logged in with my GitHub account. There's a number of login options. And you don't need to give any credit card information or spend any money to start off with. They give you a few credits so you can get going. At any rate, you can see there's a big button that says get API key. And so that's probably what we want to do.
So let's go and click get API key. And you'll see the key that I have for my previous experiments with wire claw.
Let's make a new one. I click this button here to make a new key. And I have to give it a new name. So I'm going to call this wireclaw 2 because I have a wire claw one. And that's all I need to do on this page here.
And here's my key and I need to copy it and paste it and you'll never get to see it again. So copy that the little check mark on there and you're going to need to paste that somewhere and save it. But that's the key that you have from open router and you're going to need that to configure wireclaw.
Now I'm in Telegram to get my API key and I've gone to visit bot father. I've opened a chat with botfather and this is how you create a bot in uh telegram. So what you need to do is you need to send a message to botfather. You need to use a forward slash and go new bot.
And botfather gets very happy and says all right a new bot. How are we going to call it? You have to give it a name wireclaw testbot one. Now I have to give it a username and the username needs to end with bot t. So let's give it a username.
And there it is. And it says, "Congratulations on your new bot." And here's what you need, the API. Now, I should mention, I've already created the bot for our demos. I'm just creating this one to show you how to make bots, and I'm going to delete it so I can show you the API key, but normally I'd have to eusate it. You need to copy that, and you're going to need to use that to configure Wire Claw. So, go and do that and make yourself a bot. You'll also want to note where the bot actually is because you're going to want to chat with that bot when we get this all set up.
One other place you're going to want to visit in Telegram is the IDbot in order to get your ID. And all you need to do is send a start message over to the IDbot and it'll come back and return the ID that's associated with your account.
Now, that's not a secret number or anything, but it is something you're going to need to use to configure Wire Claw. So go visit the ID bot and get your ID from that and copy that down and save it along with your API key so we can use that when we configure Wire Claw.
So now that we've got our API key and Telegram information, we are finally at the point where we can flash Wireclaw onto our ESP32.
So, at this point, you're going to want to make certain that you have your ESP32 board connected to your computer via a USB cable, and you'll go to the Wireclaw Flash Utility page, and you'll just hit this little button that says install WireClaw. And you'll look for a port, and you'll look for one that says JTAG on it. That's this one here. I'll connect and I'll install WireClaw. And I'm going to erase everything on it just in case there's something in PS RAM, etc. I don't really remember what I was doing with this microcontroller before. We'll hit next. And we'll do install.
And it does the erase first. And it says it's going to take 2 minutes, but I know from experience it doesn't take anywhere near 2 minutes. So, I'm not even speeding up the video here. And we are done. So, it's a very, very quick installation.
And Wire Claw has now been installed on our ESP32.
Now, when Wireclaw finishes installing on your ESP32, it will reboot itself as an access point, and you'll need to connect your computer to that access point in order to go to the next step.
Once you do, it should open up a page.
But if it doesn't, you can go to 192.168.4.1 and you'll come to the Wireclaw setup page where I've already filled in the values I need. So, you're going to need to put in the SSID for your Wi-Fi, and that's mine up over here, and your Wi-Fi password. The open router API key that you got, you're going to need to put that into this box here. That's why we had you save it. Keep the model as Google Gemini 2.5 Flash. That'll work just fine. The device name, I changed mine to WireClaw-02 because it wanted to do 01 and my previous installation was 01. You're going to want to remember that name because that name will help you connect to it on your web browser later on. You can leave these two alone, API based URL and that host because we're not using NATS right now. And the Telegram bot token that you got earlier on when you created your bot, you need to put that in down here. And the chat ID from your own Telegram, put that into there. Do that and then do save and reboot.
And the configuration has been saved.
then there's no need to go and save that over there.
After you finish your configuration, Wireclaw will reboot the ESP32 and it will rejoin on your local area network.
And you're going to need to go to the web page that has the guey for it. Now, in order to find the address of that web page, an easy thing to do is to go into the bot that you created because as soon as it starts, it's going to tell you the address and it gives you both the URL in an IP address form and an actual URL form. And it's going to be the name that you assign to your Wireclaw, in this case, Wireclaw02.local.
So, either of those will take you to the web page. And this is the page itself.
So, this is the Wireclaw main page. And so this means that we've successfully installed Wireclaw and connected it to our Wi-Fi network.
So now that we've installed Wireclaw in our ESP32 and connected it to our network, it's time to have a chat with it using Telegram. Now I haven't connected any other components to the ESP32. The ESP32 dev board that I'm using already has an onboard RGB LED as many of them do and it has an internal temperature sensor as well and that's enough for us to get going with. But before we have a chat, let's go and take a quick look at the Wireclaw guey.
So let's just take a quick look at the guey screen for WireClaw. We're going to be doing most of our interfacing with Wireclaw through Telegram, but it pays to know this too. Now, the first page is the one that we saw when we first configured it. And you can go back and edit some of those configuration values if you want to. Or if you didn't know some of them, such as your Telegram information, etc. when you first set up WireClaw, you can go and fill that in right now and do a save config at the bottom over here. The prompt is very interesting. This is actually the prompt that it's sending to the LLM. So it starts off saying you are a wire claw, a helpful AI assistant running on an ESP32 microcontroller. And so this is kind of interesting and you could go and edit this if you want to experiment and try to give it different behaviors. Myself, I've just basically left this alone. Now memory is interesting. The AI memory, this is the stuff that it stores in PS RAM so that it stays even after you've rebooted the uh ESP32. and we've just started off so there's nothing in there but we'll take a look in there Nate later and we'll probably put something in our memory. Now here's a list of the devices that are attached to it and right now we just have the ESP32 chip.
So this is all the internal stuff. It's listed as virtual. So we have the chip temperature, we have the hour and the minute from the clock plus a combination of the two here and the RGB LED that's on board. And you can see the status of it over here. And as we add devices later on, they will appear on this page.
Now, we haven't set up any rules yet.
This is something we've just uh started.
We've just put Wireclaw onto this. But as we set rules, you will see them over here. And the final page is just a status of Wireclaw right now. It tells you what version you're running, what IP address, and what LLM that you're using right now. And on every page, you have the option to reboot the ESP32.
Okay, let's get chatting with our ESP32 board. I'm going to ask it a question right now. I'm asking what the chip temperature is.
And the first time you do this, it sometimes takes a little while to come back, but there it goes. It tells me the chip temperature is 29.3° C. And so we can get it to do things as well. So let's get it to manipulate the LED right now.
set the LED to red.
And if you look, my onboard LED, the RGB LED, has now been set to red. And it's confirmed it's been setting it to red on the Telegram screen.
Now, I'm going to tell it something right now. I'm going to tell it that my favorite color is blue.
And it remembers that my favorite color is blue. Now, if we go over here and we look in our AI memory, you can see it's got a memory now. And the memory is that the favorite color is blue. So, that's great.
So, now let's set the LED to my favorite color.
And if you look, it's already done it right now. It set the LED to blue.
And so this is just an example of a few of the things that you can do just chatting through wire claw.
Okay. Now I'm about to give it another instruction. I want it to send me a telegram every 2 minutes with the chip temperature.
So I'm going to tell it to do that.
And it says I set up a rule to send you the chip temperature via telegram every 2 minutes. And so let's go and look at rules right now. And now you can see we've got a telegram temp alert rule that it's set. And so every two minutes it's going to send me this by telegram.
So we have to wait of course two minutes until we get the next one. Naturally I'll speed things up for you. By the way, if you're going to do something like this, make sure you turn it off after a while, especially if you've got your phone set to alert you every time you get a telegram alert.
Okay, I stopped it for a little bit just to let some of those uh chip temperature uh messages come through on Telegram.
And if you can see on the screen here at 506, I asked it to do it every 2 minutes. And then at 508, it sent me another one. And it's just about 510 right now. So, we should be getting another one any moment.
And there we go. Oh, here we've got another message coming in that tells me the chip temperature is 28.3° C. And so this will just keep on going until we delete the rule. Now, there's two ways to delete it. You can see that over here, we can delete all of the rules over here, or we could actually ask it to do it for us.
So, I just told it to delete the rule to send the chip temperature every 2 minutes.
And it says I've deleted the rule. And if I refresh my Wireclaw rule screen over here, I can see there's no rules defined anymore. And so that's how you can set up a rule very simply just through Telegram just by chatting to it.
And basically you do everything with WireClaw just by chatting to the chip.
Now so far we've just been using WireClaw with the ESP32 with nothing attached to it. But most ESP32s are attached to different peripherals and wire clock and interface and control them all. Now this brings us up to the concept of devices. Everything we have connected to the ESP32 is a device and we've actually been using devices already. The onboard LED and the temperature sensor inside the ESP32 are both devices. But what we have to do when we attach new devices is we have to define them first and then we can just use them and we can give them a friendly name as well. And so let's go and hook up a couple of components to our ESP32 and start working with external devices.
For our experiment, I've elected to use an ESP32C6 dev kit. You could use any other ESP32C6, S3, or C3 if you wanted to for this experiment.
I'm also using a 10K potentiometer and a standard LED. I used a red one, but really the color doesn't matter.
You'll also need a dropping resistor for that LED, and I'm using a 330 ohm resistor for that.
We'll begin by wiring one side of the potentiometer to the ground connection on the ESP32.
The wiper of the pot will be connected to ESP32 pin GPIO2. Now, if you're using a different ESP32 and you don't have an output for GPIO2, you could use a different GPIO pin. And the other side of the pot will be connected to the 3.3 volt output from the ESP32.
The cathode of our LED will be connected to the ground and the anode will be connected to one side of the dropping resistor and the other side of the dropping resistor will be connected to pin GPIO10.
Again, you could use a different input if you don't have DPIO10 on your ESP32.
And this completes the wiring. Now, let's go and use this with wire claw.
All right, I've got everything wired up on a small solderless breadboard. You can see my potentiometer and my LED is buried down here. Now, if we go back to our Telegram window, we can uh start chatting with our ESP32.
And the first thing we're going to do is just tell it the list of devices it has right now.
And it gives us the internal temperature, the hour, the minute, the hour, minute, and the uh RGB LED. And those are the same things we see over here on this page. Okay. Now, if you remember, I've connected my LED to GPIO pin number 10. So, let's let it know about that.
So, you can see what I've done over here. I registered a digital output actuator and I gave it a name of external_ledd and I told it what GPIO pin that it was on and it confirms that it is registered that. And so now if I go back and refresh this list of devices here I see my external LED. It's down over here.
So now if I want to I can turn the external LED on and you can see my LED has come on and it's come and confirmed that and if I refresh this you can see the value is now on. I can also directly talk to this just using the GPIO pin number if I want to if that's more convenient.
I set GPIO pin number 10 low and the LED has turned off.
Okay, now let's go and work with the potentiometer. If you remember, we have that on pin GPIO2.
And so I'm going to register an analog input sensor. I'm going to call it knob.
And it's on pin GPIO number two. So now it's registered an analog input sensor called knob GPIO2.
I go to my devices.
I'll see it down here. I've got knob.
It's an analog input. It's got a value of 500 right now. Now let me go and move the potentiometer and we'll refresh this. And now the value has changed. So we're reading it.
I can also read it of course through telegram. I say read knob and I'll get my value back.
So what I'm doing now is I'm setting up a rule. I'm saying send me a telegram message when the knob goes above 2,000 saying the knob is high and give me the value. Say it's okay. have created a rule. So, let's see if it's done that.
And there it is, the knob high alert.
And it's when it's over 2,000, it's going to send me a telegram message. And so, now let's turn the knob up a bit here.
See if we can get it over 2,000.
And there we go. Knob is high. I got my message right away on Telegram. So, that works. So, I'm able to set up a rule for any device. And once you set the rule up, by the way, it's running on the ESP32. So it has no need to go to the LLM or anything like that. So it works very quickly like that. So as you can see it's very easy to work with external IO devices using a wire claw.
Now one additional thing that wireclaw has provisions for is connecting an external microcontroller to the ESP32 and communicating with it via the serial port. And we're going to do that right now. Now they call this mode the Arduino mode. Although Arduino is just a generic term for another microcontroller. In fact, I'm going to be using a Raspberry Pi Pico for my external microcontroller.
By connecting an external microcontroller, you can add peripherals to that microcontroller and get readings from those and send them down the serial line to the ESP32 and chat with that using Telegram, etc. So, it allows you to build a pretty sophisticated setup. So, let's go and hook up a Raspberry Pi Pico to our ESP32 and start working in Arduino mode. Now, once again, I'm using an ESP32C6 dev kit for my Wireclaw installation. In fact, I'm using the same ESP32 I did for the last experiments. And if you're going to do that, you don't need to disconnect the components we already have hooked up. They won't interfere with this experiment. We're also going to be using a Raspberry Pi Pico. And I'm using the original Pico, but any of the Pico variants would work. And finally, we'll need another 10K linear tapered pot. We'll begin by connecting one side of the pot to the ground connection on the Raspberry Pi Pico. We'll connect the pot's wiper to the analog to digital zero channel on the Raspberry Pi Pico.
and the other end of the potentiometer will be connected to the Pico's 3.3 volt output. We'll also connect pin one of the Pico, which is the UART zero transmit pin to GPIO pin 4 on the ESP32.
And this is a UART receive pin on the ESP32.
And finally, we'll connect one of the Pico's grounds to one of the ESP32 grounds. This is a very important connection, so make sure you don't emit it. And that's it for the wiring. Now, let's go and use our Raspberry Pi Pico along with an ESP32 running wire claw.
Now, here's a sketch that we're going to run on the Raspberry Pi Pico. And it's a very, very simple sketch. We're just basically reading the potentiometer and sending its value out the UART so that the ESP32 can pick it up. Now, we're going to start off by defining the pin that we have the potentiometer on.
That's address pin A0, which is also GPIO26.
And we'll go into our setup. We set the analog read resolution to 12 bits. So we go from 0 to 4095. And then we have two serial begins. We have the regular serial begin. And this will drive our uh serial monitor here. And then we have serial one begin. And serial one is UART0. And that's the one that we're using to transmit to the ESP32. We're going to set that up at 9600 baud. So it goes at a much lower baud rate than the one that we're using for our serial monitor. We'll delay a second and then just print out the serial monitor that we're starting. And we go into the loop and it's again very simple. We're going to do an analog read of that pot pin.
And then we'll print our values to both places. We'll print it to the serial monitor and print it out to UART zero so that we're sending it over to wireclaw.
We're going to delay a second and then do it again. And so every second will take a reading off of the pot pin. So let's go and load this into our Pico and see if we can read it using the ESP32 running wire claw.
Okay, we're back in Telegram and I'm telling it to connect an Arduino on serial at 9600 baud and register it as a sensor called Arduino_L.
And it says that it has done it. We see it over here. and it's also picking a value up from it. Now, that's the value that we're getting from the serial monitor. Now, let's bring up the Arduino IDE over here.
And you can see we've got values on it.
I'm going to change the pot here. So, we're going to get a different value and see if we can pick up a value using Telegram.
And it's reading a value over there. It read it at 485.
And you can also see the values change.
Let me just move that over to this side here. We'll refresh that. And you see the value down over here. And let me just move the pot over here a bit.
And I'll refresh it. And you see we're seeing the same value we see on that side there. So we've been able to connect an external microcontroller and pick up uh devices from that microcontroller using the ESP32. Now, we sent it a very simple serial command. We just basically kept sending it the value. But you can also use a JSON string and it's formatted as a name value pair and it will recognize that.
And so you can have a number of different sensors and actuators on your Raspberry Pi or whatever it is that you have as an external board and you can read all of that on the ESP32 using wire claw.
Now, at the beginning of the video, I mentioned that Wireclaw is not the only product that is trying to implement open claw type functionality to microcontrollers. Another one to look for is ESP Claw, and this is made by Espresso themselves. I was playing with that as well, and it's very similar to WireClaw. One difference with ESP Claw though is it currently doesn't support that many different models of ESP32, but it is definitely something that bears looking at. Now, if you want some more information about WireClaw, if you want to grab the code I used with the Raspberry Pi Pico, you'll find all of that in the article that accompanies this video on the dronebotworkshop.com website. And there's a link below the video to that article. While you're on the website, if you haven't yet, please consider signing up for my newsletter.
just my way of letting you know what goes on here in the workshop and occasionally giving you previews of my videos. And it is free to sign up. It's also free to sign up for the DroneBot workshop forums where you can discuss wireclaw, artificial intelligence, electronics, and a bunch of other topics with a bunch of like-minded individuals and they can help you out with your project if you're having some problem with it. And of course, it's always free to subscribe to the YouTube channel. I make videos about electronics, microcontrollers, artificial intelligence, and if you like this video, you'll probably like my other ones. Subscribing is very easy to do.
All you need to do is click on that red subscribe button and also click that bell notification and that way you'll get notified every time that I make a new video. So, until we meet the next time, please take care of yourself, stay safe out there, and I'll see you soon here in the Dronebot workshop. Goodbye for now.
Ähnliche Videos
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 views•2026-05-29
Long-Running Agents — Build an Agent That Never Forgets with Google ADK
suryakunju
142 views•2026-05-30
This computer is made from real human brain cells. And you can buy it.
Talktmsmedia
3K views•2026-05-28
BREAKING: Microsoft’s New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 views•2026-06-03
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 views•2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K views•2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 views•2026-05-29
3D Platformer Update - NO CAPES
SolarLune
294 views•2026-05-30











