Based on Mike Holden's great idea (https://github.com/meholden/duetDisplay), I have made the following changes:
- Built using platformIO
- Built for maple mini (original)
- Additional page/screen for navigating around the printer (for manual bed levelling)
- Sped up some of the logic
- Refactored some code based on the updated arduinoJson library
Why did I choose the maple mini - basically I had a lot of trouble getting softwareserial to run correctly with the nextion screen. The maple mini has at least 3 native serial ports which eliminates the need for software serial completely. It is also a 3.3V logic board which works well with the duet board and the nextion screen.
Note: For both Mike's and my version, we use Dan Nixon's nextion library (https://github.com/DanNixon/NeoNextion)
Read below for description of hookup, wiring and duet config settings
Hey thanks for looking at my project!
This project is a strange one but works for me.
I have a 3D printer that uses the Duet Wifi control board, which is a great board for controlling 3D printers.
I use the web interface to upload gcode files and monitor progress, and don't really need a display at the printer
(duet does make the PanelDue which is overkill for my needs but seems pretty thorough)
But there are a couple of tasks to do at the printer that required me to take out my phone, and also occasionally in a long print the wifi would be lost and I would be unable to pause the print to change filament colors.
So this project came about. It allows you to make a display that costs less than the PanelDue with three screens:
- Printing status
- Pre-heat bed and extruder
- Pause print and load new filament
You of course could implement more functions, these were what I wanted.
So, if: you are rich enough to spring for the Duet Wifi and you're too cheap to buy the PanelDue and you are handy with arduinos, this is your project!
The data from the duet wifi comes from a serial port. There is a serial port for the PanelDue, and it uses gcode to communicate.
All the data for my display comes with a single command. M408 causes the Duet to send a string with many status states.
Try it at the web interface to see what happens!
This is the output of M408 while my printer was running (it is JSON format):
{"status":"P",
"heaters":[75.0,194.8,22.7],
"active":[75.0,195.0,0.0],
"standby":[0.0,0.0,0.0],
"hstat":[2,2,0],
"pos":[-35.248,-15.877,54.700],
"sfactor":100.00,
"efactor":[100.00,100.00],
"babystep":0.000,
"tool":0,
"probe":"0",
"fanPercent":[50.00,100.00,100.00,0.00,0.00,0.00,0.00,0.00,0.00],
"fanRPM":0,"homed":[1,1,1],
"fraction_printed":0.7257,
"msgBox.mode":-1,
"timesLeft":[7527.1,7728.8,7837.4]}
Important info from this:
- Temperatures from "heaters" (my printer has 3 probes: bed, hot end, enclosure)
- Temperature setpoints
- Percent done (0.7257 = 72.5%)
- Various estimates of time left (seconds)
Other gcode I used (see the list):
G28Homes the machineM140adjusts the bed temperatureM104adjusts the hot end temperatureM25Pauses the printM24Un-pauses the printG1 E50 F60Feeds 50mm at 60 mm/min to load filament
So lets hook an arduino up to get the data and command the commands!
The arduino is the middle-machine between the Duet and the screen. It needs a serial port to talk to the Duet as well as a serial port to talk to the Nextion display. I used an Adafruit Feather M0 data logger board for this project as I had one handy. The M0 processor is very powerful (compared to an arduino Uno) and has the ability to create extra serial ports. You can find the arduino code in this archive, I started with an example of how to configure another serial port and hacked away from there. The data from the Duet is JSON formatted and the JSON library parses this nicely. The Nextion display has many examples to copy.
You need to turn off checksums for the PanelDue serial port on the Duet board because the arduino does not calculate checksums. The command M575 P1 S0 added initialization script will make this work. If you ignore this the arduino will not communicate with the Duet!
I used a Nextion display. This is a powerful but complex module, you can create very impressive GUI displays using the Nextion software on your PC, then program the display so it is easy to interface with a microncontroller. Since the display is pre-configured, the microcontroller only has to deal with a small amount of data rather than constructing a display from scratch. If you are new to these devices I recommend Andreas Spiess's video #056.
Using the editor I created the 3 pages I wanted with buttons and displays. Then I wrote arduino code based on the built-in examples to communicate with the display.
If this shows up on AliExpress I will be honored and offended!
Put the arduino code into the Feather M0 board. I used the Feather M0 Adalogger because I had one. I think that most of the M0 boards would work.
Put the nextion code into the Nextion display. I used the small 2.4 inch board.
Duet has a panelDue port with 5V, Gnd, Tx and Rx. The 5V and Gnd go to both the arduino and Nextion.
The Feather M0 is set up to use the regular serial port at Rx0 and Tx0. The new serial port (SERCOM) is at TX=D10 and RX=D11 as in the example.
Connect
- Duet Tx to Feather Rx0
- Duet Rx to Feather Tx0
- Nextion Tx to Feather D11
- Nextion Rx to Feather D10
- Power and Ground from Duet to Feather and Nextion
I used this one.


