darkxst / silabs-firmware-builder

Silicon Labs firmware builder
https://darkxst.github.io/silabs-firmware-builder/
261 stars 25 forks source link

Sonoff-E - Connection failed #61

Closed talormanda closed 3 months ago

talormanda commented 3 months ago

image

image

I receive the error above when trying to connect to my device on COM4. I am unsure what I'm doing wrong or what I can do to fix this.

darkxst commented 3 months ago

Can you post the Debug logs.

talormanda commented 3 months ago

Can you post the Debug logs.

logs.txt

darkxst commented 3 months ago

What firmware is installed on your dongle?

talormanda commented 3 months ago

What firmware is installed on your dongle?

I had used this web tool before to put on https://github.com/itead/Sonoff_Zigbee_Dongle_Firmware/tree/master/Dongle-E/Router

but the device stopped working on home assistant ZHA so i went back here to try and start over and couldn't get anything to work.

darkxst commented 3 months ago

Okay, web flasher wont work with Router firmware as it doesnt respond to software resets.

Likely best option is to flash directly with universal-silabs-flasher, its a bit of a pain on windows though!

This command will get you sorted using a downloaded firmware:

universal-silabs-flasher --device COM4 --bootloader-reset sonoff flash --firmware <firmwarefile>.gbl

darkxst commented 3 months ago

This thread provides some info for getting it to work on Windows. https://github.com/darkxst/silabs-firmware-builder/issues/56

talormanda commented 3 months ago

This thread provides some info for getting it to work on Windows. #56

Yeah I did read through all of that before I posted. I tried using the universal flasher by running:

universal-silabs-flasher --device COM4 --bootloader-reset sonoff flash --firmware Z3RouterUSBDonlge_EZNet6.10.3_V1.0.0.gbl

and this is the error i get:

image

darkxst commented 3 months ago

"Permission Denied". Try running as administator

talormanda commented 3 months ago

"Permission Denied". Try running as administator

that's the fun part, it is running as administrator.

darkxst commented 3 months ago

I not sure then, I dont run windows myself.

talormanda commented 3 months ago

I not sure then, I dont run windows myself.

i can try this elsewhere where you are familiar. what are you running, linux?

darkxst commented 3 months ago

Yes Linux. It works well on Linux, just make sure your user is a member of the dialout group to get permissions to the serial port.

universal-silabs-flasher --device /dev/ttyACM0 --bootloader-reset sonoff flash --firmware <file>.gbl
talormanda commented 3 months ago

Yes Linux. It works well on Linux, just make sure your user is a member of the dialout group to get permissions to the serial port.

universal-silabs-flasher --device /dev/ttyACM0 --bootloader-reset sonoff flash --firmware <file>.gbl

okay, i will install this quick. is there a particular python version required or should i just need to install the flasher and good to go? is there a good way to get a list of devices to see what the path is on linux?

darkxst commented 3 months ago

It will work with any recent version of Python 3.9+ or so.

just pip install universal-silabs-flasher and off you go ;)

darkxst commented 3 months ago

is there a good way to get a list of devices to see what the path is on linux?

it will most likely be /dev/ttyACM0. However you can view available devices via ls /dev/tty*

talormanda commented 3 months ago

is there a good way to get a list of devices to see what the path is on linux?

it will most likely be /dev/ttyACM0. However you can view available devices via ls /dev/tty*

super frustrating. i seem to be getting the same error.

image

darkxst commented 3 months ago

Add your user to the dialout group, logout and back in again, then try again.

talormanda commented 3 months ago

Add your user to the dialout group, logout and back in again, then try again.

image

does this look better?

if this is finished. do i need to flash with the web or is this good? do you remember how to repair it to ZHA after this?

darkxst commented 3 months ago

yes looks good. You have re-flashed with router, it will automatically pair as soon as you goto add device in ZHA.

talormanda commented 3 months ago

yes looks good. You have re-flashed with router, it will automatically pair as soon as you goto add device in ZHA.

is there some sort of pairing mode to get into? i am doing a search with my skyconnect on ZHA and nothing is appearing.

darkxst commented 3 months ago

It should automatically enter pairing mode when powered up, unless it still has an old connection stored.

You can try connect to the console on router over serial

screen /dev/ttyACM0 115200

from there you should see periodic message that its trying to pair... if not you can run this command to force it to disconnect (I think this is the right command, but been a long time since I played with the router firmware!)

network leave

talormanda commented 3 months ago

It should automatically enter pairing mode when powered up, unless it still has an old connection stored.

You can try connect to the console on router over serial

screen /dev/ttyACM0 115200

from there you should see periodic message that its trying to pair... if not you can run this command to force it to disconnect (I think this is the right command, but been a long time since I played with the router firmware!)

network leave

image

any idea what this means?

darkxst commented 3 months ago

if its display periodically it might be it trying to pair.

Just try type in network leave and see if that changes anything

talormanda commented 3 months ago

if its display periodically it might be it trying to pair.

Just try type in network leave and see if that changes anything

Yeah that did it.

image

I had this, then I did network leave, but I couldnt see what I was typing in the terminal. Then ZHA instantly did:

image

Why would it hold onto that if I re-flashed it? That's crazy.

darkxst commented 3 months ago

NVMEM area is not wiped when you flash normally.

talormanda commented 3 months ago

NVMEM area is not wiped when you flash normally.

gotcha. im building documentation for next time. how did you determine the path was /dev/ttyACM0 ?

darkxst commented 3 months ago

CDC driver puts devices there, if you plug a second Dongle-E in it will get /dev/ttyACM1

darkxst commented 3 months ago

NVMEM area is not wiped when you flash normally.

you can however wipe it using this gbl. https://github.com/xsp1989/zigbeeFirmware/blob/master/firmware/Zigbee3.0_Dongle-NoSigned/EZSP/nvm3_initfile.gbl

talormanda commented 3 months ago

NVMEM area is not wiped when you flash normally.

you can however wipe it using this gbl. https://github.com/xsp1989/zigbeeFirmware/blob/master/firmware/Zigbee3.0_Dongle-NoSigned/EZSP/nvm3_initfile.gbl

thanks. and as for the 115200. how did we know what this was?

darkxst commented 3 months ago

baudrate is set by the firmware build, default on sonoff firmwares is always 115200

talormanda commented 3 months ago

okay thanks. marking this closed for now.