-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instruction for flashing firmware via Arduino #78
Comments
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 It's great. cctool has an even better option, because in my case cclib it is necessary to slightly modify the firmware. |
@kirovilya : Which Type of Arduino do you use ? I´m experiment via Nano V3.0 ATmega328P Micro-Board. |
@ciotlosm Oh, no! I read that cctool uses ccdebugger :( so that flashing firmware through arduino will remain |
@kirovilya sorry for that. I was posting offtopic as I was just happy to see more options for flashing. |
@tb-killa I uses Arduino Uno. @ciotlosm Don't worry :) |
@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 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 it works with esp8266 (wemos d1 mini) with changed pins. Maybe should be added to wiki? |
@definitio Did you test? Connection without resistors? What mean "changed pins"? |
@kirovilya yes, successfully flashed 1-2 weeks ago without resistors. I mean changed pins numbers. |
@definitio Good news! Thank you! |
Thanks for the instructions! To keep the getting started as noob friendly as possible I've moved this to Alternative firmware flashing methods |
Good. I close the issue |
I've updated https://github.com/Koenkk/zigbee2mqtt/wiki/Getting-started with linux/macos instructions as well |
@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 that firmware not made from Koen firmware. It make from any firmware by remove second line from end (as described here wavesoft/CCLib#19) |
Would you be able to add this firmware to: |
hi @definitio could you explain in detail which pins on the wemos d1 mini you connected to downloader cable?
they both didn't work. Thanks! |
@maur8ino just flashed the latest firmware (with removed the second line from the end) with this settings:
|
I am flashing according to your guide with Arduino Mega (5V board I suppose). I was struggling with After I removed voltage divider (4.7 kΩ + 10 kΩ), it started working like a charm! |
Is it possible to flash via a NodeMCU 1.0 (ESP-12E)? It seems to flash okay but I always get an error when trying to run:
The light on the NodeMCU turns on for a bit and then turns off. |
@ericstewart22 |
@HanschDennis No, unfortunately not. I'll let you know if I get it working. |
I have a Raspberry Pi so I think I will try this fork to flash |
Did it work? |
Not yet. Verification fails and it doesn't go past 25% or 50%. The LED on the 2531 is off when I start flashing and turns on (green) a few seconds later, at the same time verification fails; I think it's a clue as to what is happening but I'm not knowledgeable enough to troubleshoot. I attached a screenshot of what it looks like, in case you're having the same issue, or in case someone else on here can help me troubleshoot. |
At the moment, my USB Stick is still in the shipping process. I can try to look into the code, maybe i found something. I have only a little bit of experience of python. @ericstewart22 Can you please open a issue on the CCLib-raspberry project and post there a screenshot of the log? Maybe the maintainer of the project finds a solution for it. On the main project of the CClib (https://github.com/wavesoft/CCLib) are resistances between the connections? @ericstewart22 Did you have resistances between your connections? |
This is actually the trick. If the CC2531 is powered up then the ESP won't boot. I had to use Python2 and run the script as root btw. |
Hello, I have as well the CC2531 and try to manage flashing using an Arduino micro (5V). Connection is without resistors in between (seems to be no "killer"). The CC2531 is connected to a 5V USB power supply (Samsung 2,2 A max). The DD is connected like 2 (==D8 -> DO) -- 3 (==D6) -- DD (I tried different order as well, this one was the most stable). Best results are with following connection order: unplug both, then 1st Arduino and within 5s (changed delay accordingly) the CC2531. cc_info.py shows promising results: Also cc_read_flash.py worked flawless, I dumped the original flash successfully. BUUUTTT here comes the catch... cc_write_flash.py is not working with: sudo python2.7 cc_write_flash.py -p /dev/tty.usbmodem141301 --in=CC2531ZNP_Kirovilya_mod.hex --erase Any suggestions how this can be resolved? |
To all with similar problems: After making the changes in the .ino and ccproxy.py the flashing works flawlessly and within a few minutes! Regards |
Not that easy, to flash that stick. I now try it with the nodeMCU with no luck. When i try to check the values the nodeMCU seems to be go off (the blue led goes off). The green LED of usb stick is on. Have anyone some tricks how it work with the nodeMCU Amica? |
Have a look at https://hackaday.io/project/163487-zigbee-cc2531-smart-home-usb-adapter |
I'm close to giving up: after fighting with my CC2531 sticks for weeks, I'm finally able to flash more than 85%, but then I'm getting reproducibly an error: Flashing: I'm using an Arduino nano and I'm getting the same result on a MacBook and an Ubuntu desktop. I've played with the baud rates, but no success with 1200,4800,19200. Any ideas why the flashing works properly for hours and then suddenly fails just shortly before finishing? |
hooray, I was able to flash my first CC2531. Had to increase the read timeout from 3secs to 10secs. I've tried this before, but at at different baud rates. The whole thing is really a little bit tricky |
Good to hear you've made it. And which firmware have you installed now? CC2531ZNP-Prod.hex |
finally I was able to flash my two CC2531 with CC2531ZNP-Pro-Secure_LinkKeyJoin_mod.hex (and they work as expected).
I had to increase the read timeout on the Python side for the serial transfer to a ridiculous high number of 20secs: (Symptons with the default timeout of 3secs: the flashing stopped a dozen times after having flashed more than 85% with a read timeout on the serial transfer) contrary to other reports here I had no success with other baud rates (tested: 1200,4800,19200) |
I've followed exactly what @drndos did with a Wemos D1 mini (followed his pin configuration and his cable solution also) and @BotoX recommendation for a delay of 5000ms and was able to flash it just under 2 hours. Wemos was connected on my laptop with Windows 10 and the usb-stick was on a 5V 2 amp USB power supply. If errors on chip detection, check cables. Led lamp on CC2531 has to be off. Hope this bit of information will help someone as it wasn't easy to follow all the different possible configurations. I would also like to thanks @drndos for his pictures. It helped tremendously! |
Hi - none of the links for getting started, alternate flashing methods etc work anymore :( |
Have you checked https://hackaday.io/project/163487-zigbee-cc2531-smart-home-usb-adapter ? |
After weeks of trying, finally got the flash working with @vogler 's recommendation to use test hook cables. In earlier failed attempts: I improvised with Bus Pirate probe cable, nodeMCU v3, Arduino Mega... I used a nodeMCU v2 with the following pinouts:
The Arduino sketch used these values
and I also incorporated @druxx 's idea to increase timeout in cclib/ccproxy.py:
And I confirmed what others have mentioned, the LED on the CC2531 will stay off while the nodeMCU's LED is on during flashing. I powered CC2531 with a Samsung phone charger. EDIT: |
What do you want to use for flashing? Arduino uno, nano, nodemcu, wemos d1 mini? |
I figured it out, but the problem with ambiguous instructions...the following diagram looks a lot like the debug cable, except its not, it represents the direct pins on the actual board: If you're using the debugging cable (mine anyway) its actually (with the red cable strip at the bottom and the clip of the cable to your left, denoted by the indent)....: Or to put it another way humans understand: |
tried flashing a cc2530 via nodemcu with baud 9600 delay in arduino sketch, and readtimeout:20 write_timeout:3 for serial in ccproxy.py Flashing:
edit: I tried that a few times now...do I need an external power supply for the chip, because atm i power the cc2530 via the 3.3v pin of the nodemcu |
@fluffymadness : Most of the other attempts seem to use separate power supply. You can try powering from PC/laptop USB and disconnect 3.3V of nodemcu. Or you might want to try CCLoader #1057 |
Thx. |
EDIT: I Take it back this did not work, CCLoader says its working but is actually doing nothing, I may have had a dead chip, will update once replacements arrive **FINAL NOTE: The chip was dead a replacement CC2531 and Programmer, got me up and running, for those of you in Australia you can use the 40mm Test Clips from Jaycar and they do the trick ** Just to let people know who are looking CCLoader works very well with flashing a CC2530 via an ESP8266 (NodeMCU v3), using this fork, instructions and connection diagram https://github.com/jeanniquini/CCLoader https://github.com/Koenkk/zigbee2mqtt.io/blob/master/information/alternative_flashing_methods.md |
I know this has been closed but I didn't know where else to ask for help. I followed the instructions from https://hackaday.io/project/163487-zigbee-cc2531-smart-home-usb-adapter and everything seemed to be working but the information I gotten from the CC2531 was different to everyone else's. Is this likely a faulty unit or is there something I'm missing? I am using a nodemcu 8266 board. C:\CCLib-master\Python>python cc_info.py -E -p com16 INFO: Found a CC2531 chip on com16 Chip information: Device information: Debug status: Debug config: |
The memory size details look somewhat strange. It should have 256kB of flash. Maybe it's just reporting a wrong value, because the flash is inside the CC2531 chip. But since it was recognized by cc_info.py I'd just give it a try and flash it... |
I did try this and unfortunately I got the error "data to bit to fit fit in chips memory" which makes it sense as the read out says only 16kb of space! |
I'll have to take a photo tonight. Thanks for responding by the way, appreciate the advice. |
Actually, there are two devices with 16kB flash: cc2510 and cc2511.
However, these should have different chip IDs
Am 01.08.2019 23:52, schrieb Tekno-man:
… I'll have to take a photo tonight. Thanks for responding by the way,
appreciate the advice.
|
Hmmm, Im pretty sure on the top of the chip 256 was written also. This is the product I bought https://www.banggood.com/Wireless-Zigbee-CC2531-Sniffer-Bare-Board-Packet-Protocol-Analyzer-Module-USB-Interface-Dongle-p-1227206.html?rmmds=myorder&cur_warehouse=CN |
So I tried flashing with ccloader and it seems to have worked |
How did you do it? With cc_info.py i got this: Chip information: Device information: |
I have a positive experience of flashing firmware cc253x through Arduino without CCDebugger. Based on wavesoft/CCLib#19 (comment)
Does it interest anyone? I can add the translation to the wiki, then edit the grammar. Or someone more experienced can make a translation.
The text was updated successfully, but these errors were encountered: