<p><em>Opening</em> a serial connection to your printer will usually reset the microcontroller, stopping the print.</p>

<p>The serial interface has a line known as request to send (RTS) that indicates to the microcontroller that the computer is ready to receive data. When the port is closed, this line is HIGH (indicating the computer is not ready), and when you open the serial connection the line goes LOW (indicating the computer is ready now) and the transition from HIGH to LOW triggers a reset.</p>

<p>There are a number of ways to prevent this:</p>

<ul>
<li><p>In software: disable hang up on close (HUPCL). This prevents the RTS line from going HIGH after you close it, allowing it to be subsequently opened without causing a reset. However, this does not work for the first attempt (the first, initial connection still causes a reset). How this is configured depends on your software/driver set up, but it is widely supported.</p></li>
<li><p>In software: disable the RTS line from going LOW in the first place. I'm not sure if this is readily possible with common serial drivers.</p></li>
<li><p>In software: modify your workflow to always keep the connection open, preventing the associated reset from happening.</p></li>
<li><p>In hardware: your printer's board will have some circuitry on there that translates the RTS line transitioning from HIGH to LOW to trigger a reset, usually this is implemented in the form of a single capacitor between RTS and RST. RST is normally pulled high with a pull-up resistor (on the order of 10k or so), and when RTS transitions to low the capacitor briefly allows some current to flow, pulling RST low. One way to prevent this is to include a stronger pull-up resistor that overcomes the current drain associated with the RTS line going LOW. <a href="http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection" rel="nofollow">DisablingAutoResetOnSerialConnection</a> suggests using a 330 Ohm resistor between VCC and GND.</p></li>
<li><p>In hardware: desolder the capacitor mentioned earlier.</p></li>
</ul>

CC BY-SA 3.0
2016-08-20T22:17:51.697Z
Thank you Tom for your very detailed and informative reponse. I am very new to this field. I am trying to access the  bed temperature of 3D printer using a simple python code and sending M105 command. Could you please help me with this?
KDK
CC BY-SA 3.0
2016-08-25T14:25:13.830Z
@TomvanderZanden I thought that serial communication was limited to a single connection between the bus and software. If you are using a serial connection to run the printer and attempt to push a command, you risk overriding the previous connection. So, potentially, your best bet would be to use slicing software with a wrapper API. Something like the Cura Engine might work like this.
tbm0115
CC BY-SA 3.0
2016-08-25T15:10:34.027Z
I made the assumption that he was printing from SD, otherwise attempting to access the serial interface during a print would be insane as it is indeed limited to one concurrent connection in any reasonable implementation.
Tom van der Zanden
CC BY-SA 3.0
2016-08-20T22:07:06.097Z
2016-08-20T22:07:06.097Z
Tom van der Zanden
<p>I want to access the bed temperature of the 3D printer. I am able to get the temperatures using serial connection (Thanks to Demetris's help (<a href="https://3dprinting.stackexchange.com/questions/1555/access-temperature-sensor-data-of-3d-printer-via-serial-connection">Access Temperature sensor data of 3D printer via Serial connection</a>)). The problem that I am facing now is that as soon as I give the command, I get the temperature values, however the print job stops. Is there a way around it? I want to get the temperature values as the print job goes on. TIA!</p>

CC BY-SA 3.0
2016-08-21T07:10:20.977Z
I think it would be best if you reverted your edit, since questions about programming are not on-topic on this site. "Why does my printer stop printing when I connect over serial" makes a reasonable question, but "Here's my code and please make it do what I want" is not (this would not even be accepted on the programming SEs).
Tom van der Zanden
CC BY-SA 3.0
2016-08-21T13:13:56.030Z
Thanks Tom. I am not looking for a code solution from you, I just meant that this is what I am doing and just needed a point in the right direction from here since its a little difficult for beginners to interpret everything correctly right from the start. I was not asking you to make it do what I want to do, I can do that myself. I think you misunderstood. Anyhow, thanks for your help.
KDK
<extruder><heated-bed>
Print job stops when given serial command
KDK
# Print job stops when given serial command

(Asked by: username_0 on 2016-08-20)

I want to access the bed temperature of the 3D printer. I am able to get the temperatures using serial connection (Thanks to Demetris's help ([Access Temperature sensor data of 3D printer via Serial connection](https://3dprinting.stackexchange.com/questions/1555/access-temperature-sensor-data-of-3d-printer-via-serial-connection))). The problem that I am facing now is that as soon as I give the command, I get the temperature values, however the print job stops. Is there a way around it? I want to get the temperature values as the print job goes on. TIA!

**Tags:** extruder, heated-bed

> **Comments:**
> **username_1**: I think it would be best if you reverted your edit, since questions about programming are not on-topic on this site. "Why does my printer stop printing when I connect over serial" makes a reasonable question, but "Here's my code and please make it do what I want" is not (this would not even be accepted on the programming SEs).  
> **username_0**: Thanks Tom. I am not looking for a code solution from you, I just meant that this is what I am doing and just needed a point in the right direction from here since its a little difficult for beginners to interpret everything correctly right from the start. I was not asking you to make it do what I want to do, I can do that myself. I think you misunderstood. Anyhow, thanks for your help.  

---

## 1 answers

### Answer by username_1 on 2016-08-20. Score: 3

*Opening* a serial connection to your printer will usually reset the microcontroller, stopping the print.

The serial interface has a line known as request to send (RTS) that indicates to the microcontroller that the computer is ready to receive data. When the port is closed, this line is HIGH (indicating the computer is not ready), and when you open the serial connection the line goes LOW (indicating the computer is ready now) and the transition from HIGH to LOW triggers a reset.

There are a number of ways to prevent this:

* In software: disable hang up on close (HUPCL). This prevents the RTS line from going HIGH after you close it, allowing it to be subsequently opened without causing a reset. However, this does not work for the first attempt (the first, initial connection still causes a reset). How this is configured depends on your software/driver set up, but it is widely supported.
* In software: disable the RTS line from going LOW in the first place. I'm not sure if this is readily possible with common serial drivers.
* In software: modify your workflow to always keep the connection open, preventing the associated reset from happening.
* In hardware: your printer's board will have some circuitry on there that translates the RTS line transitioning from HIGH to LOW to trigger a reset, usually this is implemented in the form of a single capacitor between RTS and RST. RST is normally pulled high with a pull-up resistor (on the order of 10k or so), and when RTS transitions to low the capacitor briefly allows some current to flow, pulling RST low. One way to prevent this is to include a stronger pull-up resistor that overcomes the current drain associated with the RTS line going LOW. [DisablingAutoResetOnSerialConnection](http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection) suggests using a 330 Ohm resistor between VCC and GND.
* In hardware: desolder the capacitor mentioned earlier.

> **Comments:**
> **username_0**: Thank you Tom for your very detailed and informative reponse. I am very new to this field. I am trying to access the  bed temperature of 3D printer using a simple python code and sending M105 command. Could you please help me with this?  
> **username_2**: @username_1 I thought that serial communication was limited to a single connection between the bus and software. If you are using a serial connection to run the printer and attempt to push a command, you risk overriding the previous connection. So, potentially, your best bet would be to use slicing software with a wrapper API. Something like the Cura Engine might work like this.  
> **username_1**: I made the assumption that he was printing from SD, otherwise attempting to access the serial interface during a print would be insane as it is indeed limited to one concurrent connection in any reasonable implementation.  

---

