reality-boy / miniMover

Code to control an XYZ miniMaker or Jr line of 3D printer
68 stars 23 forks source link

USB connection is not working on MacOS #9

Open peleshenko opened 5 years ago

peleshenko commented 5 years ago

First let me say thank you for doing this job!

Application is not working in MacOS Mojave 10.14.3 (actually I think it will not work in any MacOS)

It is just stuck on open function in serial_linux.cpp:154 in Serial::openStream function. The function does not return error or valid handle just stuck.

I've added O_NONBLOCK and it started to work.

Printer is DaVinci 1.0 3in1 plugged trough USB-TypeC -> USB (tried different adapters)

peleshenko commented 5 years ago

It started to return status but fail on printing. But I think today I finally found the source of the problem. For some reasons open at serial_linux.cpp:148 is not working without O_NONBLOCK flag on my system, but we should be in blocking mode, to make everything work, so I've uncommented serial_linux.cpp:201 fcntl(m_handle, F_SETFL, 0); and it started to print. I will do additional tests and prepare pull request.