this is gonna be a tough one, cause i'm ridiculously unexperienced.
But here we go:
So i want to build a filament dryer box, like the ones you can purchase from SUNLU for example.
As a heating element to put inside of the box, i want to use an old heat bed from the AnetA8.
I wanted to hook that up to a PSU over an external mosfet and have it temperature-controlled by some kind of an arduino board. Would it be possible to connect this extra board to the raspberry pi, which my printer is connected to, and have them both show up in the command center to set a temperature?
For that kind of "connect by information" type of things I prefer MQTT.
A helpful site and point of reference is at http://www.steves-internet-guide.com/
Mosquitto is an message broker and mqtt is the protokoll that's used. It is very lightweight, you can install it on the same raspi that OctoPrint runs on and it won't interfere.
Clients suscribe to topics ('channels') and post messages to topics. The broker takes care that each client receives all the messages sent to those topics it subscribed.
If you don't already use mosquitto you can install it with
sudo apt install mosquitto mosquitto-client
The clients are mosquitto_sub and mosquitto_pub for subscription and publishing.
You can listen to all the messages on your broker on the console with
mosquitto_sub -v -h broker.host -u user -P secret -t '#' | xargs -d$'\n' -L1 sh -c 'date "+%d.%m.%Y %T $0"'
(the part after the pipe converts timestamps into more readable date - time expressions)
For the some kind of an arduino board part I suggest you take a look at ESP8266 µControllers, they cost like 3€ a piece and have Wifi inside and you can program them with Arduino IDE. With
PubSubClient and a few lines of code you'll find many examples for you have the microController listen to Mqtt.
With the MQTT plugin enabled octoprint is rather verbose, publishing many system parameters to mqtt.
It is not difficult to make a python program listen to the same MQTT broker, subscribe to the topics you're interested in and use it. The library is named paho there.
So you have it all: OctoPrint supplies it's state, your arduino listens and acts on messages it receives, some python (and eventually bash scripting) adds the glue.
Thank you for all the information! So as i understand the microcontroller reports the data provided by the thermistor to the raspberry pi. Is it also able to switch on and off the heat plate to provide a constant 50 degrees?
If you write your own plugin, anything is possible!
Here is an example of where a separate MCU can be used for safety monitoring:
There's nothing like this built out of the box, if you want to set it up you will have to make some more complicated solutions.