Troubleshooting
Common issues and solutions for DeviceSDK
CLI Issues
Authentication Failed
Symptom: devicesdk login fails or shows “Unauthorized”
Solutions:
-
Clear existing credentials:
devicesdk logout devicesdk login -
Check your internet connection
-
Verify you’re using the latest CLI:
npx @devicesdk/cli@latest --version
Command Not Found
Symptom: devicesdk: command not found
Solutions:
-
Use npx directly:
npx @devicesdk/cli [command] -
Install globally:
npm install -g @devicesdk/cli -
Check Node.js version (requires 22+):
node --version
Build Failures
Symptom: devicesdk build fails with TypeScript errors
Solutions:
-
Check TypeScript errors:
npx tsc --noEmit -
Verify all imports are correct
-
Ensure
devicesdk.tsconfig is valid -
Clear build cache:
rm -rf .devicesdk/ devicesdk build
Deploy Failures
Symptom: Deploy command fails or times out
Solutions:
-
Ensure you’re authenticated:
devicesdk whoami -
Check build completes successfully:
devicesdk build -
Verify network connectivity
-
Check dashboard for deployment status
Device Connection Issues
Device Won’t Connect
Symptom: Device offline in dashboard
Solutions:
-
Check WiFi credentials
- Verify SSID and password
- Ensure 2.4GHz network (5GHz not supported)
-
Verify firmware
- Re-flash device:
devicesdk flash - Check LED indicators
- Re-flash device:
-
Network requirements
- WebSocket (port 443) must be allowed
- No captive portal on WiFi
- Check firewall rules
-
Check device logs
- View in dashboard
- Look for connection errors
Frequent Disconnections
Symptom: Device connects then disconnects repeatedly
Solutions:
-
Check WiFi signal strength
- Move device closer to router
- Reduce interference
-
Power supply
- Ensure stable power source
- USB power must provide adequate current
-
Code issues
- Check for crashes in device logs
- Look for exceptions in
onDeviceConnect
Device Connects but Doesn’t Respond
Symptom: Device shows online but doesn’t handle messages
Solutions:
-
Check
onMessagehandler is implemented -
Verify message types match:
// Edge script sends this type { type: 'gpio_write', ... } // Device must handle this type -
Look for errors in device logs
-
Test with simulator first
Hardware Issues
GPIO Not Working
Symptom: Pin doesn’t respond to commands
Solutions:
-
Check pin number
- Verify correct GPIO number (not physical pin)
- Example: GPIO 25, not Pin 25
-
Pin configuration
- Ensure pin is configured as output/input
- Check for conflicting configuration
-
Hardware check
- Test with multimeter
- Check for shorts
- Verify connections
ADC Readings Incorrect
Symptom: Analog readings are wrong or unstable
Solutions:
-
Pin verification
- Use ADC-capable pins only (GP26, GP27, GP28)
-
Voltage range
- Input must be 0-3.3V
- Use voltage divider for higher voltages
-
Grounding
- Ensure common ground
- Check for ground loops
-
Calibration
- Take multiple readings and average
- Account for voltage reference variations
I2C Not Working
Symptom: I2C sensor not responding
Solutions:
-
Wiring check
- SDA and SCL connected correctly
- Pull-up resistors present (4.7kΩ typical)
- Common ground
-
Address verification
- Use I2C scanner to find device address
- Check sensor datasheet
-
Power
- Sensor has adequate power
- Correct voltage level (3.3V vs 5V)
Flashing Issues
Device Not Detected in BOOTSEL Mode
Symptom: devicesdk flash can’t find device
Solutions:
-
Enter BOOTSEL mode correctly:
- Disconnect USB
- Hold BOOTSEL button
- Connect USB while holding
- Release button
- Device appears as “RPI-RP2” drive
-
USB cable
- Must support data (not power-only)
- Try different cable
-
USB port
- Try different USB port
- Some hubs don’t work well
Flash Fails Partway Through
Symptom: Flashing starts but fails to complete
Solutions:
-
Don’t disconnect during flash
-
Clean flash:
- Download flash_nuke.uf2 from Raspberry Pi
- Copy to BOOTSEL drive to erase completely
- Re-flash DeviceSDK firmware
-
Check disk space on host computer
Performance Issues
High Latency
Symptom: Messages take long time to arrive
Solutions:
-
Check network latency (ping test)
-
Verify edge location is close to device
-
Reduce message size
-
Check for network congestion
Message Loss
Symptom: Messages not received reliably
Solutions:
-
Implement acknowledgments for critical messages
-
Check message size (must be < 64KB)
-
Verify stable connection
-
Look for errors in logs
Development Issues
Simulator Not Starting
Symptom: devicesdk dev fails to start
Solutions:
-
Port in use:
devicesdk dev --port 3001 -
Check for errors in terminal output
-
Clear cache:
rm -rf .devicesdk/
Hot Reload Not Working
Symptom: Changes don’t apply automatically
Solutions:
-
Check for TypeScript errors in terminal
-
Restart dev server
-
Hard refresh browser (Cmd+Shift+R / Ctrl+Shift+R)
Error Messages
“Rate limit exceeded”
Cause: Too many requests too quickly
Solution: Wait a moment and retry. For production, implement backoff.
“Script execution timeout”
Cause: Code takes too long to execute
Solutions:
- Optimize code performance
- Offload heavy work to queues
- Reduce message processing time
“Invalid device credentials”
Cause: Device authentication failed
Solution: Re-flash device with devicesdk flash
Getting Help
If you’re still stuck:
-
Check logs
- Device logs in dashboard
- Script logs in dashboard
- CLI output
-
Join Discord
- DeviceSDK Community
- Share error messages and logs
-
GitHub Issues
- Search existing issues
- Create new issue with details
-
Documentation
Debugging Tips
Enable Verbose Logging
devicesdk deploy --verbose
Check System Status
Verify DeviceSDK services are operational:
Isolate the Problem
- Test with simulator first
- Try minimal code example
- Test individual components
- Check one thing at a time
Collect Information
When reporting issues, include:
- CLI version
- Error messages
- Code snippet
- Device logs
- Steps to reproduce