I’m having a difficult time getting flashing a Sonoff SV with espthe home. I’ve been able to compile and now I’m to the final part where I’m trying to flash to the device. Unfortunately I’m receiving the following error:
esptool.py v2.6 Serial port /dev/ttyUSB0 ERROR Running command failed: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' ERROR Please try running esptool.py --before default_reset --after hard_reset --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 config/door_garage/.pioenvs/door_garage/firmware.bin locally.
I’m running the python version under Ubuntu 19.0x. I’ve been able to flash Tasmoto firmware in the past without issue. I’ve tried using the web GUI in addition to the CLI with similar results. Any help would be appreciated. Thanks!
you’ll have to refresh the environment for the user/process that is trying to access the usb port, some versions of linux may require a full reboot, others logging out and back in, some can refresh it on the go, but I can’t remember the command atm.
Specifically after usermod -a -G dialout your-username?
And you are sure both CLI and GUI is running as the same username? Do you have SELinux enabled?
If you’re fed up you could always do sudo chmod 666 /dev/ttyUSB0 then flash your device and restore the permissions back sudo chmod 660 /dev/ttyUSB0 (that change will not persist across reboot even if you don’t revert it).
thats probably okay, for good measure try without the | grep ttyUSB and see that you do get a long list of all the open files on your system. we’re not interested in any fuse based files in any case. and as such no other output should indicate the file/serial port isn’t in use. (grep ttyUSB just filters out any lines not containing ttyUSB)
so that leaves us with the permissions, try chmod, if that works you probably aren’t running as the same user as you added to the dialout group after all; and also if it works you can move on to OTA flashing while you try to work out the permissions issue