(Serial) communication to Arduino and conditional behavior
-
Hello everyone,
I am planing to build an own 3D printer and want to include some unusual/not implemented functionallity.
I experienced some additional and handy usability (coming from marlin) on the Duet3D familiy and planing to go the "Duet route" with my new build
As my core skill is not programming and the RepRap firmware is also not as well known by me, I would like to know weather and how my goal could be reached for me.
The hardware setup will include
- Duet 2 Wifi
- PanelDue Display
- Duex 5 Expansion Board (for additional motors, thermistors and heaters)
- Raspberry Pi 4 (for webcam, remote access, timelapses...)
- Arduino for additional functionality
What I would like to achieve is a user friendly perfection for myself.
The best - for me - would be to use an Arduino for this. But is there even a way/port left to communicate with it (on my setup)?
Stage 1:
Things I would like to do is for example is to control other things.
If the printer has finished a print job, change the LED light from constant white to a green beat/pulse. As far as I know there is nothing implemented to do things like this.It would be great if the Duet could send something like "finishedPrint" via Serial or USB (but this might be "blocked" by the Raspberry already) to the Arduino.
Then I can outsource functions like this to the ArduinoStage 2:
The best would be if this communication is also bidirectional.So also the Arduino could send something like "Tool1Loaded" back to the Duet.
This would be very handy, as I am planing a tool changing setup with RFID (or a simple switch - planing is not yet completed) for different toolheads.
Because if the printer stops (emergency stop) or there is a power outage, the Duet should always know if and what tool is loaded - to not crash into one of the "parking" tools by trying to load tool2 when tool1 is still loaded.
But I dont even know if there is a solution to recive commands like this on the duet, how to handle these commands and do what I would like to.
I know things can be done differently and there might be already included functionality for the examples I gave, but I hope you get the idea.
Its just for me to know, if there is a absolute flexible solution for this, by using a dedicated device, that takes care of other functions.So is it possible to communicate to a different device in certain situations and also to handle external commands in the way I showed?
I would be really greateful if someone can tell me more about that and give me links where I can learn/read/see how these things can be done.
I appreciate every help and info because currently I am not sure what can be realized and what would be "the best way".
Thanks
-
USB is essentially a serial port on the Duet. PanelDue port is a 3.3V UART as well.
So sounds like you'll have to be sharing either of those with your custome logic, or use HTTP and interface to Duet Web Control. (or even replace the wifi module with a SPI connection to the Duet when RRF 3.2 is released).
Forum has quite a few examples around the PanelDue port, and to share the USB serial port with the timelapse function you could use something like socat to multiplex the one serial port for multiple programs.