Page 1 of 1

New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 1:36 am
by Levi8than
The printer is a MakerGear M2.

I have S3D Version 3.02 installed.

I recently migrated top a new machine. Ubuntu 14.04 running on an intel i7-4790k, ASUS Z97-PRO(Wi-Fi ac)/USB 3.1.
(ModemManager has already been purged from the system).

Now, I know my M2 is behaving correctly, because my old computer can successfully connect to it and it's working fine.
On that machine it also maps to /dev/ttyACM0, and connects at 115200. (old machine is running ubuntu 12.10, unknown hardware... at least 8 years old).

I also know the serial ports on my new machine are working fine because I can successfully flash my M2's firmware from the new machine, and when I simply cat the port, I see useful output:
$cat /dev/ttyACM0
start
echo:Marlin Marlin 1.0.0 fstart
echo:Marlin Marlin 1.0.0 for M2 with LCD, Dual V4
echo: Last Updated: Nov 27 2015 20:52:18 | Author: (none, default config)
Compiled: Nov 27 2015
echo: Free Memory: 3904 PlannerBufferBytes: 1232
echo:Hardcoded Default Settings Loaded
echo:Steps per unit:
echo: M92 X88.88 Y88.88 Z400.00 E471.50
echo:Maximum feedrates (mm/s):
echo: M203 X500.00 Y500.00 Z25.00 E25.00
echo:Maximum Acceleration (mm/s2):
echo: M201 X4000 Y4000 Z100 E10000
echo:Acceleration: S=acceleration, T=retract acceleration
echo: M204 S2000.00 T3000.00
echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
echo: M205 S0.00 T0.00 B20000 X8.00 Z0.40 E5.00
echo:Home offset (mm):
echo: M206 X0.00 Y0.00 Z0.00
echo:PID settings:
echo: M301 P25.89 I1.94 D86.53
echo:SD card ok
But when load up S3D, either as root or as myself and pull up the Machine Control Panel, select /dev/ttyACM0, 115200 then click connect, within S3D I see:
Attempting connection at /dev/ttyACM0...
WARNING: Device unplugged while connected to port
Disconnected.
Testing plaintext communication protocol...
Testing binary communication protocol...
Testing alternate communication protocols...
Attempting RTS reset and trying again...
Connection failed.
And on the terminal I see:
bool QSerialPort::setDataTerminalReady(bool): device not open
bool QSerialPort::setDataTerminalReady(bool): device not open
bool QSerialPort::flush(): device not open
QIODevice::write: device not open
bool QSerialPort::flush(): device not open
QIODevice::write: device not open
bool QSerialPort::flush(): device not open
QIODevice::write: device not open
bool QSerialPort::setRequestToSend(bool): device not open
bool QSerialPort::setRequestToSend(bool): device not open
My machine is registering the connection, or at least seeing a reset because my fans turn off and back on.
But the machine doesn't connect.
I'm stumped. Any idea? Is there any way to capture debug data?

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 2:01 am
by Levi8than
My old machine that successfully connects to my M2 is running S3D 2.1.1, so I tried rolling back the version on my new machine, but no luck. It fails just the same.

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 2:25 am
by smartavionics
Hi,

Another grabber of tty ports is brltty. Make sure that /etc/default/brltty contains the line:

RUN_BRLTTY=no

Cheers,

Mark

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 2:28 am
by Levi8than
smartavionics wrote:Hi,

Another grabber of tty ports is brltty. Make sure that /etc/default/brltty contains the line:

RUN_BRLTTY=no

Cheers,

Mark
Thanks, but no. That appears to be off:
$ cat /etc/default/brltty
# This is a configuration file for /etc/init.d/brltty; it allows you to
# perform common modifications to the behavior of the brltty daemon
# startup.

# Arguments to pass to BRLTTY
ARGUMENTS="-q"

# If true (or yes) BRLTTY will be started during initramfs execution.
# If you change this setting, you have to run "update-initramfs -u" to have it
# take effect. If this setting is on, "update-initramfs -u" also needs to be
# run if /etc/brltty.conf gets changed.
START_IN_INITRAMFS=false

# Set RUN_BRLTTY=yes to start brltty at boot time. You may need to
# configure it in /etc/brltty.conf.
RUN_BRLTTY=no

$ ps xa | fgrep -i brltty
12028 pts/1 R+ 0:00 fgrep --color=auto -i brltty
$

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 3:10 am
by smartavionics
Well, try "fuser -v /dev/ttyACM0" and see if it reports any process accessing that tty.

Cheers,

Mark

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sat Nov 28, 2015 4:25 am
by Levi8than
smartavionics wrote:Well, try "fuser -v /dev/ttyACM0" and see if it reports any process accessing that tty.
Thanks for your help, that's a great idea.

I ran this in the background, while plugging in the machine and trying to connect via the S3D machine control panel.

Code: Select all

while true; do fuser -v /dev/ttyACM0 && date; done
What's odd is: not only did it not detect any access to the tty port, it didn't even register S3D as accessing the port.

To double check fuser -v was working correctly, I tried cat on the port. That works fine, with the expected output, and it begins scrolling:
/dev/ttyACM0: levi8than 17302 f.... cat
Sat Nov 28 01:22:35 PST 2015
USER PID ACCESS COMMAND
/dev/ttyACM0: levi8than 17302 f.... cat
Sat Nov 28 01:22:35 PST 2015
USER PID ACCESS COMMAND
/dev/ttyACM0: levi8than 17302 f.... cat
Sat Nov 28 01:22:35 PST 2015
USER PID ACCESS COMMAND
/dev/ttyACM0: levi8than 17302 f.... cat
Sat Nov 28 01:22:35 PST 2015
USER PID ACCESS COMMAND
/dev/ttyACM0: levi8than 17302 f.... cat
Sat Nov 28 01:22:35 PST 2015
But I know S3D is having some influence on the port, because it at least resets my machine. Maybe it's hold on the file is just so short that fuser isn't catching it.

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Sun Nov 29, 2015 6:45 pm
by Levi8than
Hey smartavionics, thanks for your help on this.

I've found the issue. There is a kernel bug in 3.13.0-64 and 65. I've upgraded to 3.13.0-67 and now everything is working fine.
I'm not sure what the bug is. They bugreports simply mark the issue as being fixed with .66 and beyond, but there's no explanation of the underlying issue.

Details:
https://bugreports.qt.io/browse/QTBUG-48304
https://bugs.launchpad.net/ubuntu/+sour ... ug/1501345

Re: New ubuntu 12.04 machine, S3D cannot connect to M2

Posted: Mon Nov 30, 2015 2:20 am
by smartavionics
Hi,

Thanks for posting the solution.

I am still using 3.13.0-63 and it works just fine. Looks like my being lazy and not updating the kernel for a while has saved me some grief!

Cheers,

Mark