Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'Named EBBs' to allow plotting to many AxiDraws #39

Closed
EmbeddedMan opened this issue Aug 12, 2017 · 26 comments
Closed

Support 'Named EBBs' to allow plotting to many AxiDraws #39

EmbeddedMan opened this issue Aug 12, 2017 · 26 comments

Comments

@EmbeddedMan
Copy link

Not sure how or even if this is possible from Inkscape. But if the EBB gets a new 'name' command (issue 83 in EggBot) then it might be possible to have multiple instances of Inkscape open, and somehow choose one of the available AxiDraws by EBB name. Also a way to set the name of a given EBB.

@oskay
Copy link
Contributor

oskay commented Aug 12, 2017

Not sure that this is a necessary part of that process; each USB port connection already has a unique name. It would be neat if there were an ability to save a name string (e.g., in EEPROM).

@EmbeddedMan
Copy link
Author

Agreed - I don't think this naming ability is required, but it would really make things easier for users. You could have 3 EggBots, and give them each nice names ("Yoke", "White", and "OverEasy") which would make selecting one to print to at plot time much easier.

Since we don't have EEPROM on the EBB, we will simply dedicate a block of Flash for this functionality (as well as other things we might want to store there in the future). Microchip has a nice EEPROM emulation library we can use for this.

I think the more difficult part is in the Inksacpe extension. The thing is, you could walk through the list of all available com ports (like we do now), but also ask each EBB what it's name is. Then let the user pick which one (if there is more than one) they want to plot to. This won't work if there is already some app that is in the middle of plotting to one of the EBBs, as you won't be able to open up a com port to it and ask it what it's name is. That's why having it's name appear in the Device Manager (which is just part of the USB information that the OS keeps cached on each device) means you could get it's name even if somebody else is printing to it.

This will increase the complexity of the Inkscape plugin, at least at 'detect' time. But hopefully it's deemed worth while . . .

@oskay
Copy link
Contributor

oskay commented Aug 12, 2017

My bigger concern is with total execution time if we're running multiple machines at once. There is computation time involved on the computer, and it tends to slow things down.

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Aug 12, 2017 via email

@oskay
Copy link
Contributor

oskay commented Jan 5, 2018

What would it take to get this up and running? (Assuming that we can manage it from the software side...)

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 5, 2018 via email

@oskay
Copy link
Contributor

oskay commented Jan 5, 2018

It won't be possible to list the attached devices within Inkscape; the extension format isn't that flexible.

Yes, having an optional place to specify which EBB is plausible. (If none specified, use the first one found -- the default option.)

Yes, listing the names with the id (maybe "EiBotBoard,Sally") would be helpful. Ideally, we could then search through the com ports without interrupting a plot already in progress on another.

Separately: Some people would benefit from a plotting mode where multiple machines are controlled simultaneously, acting in unison. Something to ponder for the future.

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 5, 2018 via email

@oskay
Copy link
Contributor

oskay commented Jan 5, 2018

I could imagine spawning multiple processes that each plot a file, but changing things to have one process send the same command to each and every machine, then wait for responses from each and every machine sounds like a recipe for slow and painful disaster.

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 5, 2018 via email

@oskay
Copy link
Contributor

oskay commented Jan 5, 2018

It certainly does not handle the case if you want to pause one machine...

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 5, 2018 via email

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 6, 2018 via email

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 6, 2018 via email

@EmbeddedMan
Copy link
Author

OK, the change is in and, from my limited testing so far, works.

Three new commands : "NS" for Name Set, "NG" for Name Get, and "RB" for ReBoot.

So far it's sitting on the "EBB_Naming" branch, so please check that branch out and update your firmware to test it out on your own.

Before we merge this change in and make this version final, it really should be tested out to make sure that it doesn't bork anything up, and to make sure that it's actually usable by the Inkscape extension. (I'm not sure how the Inkscape extension can query the Device Names. Hopefully there is an easy way.)

Under Windows, you can use the program USBDeview (http://www.nirsoft.net/utils/usb_devices_view.html) if you want to see the Device Name of every attached USB device. This will show you that the EBB's name gets appended to the normal device name.

Note that the name shown in the Device Manger (which is technically called the "Display Name" of the device in Windows) is hard-coded in the .inf file which is installed as part of the EBB drivers. I don't know how to change that string from the EBB firmware, or if there even is a way. So that string in the Device Manager will still say "USB Serial (UBW-based) communications port (COMxx)". It's only the "Device Name" which we have control over from the firmware.

The documentation has been updated with the three new commands, as have the release notes.

I'll continue to do testing here on different versions of Windows. If you could test on your systems and report back once you're able to get the extension to use this new command, then we can merge this change in.

@EmbeddedMan
Copy link
Author

OK, hold on for a bit before testing - a bug has been found and version 2.5.4 will be re-released shortly on the branch.

The bug is that a blank line is NOT printed if the name field has never been set before (the docs say that this will happen).

@oskay
Copy link
Contributor

oskay commented Jan 6, 2018

Awesome.

For consistency, I would prefer that the query command starts with a (or at least contains) a Q.
Perhaps that should be NQ, or we could rename the commands to:
ST: Set EBB Tag
QT: Query EBB Tag

@oskay
Copy link
Contributor

oskay commented Jan 6, 2018

Also, here is the general syntax that we use to check for the EBB name: https://github.com/evil-mad/plotink/blob/master/libraries/ebb_serial.py#L42

@EmbeddedMan
Copy link
Author

Oh, that's awesome! I think it will be very easy for you to modify that code to look at the rest of the string (after the "EiBotBoard") to see if there is a name attached, and then do a match based on that with which EBB the user wants to plot to. Splendid.

I will rename the commands and get updated docs in shortly.

@EmbeddedMan
Copy link
Author

OK, we should be all good now. v2.5.4 is updated to use the new command names, and the docs have been updated as well. All still on the EBB_Naming branch. Give it a go, and let me know what you think.

@oskay
Copy link
Contributor

oskay commented Jan 8, 2018

Is there a compelling reason to have a separate RB command versus reset?

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 8, 2018 via email

@oskay
Copy link
Contributor

oskay commented Jan 8, 2018

Perhaps it would be good to clarify the difference between the two in the documentation.

@EmbeddedMan
Copy link
Author

EmbeddedMan commented Jan 8, 2018 via email

@oskay
Copy link
Contributor

oskay commented Jan 8, 2018

Yes, that's much better.

@oskay
Copy link
Contributor

oskay commented Jul 8, 2018

Working and committed.

  • Update your EBB firmware to at least v2.5.5.
  • Use the new AxiDraw Naming extension to assign a name to a given AxiDraw.
  • Use the new AxiDraw Control Plus extension, and name the target AxiDraw in the Version tab.
  • Use multiple open copies of Inkscape to plot to multiple machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants