OpenBuilds / OpenBuilds-CONTROL

OpenBuilds CONTROL: Download from https://software.openbuilds.com
https://software.openbuilds.com
GNU General Public License v3.0
173 stars 108 forks source link

Could not flash OpenBuilds firmware on Linux #361

Closed dheera closed 4 months ago

dheera commented 5 months ago

System: Ubuntu 23.10 OpenBuilds Control deb version (not appimage version)

Tried to: Flash Interface firmware with USB cable

Problem:

Stuck on [ Firmware Upgrade ] [ Starting ... ]

console shows

libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
statusCode: 200
Flashing Interface on /dev/ttyUSB0 with file: firmware.bin
Error: EPERM: operation not permitted, chmod '/opt/OpenBuildsCONTROL/resources/app.asar.unpacked/esptool.py'
    at Object.chmodSync (node:fs:1888:3)
    at flashInterface (/opt/OpenBuildsCONTROL/resources/app.asar/index.js:3467:8)
    at Socket.<anonymous> (/opt/OpenBuildsCONTROL/resources/app.asar/index.js:998:5)
    at Socket.emit (node:events:513:28)
    at Socket.emitUntyped (/opt/OpenBuildsCONTROL/resources/app.asar/node_modules/socket.io/dist/typed-events.js:69:22)
    at /opt/OpenBuildsCONTROL/resources/app.asar/node_modules/socket.io/dist/socket.js:704:39
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  errno: -1,
  syscall: 'chmod',
  code: 'EPERM',
  path: '/opt/OpenBuildsCONTROL/resources/app.asar.unpacked/esptool.py'
}

Workaround:

sudo chown $USER '/opt/OpenBuildsCONTROL/resources/app.asar.unpacked/esptool.py'

Then Problem:

libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
statusCode: 200
Flashing Interface on /dev/ttyUSB0 with file: firmware.bin
Pyserial is not installed for /home/dheera/miniconda3/bin/python3. Check the README for installation instructions.

Traceback (most recent call last):
  File "/opt/OpenBuildsCONTROL/resources/app.asar.unpacked/esptool.py", line 38, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'

Solution: $pip3 install pyserial

petervanderwalt commented 5 months ago

Pull requests accepted if you find a way to fix permissions from within the install, as well as dependencies like users python

You could maybe look into a script (universal for all DEB targets) https://github.com/electron-userland/electron-builder/issues/2065 to run from afterInstall (sudo escalation, do chmod, check if python/pyserial is installed if not install)