OC
OceanRemote
Low-code IoT platform
← Back to Tutorials
← Previous Next β†’

Tutorial 25: Common Connection Issues and Fixes

πŸ“– What You'll Learn in This Tutorial:
  • βœ“ WiFi connection problems and solutions
  • βœ“ Device not showing in dashboard
  • βœ“ Relay not responding or behaving strangely
  • βœ“ Sensor reading issues
  • βœ“ Serial monitor debugging techniques
  • βœ“ Power-related problems

Diagnostic Checklist (Before Troubleshooting)

Before diving into specific issues, check these basics:

  1. βœ… Is your device powered? (Check LED)
  2. βœ… Is your USB cable data-capable (not charge-only)?
  3. βœ… Is the correct port selected in Arduino IDE?
  4. βœ… Is the correct board selected?
  5. βœ… Did the firmware upload successfully? (Check Serial Monitor)
  6. βœ… Is your 2.4GHz WiFi working? (ESP8266/ESP32/Pico W don't support 5GHz)
  7. βœ… Is your account confirmed? (Check email)
πŸ’‘ First Step:

Always check the Serial Monitor (115200 baud) first. It shows exactly what your device is doing and where it's failing.

Section 1: WiFi Connection Issues

Problem: "WiFi Connecting... Failed" in Serial Monitor

Possible Cause Solution
Wrong SSID/password Regenerate firmware with correct credentials
5GHz WiFi network Use 2.4GHz network (ESP boards don't support 5GHz)
Special characters in SSID/password Avoid $, %, &, etc. or escape them properly
Hidden SSID Make network visible or add manually in code
MAC address filtering Add device MAC to router whitelist
Signal too weak Move device closer to router or add external antenna
Serial Monitor Output (WiFi Failure):
[WiFi] Connecting... ........ Failed!
[ERROR] Cannot connect to WiFi - restarting

Serial Monitor Output (WiFi Success):
[WiFi] Connecting... Connected!
[WiFi] IP: 192.168.1.100

Problem: WiFi connects but drops frequently

  • Cause: Interference or weak signal
  • Fix:
    • Move device closer to router
    • Change WiFi channel on router (avoid congested channels)
    • Add external antenna to ESP32 (if supported)
    • Use WiFi repeater/extender

Section 2: Device Not Showing in Dashboard

Problem: Device registers but doesn't appear

  1. Check Serial Monitor for registration message:
    [REG] Response: 200
    [REG] βœ“ Registered!
  2. Check your dashboard after 10-15 seconds (may take time to appear)
  3. Refresh the page (Ctrl+F5)
  4. Check if device appears in "Pending Devices" section
  5. Verify you're logged into the same account used to generate firmware

Problem: "Registration failed" error

Error Message Meaning Solution
"Invalid registration token" Token doesn't exist or is malformed Generate new firmware
"Token already used" Registration token already used Generate new firmware (token is one-time use)
"Token expired" Registration token expired (24 hours) Generate new firmware
"Device limit reached" You've reached your device limit (default 10) Delete unused devices or contact support
⚠️ Registration Token Expiry:

Registration tokens expire after 24 hours. If you generated firmware but didn't flash it within 24 hours, generate new firmware.

Section 3: Relay Problems

Problem: Relay doesn't click when button is pressed

  1. Check VCC connection (relay needs 5V, not 3.3V)
  2. Check GND connection
  3. Check IN pin connection to correct GPIO
  4. Verify relay logic (Positive vs Negative) in dashboard
  5. Test GPIO pin with a multimeter or LED
Test GPIO Pin with Multimeter:
1. Set multimeter to DC voltage (20V range)
2. Connect black probe to GND, red probe to GPIO pin
3. Click relay button in dashboard
4. Voltage should change: 0V β†’ 3.3V (or 3.3V β†’ 0V depending on logic)

Problem: Relay clicks but connected device doesn't turn on

  • Check COM and NO/NC wiring
  • Most loads connect to COM and NO (Normally Open)
  • Verify the connected device is powered
  • Check relay contact rating (don't exceed maximum current)
Relay Terminal Explanation:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  COM (Common)    β†’ Connected to device powerβ”‚
β”‚  NO (Normally Open)   β†’ Connected to device β”‚
β”‚  NC (Normally Closed) β†’ Connected to device β”‚
β”‚                     (opposite of NO)        β”‚
β”‚                                             β”‚
β”‚  Relay OFF: COM connected to NC             β”‚
β”‚  Relay ON:  COM connected to NO             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Problem: Relay chatters or buzzes

  • Cause: Insufficient power or electrical noise
  • Fix:
    • Add 100Β΅F capacitor across VCC and GND of relay module
    • Use external power supply for relays
    • Check if GPIO pin is floating (should be driven HIGH or LOW)

Problem: Wrong relay activates (e.g., Relay 2 activates when clicking Relay 1)

  • Check IN pin wiring (IN1 β†’ GPIO for relay 1, etc.)
  • Verify pin mapping in firmware matches your wiring
  • Check for short circuits between IN pins

Section 4: Sensor Problems

Problem: DHT22 shows "Invalid resistance" or no readings

Issue Solution
DATA pin wrong Connect to correct GPIO (D2 on ESP8266, GPIO15 on ESP32/Pico W)
Missing pull-up resistor Add 4.7kΞ© resistor between DATA and 3.3V
Wrong power voltage DHT22 can use 3.3V or 5V (be consistent)
Faulty sensor Test with separate sketch or replace sensor

Problem: DS18B20 shows -127Β°C

  • Cause: Missing pull-up resistor
  • Fix: Add 4.7kΞ© resistor between DATA and 3.3V
  • Alternative: Enable internal pull-up in software (less reliable)

Problem: NTC Thermistor shows incorrect temperature

  • Check voltage divider circuit (NTC between 3.3V and A0, 10kΞ© resistor between A0 and GND)
  • Verify Beta value matches your NTC (common values: 3950, 3435, 4250)
  • Check R25 value (usually 10kΞ© or 100kΞ©)
  • Use calibration offset in dashboard
πŸ”§ NTC Troubleshooting:

If readings are consistently off by a few degrees, use the calibration offset. If readings are wildly wrong, check your Beta value and resistor values.

Section 5: Power Problems

Problem: Device resets when turning on relay

  • Cause: Power supply cannot provide enough current
  • Fix:
    • Use external 5V 2A+ power supply for relays
    • Add 1000Β΅F capacitor across power supply
    • Use separate power supplies for microcontroller and relays (connect grounds)
Separate Power Supply Wiring:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                             β”‚
β”‚  USB Power (5V)         External 5V Power Supply (2A+)      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”‚
β”‚  β”‚ ESP8266 β”‚            β”‚ Relay Module β”‚                    β”‚ 
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€            β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                    β”‚
β”‚  β”‚   VIN   β”‚            β”‚     VCC      β”‚                    β”‚
β”‚  β”‚   GND   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     GND      β”‚                    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚                                                             β”‚
β”‚  Connect GND of both power supplies together!               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Problem: Device randomly resets or crashes

  • Check power supply stability
  • Add 100Β΅F capacitor near the microcontroller's power pins
  • Check for electrical interference (keep high-voltage wires away)
  • Update to latest firmware version

Section 6: Upload Problems

ESP8266: "Timed out waiting for packet header"

  • Hold FLASH button on board while uploading
  • Lower upload speed to 115200
  • Try different USB cable
  • Check port selection

ESP32: "Failed to connect to ESP32: Timed out"

  • Hold BOOT button while uploading
  • Release when you see "Connecting..."
  • Lower upload speed to 115200
  • Press EN/RST after upload attempt

Pico W: "RPI-RP2" drive not appearing

  • Hold BOOTSEL for 5 seconds before connecting USB
  • Try different USB cable (many are charge-only)
  • Try different USB port
  • Press RUN button after connecting
πŸ’‘ USB Cable Test:

If your device powers on but doesn't appear as a COM port, your USB cable might be charge-only. Try a different cable that supports data transfer.

Section 7: Serial Monitor Debugging

What to look for in Serial Monitor:

βœ… GOOD (Working Device):
########################################
# 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%
.... (dots indicate polling)

❌ BAD (Common Errors):
[WiFi] Connecting... Failed!
[ERROR] Cannot connect to WiFi - restarting

[REG] Response: 401
[REG] Invalid token

[SENSOR] DHT22 read failed!
[SENSOR] Temp: -999Β°C

[STATE] Token invalid
[STATE] Device not found

Section 8: Dashboard Debugging

Check Device Status Colors:

  • 🟒 ONLINE (Green) - Device communicating (last 10 seconds) β†’ Good
  • 🟑 AWAY (Yellow) - Device missed 1-2 polls (10-300 seconds) β†’ Check WiFi
  • πŸ”΄ OFFLINE (Red) - No communication for 5+ minutes β†’ Power cycle device

Browser Console Debugging (F12):

  • Open browser developer tools (F12)
  • Go to Console tab
  • Look for red error messages
  • Check Network tab for API call responses
πŸ”§ Dashboard Tips:
  • Use "Clear Disturbance" page if your IP was banned
  • Check device session expiry (sessions auto-renew)
  • Verify device is assigned to your account
  • Try regenerating token if device won't connect

Quick Reference Troubleshooting Table

Symptom Most Likely Cause Quick Fix
No Serial output Wrong baud rate or USB cable Set 115200 baud, try different cable
WiFi won't connect Wrong credentials or 5GHz network Check SSID/password, use 2.4GHz
Device not in dashboard Registration failed or wrong account Check Serial Monitor for errors
Relay not clicking Wrong VCC (needs 5V) or wrong logic Use 5V, check Positive/Negative setting
Device resets randomly Insufficient power Use external 5V 2A power supply
Upload fails Wrong port, cable, or button not pressed Check port, hold FLASH/BOOT button
🎯 Still Stuck?

Next Steps

Now that you know how to troubleshoot common issues:

  • Tutorial 26: Understanding Device Status (Online/Away/Offline)
  • Tutorial 27: How to Claim and Manage Devices
  • Tutorial 29: WiFi Connection Troubleshooting
  • Return to Tutorial 02: Generate fresh firmware if needed
πŸ“ž Support Resources: