26

Re: print gcode files to miniMaker

madman907 wrote:

Nice work! Thanks for all you hard work. Personally, I'm just using the command-line tool in my conversion/print script and it works like a charm with my minimaker. Have you ever tought of creating a Cura-Plugin for printing from Cura directly? Would save some time. I have to save the gcode file and call my script on the gcode to get it printed. Not a big deal, but...

It is on my list to look into a way to make a command line call from cura. It seems like it should be supported but I have not found anything yet.  Maybe I have to make a plugin...

27 (edited by david.tucker 2018-02-25 05:19:06)

Re: print gcode files to miniMaker

Ok, there is a new version of the minimover app.  Overall this is mostly a fix to the UI but there are a few small improvements to the command line.  In particular I now parse the z: zOffset command from the status and I properly read all the return characters when printing a file. 

On the UI side I dumped the tree widget in favor of a list for the status info and I cleaned it up so it no longer flickers.  Now that it behaves well I can poll 2x a second automatically so you don't have to update the status by hand.

I also added in some locks so it is impossible to attempt to make two requests to the serial port at the same time.

Finally I added in some code to monitor print progress and pause/cancel a print.  I still want to clean this up more, it is not as clean as it could be, but it should be fully functional.

Everything works fairly well and it should now be a lot more resilient.  Previously it had a hard time recovering from even the smallest communications errors.

28 (edited by david.tucker 2018-02-25 05:29:53)

Re: print gcode files to miniMaker

I know I called this miniMover, but I want to be clear that this should let you send a gcode file to most of the currently shipping XYZ printers.  In fact here is a dump of all the printers I know about, everything not in the 'older' section should work with this utility.  Please let me know if you get it working with anything besides a miniMaker. 

Also, this currently only works over a serial connection (USB) but in theory it could be extended to work over wifi.

//  older communication protocol

"da Vinci 1.0"       
"da Vinci 1.0A"
"da Vinci AIO"
"da Vinci 2.0 Duo"
"da Vinci 2.0A Duo"

//  v3 protocol

"da Vinci 1.1 Plus" //???? I'm suspicious of this one, think it belongs above

"da Vinci Nano"
"da Vinci Mini w"
"da Vinci miniMaker"
"da Vinci Jr. 1.0"
"da Vinci Jr. 1.0 Wireless"
"da Vinci Jr. 3in1"
"da Vinci Jr. 2.0 Mix"
"da Vinci Jr. 1.0A"

//  new file format

"da Vinci Jr. 1.0 Pro"
"da Vinci Jr. 3in1 (Open filament)"
"da Vinci 1.0 Pro"
"da Vinci 1.0 Pro 3in1"
"da Vinci 1.0 Super"

29

Re: print gcode files to miniMaker

I put up a new version that has a much improved handling of the printer status message.  This has now been tested against a da Vinci Pro 1.0 and it does work (with some small issues).  This also fixes a new bug I introduced that can cause the ZOffset to be set wrong on some models of printer.

30

Re: print gcode files to miniMaker

Latest version is up, this one has a cleaned up serial library with a lot fewer waits.  I had a lot of cruft laying about from when I was still trying to debug how the messages work, now that I know things better It was time to simplify. 

This eliminates all sleeps in the windows version and all but one in the dos version.  That is a very good thing, it should make the program more responsive.  I also reduced most serial timeouts to 0.5 seconds, down from 10 seconds originally.  Hopefully no one has issues with timeouts with this change.  It should make the UI much more responsive if I make a call that the printer cant currently process.

Finally this fixes an annoying bug I introduced in 0.5 that could cause the UI to become unresponsive on a Pro 1.0 printer.  I was making an unsupported call and the 10 second timeouts were killing the UI.

31

Re: print gcode files to miniMaker

I managed to get my hands on some 3w files from the original da Vinci 1 and 2 machines, these files use some sort of zip compression on the gcode before encrypting them.  I can pull out the zip file but it is not a standard zip, and can't be decompiled by regular zip libraries.  I'm probably going to end up rewriting a zip reader/writer from scratch to make this work.

Anyway, once I can read/write these files then you can use my tool to convert from gcode to 3w and back for any xyz printer.  I still won't have support for the older communications protocol so you have to use XYZWare to send the print but at least you can modify the file at will.

If anyone else has a clue about the zip file format then let me know.

32

Re: print gcode files to miniMaker

https://github.com/tai/decrypt-xyz3w

(Da Vinci 1.0, Jr. 1.0 RAMPS, miniMaker) X4, (Creality CR-10S, CR-10 mini, Ender-3) X4, Anycubic MEGA X4, Anycubic Chrion X1, ADMILAB Gantry X2 (MonoPrice Maker Select V2, Plus, Ultimate)X4--Select mini X1, Anycubic photon X4, Wanhao duplicate D7 X1.
iNSTONE Inventor Pro X2, CTC Dual X2, ANET-A8, Hictop 3DP-11, Solidoodle Press, FLSUN I3 2017X1

33

Re: print gcode files to miniMaker

Thanks Yizhou, that is a help.

I spent a lot of time looking over this and feeling very confused but last night on the way to bed the answer popped into my head.  When decrypting a zip file they change how the data is read out and actually read it in fixed size blocks compared to the non zip file format.  I think that the zip file is zero padded when encrypting, even though the code is not explicitly attempting to zero pad the file, it is just a side effect.  That results in me decoding too small of a block on the end of the file and that in turn is causing some corruption to the file without completely destroying it.

If that is not the case then they are resetting the decrypter every n blocks, but I don't see any code that explicitly resets the decryptor.  They do call a decryptFinal() call on each set of blocks and I have not been able to work out what the final part means, does it reset the key back to the initial value at the end of each block of decryption?

Either way I have a plan, and a reasonable explanation why my zip file appears good but is slightly corrupted.

34

Re: print gcode files to miniMaker

When I had my 1.0 I used to print on it using just a gcode file generated by Repetier host and Slicer. All I did is got an SD card extension so that I could place the SD card in the print area. I would then just take the file I wanted to print and rename it Sample1.gcode and put on the SDcard in place of the existing sample file. Then just tell it to print the sample which was my file through the menu. Those files are just plain gcode files and are not encrypted.

As long as you have the machine dimensions and parameters correct in your host and your slicer you can just save the print to a gcode file then put that file on the SDcard as a Sample.

Printing since 2009 and still love it!
Anycubic 4MAX best $225 ever invested.
Voxelabs Proxima SLA. 6 inch 2k Mono LCD.
Anycubic Predator, massive Delta machine. 450 x 370 print envelope.

35 (edited by yizhou.he 2018-03-15 21:39:43)

Re: print gcode files to miniMaker

david.tucker wrote:

Thanks Yizhou, that is a help.

I spent a lot of time looking over this and feeling very confused but last night on the way to bed the answer popped into my head.  When decrypting a zip file they change how the data is read out and actually read it in fixed size blocks compared to the non zip file format.  I think that the zip file is zero padded when encrypting, even though the code is not explicitly attempting to zero pad the file, it is just a side effect.  That results in me decoding too small of a block on the end of the file and that in turn is causing some corruption to the file without completely destroying it.

If that is not the case then they are resetting the decrypter every n blocks, but I don't see any code that explicitly resets the decryptor.  They do call a decryptFinal() call on each set of blocks and I have not been able to work out what the final part means, does it reset the key back to the initial value at the end of each block of decryption?

Either way I have a plan, and a reasonable explanation why my zip file appears good but is slightly corrupted.


XYZWare.exe is written in .NET and it can be decompiled. I'm not familiar with these area but it might help you find out how XYZWare doing it. I think someone else in this forum decompiled it and generated something like XYZWare advance version. (modfreakz I think)

http://www.soliforum.com/topic/16978/xy … de-v21261/

Good luck.

(Da Vinci 1.0, Jr. 1.0 RAMPS, miniMaker) X4, (Creality CR-10S, CR-10 mini, Ender-3) X4, Anycubic MEGA X4, Anycubic Chrion X1, ADMILAB Gantry X2 (MonoPrice Maker Select V2, Plus, Ultimate)X4--Select mini X1, Anycubic photon X4, Wanhao duplicate D7 X1.
iNSTONE Inventor Pro X2, CTC Dual X2, ANET-A8, Hictop 3DP-11, Solidoodle Press, FLSUN I3 2017X1

36

Re: print gcode files to miniMaker

Thanks Yizhou, I did that a while back, it was informative.

I spent another frustrating night on this, I tried decoding in blocks, and resetting the seed between blocks and making the last block 8010 bytes long.  With the right combo I got a different output from the decrypter but it was still a bogus zip file.

I'm starting to suspect there is something off with my decrypter, it decrypts the header just fine but for some reason this is coming out wrong, but not so wrong that the file does not appear valid when inspecting it with a hex editor.  I think the next step is to pull out java or C# and replicate code that is known to work so I can at least pin down what part of the process is broken in my C++ code.

This is one of the perpetual frustrations in C land, you have all this power but everything is hard to do.  Sadly I'm a C++ developer, I did it to myself smile

37 (edited by yizhou.he 2018-03-16 15:58:47)

Re: print gcode files to miniMaker

Hi, David,

I did not try to do this. But I want to share some of my past experience in this kind of troubleshooting.
1. The order of decryption and compression may make difference. Also the checksum or CRC may contribute to the difference.
2. I don't know if it worth the time and effort, but try generate .3w file from your apps and corresponding XYZware and compare the result and sometime can help you find out if you are on the right direction.

3. I think old .3w file are just just a base64 encoded gcode file. Only new version .3w file are AES-encrypting ZIP-ed gcode.

4. I'm not sure if I misunderstood your previous post (#31). If I understand it correctly, this may be something you need.

I guess this is what you are after:
"uploadGCodeText"        = "XYZ_@3D:4";
"latestBlockSent"        = "XYZ_@3D:90”;

Just need to find out how big each block is.


"prefix"              = "XYZ_@3D:";

//"disconnect"           = "XYZ_@3D_S10_X";
//"connect"              = "XYZ_@3D_S10_0";
//"start print"          = "XYZ_@3D_S10_1";
//"test case"            = "XYZ_@3D_S10_2";
//"uploadFirmwareBinary" = "XYZ_@3D_S10_3";
//"uploadGCodeText"      = "XYZ_@3D_S10_4";

//"extruder Temperature" = "XYZ_@3D_S10_101";
//"get standard info"    = "XYZ_@3D_S10_102";
//"get advanced info"    = "XYZ_@3D_S10_103";


"disconnect"             = "XYZ_@3D:-1";
"connect"                = "XYZ_@3D:0";
"startOnlinePrint"       = "XYZ_@3D:1";
"test print"             = "XYZ_@3D:2";
"injectManualCommand"    = "XYZ_@3D:2";
"uploadFirmwareBinary"   = "XYZ_@3D:3";
"uploadGCodeText"        = "XYZ_@3D:4";
"latestBlockSent"        = "XYZ_@3D:90";
"uploadBinaryDidFinish"  = "XYZ_@3D:91";
"uploadGCodeDidFinish"   = "XYZ_@3D:92";
"machineLife"            = "XYZ_@3D:5";
"read eeprom A"          = "XYZ_@3D:6";
"read eeprom B"          = "XYZ_@3D:7";
"machine status"         = "XYZ_@3D:8";
"printer status"         = "XYZ_@3D:8"; // same as machine status

"get standard info"      = "XYZ_@3D:201";
"get advanced info"      = "XYZ_@3D:202";

//example "XYZ_@3D:101,1"
//example "XYZ_@3D:101,2"
//example "XYZ_@3D:103,2"
"extruder on"           = "XYZ_@3D:101";
"extruder off"          = "XYZ_@3D:102";
"extruder Temperature"  = "XYZ_@3D:103";

http://www.soliforum.com/topic/6279/xyz … 0-hacking/

(Da Vinci 1.0, Jr. 1.0 RAMPS, miniMaker) X4, (Creality CR-10S, CR-10 mini, Ender-3) X4, Anycubic MEGA X4, Anycubic Chrion X1, ADMILAB Gantry X2 (MonoPrice Maker Select V2, Plus, Ultimate)X4--Select mini X1, Anycubic photon X4, Wanhao duplicate D7 X1.
iNSTONE Inventor Pro X2, CTC Dual X2, ANET-A8, Hictop 3DP-11, Solidoodle Press, FLSUN I3 2017X1

38

Re: print gcode files to miniMaker

I managed to unencrypt a zip file using the Java code that Yizhou provided.  Comparing that to my own attempts to unencrypt the same zip file I see that I am inserting an extra 16 random bytes into the file every 8192 bytes.  Now I just need to work out what I'm doing wrong...

39

Re: print gcode files to miniMaker

Looks like the trick is to pkcs7 unpad each encrypted block rather than just unpadding the full buffer after decrypting.

40

Re: print gcode files to miniMaker

Success! I can read zipped files, now to work out writing them.

41

Re: print gcode files to miniMaker

Congratulations!

(Da Vinci 1.0, Jr. 1.0 RAMPS, miniMaker) X4, (Creality CR-10S, CR-10 mini, Ender-3) X4, Anycubic MEGA X4, Anycubic Chrion X1, ADMILAB Gantry X2 (MonoPrice Maker Select V2, Plus, Ultimate)X4--Select mini X1, Anycubic photon X4, Wanhao duplicate D7 X1.
iNSTONE Inventor Pro X2, CTC Dual X2, ANET-A8, Hictop 3DP-11, Solidoodle Press, FLSUN I3 2017X1

42 (edited by david.tucker 2018-03-18 17:49:48)

Re: print gcode files to miniMaker

I have the zip writing stubbed in, it just needs debugging.  Hopefully I will have a new version out to you soon that can read and write files from any printer (other than the color).  I thought it would be a good time to write up a small to do list to keep me inspired.

- Set networking options, I know roughly how these should be formatted, I just need to try it out and get someone to test it.
- Set lazer options (lazer temp, etc), again I have a rough idea how this works, but no lazer to test with.  On a side note, anyone wanting to donate a da Vinci pro with lazer to the cause smile
- Communicate over wifi, this should not be too hard in theory.
- Fill in rest of header, maybe this will help the pro show progress.
- Reorganize the communications so that I can show progress when the hotend is heating up and cooling down.
- Clean up the UI to have a proper print progress dialog and hide the more obscure options.
- Test, test, test!  I have had almost zero testing with this on anything but a miniMaker.  I wish I could find a way to get my hands on more machines.

43

Re: print gcode files to miniMaker

Hey David, keep up the good work! Also, please continue to document and publish your findings, it helped me already here and there :-)

44

Re: print gcode files to miniMaker

I put up version 0.7, it adds support for reading/writing the older zip based 3w file format used by the version 1 and 2 printers.  I also added in a new dropdown that lets you select the printer model to target when converting from a gcode file to 3w.  This is auto set to your local printer when it is connected.

45

Re: print gcode files to miniMaker

I am not a code monkey and not a davinci owner so can not really appreciate this project. But thank you for your hard work and commitment to this.

Soliddoodle 4 stock w glass bed------Folger Tech Prusa 2020 upgraded to and titan /aero extruder mirror bed
FT5 with titan/ E3D Aero------MP mini select w glass bed
MP Utimate maker pro-W bondtech extruder
Marlin/Repetier Host/ Slic3r and Cura

46

Re: print gcode files to miniMaker

I spent some time going through the XYZMaker code and through these forums trying to work out how the older version 2 communication protocol works, unfortunately I have not made much progress.  I have a reasonable list of commands I can send but almost no idea what the return data looks like.  I'm going to put it on hold till I can get access to a da Vinci 1.0 machine to test against.  I had been hoping to at least work out how to safely identify the machine type so I can automatically convert from gcode to a 3w file that is tagged for the correct machine.

I did spend some time looking over the filament load and unload and nozzle cleaning routines and I think I can get them to send a progress update so you are not just left in the dark while the nozzle does its thing.

47

Re: print gcode files to miniMaker

On a side note, if anyone has an old busted xyz printer they would like to donate to the cause I would be happy to pay shipping.  It does not need to work but should have enough of its internals left so you could send a print job to it using XYZWare. I would love to get my hand on one of each, but anything would be a big step forward at this point in time.

48

Re: print gcode files to miniMaker

david.tucker wrote:

On a side note, if anyone has an old busted xyz printer they would like to donate to the cause I would be happy to pay shipping.  It does not need to work but should have enough of its internals left so you could send a print job to it using XYZWare. I would love to get my hand on one of each, but anything would be a big step forward at this point in time.

P.S. It need to stay on stock firmware not repetier-firmware smile

(Da Vinci 1.0, Jr. 1.0 RAMPS, miniMaker) X4, (Creality CR-10S, CR-10 mini, Ender-3) X4, Anycubic MEGA X4, Anycubic Chrion X1, ADMILAB Gantry X2 (MonoPrice Maker Select V2, Plus, Ultimate)X4--Select mini X1, Anycubic photon X4, Wanhao duplicate D7 X1.
iNSTONE Inventor Pro X2, CTC Dual X2, ANET-A8, Hictop 3DP-11, Solidoodle Press, FLSUN I3 2017X1

49

Re: print gcode files to miniMaker

Hello i am a french teacher

i have a problem

when i launch minimover and i try to print a file a have a message PROCESS FAILED. If i see minimover, for extruder temp, i have 20°C/198654465423°C

Is anyone have an idea ?

Thanks a lot

50

Re: print gcode files to miniMaker

I can not print files, not sure if this bypasses the cartridge authenticity check...