AI 资讯
Beyond Arduino: Getting Started with ESP-IDF in VS Code for ESP32
Note: This tutorial was originally published on effessdev.github.io . Check out the original article for the most up-to-date version: https://effessdev.github.io/posts/2026-07-27/ This is a step-by-step tutorial that explains how you can set up your development environment for working with ESP-IDF projects in VS Code . Install ESP-IDF Install EIM Espressif Systems provides a graphical tool called EIM (ESP-IDF Installation Manager) to install ESP-IDF. Click the link below to go to the official page to download EIM: https://dl.espressif.com/dl/eim/ Make sure you are in the "Online Installer" tab. The exact file to download depends on your system: Windows: Download eim-gui-windows-x64.exe . Run this installer to install EIM. Linux x64 (Ubuntu): Download and install the .deb package ( eim-gui-linux-x64.deb ). Install ESP-IDF using EIM Now that we have installed EIM, let's install ESP-IDF using it. Open EIM. Under "New Installation" click "Start Installation". Under "Easy Installation", click "Start Easy Installation" to install the latest stable version of ESP-IDF with default settings. If there are no problems, you will see the "Ready to Install" page. Click "Start Installation". Install ESP-IDF VS Code Extension We use this extension as a high-level wrapper for ESP-IDF. Most times, we do not use ESP-IDF directly. For example, if we need to compile our source code, we ask the extension to do it, which uses the ESP-IDF we just installed internally to to compile the source code. Install the extension named "ESP-IDF" by "Espressif Systems" in VS Code. Verify installation After installing, restart VS Code. Use the shortcut Ctrl + Shift + P to open the command palette (remember this shortcut, we are going to use it a lot). Inside the command palette, search ESP-IDF . You will see many entries which start with ESP-IDF: . Those commands are provided my the ESP-IDF extension. These commands are what we use for almost everything. Note If you are not in an ESP-IDF project, you m
AI 资讯
LighthouseReckoning: A Lightweight LoRa Mesh Network for Arduino, ESP32 and RP2040
LighthouseReckoning LighthouseReckoning is a lightweight LoRa mesh networking library for Arduino-compatible microcontrollers, currently tested on ESP32 and RP2040 with SX126x LoRa radios. What is LighthouseReckoning? The goal is simple: Sensor → Relay → Relay → Home One node acts as the Home node . Other nodes automatically determine a path toward it. A node does not need to know the entire network topology. Instead, nodes exchange information about their distance to Home and select a suitable neighboring node as their next hop. For example: Sensor | v Sensor → Relay → Relay → Home ^ | Sensor This allows nodes to communicate over multiple hops without manually configuring routes. How does routing work? Each node keeps track of information about its neighbors and their distance to Home. For example: Node Distance Home 0 hops Relay A 1 hop Relay B 2 hops Sensor C 3 hops Sensor C can therefore forward its data toward Relay B, which forwards it toward Home. When the network changes, nodes can update their routing information and select a different path. Hop-by-hop reliability LighthouseReckoning uses hop-by-hop confirmation instead of requiring one end-to-end acknowledgment. Sensor C → Relay A → Relay B → Home Sensor C only needs confirmation that Relay A received its packet. Relay A then handles the next hop independently. This allows each node to deal with retries locally instead of requiring Home to maintain the state of every route in the network. Using the library A basic node can be initialized with: #include <RadioLib.h> #include <LighthouseReckoning.h> LighthouseReckoning lhr ; void setup () { // Initialize your LoRa radio here lhr . beginAsNode ( & radio , 0xA1B2C3D4 ); } void loop () { lhr . update (); uint8_t payload [] = { 0x01 , 0x02 , 0x03 }; // Send application data when needed lhr . sendData ( payload , sizeof ( payload )); } The Home node uses beginAsHome() and can receive application data through the library's callback mechanism. The library is design
AI 资讯
ESP32 HTTP Client Sem Dores de Cabeça: Consuma REST APIs com Zero Alocação de Memória
Consumindo REST APIs no ESP32 sem Estourar a Memória: Conheça o ESP32-HTTP-Client Se você já desenvolveu projetos IoT no ESP32 que se comunicam com APIs REST (seja para enviar dados de sensores para a nuvem, consultar status de serviços ou integrar com Firebase e AWS), provavelmente já enfrentou um destes problemas clássicos: Fragmentação e estouro de heap: O combo padrão HTTPClient + ArduinoJson precisa carregar todo o payload HTTP na RAM como String antes de desserializar o JSON. Em payloads médios ou grandes, isso gera Out of Memory ou travamentos intermitentes. Lentidão em requisições consecutivas: O HTTPClient padrão refaz o handshake TLS/TCP repetidamente, adicionando centenas de milissegundos a cada chamada. Código verboso e boilerplate excessivo: Mais de 15 a 20 linhas de código para instanciar clientes, extrair buffers, checar erros e navegar em nós JSON. Para resolver esses gargalos de forma elegante e moderna, foi criada a biblioteca ESP32-HTTP-Client . O que é o ESP32-HTTP-Client? O ESP32-HTTP-Client é um cliente HTTP/REST moderno, fluente e orientado a objetos para ESP32, projetado especificamente para sistemas embarcados de alta eficiência. Em vez de "fazer download da resposta, guardar na memória e depois processar", ele utiliza Direct Memory Binding (injeção direta) e Stream Parsing : os dados do JSON são lidos diretamente do stream da rede e injetados direto nas suas variáveis ou struct s em C++, sem armazenar o payload inteiro na RAM . // Uma linha. Zero strings intermediárias. Injeção direta em memória. client . get ( "/sensor" ). getBody ( "temperature" , & myFloatVariable ); Benchmark: ESP32-HTTP-Client vs Abordagem Tradicional Em testes controlados com 100 requisições HTTP consecutivas contendo payloads JSON (usando o endpoint /users do JSONPlaceholder), os resultados comprovam a economia de recursos: Métrica / Recurso HTTPClient + ArduinoJson (Padrão) ESP32-HTTP-Client Diferencial Heap alocado por requisição ~58.2 KB ~0.0 KB (15 bytes) ~99.9%
开发者
ESP32 OLED Mini Shooter Game: Full Beginner Tutorial
Want to turn a small ESP32 board into a mini arcade game you can actually play? This ESP32 OLED Mini Shooter Game uses a 128x64 OLED display and two push buttons to create a simple shooter experience. The player moves left and right, bullets fire upward, and enemies fall from the top of the screen. It is a small project, but it already feels like a real handheld game once the display starts updating. This build is a great next step after basic OLED and button tutorials. Instead of only printing text or drawing one shape, the code manages several moving objects at the same time. It tracks the player, bullets, enemies, collisions, and game-over state. The screen is divided into a simple grid. The 128x64 OLED becomes a 16x8 playfield, where each tile is 8x8 pixels. This makes object movement easier to understand because the player, enemies, and bullets move by grid position instead of raw pixel math. Why build it? This project teaches interactive programming on real hardware. The ESP32 reads button input, updates game objects, checks collisions, and draws the next frame on the OLED. That is much more active than a normal sensor display project. It also teaches timing without blocking the whole game flow. The code uses millis() to control when bullets and enemies update, so they can move at different speeds. This is useful because many embedded projects need timed actions without stopping everything else. What you'll learn ESP32 OLED display control - drawing text, squares, circles, and game objects on an SSD1306 screen. Custom I2C pins - using Wire.begin(5, 19) so the OLED uses GPIO5 for SDA and GPIO19 for SCL. Button input handling - reading two push buttons for left and right movement. Debounce logic - preventing one press from being counted many times. Grid-based game design - turning a 128x64 screen into a simple 16x8 game map. Game object arrays - storing multiple bullets and enemies with active/inactive states. Timer-based updates - using millis() to move bullets
开发者
Build a Cloud-Connected Weather Station with Arduino UNO R4 WiFi
Learn how to build a real IoT weather station using the Arduino UNO R4 WiFi and BME280 sensor, sending live temperature, humidity, and pressure data to Arduino IoT Cloud — with full code, wiring diagrams, and dashboard. What We're Building In this project, you'll build a cloud-connected weather station that measures: Temperature (°C / °F) Humidity (%) Atmospheric Pressure (hPa) All three readings will be streamed live to the Arduino IoT Cloud , where you can monitor them from anywhere in the world via a browser or the free Arduino IoT Remote app on your phone. Components Required Component Qty Notes Arduino UNO R4 WiFi 1 Built-in ESP32-S3 WiFi module BME280 Sensor Module 1 Measures temp + humidity + pressure via I²C Breadboard 1 Full or half size Jumper Wires (M-M) 4 For I²C connections USB-A to USB-C Cable 1 For power & programming Why BME280 over DHT22? The BME280 gives you three measurements (including barometric pressure) over a single I²C bus using just 2 wires, making it more capable and cleaner to wire. The DHT22 only gives temperature and humidity. Wiring the BME280 to Arduino UNO R4 WiFi The BME280 uses the I²C protocol , so it only needs 4 wires: BME280 Pin → Arduino UNO R4 WiFi Pin ────────────────────────────────────── VCC → 3.3V GND → GND SDA → A4 (I²C Data) SCL → A5 (I²C Clock) Important: The BME280 runs on 3.3V , not 5V. Connecting it to the 5V pin can damage the sensor permanently. Here's the schematic overview: ┌────────────────────────────┐ │ Arduino UNO R4 WiFi │ │ │ │ 3.3V ──────────────► VCC │ │ GND ──────────────► GND │ ← BME280 │ A4 ──────────────► SDA │ │ A5 ──────────────► SCL │ └────────────────────────────┘ ☁️ Step 1 — Set Up Arduino IoT Cloud Before writing any code, you need to configure the Arduino IoT Cloud . It's free for up to 2 devices. 1.1 Create a Free Account Go to cloud.arduino.cc and sign up or log in. 1.2 Create a New "Thing" Click Things in the left sidebar Click + Create Thing Name it WeatherStation 1.3 Add Your Device Click
AI 资讯
Why Arduino Is Named After a Bar in Italy
Ask a roomful of engineers where the name "Arduino" comes from and you will get confident answers about acronyms, Italian for "bold friend," or some clever electronics pun. Almost all of them are wrong. The most influential open-source microcontroller board in history — the one that introduced millions of students, artists, and tinkerers to embedded development — is named after a bar. The pub in Ivrea The story begins in Ivrea, a small town in northern Italy straddling the Dora Baltea river. In the early 2000s it was home to the Interaction Design Institute Ivrea, where a team led by Massimo Banzi was looking for a cheap, approachable way to teach design students how to make things that sense and respond to the world. The tools available at the time were either too expensive or too intimidating for people who were not electrical engineers. So, in 2005, the team built their own board and released the design as open hardware. They needed a name. Banzi and his collaborators were regulars at a local pub called Bar di Re Arduino — "the Bar of King Arduino." When it came time to christen the project, the bar's name stuck. There was no acronym, no marketing committee, no focus group. The board was named after the place where the people who made it spent their evenings talking through ideas. The medieval king behind the bar The bar itself carries a much older name. Arduin of Ivrea — Arduino in Italian — was a real historical figure, an Italian nobleman who became King of Italy in 1002 and held the crown until 1014. He is one of Ivrea's famous "underdog kings," remembered locally long after his short reign ended. So the chain runs a thousand years deep: a development board used in connected sensors and robots today is named after a pub, which was named after an early-medieval king who ruled around the year 1000. It is the kind of detail that sounds like trivia, but it points at something real about how durable technology actually comes together. Why the origin story matters