KNOMI icon indicating copy to clipboard operation
KNOMI copied to clipboard

Is there a way for Knomi to show temp by Tool?

Open TheSin- opened this issue 2 years ago • 7 comments

I'd like to add a knot to each of my tools and show the temp of the tool it's attached to, is there a way to accomplish this easily? To T0 will show the temp for T0 and T1 will show the temp for T1 etc etc

TheSin- avatar Jul 02 '23 14:07 TheSin-

Sounds like a cool idea :)

This would require costume code on each Knomi, but can definitely be achieved.

Have a look at line 1007 to 1015 in main.cpp

String nameStr3 = doc["temperature"]["tool0"]["actual"].as<String>();
String nameStr4 = doc["temperature"]["tool0"]["target"].as<String>();
String nameStr5 = doc["state"]["flags"]["printing"].as<String>();
String nameStr6 = doc["state"]["flags"]["paused"].as<String>();

bedtemp_actual = (uint16_t)((doc["temperature"]["bed"]["actual"].as<double>())*100);
bedtemp_target = (uint16_t)((doc["temperature"]["bed"]["target"].as<double>())*100);
tooltemp_actual = (uint16_t)((doc["temperature"]["tool0"]["actual"].as<double>())*100);
tooltemp_target = (uint16_t)((doc["temperature"]["tool0"]["target"].as<double>())*100);`

As you can see, its referencing temps for tool0 -> change that too tool1 and build + flash it to your second KNOMI

M4dMike avatar Aug 10 '23 12:08 M4dMike

excellent! I'll order up an other one to see if I can figure it out, this will be great if I can get it running!

TheSin- avatar Aug 10 '23 13:08 TheSin-

Do you know of an example to make it a configuration option on startup, like the screen used for the wifi setup? That way they can all have one firmware that I can just select the tool id on?

Trying to figure out the codebase for configuration options.

Like how klipper_ip is referenced I guess, via WiFiUser.cpp, looks like it should be doable. This is great, thanks for pointing me in the right direction.

TheSin- avatar Aug 10 '23 16:08 TheSin-

Exactly, adding a 4th input field and storing this information makes it dynamic and would probably help to get this change back into mainline. Awesome!

M4dMike avatar Aug 10 '23 17:08 M4dMike

Into the testing phase now! Thanks again for leading me into the right direction, I'm going to make a PR once I know 100% it's working and saving.

IMG_8783

TheSin- avatar Aug 11 '23 17:08 TheSin-

Awesome 😀 Happy to help, knomi has a lot of unused potential 😉

M4dMike avatar Aug 11 '23 17:08 M4dMike

Awesome work guys!!

mcbeenb avatar Nov 20 '23 00:11 mcbeenb