Home › Evil Mad Scientist Forums › Egg-Bot › Multiple Machines
- This topic has 9 replies, 3 voices, and was last updated 9 years, 1 month ago by ragstian.
April 7, 2014 at 11:31 pm #20325
I probably know the answer to this but will ask anyway. Is there anyway to control multiple bots from one computer running different plots?RayApril 8, 2014 at 12:22 am #21700
I have just tried this on a Windows7 system and it works like a charm!
The difficult part is to know which plot goes to which bot!
(If you plot the same design to the same media it would not matter.)
Some methods to get the right plot to the right bot;
For the example let’s call the bots Bot_1 and Bot_2, the Inkscape “instances” will be called “Inkscape_1” and “Inkscape_2”. The intention is to have Inkscape_1 plot to Bot_1 and Inkscape_2 plot to Bot_2.
By having only Bot_1 plugged in and starting the plot from Inkscape_1 starts the first plot to Bot_1.
Then plugg in the Bot_2 and start Inkscape_2 by clicking on the SVG file you want to plot. This starts another “instance” of Inkscape. By starting the plot from Inkscape_2 before Bot_1 finishes will get the correct plot to Bot_2.
Another method is to have the first bot on the lowest number USB port as the eggbot extension polls from a list of available ports starting with the lowest number, once it finds an EBB board it starts sending commands. (Windows will then “lock” this port until it’s no longer used or “closed” in “geek” lingo).
Unfortunately there is no way in the eggbot extension to avoid closing the port when a plot is finished.
( By use of a small python program to open the ports and keep them open until ready to plot a more advanced system can be devised, however with my limited brain capacity and multitasking ability I reckon juggling two bots and two programs might be more than enough ;-) )
This might work differently on Linux & Mac as the “locking of ports” might work differently.
When running a standalone program talking to the eggbots the output will look like this with two bots plugged in; (The USB ports will “look like” com ports when the EBB is plugged in.)
Com ports available on your system; (‘COM1’, ‘COM4’, ‘COM10’)
testing: COM1 for EBB Board
testing: COM4 for EBB Board
Found EBB on port: COM4
EBBv13_and_above EB Firmware Version 2.2.3
Current setting: 569.23mA. Motor supply voltage: 11.87V.
Here the two bots are plugged in to COM4 and COM10. Com1 is a “regular” com port. while COM4 and COM10 “comes and goes” as the EBB boards are plugged in or out, one physical USB port will always be listed as COM4 and the other physical USB port always as COM10. By plugging in the bots to different ports other numbers will appear.
(Please note that it is NOT recommended by EMSL to flash the EBB board with higher versions than 2.0.1 until later versions are verified to be “bug free”)
Good Luck plotting several eggs at once!
RagnarApril 8, 2014 at 1:09 am #21701dnewmanParticipant
1. On Windows this works well as file and device locking is mandatory. Moreover, the default is to create an exclusive lock when opening an I/O channel to a device. So, by default other threads and processes cannot concurrently access the device. On Linux and OS X, file and device locking is 100% advisory. Any number of threads and processes can open an I/O channel to the same device and concurrently write or read from it.2. Several years ago, I actually wrote the necessary Python code for the Eggbot Control extension to do coordinated device locking. However, I never got around to wiring it in. If someone is interested, here it is,April 8, 2014 at 11:24 am #21702
Clever indeed. Like your comments in the code about the software patent ‘troll”!
For the multi-bot setup to work on Mac / Linux this will have to be incorporated in the eggbot extension.
From other threads on this forum I see that the inkscape eggbot extensions are “stripped to the bone” to aid code reliability so this might/might not make it to the “official” code.
RagnarApril 8, 2014 at 11:43 am #21703dnewmanParticipantFor the multi-bot setup to work on Mac / Linux this will have to be incorporated in the eggbot extension.Correct. I just never got around to doing that. At the time, there was no pressing need for it: Windell and Lenore were the only people likely to be running more than one eggbot at a time and they weren’t in dire need of it. They did suggest at one point that I go ahead and put it in, but absent any serious need for it, it seemed prudent to myself at least to leave it out — to reduce likelihood of another potential issue. (E.g., if a new permissions model is introduced and now your lowly, mortal login account needs a permission for locking files. That’s a *real* stretch of the imagination since a lot of established code would break if that were the case.)From other threads on this forum I see that the inkscape eggbot extensions are “stripped to the bone” to aid code reliability so this might/might not make it to the “official” code.Sure, I was involved with some of that myself. (You’ll see my name here and there in the various extensions.) But if there is a legitimate need for this support, I can carve out the time to finish it and then discuss over on the eggbot-dev list, or directly with Windell and Lenore, whether or not to move forward with it. We could even make it optional via either (1) a UI element [tick box], or (2) by making a file appear which enables it, or (3) something else.April 8, 2014 at 2:51 pm #21704
Thanks for the info guys, I am going to look more into this one. The question came up yesterday when I was asked to bring the bot to a preschool shindig and do something for each of some 30 kids, only having an hour and a half to complete. One discussion led to another and we envisioned having a half dozen bots running at once. Probably the best solution to that would be to have a Pi attached to each one and download a program to each in turn as they become available. We do have a solution to the immediate problem in that we will have several designs already done and plotted, the kids will then pick an egg they like and we will then plot their name on it so they can see the machine working for them.I downloaded the zip file and will look into it, but I quit coding 35 years ago. Looks like another learning curve.RayApril 8, 2014 at 4:19 pm #21705
That explains why setting some of the options in the code does not produce the expected result, for instance setting
bDryRun = True # write the commands to a text file instead of the serial port
does not redirect the output but causes the extension to fail.
Does the original code (from before it was stripped) still exist?
Would be nice to have the option to write to a file in order to make multiple identical plots later using the command line.
RagnarApril 8, 2014 at 9:16 pm #21706
“The question came up yesterday when I was asked to bring the bot to a
preschool shindig and do something for each of some 30 kids, only having
an hour and a half to complete.”
Where are you? I’ll bring my bot and join you!
RagnarApril 9, 2014 at 11:12 am #21707
Anderson, IN probably a long commute but you are welcome to come.RayApril 9, 2014 at 3:39 pm #21708
Thanks, just an 18 hour drive!
I’am on my way!
- You must be logged in to reply to this topic.