diff --git a/index.htm b/index.htm index cbb5137..b03d974 100644 --- a/index.htm +++ b/index.htm @@ -21,7 +21,10 @@

Welcome to the WLED web installer!

  1. Plug in your ESP to a USB port. We will install WLED 0.12.0 to it.
  2. -
  3. Hit "Install" and select the correct COM port. No device found?
  4. +
  5. Hit "Install" and select the correct COM port. + No device found? + Failed to open serial port? +
  6. Get WLED installed and connected in less than 3 minutes!


diff --git a/script.js b/script.js index 07a6b8e..aa8dacc 100644 --- a/script.js +++ b/script.js @@ -15,6 +15,8 @@ function setManifest() { document.getElementById('inst').setAttribute('manifest', m); document.getElementById('verstr').textContent = opt.text; + + checkOS(); } @@ -52,6 +54,12 @@ function checkSupported() { else setManifest(); } +function checkOS() { + if (navigator.userAgent.includes("Linux")) { + document.body.classList.add("linux"); + } +} + function unsupported() { document.getElementById('flasher').innerHTML = `Sorry, your browser is not yet supported!
Please try on Desktop Chrome or Edge.
@@ -62,11 +70,36 @@ function unsupported() { } function showSerialHelp() { - document.getElementById('coms').innerHTML = `Hit "Install" and select the correct COM port.

+ document.getElementById('coms').innerHTML = `Hit "Install" and select the correct COM port. Failed to open serial port?

+ + Your USB cable might not support data transfer.
+ To check if your cable supports data, connect the device and run:
+ lsusb — Look for CP210x/CH341

+ Missing drivers might also be the issue.
+ To check whether your kernel includes the right driver, run:
+ zcat /proc/config.gz | grep -E "CP210X|CH341"
+ You should see:
+ CONFIG_USB_SERIAL_CP210X=m or =y — for CP2102 (square chip)
+ CONFIG_USB_SERIAL_CH341=m or =y — for CH34x (rectangular chip)
+ If not present or set to =n, you may need to recompile your kernel with these options enabled.

+ Note: Your device may appear as ttyUSBX. +
+ You might be missing the drivers for your board.
Here are drivers for chips commonly used in ESP boards:
CP2102 (square chip)
CH34x (rectangular chip)

- Make sure your USB cable supports data transfer.

+ Make sure your USB cable supports data transfer. +
+

+ `; +} + +function showPermissionHelp() { + document.getElementById('coms').innerHTML = `Hit "Install" and select the correct COM port. No device found?

+ Your browser likely does not have the necessary permissions to access the connected ESP device.
+ To resolve this issue, add your user to the group that owns the device (typically /dev/ttyUSB0):
+ sudo usermod -aG "$(stat --format='%G' /dev/ttyUSB0)" "$USER"
+ After running the command, reboot for the changes to take effect.

`; } \ No newline at end of file diff --git a/style.css b/style.css index 6920db4..dfaa151 100644 --- a/style.css +++ b/style.css @@ -136,6 +136,18 @@ li { padding: 0; } +.showOnLinux { + display: none; +} + +body.linux .showOnLinux { + display: inline-block; +} + +body.linux .hideOnLinux { + display: none; +} + @media (prefers-color-scheme: dark) { ewt-install-dialog { /*--mdc-theme-primary: #ffa000; /*buttons*/