itead / Sonoff_Devices_DIY_Tools

BSD 3-Clause "New" or "Revised" License
548 stars 168 forks source link

Do not use port 80 to flash firmware! #124

Open igoro00 opened 1 year ago

igoro00 commented 1 year ago

The program opens a server on a port to transfer firmware to the chip. It tries to open it on port 80 but on Linux(unix-like systems in general) you have to have root to open ports 1-1024 and if you don't(or you're running the tool through Wine like me) it silently crashes. Please, remove port 80 from the list of ports to try and use port 1080 and up

A workaround

If the program detects that port 80 is already opened by another app, it will try to open it's server on port 1080(that's what we want). It doesn't if it's available but you don't have permissions... So we need to open port 80 ourselfs. That's what I did:

sudo npm install -g http-server #make sure you have nodejs installed
sudo http-server -p 80

then flash the firmware. After flashing, stop the server by hitting ctrl+c in terminal.