MatterHackers / MatterControl

3D printing software for Windows, Mac and Linux
http://www.mattercontrol.com/
BSD 2-Clause "Simplified" License
457 stars 184 forks source link

Autodetecting Bukito and printrboards #28

Open whosawhatsis opened 10 years ago

whosawhatsis commented 10 years ago

When trying to autodetect the serial port for a Bukito in MatterControl (at least on a Mac), the detection fails. The Bukito uses an AT90USB1286 (like the printrboard). Normally, these appear on a Mac as "/dev/tty.usbmodem12341" (autodetect fails with this, suggesting that it will fail for all printrboards as well). For the Bukito, we have modified the USB>Serial library used to compile the firmware so that they appear as "/dev/tty.usbmodem_Bukito1" instead. The autodetect algorithm should be modified to recognize these.

kevinepope commented 10 years ago

Interesting. The filter for Mac is just '/dev/tty' and auto-detect currently works by waiting for a new connection to appear. In the case of the AT90USB1286 the old connection may not disappear fast enough if it was previously plugged in. However having a specific identifier to work with opens up new possible approaches.

On Mar 16, 2014, at 4:42 PM, whosawhatsis notifications@github.com wrote:

When trying to autodetect the serial port for a Bukito in MatterControl (at least on a Mac), the detection fails. The Bukito uses an AT90USB1286 (like the printrboard). Normally, these appear on a Mac as "/dev/tty.usbmodem_12341" (autodetect fails with this, suggesting that it will fail for all printrboards as well). For the Bukito, we have modified the USB>Serial library used to compile the firmware so that they appear as "/dev/tty.usbmodem_Bukito1" instead. The autodetect algorithm should be modified to recognize these.

— Reply to this email directly or view it on GitHub.

whosawhatsis commented 10 years ago

Ah, so when the instructions are actually followed, it does work. She (and I, when attempting to reproduce the problem) moved too quickly through that section and missed the part where we were supposed to disconnect the machine.

This process makes sense on Windows/linux machines, where the devices are difficult to distinguish from many other types of devices, but on a Mac they will appear as "/dev/tty.usbmodemXXXXX" for an AT90USB chip (where XXXXX is usually 12341, but is different for the Bukito for the reasons I mentioned above) or for an arduino-compatible board (like the Arduino Mega 2560) using an ATMega8U4 or similar chip for USB>Serial translation (where XXXXX will be some other number, I haven't used these much and I'm not sure what the rules are).

An arduino-compatible board using a FTDI USB>Serial converter will appear as "/dev/tty.usbserial-XXXXXXXX",where XXXXXXXX is an 8-digit alphanumeric serial number that starts with 'A' for an FT232 chip used by older Arduinos (like the original Arduino Mega with ATMega1280) and Sanguino boards, or starts with 'D' for boards using the FT231x (the Azteeg boards from Panucatt that we use for the Bukobots are the only ones I'm aware of using this chip).

Given these rules, it should be pretty easy to detect which serial port corresponds to the printer without the need to disconnect it (assuming the user doesn't have other printers or Arduino boards plugged in at the time), though it should fall back to the current system of determining the port if this search doesn't return exactly one match.