zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Instruction for flashing firmware via Arduino

Open kirovilya opened this issue 8 years ago โ€ข 81 comments

I have a positive experience of flashing firmware cc253x through Arduino without CCDebugger. Based on https://github.com/wavesoft/CCLib/issues/19#issue-260545038

Does it interest anyone? I can add the translation to the wiki, then edit the grammar. Or someone more experienced can make a translation.

kirovilya avatar May 31 '18 05:05 kirovilya

I think would be great to have more flashing options. I just posted on the forum a way to flash using cc-tool (just seconds ago!): https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/52108/176?u=ciotlosm

This is based on yet another great repo around CC2531 gateway emulation in C++ here: https://github.com/Frans-Willem/AqaraHub. That has a good tutorial on how to flash using cc-tool

ciotlosm avatar May 31 '18 05:05 ciotlosm

@ciotlosm It's great. cctool has an even better option, because in my case cclib it is necessary to slightly modify the firmware. I'll try to flash through cctool and maybe delete my version, and leave them :)

kirovilya avatar May 31 '18 06:05 kirovilya

@kirovilya : Which Type of Arduino do you use ? Iยดm experiment via Nano V3.0 ATmega328P Micro-Board. Btw: Here: http://magictale.com/2884/flashing-ble112-with-arduino-based-cc-debugger/ you will find an performance boosting Version but there we need to modifiy to add the CC253X Type.

tb-killa avatar May 31 '18 06:05 tb-killa

@ciotlosm Oh, no! I read that cctool uses ccdebugger :( so that flashing firmware through arduino will remain

kirovilya avatar May 31 '18 06:05 kirovilya

@kirovilya sorry for that. I was posting offtopic as I was just happy to see more options for flashing.

ciotlosm avatar May 31 '18 06:05 ciotlosm

@tb-killa I uses Arduino Uno. I seen this article, but can not check - need compiling with specific port...

@ciotlosm Don't worry :)

kirovilya avatar May 31 '18 06:05 kirovilya

Check out please https://github.com/Koenkk/zigbee2mqtt/wiki/Getting-started#22-via-arduinoesp8266

kirovilya avatar Jun 01 '18 06:06 kirovilya

@kirovilya you have to mention the needing of 3.3v on side of the usb Stick, because normaly you put an divider inside the connections. Or you use the internal resistor of the atmega themselve. I know it works without it but if some one broken the usb Stick you could say we mention it as an warning ;-)

tb-killa avatar Jun 01 '18 09:06 tb-killa

@tb-killa I refer to the instruction from CCLib and there it is mentioned about 5v on Arduino and 3.3v on the CC**** chip. Probably, the chip can work with 5v, but I did not check it :)

kirovilya avatar Jun 01 '18 10:06 kirovilya

@kirovilya it works with esp8266 (wemos d1 mini) with changed pins. Maybe should be added to wiki?

definitio avatar Jun 01 '18 11:06 definitio

@definitio Did you test? Connection without resistors? What mean "changed pins"?

kirovilya avatar Jun 01 '18 11:06 kirovilya

@kirovilya yes, successfully flashed 1-2 weeks ago without resistors. I mean changed pins numbers.

definitio avatar Jun 01 '18 11:06 definitio

@definitio Good news! Thank you! Added in wiki.

kirovilya avatar Jun 01 '18 11:06 kirovilya

Thanks for the instructions!

To keep the getting started as noob friendly as possible I've moved this to Alternative firmware flashing methods

Koenkk avatar Jun 01 '18 17:06 Koenkk

Good. I close the issue

kirovilya avatar Jun 01 '18 17:06 kirovilya

I've updated https://github.com/Koenkk/zigbee2mqtt/wiki/Getting-started with linux/macos instructions as well

ciotlosm avatar Jun 01 '18 20:06 ciotlosm

@kirovilya in https://github.com/Koenkk/zigbee2mqtt/wiki/Alternative-firmware-flashing-methods you mention modified firmware for flashing via Arduino https://github.com/kirovilya/files/blob/master/CC2531ZNP-Pro-Secure_LinkKeyJoin_mod.hex

Is the above firmware different from the ones @Koenkk prepared? I'm trying to make sense and gather most of the firmwares in a logical place here: https://github.com/Koenkk/zigbee2mqtt-firmware for easier maintenance and linking.

ciotlosm avatar Jun 02 '18 20:06 ciotlosm

@ciotlosm that firmware not made from Koen firmware. It make from any firmware by remove second line from end (as described here https://github.com/wavesoft/CCLib/issues/19)

kirovilya avatar Jun 03 '18 12:06 kirovilya

Would you be able to add this firmware to:

https://github.com/Koenkk/zigbee2mqtt-firmware ?

ciotlosm avatar Jun 03 '18 12:06 ciotlosm

hi @definitio could you explain in detail which pins on the wemos d1 mini you connected to downloader cable? I've tried different combination, but with no luck:

int CC_RST   = D4; // 2
int CC_DC    = D3; // 0
int CC_DD_I  = D2; // 4
int CC_DD_O  = D1; // 5
int CC_RST   = D7; // 13
int CC_DC    = D6; // 12
int CC_DD_I  = D5; // 14
int CC_DD_O  = D0; // 16

they both didn't work.

Thanks!

maur8ino avatar Aug 08 '18 22:08 maur8ino