Skip to content

Connection Troubleshooting

Documentation in Progress

This documentation is currently being developed based on common user issues and support requests.

Status: 📝 Documentation in progress based on real-world testing
Expected completion: After hardware validation phase

Coming Soon

This page will provide comprehensive troubleshooting guidance for connection issues, including:

  • Common Connection Errors: Device not found, permission denied, timeout issues
  • Platform-Specific Solutions: Windows, Linux, and macOS troubleshooting steps
  • Driver Issues: USB-to-serial driver problems and solutions
  • Port Detection: Finding and identifying correct serial ports
  • Permission Problems: Linux/macOS permission and group membership issues
  • Hardware Debugging: Physical connection and cable problems
  • Firmware Issues: Corrupted firmware recovery procedures

Common Issues Preview

Device Not Found

csharp
// Error: No devices discovered
var devices = await Device.DiscoverDevicesAsync();
if (devices.Length == 0)
{
    // Troubleshooting steps will be provided here
    Console.WriteLine("No MicroPython devices found");
}

Connection Timeout

csharp
try
{
    var device = Device.FromConnectionString("serial:COM3");
    await device.ConnectAsync(); // May timeout
}
catch (DeviceConnectionException ex)
{
    // Detailed timeout troubleshooting steps coming
    Console.WriteLine($"Connection failed: {ex.Message}");
}

Permission Denied (Linux/macOS)

bash
# Common error on Linux
# SerialException: [Errno 13] Permission denied: '/dev/ttyACM0'

# Solution will include adding user to dialout group
# sudo usermod -a -G dialout $USER

Quick Diagnostic Tools

csharp
// Example diagnostic utilities coming soon
public static class ConnectionDiagnostics
{
    public static async Task RunDiagnosticsAsync()
    {
        Console.WriteLine("=== Belay.NET Connection Diagnostics ===");
        
        // Check available ports
        var ports = SerialPort.GetPortNames();
        Console.WriteLine($"Available serial ports: {string.Join(", ", ports)}");
        
        // Attempt device discovery
        var devices = await Device.DiscoverDevicesAsync();
        Console.WriteLine($"Discovered MicroPython devices: {devices.Length}");
        
        // Test each discovered device
        foreach (var device in devices)
        {
            await TestDeviceConnection(device);
        }
    }
    
    private static async Task TestDeviceConnection(DeviceInfo deviceInfo)
    {
        try
        {
            using var device = Device.FromConnectionString(deviceInfo.ConnectionString);
            await device.ConnectAsync();
            
            var response = await device.ExecuteAsync("print('Hello from device')");
            Console.WriteLine($"✅ {deviceInfo.Port}: Connection successful");
            Console.WriteLine($"   Response: {response.Trim()}");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"❌ {deviceInfo.Port}: {ex.Message}");
        }
    }
}

Platform-Specific Sections

Windows Issues

  • Driver installation (CP210x, CH340, FTDI)
  • Device Manager troubleshooting
  • COM port conflicts and resolution
  • Windows Defender/antivirus interference

Linux Issues

  • User permissions and group membership (dialout, tty)
  • udev rules for device recognition
  • ModemManager conflicts with serial devices
  • systemd service conflicts

macOS Issues

  • Driver installation for USB-to-serial chips
  • System Integrity Protection (SIP) considerations
  • Port naming conventions (/dev/cu.* vs /dev/tty.*)
  • Homebrew driver installation

Hardware-Specific Issues

ESP32 Boards

  • Boot mode selection (normal vs download mode)
  • Power supply problems
  • CH340 vs CP2102 driver differences

Raspberry Pi Pico

  • BOOTSEL mode recognition
  • Firmware corruption recovery
  • Mass storage vs serial mode switching

PyBoard

  • DFU mode entry and exit
  • USB cable quality issues
  • Power LED indicators

Error Code Reference

Error CodeDescriptionCommon Causes
DEVICE_NOT_FOUNDNo devices discoveredDriver, cable, or firmware issues
CONNECTION_TIMEOUTDevice connection timeoutBaud rate, permissions, or hardware
PERMISSION_DENIEDAccess denied to serial portUser permissions (Linux/macOS)
PORT_IN_USESerial port already in useAnother application using port
INVALID_RESPONSEUnexpected response from deviceFirmware or protocol issues

Need immediate help? Check our GitHub Discussions for community troubleshooting assistance, or create a new issue with your specific error message and platform details.

Released under the Apache License 2.0.