2
$\begingroup$

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)). 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!

$\endgroup$
2
  • $\begingroup$ 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). $\endgroup$ Aug 21 '16 at 7:10
  • $\begingroup$ 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. $\endgroup$
    – KDK
    Aug 21 '16 at 13:13
3
$\begingroup$

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 suggests using a 330 Ohm resistor between VCC and GND.

  • In hardware: desolder the capacitor mentioned earlier.

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – KDK
    Aug 20 '16 at 22:17
  • $\begingroup$ @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. $\endgroup$
    – tbm0115
    Aug 25 '16 at 14:25
  • $\begingroup$ 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. $\endgroup$ Aug 25 '16 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.