Ankermgmt / ankermake-m5-protocol

Ankermake M5 protocol specifications and libraries *NOT AFFILIATED WITH ANKER*
GNU General Public License v3.0
164 stars 38 forks source link

[BUG] MQTT not connecting on latest firmware #131

Closed Maddin4000 closed 11 months ago

Maddin4000 commented 1 year ago

Don't Show Temperature or Print Progress

MacBook Air 2020 M1 Safari Browser

billyjbryant commented 1 year ago

Can you expand on what exactly the bug here is?

Maddin4000 commented 1 year ago

It don’t show any time for Print or temperature

only I see the Camera Live picture

billyjbryant commented 1 year ago

Can you share more information about your setup?

Maddin4000 commented 1 year ago

Hi, no Docker Mac Sonoma Python 3.12 Printer a the same Network stehst i don't no

Bildschirmfoto 2023-10-19 um 15 43 53
Maddin4000 commented 1 year ago

Lights on off and SD HD is working Prusa upload is working too

billyjbryant commented 1 year ago

MQTT status doesn't appear to be connected, do you see any errors in the Ankerctl console when you are printing? I would definitely say a lack of MQTT communication is at fault for that data being missing.

You can also go to the Setup tab and click the restart button to restart the services and reload ankerctl.

Maddin4000 commented 1 year ago

reloud dont fix it

screenshot without printing

Bildschirmfoto 2023-10-20 um 08 22 29
billyjbryant commented 1 year ago

What about the console logs in the browser? Can I see them as well?

Maddin4000 commented 1 year ago

What about the console logs in the browser? Can I see them as well?

which do you mean?

billyjbryant commented 1 year ago

Accessing the browser console (typically through F12 to get into developer tools).

Also, Can you advise what firmware version you are on with the AnkerMake and which model of printer you have.

Maddin4000 commented 1 year ago
        Ok, Ankermake m5, SW 

V3.0.57_3.0.74

Lieben Gruß Martin HilbrandtAm 27.10.23 um 18:59 schrieb Billy Bryant

                Von: "Billy Bryant" ***@***.***>Datum: 27. Oktober 2023An: "Ankermgmt/ankermake-m5-protocol" ***@***.***>Cc: "Maddin4000" ***@***.***>,"Author" ***@***.***>Betreff: Re: [Ankermgmt/ankermake-m5-protocol] [BUG] (Issue #131)

Accessing the browser console (typically through F12 to get into developer tools). Also, Can you advise what firmware version you are on with the AnkerMake and which model of printer you have.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

HansAndreManfredson commented 1 year ago

Hi dudes,

same issue over here...

image

I have the same issue when I am using docker and the native python script aswell.

The python script throws the following errors:

ndle.min.js.map HTTP/1.1" 304 -
[*] VideoQueue: Requesting start
[*] PPPPService: Requesting start
[*] Trying connect to printer AnkerMake M5 (xxxxxxx) over pppp using ip 192.168.0.185
[*] 127.0.0.1 - - [29/Oct/2023 20:43:22] "GET /static/img/logo.svg HTTP/1.1" 304 -
[*] Established pppp connection
[*] PPPPService: Worker started
[*] VideoQueue: Worker started
[E] Failed to decode mqtt message: expected set() but found {20, 205}
[E] Failed to decode mqtt message: expected set() but found {43, 11}
[E] Failed to decode mqtt message: expected set() but found {225, 29}
[E] Failed to decode mqtt message: expected set() but found {129, 12}
[E] Failed to decode mqtt message: expected set() but found {153, 17}
[E] Failed to decode mqtt message: expected set() but found {18, 92}
[E] Failed to decode mqtt message: expected set() but found {2, 183}
[E] Failed to decode mqtt message: expected set() but found {1, 214}
[E] Failed to decode mqtt message: expected set() but found {126}
[E] Failed to decode mqtt message: expected set() but found {227, 37}
[E] Failed to decode mqtt message: expected set() but found {39}
[E] Failed to decode mqtt message: expected set() but found {16, 131}
[E] Failed to decode mqtt message: expected set() but found {9, 35}
[E] Failed to decode mqtt message: expected set() but found {100, 28}
[E] Failed to decode mqtt message: expected set() but found {2, 30}
[E] Failed to decode mqtt message: expected set() but found {42, 35}
[E] Failed to decode mqtt message: expected set() but found {244, 4}
[E] Failed to decode mqtt message: expected set() but found {11, 95}
[E] Failed to decode mqtt message: expected set() but found {21, 103}
[E] Failed to decode mqtt message: expected set() but found {2, 244}
[E] Failed to decode mqtt message: expected set() but found {17, 27}
[E] Failed to decode mqtt message: expected set() but found {32, 82}
[E] Failed to decode mqtt message: expected set() but found {233, 27}
[E] Failed to decode mqtt message: expected set() but found {16, 122}
[E] Failed to decode mqtt message: expected set() but found {139, 12}
[E] Failed to decode mqtt message: expected set() but found {32, 200}
[E] Failed to decode mqtt message: expected set() but found {24, 83}
[E] Failed to decode mqtt message: expected set() but found {161, 20}
[E] Failed to decode mqtt message: expected set() but found {5, 55}
[E] Failed to decode mqtt message: expected set() but found {234}

The console of the browser throws only:

image
martinmcu commented 1 year ago

I am seeing similar behavior. Using the native python script on Linux Mint 21 and Firefox as my browser:

ankerctl ankerctl-cli

I have an M5 running version 3.0.57_3.0.74.

I have run with the following code modification:

diff --git a/libflagship/mqttapi.py b/libflagship/mqttapi.py
index 13dc662..0b6d2a1 100644
--- a/libflagship/mqttapi.py
+++ b/libflagship/mqttapi.py
@@ -52,6 +52,7 @@ def _on_message(self, client, userdata, msg):
             pkt, tail = MqttMsg.parse(msg.payload, key=self._key)
         except Exception as E:
             log.error(f"Failed to decode mqtt message: {E}")
+            log.info(f"msg.payload: {msg.payload}")
             return

         data = json.loads(pkt.data)

This provides the more verbose output

[E] Failed to decode mqtt message: expected set() but found {24, 165}
[*] msg.payload: b'MA\x91\x02\x05\x01\x02\x05F\xc0\x01\x00\x19\x98Be2542fc34-xxxx-1038-8a13-a976d48862fa\x00\x00\x00\x00\xa5\x18\x00\x00\x00\x00\x00\x00\xc3J\x0c\x94\x9c\n`\xec&\xda]\x13h\xcc\xfe\xcbwnb\xb4^I\x00\x9a\xcbJ\xbe\xab\x82\xb7\xf8;\xb3{\xf5\xd0\xb2=\x93\xea\xe2V\xb6\x8d\xb7\xb4\xd4\xdcJ\x85\xbd\xf4E\xcc\xe8\xbc0i\xb01\xf3y7\xdf~\x17bm\xa4n%\xe4\xf7\x88w\x88\xabp\xeb\x05\xa0\\@1\xc5\x83\xe7\xd0\xe45O\xb0EP\xe4\xcb\x18\xd9qJ\x11h\xd1\x05\xb9\x92B\x99\xfc\x93\xa8\x01B\xa5\xf7\xf6W\xfew\xaa\xba\x027\xe8"\xd2\xdf\x13\xd0-\xb1\x84s]\x95:1\xa0\xdcs\x9b\xc8\x1b\xfb\x89\xf4\xaf\xc6\x9ba\x9a\x1e\xf51-\xaa\x8a\xa3e\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\xb7\xe7\xccX\x0b}>>`*\x03\xfa}\xd0\x17\xe3>\xc4>\xd5\x08\xd5\x1a\xbe\x99<\xab\xdf\xc6\xbe?(W\xb6(;\rz\xe2'
[E] Failed to decode mqtt message: expected set() but found {1, 98}
[*] msg.payload: b'MA\xd1\x02\x05\x01\x02\x05F\xc0\x01\x00\x1c\x98Be2542fc34-xxxx-1038-8a13-a976d48862fa\x00\x00\x00\x00b\x01\x00\x00\x00\x00\x00\x00\xc3J\x0c\x94\x9c\n`\xec&\xda]\x13h\xcc\xfe\xcb~\xe8\xb2\x8eq:Vk\x85g9\xaa\xaa\xa9\x93\xdd\x97n\xcf\xe1\x8ev\xab\xf9\xdf\xa6\xed\xa2\xd4\xedC\x98\x1ap\xf2\xec\x16\xdf\xc18\x8b\xa1\xf5\x1c\xa7\xd9q#\x94x\x9b-CU\x01\xb1x\x82\xf6\x92\xc3\x85l-\xbf\x8b8\x9d\xd4\x08Yi\xe9 \n)\x84\xa6`U\r\xfb\xb7\xb6\xf1\x8c\nMS\x81C\xe7~.\xbdI8\xf7T\x01\xc5\n\xae\x91\rr\x08}%\x06\x8aw\x0c\xb2_\x1di\x97\x88\xab7\xd0\xbcS\x8f\xfa\x90\x95\xb0V\x84\xd3\x8a\x86\xdci\xf3\xc6d\xb5-I\x9aK\x15\xe36\x15^\xddr\x937\xfbQ\xceJ\xc5\x8b\xe8(\xe4f2\xe0n5\x9fd\xf3:\x80\xa8\x91aF\x127\xa9e\xf2S\x10\xf1\xdf\x8a\x97\xef\xff\xd0\x08>\x85y\xcb\xda$\x9f\xbbH\xe8\x92"<1\x17\x8e\xe9y\x05M#>Hv\x93\x9e\xb8\x07\xe2\x1f?\xbe\xd49\x9f/\xec\x10j/\xb7%\xde\x84\xc9\'\x0b\xc5f\xa6\x98\xf6$\xa0~\xc1w\n\xf1x\xcc)|\xebC\x98\x1e\xa2*\x9a\xae\r\xb3\xea\xd5\x1d\xc6\xcf\xf0\x82\xfa\xa8\xa0\xf3\xa4\x19\xdc]W|o\xc6 ?\xc9l\xf0\x9fz~\xbd\x17k\xae*\x7f2h\x1e\x9d\x11\x0225\xbe\xbd\x1f\x0c[\xbc\xa1s\xba\xa5\x04\x13|\x0e\xa7\xadc3\x1e\x05\xd8<\xc2\xe6\x87\x07=\x80\x91Y>W\xdbH\x86\xd4\x13\x90\x19\x95\x96\x868\x06g\xbdQ\x0f\x84\x0fM\xf7\xa82\xd0\x88\xaax\xb8\xba`\x17\x1f\x82C;\x7f\xdc7r\xa0\x8f\nX\x18lp\x1f\xb2\xc1\xa74W\xfb\x07\xdbW_\x0bQ\xd0U\x9bY\x15\x88\x1c\x1d\x82Jn\xe47\xc0\t\x9c\x14\xffi![\x03\xe2_\xd8&\xd4\x1bT\xf7\xdf1e\x18\xb5(sH \x889\x8a\x9bShM\xf0\x16\xb5\xc0\xc8\x1a\x8b\xfe\x1e,\x9c+\x8d\xdc\xb9\xb1&O\x0c\xd0\xbc\xd7\x8d7T\x8f\xf6v\xc9L\xab\xd00=\xe4\xebj\xdbo]d\xc5\xfd%\xa7^\xe7--\x12\x1a\x8d\xe2\x84\xf5T>\xd9\xc1w\t,I\x8f\xfd\xb5{\xa0\x8a\x9b;\x8cVDG\x0e\xdf\xf0\xd2$y\x92\xd3\xab/X\x90\xe9\xc5O\x84\x07\t\xa3\x99\x19-\r\n\xa9\t\xa9M\xb3\xdc\xd3T\x9e\xdc/\x0f\xed\x1d\xce\x9c\x83#\xaeK\x85\xde)5\xbc\xdf=J\x07\xea\x84\xee\x95\xa9\x02W;\xae\xc2f-<\xaf\x88V>\x16\x12\xa7\xf3J\x9f\x9b\xee\x8ao\xfc"\xf2\x96\x89I,\xa8\xfe\xc4P\xdf\xa0\x83y\x83\xc6\xf2\x90)\xfdG\x86\xf6M \xb0R\xb2~\x88\xd4\xea\xdb\x9e\xf6P_\xd7\xa9\xf7\t\xc4QQ'
billyjbryant commented 1 year ago

It looks like there is indeed a bug in ankerctl with regards to the latest firmware versions of the AnkerMake M5. We will need to investigate this further.

billyjbryant commented 1 year ago

@Maddin4000 can you please delete https://github.com/Ankermgmt/ankermake-m5-protocol/issues/131#issuecomment-1783294390, it does not contain console logs and is instead causing a lot of interference with reading through the comments on this issue.

billyjbryant commented 1 year ago

@Maddin4000 please update the title of this issue to [Bug] MQTT not connecting on latest firmware

132 is a duplicate of this issue.

HansAndreManfredson commented 1 year ago

I am getting additional error messages:

image

I looks like, a language/charset problem? Do you agree?

Hemiu1 commented 1 year ago

Firmware 3.0.70.3.0.84 same problem:

MqttQueue: Worker started [E] Failed to decode mqtt message: expected set() but found {217, 19} [E] Failed to decode mqtt message: expected set() but found {181, 14}

no connection, no camera, no light on/off ... nothing works :-(

mtoner23 commented 12 months ago

I updated my firmware and noticed the same thing.AFter some debuggin it looks like they changed the formatting on mqtt after the guid and perhaps removed the zeroes field. still debugging it locally.

Anyone else looking into this who i can talk with? i tried joining the discord but all the links to it are dead, is there a new discord?

billyjbryant commented 12 months ago

@mtoner23 you can join the Discord @ https://discord.gg/x3QZr4KcGB

mtoner23 commented 12 months ago

I got it working, i'll put up a PR soon