- ✓ Generating firmware from OceanRemote dashboard
- ✓ Flashing ESP8266 D1 Mini / D1 Large
- ✓ Flashing ESP32 Dev Module
- ✓ Flashing Raspberry Pi Pico W (BOOTSEL mode)
- ✓ Verifying your device connects successfully
- ✓ Troubleshooting common flashing issues
Prerequisites
- ✅ OceanRemote account created and activated
- ✅ Arduino IDE installed (Tutorial 04)
- ✅ Board support installed (Tutorials 05-07 for your board)
- ✅ Required libraries installed (Tutorial 08)
- ✅ Your device wired and ready (Tutorials 10-14)
- ✅ USB cable (data, not charge-only)
Make sure your device is properly wired before flashing. Incorrect wiring won't damage the board, but relays and sensors won't work correctly.
Step 1: Generate Firmware from Dashboard
- Log in to your OceanRemote dashboard
- Click "Add New Device" button (or go to /your-device/)
- Fill in the configuration form:
- Board Type: Select your board (ESP8266 D1 Mini, ESP32, Pico W, etc.)
- WiFi SSID: Your WiFi network name
- WiFi Password: Your WiFi password
- Relay Names: Custom names (e.g., "AC", "Fan", "Light")
- Relay Logic: Positive (HIGH=ON) or Negative (LOW=ON) - most cheap relay modules use Negative Logic
- Sensor Type: DHT22, DS18B20, NTC, or None
- Sensor Configuration: For NTC, enter Beta, R25, and Series Resistor values
- Click "Generate Firmware Code"
- A modal window will appear with the complete firmware code
- Click "Copy to Clipboard" or select all and copy (Ctrl+C / Cmd+C)
- Positive Logic (🔺) - Relay turns ON when pin is HIGH (3.3V). Common for industrial relay modules.
- Negative Logic (🔻) - Relay turns ON when pin is LOW (0V). Most cheap 5V relay modules use this.
If your relay clicks when you expect it to be OFF, change the logic setting.
Your generated firmware contains your WiFi password and a unique device token. Keep it private. Do NOT share it online. If compromised, regenerate a new token from the device dashboard.
Step 2: Prepare Arduino IDE
- Open Arduino IDE
- Create a new sketch: File → New
- Delete any existing code in the editor
- Paste the copied firmware code (Ctrl+V / Cmd+V)
- Select your board: Tools → Board → [Your Board]
- Select the correct port: Tools → Port → [Your Port]
- Verify board settings (Tutorial 09 for optimal settings)
Step 3: Flashing ESP8266 (D1 Mini / D1 Large)
Upload Steps:
- Connect your ESP8266 to your computer via USB
- Select the correct port (COM3 on Windows, /dev/cu.usbserial-* on Mac, /dev/ttyUSB0 on Linux)
- Click the Verify button (✓ checkmark) to compile the code
- Wait for compilation to complete (should say "Done compiling")
- Click the Upload button (→ right arrow)
- Watch the progress bar
- Wait for "Done uploading" message
Expected ESP8266 Upload Output: Compiling sketch... Connecting........____ Uploading... Done uploading.
ESP8266 Upload Troubleshooting:
| Problem | Solution |
|---|---|
| "Timed out waiting for packet header" | Hold FLASH button on board while uploading, then press RST |
| "Failed to connect to ESP8266" | Check port selection, USB cable, and drivers (CH340/CP2102) |
| "Invalid head of packet" | Lower upload speed to 115200 in Tools menu |
| Board not recognized | Install CH340/CP2102 USB drivers (Windows only) |
Step 4: Flashing ESP32
Upload Steps:
- Connect your ESP32 to your computer via USB
- Select the correct port
- Click Verify to compile
- Click Upload
- IMPORTANT: Hold the BOOT button on your ESP32 when you see "Connecting..." in the console
- Release BOOT button when upload starts
- Wait for "Done uploading"
Expected ESP32 Upload Output: Compiling sketch... Connecting...___ (press BOOT here) Uploading... Done uploading.
ESP32 Upload Troubleshooting:
| Problem | Solution |
|---|---|
| "Failed to connect to ESP32: Timed out" | Hold BOOT button until you see "Connecting...", then release |
| "A fatal error occurred" | Check port selection and USB cable |
| "Invalid head of packet" | Lower upload speed to 115200 |
| Brownout detector was triggered | Use a better USB cable or power supply (5V 2A) |
Step 5: Flashing Raspberry Pi Pico W
The Pico W uses a different upload method (UF2 file copy). No COM port needed!
Upload Steps:
- Disconnect the USB cable from your Pico W
- Press and HOLD the BOOTSEL button (white button on the board)
- While holding BOOTSEL, connect the USB cable to your computer
- Release the BOOTSEL button after 2 seconds
- A drive called "RPI-RP2" should appear on your computer
- In Arduino IDE, select Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico W
- You don't need to select a port (Pico W uses UF2 upload)
- Click Verify to compile
- Click Upload - Arduino will compile and copy the UF2 file to the Pico W
- The Pico W will automatically reset and run your code
Expected Pico W Upload Output: Compiling sketch... Uploading... Writing to RPI-RP2 drive... Done uploading.
If the upload gets stuck at "Looking for drive", manually copy the UF2 file from the Arduino temp folder (C:\Users\[User]\AppData\Local\Temp\arduino\sketches\) to the RPI-RP2 drive.
Pico W Upload Troubleshooting:
| Problem | Solution |
|---|---|
| "RPI-RP2" drive not appearing | Try a different USB cable (many are charge-only). Hold BOOTSEL longer (5 seconds). |
| Upload stuck at "Looking for drive" | Manually copy the UF2 file to RPI-RP2 drive |
| Serial Monitor not working | Close and reopen Serial Monitor, or press RUN button |
| Board not recognized at all | Install Pico W drivers (Windows only). On Mac/Linux, no drivers needed. |
Step 6: Monitor Serial Output
After successful upload, open the Serial Monitor to see your device connect:
- In Arduino IDE, go to Tools → Serial Monitor
- Set baud rate to 115200 (bottom right corner)
- You should see output like:
######################################## # OceanicRemote v4.4 - ESP8266 D1 Mini # ######################################## [SYSTEM] Device ID: ESP_AABBCCDDEEFF [WiFi] Connecting... Connected! [WiFi] IP: 192.168.1.100 [REG] Registering... [REG] ✓ Registered! [SESSION] Got session: a1b2c3d4 [SENSOR] DHT22 - Temp: 23.5°C, Hum: 45.2% ....
- Device ID - Unique identifier (e.g., ESP_AABBCCDDEEFF)
- WiFi Connected - Your device joins your network
- Registered - Device registers with OceanRemote server
- Session ID - Unique session token (changes periodically)
- Sensor readings - Temperature/humidity values
- Periodic dots (.) - Device polling every 5 seconds
Step 7: Verify Device in Dashboard
- Go to your OceanRemote dashboard
- Your device should appear in the "My Devices" section
- Check the status indicator:
- 🟢 ONLINE (Green) - Device is communicating properly
- 🟡 AWAY (Yellow) - Device was online but missed a few polls
- 🔴 OFFLINE (Red) - Device is not communicating
- Try toggling a relay - the button should change state
- If you have a sensor, temperature should appear
If your device shows ONLINE, congratulations! Your IoT device is now connected to OceanRemote. You can control it from anywhere in the world.
Troubleshooting: Device Won't Connect
Problem: Serial Monitor Shows "WiFi Connecting... Failed"
- Check WiFi SSID and password in the generated firmware
- Make sure you're using 2.4GHz WiFi (ESP8266/ESP32/Pico W don't support 5GHz)
- Check WiFi signal strength (move device closer to router)
- Verify WiFi network doesn't have special characters in SSID/password
Problem: "Registration failed" or "Invalid token"
- Registration token expires after 24 hours. Generate new firmware if too much time passed.
- Make sure you didn't modify the token in the firmware code
- Check that your account is active (email confirmed)
Problem: Device shows OFFLINE in dashboard but Serial Monitor shows polling
- Check that the device ID in Serial Monitor matches the device in dashboard
- Wait 30 seconds - first connection may take time
- Check server connectivity: can your device reach www.oceanremote.net?
- Try power cycling the device
Problem: Relays not responding
- Check relay VCC is connected to 5V (not 3.3V)
- Verify relay logic (Positive vs Negative) in dashboard device settings
- Check that IN pins are connected to correct GPIOs (D1-D5 for ESP8266, GPIO16-20 for Pico W)
- Test GPIO pin with a multimeter or LED
Many users forget to change the relay logic. If your relay clicks when you expect OFF and stays silent when you expect ON, change the logic setting in your device dashboard!
After Successful Flash
Once your device is online, you can:
- Control relays - Click buttons in dashboard to turn devices ON/OFF
- Monitor sensors - View temperature and humidity in real-time
- Calibrate temperature - Add offset if readings are inaccurate
- Customize relay names - Change names in device settings
- Regenerate token - If you suspect your token was compromised
- Delete device - Remove from dashboard (cannot be undone)
- Tutorial 16-20: Learn about sensors (DHT22, DS18B20, NTC)
- Tutorial 21-24: Advanced relay configurations
- Tutorial 25-30: Troubleshooting and best practices
Flashing Multiple Devices
To add more devices to your account:
- Repeat Step 1 (Generate Firmware) for each new device
- Each device gets its own unique token
- Flash each device individually (same process)
- All devices appear in your dashboard
- You can control them independently
Your device is now flashed and connected to OceanRemote. You can control it from anywhere in the world with an internet connection.
What will you build? A smart garden? Remote temperature monitor? Automated workshop? The possibilities are endless!