niceboygithub / AqaraM1SM2fw

Aqara Gateway M1S (ZHWG15LM) , P3(KTBL12LM), H1(QBCZWG11LM), M2 (ZHWG12LM) Firmwares
164 stars 27 forks source link

Can't flash M2 #12

Closed kolaa closed 2 years ago

kolaa commented 2 years ago

aqaragateway.exe is not working with Aqara M2

M2 current firmware version 3.2.7_0018_0524

When i trying to flash rootfs, i see

Goto flasher failed, try again. Error: 'NullWriter' object has no attribute 'fileno'

niceboygithub commented 2 years ago

If you are using M2 EU, the flash is not support M2 EU.

gnep88 commented 2 years ago

I had exactly the same issue with M2 CN, the aqaragateway.exe does not work for me as well with above mentioned issue.

In the end I flashed by using "gateway3utils.exe", now works fine.

See the CMD history for reference:

D:\aqara>gateway3utils.exe -x -c COM5 -t linux_0 -f .\linux_3.3.0_0017.0526.bin Please power up gateway3! If your gateway3 is powered up, disconnect usb cable and reconnect it. Downloading the flasher. 0% [##############################] 100% | ETA: 23:59:59 Total time elapsed: 00:00:46 Now transmitting .\linux_3.3.0_0017.0526.bin_raw 0% [############################################################] 100% | ETA: 00:00:00 Total time elapsed: 00:01:46 Transmit Done! Please wait for programming to flash. Programming .\linux_3.3.0_0017.0526.bin_raw Done!

D:\aqara>gateway3utils.exe -x -c COM5 -t rootfs_0 -f .\rootfs_3.3.0_0017.0526_modified.bin Please power up gateway3! If your gateway3 is powered up, disconnect usb cable and reconnect it. Downloading the flasher. 0% [##############################] 100% | ETA: 23:59:59 Total time elapsed: 00:00:49 Now transmitting .\rootfs_3.3.0_0017.0526_modified.bin_raw 0% [############################################################] 100% | ETA: 00:00:00 Total time elapsed: 00:07:13 Transmit Done! Please wait for programming to flash. Programming .\rootfs_3.3.0_0017.0526_modified.bin_raw Done!

niceboygithub commented 2 years ago

I had exactly the same issue with M2 CN, the aqaragateway.exe does not work for me as well with above mentioned issue.

In the end I flashed by using "gateway3utils.exe", now works fine.

See the CMD history for reference:

NOT recommend to use gateway3utils to flash M2.

gnep88 commented 2 years ago

@niceboygithub THanks for the information. But the aqarawaygateway.exe does not work for me with error: Goto flasher failed, try again. Error: 'NullWriter' object has no attribute 'fileno'

Seems like a python error. Would it be possible to output more debug info?

niceboygithub commented 2 years ago

Please plug-in USB2Uart first and have try.

zsqduke commented 2 years ago

Hi, I have the same error code with M1S. I can see the boot sequence from putty. Before using the tool, do we need to do something in Putty? Like, interrupt the boot sequence?

niceboygithub commented 2 years ago

do not open COM port with other app, like putty.

gnep88 commented 2 years ago

@niceboygithub I tried again with 3.3.2_0008.0605. First plugged in the USB-Serial then start the exe, same error on Windows 10: Error: 'NullWriter' object has no attribute 'fileno'.

As a fallback and only solution, I have to use "gateway3utils.exe".

If you say this is not recommended, would it be possible to provide a command line tool like gateway3utils.exe, for M2 ? Thanks

niceboygithub commented 2 years ago

You can test UART connection by putty first. Make sure that the logs is output from gateway. Then power off the gateway and close the putty. Try flash again.

zsqduke commented 2 years ago

I did use Putty to see log so I can confirm my UART connection is working. Same error from the .exe tool no matter what I do. I have talked to Miniknife88 who had the same issue. I’m wondering what am I doing different than you

niceboygithub commented 2 years ago

Please try the latest one