What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

Question Why does it take Klipper 6 minutes to update the data from RP2040 mcu

GadgetAngel

Well-known member
Ok I wanted to add two more thermistors to by build but I am out of Thermistor ports on the Octopus Pro.

So I have a TinyFAN PCB board in the build that I use to control my Hardware PWM 12V Fans (https://github.com/Gi7mo/TinyFan)

The TinyFAN PCB has AUX ports which are configurable. I can configure AUX 1 and AUX2 so that GND appears on Pin 1 (AUX1GND, AUX2GND ) and AUX1DATA is GPIO26 pin of RP2040 where AUX2DATA is GPIO27.

But to get a good thermistor reading a voltage must appear across the thermistor so I hooked up the thermistors so that they would have 4.7k Ohms pull-up resistors to 3.3V and 10uF Caps to GND to filter out noise.

I can get temperature reading BUT BUT it takes 6 minutes for the reading to come thru from the RP2040!

What I am saying is this,
If I reboot the Raspberry Pi (reboot the pi; shutdown the pi and reboot the pi) it takes 6 minutes (360 seconds) before Klipper will report the correct temperatures.

From restart of Klipper to 360 seconds, the thermistor reads ZERO.

After 6 minutes I get a temperature reading!
Does anyone have an explanation as to WHY it takes 360 seconds for the RP2040 to report a nonzero temperature?
After 6 minutes I will get temperature readings until I have to reboot again.

Here is how I hooked up the thermistor to the TinyFAN PCB: Hookup Thermistor to TinyFAN PCB.jpg


Here is the schematic for the AUX1 port on the TinyFAN PCB board:

1669330056777.png


Here are snap shots of the console output. I have a macro running that display M105 every 30 seconds:


Console output1.jpg

Console output2.jpg

Console output3.jpg


Here is the klippy.log file:
see attached file klippy.log


After I rebooted and waited 6 more minutes here is the temperature graph and you can see the temperature for the External_Air_temp and Electronics_Case both go from a zero value to a non-zero value about 6 minutes after reboot. BTW the TinyFan PCB on board mcu temperature starts to get reported also.

1669330489846.png
In the above graph you can see that the data is zero (yellow line) and then a step occurs where the temperatures start to come in


BTW, I tried changing the BAUD rate......if BAUD rate is set to 2400 it still takes 6 minutes for the temperature to become a non-zero. If BAUD rate set to 250000 it still takes 6 minutes.

Tried changing the restart_command the same thing. No matter what I change it takes 6 minutes before I can get a non-zero temperature reading.

In fact I believe all the data coming from the TinyFAN PCB's RP2040 mcu takes 6 minutes after a raspberry pi reboot before the data arrives.

I noticed that the RP2040 has a host temperature sensor and I enabled it and it takes 6 minutes after a raspberry pi reboot before the mcu temperature is reported as a non-zero temperature reading,

I mean, for the two thermistors and what I am using them for, I really don't care (I can wait for 6 minutes). I just would like to know why this delay is happening. BTW this problem is repeatable. It take 5min 58 second to 6 minutes.

Any help would be appreciated. The RP2040 mcu is on /dev/ttyACM1 or serial: Klipper_rp2040_E66138935F916E28
 

Attachments

  • 1669330519890.png
    1669330519890.png
    67.5 KB · Views: 1
  • klippy.log
    262.2 KB · Views: 1

GadgetAngel

Well-known member
The RP2040, the output from lsusb:
1669333614974.png

So the RP2040 is Bus 1 device 012, here is the output from lsusb -s 1:012 -v:

see attached file "lsusb_bus_1_device_012.txt"

Is there a way to increase the buffer size for the USB device?
 

Attachments

  • lsusb_bus_1_device_012.txt
    2.9 KB · Views: 0

GadgetAngel

Well-known member
Or I could try disabling the nak_holdoff by doing the following command:
echo 0 > /sys/module/dwc_otg/parameters/nak_holdoff
 

GadgetAngel

Well-known member
I really do not want to mess with nak_holdoff until someone more knowledgeable about USB RP2040 coms tells me this would help. Anyone have an opinion?
 

GadgetAngel

Well-known member
Temperatures still being reported correctly after up for three hours!

I changed my report_temperatures macro so I would execute once per hour:

1669336335776.png
 
Top