How to: Flash SonOff USB Dongle to be a Zigbee Repeater/Router & Set Transmit Power

I know...I'm a problem child.

I unplugged and replugged the dongle to wake it up - same error.

I was able to add the dongle to my hub, so the dongle is working.

Also, I've just realized, since this was a new dongle that I had not previously flashed with the older router FW, the only FW that can be on the dongle is the newer 20220125 FW that I flashed, since the dongle joined my hub and is behaving like a router. I can declare success flashing the newer FW using cc2538-bsl on a Pi.

What I need to know now, is how to use the new feature to adjust transmit power. :slight_smile: Would be nice if one of the geniuses running around here could write a driver for this device that would provide access to the transmit speed settings.

?
The newer firmware is 20221102.
Also, look at the comments on github. One person was able to flash and it appeared to work, but HA (I think) reported it still had the old firmware.

Dammit! I grabbed the wrong FW? Aieee....

It’s in the dev branch. You’re probably better off with the September (?) firmware, as it increased the output to 9dbm from 5 and had some other fixes. Although I thought the new E dongle defaulted to 20.

I used the wrong link... Had saved it earlier and just clicked the wrong one. DOH!

Thanks for pointing that out. More fun flashing tomorrow! :slightly_smiling_face:

Think we can assume that the newest keeps the 9db default in the previous?

I just saw that your way should work with the dev firmware, or uniflash 8.0.0 (not 8.1.0)

1 Like

Sorry, you are correct sir. The January edition had that change.

1 Like

I’m thinking that a command needs to be sent to it. Maybe it could be done with a driver, but that’s beyond my scope. I think HA may have support for that, just from some of the comments I read previously on koenkk’s repo.

1 Like

Hmmm... So I could add it to HA, set the transmit power, then add it back to HE. That's doable.

1 Like

Or send the command while it’s still plugged into your computer. I tried the other day and couldn’t get a response from the dongle, which I imagine is do to my ignorance.

Verified can flash 20221102 using cc2538-bsl...completed this AM.

I was trying to get the output that @aaiyar suggested - found that if I run the command right after flashing starts to pull the data to write the hex file, but unfortunately it timed out during the process w/the same type of ACK error (Timeout waiting for ACK/NACK after 'Mem Read (0x2A)').

Re-joined the dongle to my hub (and BTW, I'm finding that the "press reset button while connecting to USB" tip is a must-do and very reliable for me) and the dongle is operating normally.

2 Likes

What command did you send, via command line or app?

This

Quite concise... :wink:

1 Like

Thanks...the serial port command info in that is pretty much some form of acient Greek to me. :wink: I am not a serial port command kinda guy...

"Set the transmit power through the serial port command SYS_SET_TX_POWER"

Me too unfortunately, which is probably why I didn’t get it to respond :cry:

1 Like

I made an attempt on deciphering the "ancient greek". This does not work successfully as of now, but it might be a first step to build on.

  1. start this first to read the reply from the serial device
od -x < /dev/ttyUSB0

(from stackexchange 42376)

  1. write data to serial device, e.g. for 15dBm transmit power
echo -en '\x01\x21\x14\x15' > /dev/ttyUSB0 

(from stackoverflow 8877269)

But I just did not get a reply from the device, and the transmit power has not changed, apparently.

Also I am unsure whether one has to swap each pair of bytes like

echo -en '\x21\x01\x15\x14' > /dev/ttyUSB0 

because of endianness related reasons.

I hope someone can build on this.

2 Likes

Thanks for working on this, appreciate you puttting something out there for folks to comment on. @aaiyar is smarter than your average bear, he may have some comments. Also shamelessly poking @thebearmay, not because he has one of these, but because I'm sure he secretly wants one of these. :wink: (Plus he's kinda brainy too and has mentioned he likes a challenge/learning new things.) :smiley:

1 Like

@mike.maxwell - any interest/available time to create a driver for these SonOff dongles as repeaters? Hopefully including an option to set transmit power in addtion to pulling other diagnostic/route table info.

I can send you one if necessary.