Changing the connection timeout setting [SOLVED]

I have a Solidoodle 2 printer and would like to be able to try using Astroprint. The problem is that I can’t connect. In an earlier version of Octoprint I needed to edit a configuration file to make the connection timeout longer “I believe I set it to 10”. Since I have been having so many problems getting Astroprint to work I went back and downloaded the latest version of Octoprint to see if I could find the configuration file and maybe just change the same file in Astroprint. Octoprint has made many changes since I have last used it and it now lets me change the timeout setting fright from the UI. Does anyone know where I can do this in Astroprint? If it helps my USB device shows as FT232 USB-Serial (UART) IC.

These are not my particular settings but I need the file that sends these settings.

  • SERIAL - DEBUG - Connected to: Serial<id=0x30a9ab0, open=True>(port=’/dev/ttyACM0’, baudrate=115200, bytesize=8, parity=‘N’, stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor

You can edit the configl file /etc/astrobox/config.yaml and add this:

serial:
   timeout: 
      detection: 10

Note that the serial section might already be there.

After that restart the astrobox service: sudo service astrobox restart

Daniel,

Thanks for your reply. I made the changes like you noted but I don’t think I’m getting the results I expected. Here is what I’ve done and what the log file says.

serial:
log: true
port: /dev/ttyUSB0
timeout: 15
detection: 10

I get this message 3 times & the screen says no printer connection

2015-09-23 17:09:37,992 - SERIAL - DEBUG - Connecting to: /dev/ttyUSB0
2015-09-23 17:09:37,996 - SERIAL - DEBUG - Unexpected error while connecting to serial port: /dev/ttyUSB0 AttributeError: ‘‘int’ object has no attribute ‘keys’’ @ comm.py:_openSerial:996
2015-09-23 17:09:37,996 - SERIAL - DEBUG - Changing monitoring state from ‘Opening serial port’ to ‘Error: Failed to open serial port, permissions correct?’
2015-09-23 17:09:39,042 - SERIAL - DEBUG - Changing monitoring state from ‘Offline’ to ‘Opening serial port’

if I take out the timeout line and leave detection
serial:
log: true
port: /dev/ttyUSB0
detection: 10

I get this in my log:
2015-09-23 17:13:43,379 - SERIAL - DEBUG - Changing monitoring state from ‘Offline’ to ‘Opening serial port’
2015-09-23 17:13:43,382 - SERIAL - DEBUG - Connecting to: /dev/ttyUSB0
2015-09-23 17:13:43,398 - SERIAL - DEBUG - Connected to: Serial<id=0x172b5b0, open=True>(port=’/dev/ttyUSB0’, baudrate=250000, bytesize=8, parity=‘N’, stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2015-09-23 17:13:43,401 - SERIAL - DEBUG - Changing monitoring state from ‘Opening serial port’ to ‘Connecting’
2015-09-23 17:13:44,352 - SERIAL - DEBUG - Recv:
2015-09-23 17:13:46,356 - SERIAL - DEBUG - Send: M105
2015-09-23 17:13:48,360 - SERIAL - DEBUG - Send: M105
2015-09-23 17:13:50,363 - SERIAL - DEBUG - Send: M105
2015-09-23 17:13:52,367 - SERIAL - DEBUG - Send: M105
2015-09-23 17:13:54,371 - SERIAL - DEBUG - Send: M105
2015-09-23 17:13:54,949 - SERIAL - DEBUG - Recv: start
2015-09-23 17:13:54,952 - SERIAL - DEBUG - Recv: echo:Marlin 1.0.0
2015-09-23 17:13:54,954 - SERIAL - DEBUG - Changing monitoring state from ‘Connecting’ to ‘Closed’
2015-09-23 17:13:54,955 - SERIAL - DEBUG - Connection closed, closing down monitor

serial:
log: true
port: /dev/ttyUSB0
timeout: 10

I get this:
2015-09-23 17:30:49,218 - SERIAL - DEBUG - Changing monitoring state from ‘Offline’ to ‘Opening serial port’
2015-09-23 17:30:49,234 - SERIAL - DEBUG - Connecting to: /dev/ttyUSB0
2015-09-23 17:30:49,240 - SERIAL - DEBUG - Unexpected error while connecting to serial port: /dev/ttyUSB0 AttributeError: ‘‘int’ object has no attribute ‘keys’’ @ comm.py:_openSerial:996
2015-09-23 17:30:49,241 - SERIAL - DEBUG - Changing monitoring state from ‘Opening serial port’ to ‘Error: Failed to open serial port, permissions correct?’

So at the end of this I still don’t see how I can increase the “timeout=2.0” value as shown in the second log above. I appreciate all of your help on this.

Coy

You need to write exactly what I described in my post. Including the indentation. There’s no number after timeout:

the serial section of my config.yaml file now looks like this and the timeout still says 2 in the log file. Every time I check the log box the log: true always appears. If I type it exactly as you had it when I restart it locks up (3 spaces in front of timeout and another 3 space indention for detection) when I removed one of the spaces in front of timeout (only 2) it boots up. I also tried 2 space indention for detection and nothing different. Do you have any other ideas?

Does not boot on restart

serial:
  log: true
   timeout:
      detection: 10

 serial:
      log: true
      timeout: 5
         detection: 10

This boots but timeout is always 2.0

serial:
  log: true
  timeout:
    detection: 10.0

serial:
  log: true
  timeout:
     detection: 10

I’m sure when I figure this out I’m going to be upset on how simple it is but still no luck here.

The serial block should not be repeated. If it’s there already use the one that’s there and use the same indentation (I believe is 2 spaces per level. I did make a mistake also, it’s not the detection timeout that we need it’s the ‘connection’ one so your serial block (only one in the file) should look like:

serial:
  log: true
  timeout:
    connection: 10

OK so I figured this out. I found the Octoprint documentation page here for serial connections. http://docs.octoprint.org/en/master/configuration/config_yaml.html#serial

This page gave me all of the options for connections and I just added this to my config.yaml. There may be more optimal settings but these settings allowed me to get connected.

serial:
  timeout:
    communication: 8
    connection: 10
    detection: 5.0

Daniel thanks for all of your help. FYI I always had just one serial block. I was just trying different settings.

1 Like

Thanks for this. I think I’m going to change the defaults for next release. These are reasonable.