Quick Start
Get your first device online and displaying live data in under 5 minutes.
Prerequisites
- A VwireIOT account — sign up at app.vwire.io
- An ESP32 or ESP8266 (recommended), or any MQTT-capable board
- Arduino IDE with the Vwire Arduino Library installed
Installing the library
- In Arduino IDE: Sketch → Include Library → Manage Libraries
- Search Vwire
- Click Install (also install the required dependencies: PubSubClient and ArduinoJson)
Step 1 — Create a device
- Log in to the VwireIOT Dashboard
- Go to Devices → Add Device, enter a name, and click Create
- Open the device settings and copy two values:
- Auth Token — secret key used to authenticate the connection
- Device ID — the device's identifier (e.g.
VU-XXXXXX)
Step 2 — Flash your device
Use this minimal sketch. Replace the placeholders with your actual WiFi credentials, auth token, and device ID:
#include <Vwire.h>
// WiFi credentials
const char* WIFI_SSID = "YOUR_WIFI_SSID";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";
// From device settings in the dashboard
const char* AUTH_TOKEN = "YOUR_AUTH_TOKEN";
const char* DEVICE_ID = "YOUR_DEVICE_ID"; // e.g. VU-ABC123
void setup() {
Serial.begin(115200);
// Configure Vwire (connects to mqtt.vwire.io:8883 via TLS by default)
Vwire.config(AUTH_TOKEN);
Vwire.setDeviceId(DEVICE_ID);
// Connect to WiFi and the Vwire cloud
Vwire.begin(WIFI_SSID, WIFI_PASSWORD);
}
void loop() {
// Must be called every loop iteration
Vwire.run();
static unsigned long lastSend = 0;
if (Vwire.connected() && millis() - lastSend >= 2000) {
lastSend = millis();
// Send a simulated temperature reading to pin V0
float temperature = 23.5; // replace with actual sensor reading
Vwire.virtualSend(V0, temperature);
}
}
Upload the sketch. Open the Serial Monitor at 115200 baud and wait for the connected message. Your device will appear Online in the dashboard.
Step 3 — Create a project and add a widget
- In the dashboard, go to Projects → New Project, enter a name, and click Create
- Click + Add Widget and choose Value Display
- Set:
- Device → your newly created device
- Pin →
V0 - Suffix →
°C - Label →
Temperature
- Click Save — the widget immediately shows the live value from your device
Step 4 — Add a historical chart
- Click + Add Widget and choose Graph
- Set the same device and pin
V0 - Set Duration to
1hand click Save
You now have a live temperature readout and a scrolling historical chart.
Receiving commands from the dashboard
To react to values written from a dashboard widget (e.g. a Button or Switch on V1):
// Declare this outside setup() and loop()
VWIRE_RECEIVE(V1) {
int value = param.asInt(); // 0 or 1
digitalWrite(LED_BUILTIN, value);
Serial.printf("V1 received: %d\n", value);
}
The VWIRE_RECEIVE macro auto-registers the handler — no additional setup required.
Next steps
-
Your First Project — complete DHT22 temperature + humidity monitor walkthrough
-
Add more widgets → Widget Overview
-
Set up push notifications → Alerts Guide
-
Share your project with a teammate → Project Sharing
-
Explore all Arduino API methods → Arduino Library