fairecasoimeme / ZiGate

Zigate is an Universal Zigbee Gateway
http://zigate.fr
171 stars 59 forks source link

Flash PiZigate - Error setting baudrate #182

Closed GPierrot closed 4 years ago

GPierrot commented 5 years ago

Bonjour,

Après réception de ma PiZigate, j’ai voulu la mettre a jour en suivant les instructions du Wiki.

A la première utilisation de JennicModuleProgrammer, l’operation s’est bien lancée, mais a planté sur une erreur ´Failed to write at address‘. Depuis, a chaque nouvelle tentative, je recois le message suivant : JennicModuleProgrammer version: 0.6 (r56124) Setting baudrate: 115200 Error setting baudrate 🥺

Merci par avance pour vos idées ou solutions 😬

Martial83 commented 5 years ago

J'ai exactement le même problème, mais sans être passé par la case "Failed to write at address" mais j'ai pu résoudre mon problème initial sans reflasher, mais en faisant un erase persistant data.

ISO-B commented 5 years ago

I have Raspberry Pi 2B with Raspbian. I had to remove console=serial0,115200 from /boot/cmdline.txt before flashing started working. I used https://github.com/tjikkun/zigate-flasher with following command: sudo python3.5 zigate-flasher.py -p /dev/ttyAMA0 -w /home/pi/firmwares/firmware.bin

Martial83 commented 5 years ago

Thank ISO-B I have already suppress console=serial0,115200 from /boot/cmdline.txt. The problem seems to be near JennicModuleProgrammer. I will try zigate-flasher soon

GPierrot commented 5 years ago

I have Raspberry Pi 2B with Raspbian. I had to remove console=serial0,115200 from /boot/cmdline.txt before flashing started working. I used https://github.com/tjikkun/zigate-flasher with following command: sudo python3.5 zigate-flasher.py -p /dev/ttyAMA0 -w /home/pi/firmwares/firmware.bin

I tried this, but I have again an error message related to baudrate : Capture du 2019-04-04 22-08-36

GPierrot commented 5 years ago

Just to be clear on the process

result of a new test just here after Capture du 2019-04-04 22-12-28

Martial83 commented 5 years ago

Sorry GPierrot, Are you using zigate-flasher ou JennicModuleProgrammer ?

GPierrot commented 5 years ago

I tried both :

Initialy, I used Jennic and I received the baud rate error message. Following Iso-b feedback, I tried zigate-flasher without success.

ISO-B commented 5 years ago

Have you switched between production and flashing pins between tries? I have following sh scripts that I use to toggle between modes, before and after programming. Also sometimes booting before flashing can fix things. If nothing else works and you have usb to ttl adapter available you could try programming chip using it.

pizigate_flash.sh

#!/bin/bash

gpio mode 0 out
gpio mode 2 out
gpio write 2 0
gpio write 0 0
gpio write 0 1

pizigate_production.sh

#!/bin/bash

gpio mode 0 out
gpio mode 2 out
gpio write 2 1
gpio write 0 0
gpio write 0 1
pipiche38 commented 5 years ago

Here is the script which is part of the Domoticz Zigate Plugin and which can be used for seting the PiZigate in Run or Flash mode

https://github.com/sasu-drooz/Domoticz-Zigate/blob/stable/Tools/pi-zigate.sh

fairecasoimeme commented 5 years ago

Hi, I have just developed a tool to test if the PiZiGate works. You can find this here : https://github.com/fairecasoimeme/ZiGate/tree/master/Tools/PiZiGate

Here an example when all it's OK. image

nunus59147 commented 5 years ago

with a friend we both have the same issue

GPierrot commented 5 years ago

Update :

I used the testing tool, with the following result : Capture du 2019-04-08 15-54-45

Following the test, the flash was successful using JennicModuleProgrammer :
Capture du 2019-04-08 15-55-24

I used again the testing tool : Capture du 2019-04-08 15-55-54

Good progress, thanks for your help. My remaining concern is that the version looks not correct : 0180

fairecasoimeme commented 5 years ago

Hi, It's possible that datas are not good because I do very too simple interpretation. The aim was to show bidirectional communication. I'll evolve the tool quickly :)

pipiche38 commented 4 years ago

This issue has been closed due to no activity since while!

xlyric commented 3 years ago

Bonjour, voulu faire une mise à jour ce jour et même problème

/boot/cmdline.txt dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=00690444-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait `root@raspberrypi:~/1/PiZiGate-tools/test# ./PiZiGate_test /dev/ttyAMA0 RPI Model searching ... Warning !!! you must modify /boot/config.txt Verifying /boot/cmdline.txt ...

et en mode update : ./JennicModuleProgrammer -V 255 -P115200 -f "ZiGate_v3.1e.bin" -s /dev/ttyAMA0 JennicModuleProgrammer Version: 0.7(r56124) Setting baudrate: 115200 Error setting baudrate

pas de solution trouvée sur le net avant de poster cdt

xlyric commented 3 years ago

étrangement c'est passé ... à moitié j'ai remis en mode prod, redémarré domoticz arreté domoticz remis en mode update et relancé le script

oot@raspberrypi:~/1/JennicModuleProgrammer/Build# ./JennicModuleProgrammer -V 6 -P115200 -f "ZiGate_v3.1e.bin" -s /dev/ttyAMA0 JennicModuleProgrammer Version: 0.7(r56124) Setting baudrate: 115200 Detected Chip: Unknown MAC Address: 00:15:8D:00:01:ED:E9:42 Opened firmware file size 208404 Module uses Bootloader v2 Header Erasing: 100% Writing Program to Flash Writing: 100% Verifying Program in Flash Verifying: 89% Error reading at address 0x0002db80 et impossible de relancer le script ensuite

JennicModuleProgrammer Version: 0.7(r56124)
Setting baudrate: 115200
Error setting baudrate

par contre en redémarrant domoticz il a quand même pris la nouvelle version