Jump to content

3dmaker4u

Dormant
  • Posts

    102
  • Joined

  • Last visited

Everything posted by 3dmaker4u

  1. Well, once in browser, all is simple: you can give it a name and make the header of the page a distinctive color. But you have to get there, and this requires some configuration in Raspbian and a bit in OctoPrint. I'll prepare a short guide in a couple of days and post it here. The basic idea is to use the USB device identification codes (usually stored in the EEPROM, e.g. for a FTDI FT232RL) and map the code to a particular name for each printer. Then the name is used to configure the http daemon of OctoPrint. L.E. Here is a config guide for multiple printers on OctoPrint/RPi, pretty long, but hopefully detailed and clear enough. Configuring RPi and OctoPrint for multiple printers is neither too simple, nor too complicated. Besides the specific steps below, there are some prerequisites that you should/shall fulfil: install and update/upgrade Raspbian configure a fixed IP address for RPi install and test OctoPrint in default configuration Once all the above are in place and working we have to perform the following steps: discover the unique codes of the serial interfaces for all printers define names for every printer and map them to codes create the configuration file for each OctoPrint daemon create quick links in browser Let's have a more detailed look to these steps. To find the codes of interest, after RPi boots up, issue the following command to dump the kernel message buffer: dmesg There will be a pretty long listing of messages pertaining whatever has happened during the boot process. Scroll down to find the beginning of the USB devices tree. In the example below, there are: one 4-port USB 2-0 hub connected to the third USB port (well, yes, the first is internally used to provide the Ethernet port, while the next two are available physically to connect USB external devices) four printers connected to the four ports of the USB hub, each equipped with a FTDI FT232RL chip ... [ 3.531762] usb 1-1.3: new high-speed USB device number 5 using dwc_otg [ 3.680789] usb 1-1.3: Product: USB2.0 Hub ... [ 4.002011] usb 1-1.3.1: new full-speed USB device number 6 using dwc_otg [ 4.142434] usb 1-1.3.1: New USB device found, idVendor=0403, idProduct=6001 [ 4.190939] usb 1-1.3.1: Product: FT232R USB UART [ 4.206725] usb 1-1.3.1: Manufacturer: FTDI [ 4.214382] usb 1-1.3.1: SerialNumber: A10248WD ... [ 4.311927] usb 1-1.3.2: new full-speed USB device number 7 using dwc_otg [ 4.459478] usb 1-1.3.2: New USB device found, idVendor=0403, idProduct=6001 [ 4.490897] usb 1-1.3.2: Product: FT232R USB UART [ 4.541582] usb 1-1.3.2: Manufacturer: FTDI [ 4.547665] usb 1-1.3.2: SerialNumber: A102499T ... [ 4.671972] usb 1-1.3.3: new full-speed USB device number 8 using dwc_otg [ 4.829533] usb 1-1.3.3: New USB device found, idVendor=0403, idProduct=6001 [ 4.881350] usb 1-1.3.3: Product: FT232R USB UART [ 4.904643] usb 1-1.3.3: Manufacturer: FTDI [ 4.910623] usb 1-1.3.3: SerialNumber: A10248W3 ... [ 5.141922] usb 1-1.3.4: new full-speed USB device number 9 using dwc_otg [ 5.285609] usb 1-1.3.4: New USB device found, idVendor=0403, idProduct=6001 [ 5.319118] usb 1-1.3.4: Product: FT232R USB UART [ 5.332834] usb 1-1.3.4: Manufacturer: FTDI [ 5.338718] usb 1-1.3.4: SerialNumber: A90197ZC ... Please note that could be other lines besides those kept in the listing above. For each printer, write down idVendor, idProduct and SerialNumber . Each set makes up the unique identification code of one printer. Now, we need to create some mapping rules that will assign a more human readable name to each printer. To do that, issue the following command, to create and edit a rules file: sudo nano /etc/udev/rules.d/10-local.rules For each printer, we need to enter one line, as in the example below: SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A90197ZC" SYMLINK+="Huxy1" SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A10248W3" SYMLINK+="Huxy2" SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A102499T" SYMLINK+="Huxy3" SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A10248WD" SYMLINK+="Huxy5" Well, you have to select names in a way that will enable further configuration. There should be a common root of all the names used. Later on, OctoPrint will have to select each printer out of a bunch of devices, and this is accomplished by filtering out the name strings based on this common root, then looking for an exact match. The example above is appropriate in case it's about the same type of printer, so that just an index could differentiate them. In case of a pool of different printers, it would be adequate to use the printer name, prefixed by something, e.g. the nickname of the owner. Be sure to use the exact syntax or the rule will be entirely ignored. Once everything is fine, save the file and reboot RPi. That's all about Raspbian setup, now let's prepare OctoPrint as well. Having more printers, we have to create and setup a configuration file (config.yaml like) for each. Among many other options, here are the ones that we are interested in, as an example for Huxy1 above: serial: # Instead of Huxy1, use a name for your printer port: /dev/Huxy1 # Default is false, but configuring it to true will do the job, well, not really always autoconnect: true # Instead of Hux, use you specific prefix additionalPorts: - /dev/Hux server: # Use a different port number for each printer port: 5001 appearance: # Give each of your printer a suggestive name that will appear in the title and navigation bars name: Huxy 1 # Customize the color of the navigation bar (limited choice of colors) color: blue Obviously, there many other options that deserve some attention, but these are part of other interesting features of OctoPrint. After each configuration file has been defined, start the corresponding http daemon (or restart it, if already made the configuration for automatic startup). There is one more step, to create a quick link (favorite) to each printer in the preferred browser. Assuming that RPi will be a dedicated print server, you'll have to configure automatic startup of all http daemons. This and many other useful setup and configuration instructions are available on OctoPrint wiki pages.
  2. What I found to be even more useful about RPi and OctoPrint is that you can run multiple instances of the OP daemon and control more printers, each in another browser tab/instance. If you connect a regular 4-port USB hub to one of the RPi's USB port (and perhaps an WiFi dongle to the other) you can run a pool of 4 printers! Each printer daemon being configurable independently. I don't know yet if it works with 3 printers and a camera
×
×
  • Create New...