1

Topic: Threedub Parameters

Does anyone know, in more detail than the help file, what the parameter definitions for thredub are? I am really looking for the the "-e". Specifically what would be the DEVICE on a windows 7 machine. The default device is setup for a linux type OS.

positional arguments:
  infile                Input file
  outfile               Output file

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Debug logging
  -f OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
                        Output file type (.3w, .gcode)
  -m MODEL, --model MODEL
                        Machine to translate headers for. Set to 'none' for no
                        translation.
  -s SLICER, --slicer SLICER
                        Flavor of Slicer gcode being read. Tries to autodetect
                        if not given.
  -l, --list            List known models (for -m) and slicers (for -s)
  -e DEVICE, --device DEVICE
                        Printer device name or address
  -q, --status          Show printer status
  -r, --raw             Show raw status values
  -p, --print           Print the file to the named device (in addition to
                        encoding and translating) (default: /dev/ttyACM0)
  -c, --console         Open a console for direct communication.
  -u, --unlock          Unlock filament
  -F, --firmware        Write firmware (exclusive with other options)

2

Re: Threedub Parameters

That is not the windows device name though. That is the Linux device address.

3

Re: Threedub Parameters

yup, the code (main.py) say this: ap.add_argument("-e", "--device", default="/dev/ttyACM0", help="Printer device name or address")

4

Re: Threedub Parameters

Bozotclown1970 wrote:

That is not the windows device name though. That is the Linux device address.

Very true.  I have no idea how windows / python translates a linux port to a windows com port.  I wonder if google know.  I think I'll ask.  Back shortly

5

Re: Threedub Parameters

I have been looking for the solution to this for two days. That's why I thought I would post here. These folks seem to know everything.

6

Re: Threedub Parameters

mjf55 wrote:
Bozotclown1970 wrote:

That is not the windows device name though. That is the Linux device address.

Very true.  I have no idea how windows / python translates a linux port to a windows com port.  I wonder if google know.  I think I'll ask.  Back shortly

Ok, so it looks like the PySerial package will figure out what com ports are available.  See this link for a great little program that will show you what ports are available.  I just tested it on Windows and Linux   https://stackoverflow.com/questions/120 … ith-python

Now, what are you trying to do, so maybe we can help?

7

Re: Threedub Parameters

The only reference to windows is the COM Port. Threedub does not accept the COM Port as a valid device name.

8 (edited by mjf55 2017-11-15 20:20:04)

Re: Threedub Parameters

So, the linux serial port is only mentioned 3 time in the threedub set of code modules.  2 time as a comment/print statement and one time to set the default.  That is in Printers.py:  Perhaps you can change it to a windows COM port you want to use

class DaVinciJr10(PrinterInterface):
    name = "davincijr"
    QueryCmd = "XYZv3/query={}"
    ActionCmd = "XYZv3/action={}"
    ConfigCmd = "XYZv3/config={}"
    UploadCmd = "XYZv3/upload={filename},{size}{option}"
    FirmwareCmd = "XYZv3/firmware={filename},{size}"
    SaveToSD = ",SaveToSD"
    UploadDidFinishCmd = "XYZv3/uploadDidFinish"
    PauseCmd = "M84 P"
    ResumeCmd = "M84 R"
    CancelCmd = "M84"

    def __init__(self, device="/dev/ttyACM0"):
        self.device = device

Remember to reinstall it to get it active if you change it

9

Re: Threedub Parameters

mjf55 wrote:

So, the linux serial port is only mentioned 3 time in the threedub set of code modules.  2 time as a comment/print statement and one time to set the default.  That is in Printers.py:  Perhaps you can change it to a windows COM port you want to use

class DaVinciJr10(PrinterInterface):
    name = "davincijr"
    QueryCmd = "XYZv3/query={}"
    ActionCmd = "XYZv3/action={}"
    ConfigCmd = "XYZv3/config={}"
    UploadCmd = "XYZv3/upload={filename},{size}{option}"
    FirmwareCmd = "XYZv3/firmware={filename},{size}"
    SaveToSD = ",SaveToSD"
    UploadDidFinishCmd = "XYZv3/uploadDidFinish"
    PauseCmd = "M84 P"
    ResumeCmd = "M84 R"
    CancelCmd = "M84"

    def __init__(self, device="/dev/ttyACM0"):
        self.device = device

Remember to reinstall it to get it active if you change it


Not sure I can because I am using the exe version, but I will look around and see what I can find. Thanks for the idea.

10

Re: Threedub Parameters

Ok, following what razor_keen posted I was able to send a file to my JR. I did not let it print, but I did let the download complete. Also I was able to query the printer for the following information:

Extruder temperature: 24
Nozzle information: GB-0002-0002-TH-57F-0353-46444
Language: en
Bed temperature: 20
Filament serial number: --------------
Printer status status: 10
m: 0,0,0
Versions firmware version: 2.2.0
Error status: 1073742345
Remaining filament: -1
fd value (unknown): True
fm value (unknown): True
SD Card present: True
Job progress percentage: 0
Job progress elapsed time: 0
Job progress estimated time: 0
Life left machine life: 67650
Life left extruder life: 47256
Serial number: 3F1J0PGBXTH54Q0153
Model name: dv1J00A000
System Attribute package size (/1024): p8
System Attribute t (unknown): t1
System Attribute c (unknown): c1
System Attribute auto leveling (+/-): a-

11

Re: Threedub Parameters

You use threedub with the -q and iy will return the status I posted.

threedub.exe -q

12

Re: Threedub Parameters

razor_keen wrote:

Does anyone know an alternate way to get the info like as was posted by bozot, off of a davinci 1.0a? Maybe USB sniffing of some sort?

I'm not good at English, do not understand what is your question, is this the information you are looking for?

https://stackoverflow.com/questions/120 … ith-python

https://stackoverflow.com/questions/120 … on-windows

http://raaviblog.com/python-2-7-get-lis … in-system/

(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

13 (edited by yizhou.he 2017-11-19 13:50:25)

Re: Threedub Parameters

razor_keen wrote:

No not quite. The info I'm looking for is davinci specific. It's a type of send and respond. Yes you are correct I can find the com port and other info like this but it's not exactly what I'm looking for. Which printer do you own. Maybe you could try it and then you will know exactly what I am looking for..

OK, still not sure what exactly you are looking for, if you trying to get the query result for Da Vinci 1.0A, you will not be able to get from threedub. threedub is designed for jr.1.0, in the class DaVinciJr10(PrinterInterface), the DaVinciJr10 is actually the model name for jr.1.0, any place that execute code based on the model information will give you problem. you may need to define a class with Da vinci 1.0A model name and execute model specific command here.

Jr. command start with XYZv3/ but Da Vinci 1.0 command start with XYZ_@3D:

https://github.com/foosel/OctoPrint/issues/510
https://github.com/jasongao/DaVinci1.0/ … davinci.py

(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

14

Re: Threedub Parameters

razor_keen wrote:

Also, I've been working on that plugin you spoke of.. how would I implement actual printing? I don't really know how the davinci communicates but I could spoof another printer and capture curas output and send it to threedub. It's not pretty but it would work. You spoke of a plug-in. Are you a coder is that something you could do?

For simplicity, call xyzware and let xyzware do the rest. Keep this in mind, the less you do, the less bug and troubleshooting. Everything you code, must have good reason for it. you can call system command or shell command to execute 3rd party apps in python.

https://stackoverflow.com/questions/892 … -in-python

If you really want to use threedub, you can include part of three dub code in the plugin, they are all python code, just make sure you communicate with Da Vinci 1.0 and Jr. in separate code based on the model name because the serial command are different.
you should set this goal 2nd piority because it add more complexity to the system.

(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

15

Re: Threedub Parameters

razor_keen wrote:

Ok well I see now how I can call system commands or open external programs but why exactly do I need to open xyz? I get to send a print to the printer but I'm looking for a minimalistic approach. So as to not open two slicer programs. Your probably right, I'm just not familiar with this approach and I need a bit more guidance. Thanks

1. I think open xyzware is the easiest way to implement in your code. I'm not saying you should not use threedub or send a print to the printer directly. I think when you get more experience and have more confidence, you should even allow user to choose open in xyzware, S3D, threedub, or direct send to printer (I think this is the "right" way of doing it). But for now, make simplest solution, debug the whole system, work out the details, then expand the function.

2. If you don't want to open two slicer programs, just save the file as .3w file in the save directory as the .gcode, popup a window showing file in the directory, user can double click to open in whatever apps they want. (I think this is also the "right" way of doing it).

3. Be able to call system command or 3rd party apps are important skills in any program language, as important as learning how to call system API, it really expand your ability to do things you can not imaging before.

4. When you trying to implement a function, think about how microsoft will do it, how google will do it, and how apple will do it. when you use other apps, pay attention to how they do thing that you don't know how in python.

(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

16

Re: Threedub Parameters

razor_keen wrote:

Your info was very useful indeed. I now have a working query. I just have to work my sample program into threedub.
As far as the plug in I'm thinking I can just add the encryption and serial used in threedub to make it work. Unfortunately I'm not so good at making it multiple printer friendly but I can make two or three different visions for different printers. I'm sure it's something simple but I've only got a few months experience coding I think I'm doing ok for what I got.

I think make it work for Da vinci 1.0 and Jr. is good enough for now. Don't set your goal too high, work out all the small detail and make it work well for these two model is already a big achievement. You can always add support for other model later.

Make two or three different visions for different printers is a bad idea, you need to maintain multiple version, it is start of nightmare, trust me. It is a matter of get model name of the printer and execute device specific functions. Many beginner likes to copy and paste the whole function and rename it and make some simple change for different device, this is a bad idea. It is easy to write in the beginning but difficult to troubleshoot in the future. Make sure you structure your code to share as much code as possible for different device.

(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