Analyzing GCode with Wireshark, lots of Gcode Duplicates in Packet Capture, Why?
Hi,
I have been working on project where I am interested in using Wireshark to analyze Gcode instructions as they travel through my instance of Repetier Server (running on Raspberry pi) and into my printers.
I have successfully been able to view and monitor Gcode instructions in my packet captures and confirm them in the print.log files. All is good.
The issue I am having is that I am finding the some Gcode instructions are present in the wireshark packet capture multiple times. In fact I have observed the same Gcode instruction up to 60+ times in one packet capture. Why is this? It seems as though there entire chunks of duplicated Gcode being observed in Wireshark. I even searched for specific lines of Gcode that would only run one time in a print and they too appeared multiple times in my packet capture?
Furthermore, I have observed Gcode instructions in my Wireshark captures that were NOT present in the Print.log files and I am unsure as to why they are listed in my packet capture and the only data that should be in my Wireshark capture is the data from the Gcode file I selected.
Comments
I'm pretty sure I'm not sending same command 60 times, but there are queries that get repeated every x seconds e.g. printer status. But without seeing the complete message I have no idea which communication part you are seeing so hard to give qualified responses. You can use imgur.com for example to upload images and post links here.
{ "lastid": 2997, "lines": [ { "id": 1998, "text": "N532 M105", "time": "19:55:50", "type": 1 }, { "id": 1999, "text": "ok 532", "time": "19:55:50", "type": 2 }, { "id": 2000, "text": "T:25.47 /0 @:0 T0:25.47 /0 @0:0 T1:25.47 /0 @1:0", "time": "19:55:50", "type": 2 }, { "id": 2001, "text": "wait", "time": "19:55:51", "type": 2 }, { "id": 2002, "text": "N533 M105", "time": "19:55:51", "type": 1 }, { "id": 2003, "text": "ok 533", "time": "19:55:51", "type": 2 }, { "id": 2004, "text": "T:25.35 /0 @:0 T0:25.35 /0 @0:0 T1:25.47 /0 @1:0", "time": "19:55:51", "type": 2 } ], "state": { "activeExtruder": 0, "debugLevel": 6, "extruder": [ { "output": 0, "tempRead": 25.4, "tempSet": 0 }, { "output": 0, "tempRead": 25.39999961853027, "tempSet": 0 } ], "fanOn": false, "fanVoltage": 0, "firmware": "Repetier_0.92", "firmwareURL": "https://github.com/repetier/Repetier-Firmware/", "flowMultiply": 100, "hasXHome": false, "hasYHome": false, "hasZHome": false, "heatedBed": { "output": 0, "tempRead": 0, "tempSet": 0 }, "layer": 0, "numExtruder": 2, "powerOn": false, "sdcardMounted": true, "speedMultiply": 100, "x": -21, "y": 0, "z": 0 } }
When I add a "lines" filter in chrome websocket stream I only see incremental updates. But again if you post one of the responses and request to it, it is easier to answer. I'm very interested just because if it repeats all it is not meant to happen, just I do not see it where I'm looking for it. So either you look at something different or there is a case where it happens.
What exactly are you trying to do that you need to monitor network traffic to get some data? That sounds like the worst solution possible since it means you need to have at least one gui running so you get the traffic at all. In server you can add scanners for communication in/out and execute actions when some you are interest in are send. When log options are not set to watch commands they even will not be in the data communication, and of course I have not to say that it very error prone.
You can also make your own websocket channel and just send you are interested in log lever xy and get all data in "log" events free house. No need for the wireshark hack.
BTW: The function that always read the 1000 lines was not interested in the log but in the state part, so it will not check any line in future. Only when you are in console logs will be queried at start, but still the log event is set to provide matching data. But that is initially off for ack and commands.