I build my first 3D Printer! The Creality Ender 3 may be a budget option without flashy features, but it doesn’t have to stay this way! I don’t want to babysit my 3D printer constantly, so for the last 3 weeks, I have been working on mobile notifications for 3D printers. It’s time to showcase what I have cooked up! It works with any Octoprint enabled printer.
Awesome mobile notifications for 3D printers
Neither Octoprint’s web interface, or existing solutions (Pushbullet, Telegram) were close to what I would like to have, so I decided to take the matter in my own hands. I’m pleased to say, that the project got even more features than I initially set!
- support for 6 filament types (PLA, ABS, TPU, PETT, PETG, HIPS)
- support for different spool sizes (just enter weight)
- filament cost calculation (per print)
- energy cost calculation (per print)
- total cost of the print
- supports 2 energy tariffs
- Live view and snapshots in Android notifications
- Print ETA time
- Print Calculated time
- Progress in % and progress bar
- Support for multiple printers and phones
- Print data export (name, printer, cost breakdown, time)
- Commands (pause, resume, cancel)
- Auto ON/OFF
- 180 degree time-lapse *
- Custom lights*
- Custom Enclosure *
*these are features I’m still working on
As you can see, this mobile notifications for 3D printers system has a pretty extensive list of features that can be added to ANY Octoprint enabled printer. There are a couple of things that you will need to read and learn first.
To create your own mobile notifications for 3D printers you will need to get yourself familiar with the following reading list (skip links if you are familiar with the topic). You can simply just download ready made files, but before you ask questions – please check the articles.
- Perfect Notifications 2.0
- AutoRemote in NodeRED
- NodeRED for beginners
- Credentials in NodeRED
- Saving variables in NodeRED
- Flashing Tasmota on Sonoff POW R2
- Econ SEE3CAM SU30
I know the list is extensive already, but this is a very difficult tutorial to breakdown already. If you want to have something awesome, you will have to commit some time.
I’m working with file events without indexing the names, so this only works with a single file uploaded to Octoprint. It’s not a big deal as you have to remove the print first to start a new one.
- USB Camera (see3cam, ELP camera, or any cheap USB webcam)
- Sonoff POW R2 (aliexpress, banggood, gearbest, amazonUK, AmazonUS, ITEAD store)
- 3D Printer (obviously) – (banggood)
- Tasker, AutoNotification, AutoRemote
- Raspberry Pi 3 (Recommended – Octoprint)
- Raspberry Pi (any) – NodeRED server
Let’s make mobile notifications for 3D printers
First of all, this is an overview. I’m not able to write a step by step guide to every single action. It meant to guide you through the process giving you enough info to get you started with the existing files. The NodeRED Flow should work off the box.
You will need a Raspberry Pi with a running Octoprint. I will leave the O
I will assume you know how the Perfect Notifications work, you also completed the NodeRED for beginners.
There was a reason I talked about Sonoff POW R2. I knew exactly where it is going to end up. I flashed it with Tasmota to get MQTT, spliced the 3D Printer’s cable and mounted the Sonoff using 3M tape. It will stay there.
I won’t be powering the
NodeRED Flow from hell
Playing with flow variables
A lot of data is saved locally. All the settings or current print values are stored using the method
flow.set(). To preserve these, I enabled saving values. It’s crucial you do the same, just follow instructions in this post.
In the essense, each time I have a piece of data coming from the printer. I will save it as variable. These will get overridden with new prints, and I reference it a lot across my functions.
Mobile notifications for 3D Printers
- filament type and diameter
- filament size and cost
- energy tariff time and cost
- phone API for notifications
I was not sure where I can find the info about flament profile in Octoprint, otherwise I would link the selection of the filament with the data coming from the printer.
Either way, it’s easier to configure something like this, than go through each function node looking for the references. There is also a message that will let you know if something is not ready for calculations.
If you seen the video, you know that I have different notification for warm up, and another one for the actual print update. I needed a way to control when these would be showing up, even if Octoprint events were treating the warm-up period and printing as one.
I came up with a neat solution when I would use print progress change to disable the warm-up messages. I used that method of letting the payloads through a couple of times before and it works well. You will see a bunch of XXXX Enable nodes. These are there to control what shows up when and usually it’s activated from a relevant node.
Events – the heart of the flow
Octoprint can post a lot of data each time something happens at the server level. I used that to obtain most of the events and info about the print. The main events I monitor are:
- FirmwareData (printer connected get details)
- FileAdded (check if settings are set)
- FileSelected (turn on the 3d printer, get print info)
- FileRemoved (turn off the 3d printer)
- PrintStarted (show preheat info and estimated cost)
- Printing (update the notification every 30sec or 1%)
- PrintPaused (display resume variant)
- PrintResumed (display the standard variant)
PrintCancelled(cancel the print and clear variables, remove notifications)
- PrintDone (calculate the power and total cost, display a new message)
These are available using MQTT topic
When the Octoprint is connected (FirmwareData), the information about the printer is saved as
A file can be loaded to the Octoprint. Mobile notifications for 3D Printers will check if all settings has been selected. The flow for file info will get enabled, otherwise an android notification is sent with the prompt to set up much needed details.
Once the file is selected, NodeRED will keep spamming the Octoprint every 2 seconds until it gets the details of the print. Make sure to add your API key from Octoprint. I saved it as a global variable using my credentials system.
The details from these tasks are saved as variables and the NodeRED is ready to get the printing command. This loop is not accessible unless all variables are set in the settings menu.
Print - pre heat phase
To print, the extruder and bed have to reach certain temperatures. The temps are available in the bed:
octoprint/temperature/bed and an extruder:
octoprint/temperature/tool0 topics. This flow is activated in the preheat flow triggered by PrintStarted event. At the same time, the printer is turned on by Sonoff POW R2.
This will continue updating the notification every 30 sec until the printing is in progress.
Since the printer is now powered on, we should start monitoring the power use. This is why you see the Printer data on/off (power data) toggles. It actually took me several hours to figure out the best approach if you want to have more than a single tariff.
Printing in progress
Calculating the use of power using multiple tariffs had proven to be complicated at first. Instead of creating the time ranges, I decided to use an alternative solution. In reality, I probably run my prints crossing 2 different power rates. To to calculate this efficient as possible, I will calculate how much I pay per minute (at current rates) and then sum up the cost in total. This will save me calculating the power use in tariff 1 vs tariff 2 and the tariff N.
The calculation will continue until the end of the printing process. I will add the values from the total array when the final notification is being created.
Print is happening
Extruder is hot, so is the print bed. The print is being created layer by layer. At this point I would like to get a new notification. I will cancel the warm-up message flow and start the print updates.
These will be pushed to the phone every 30 sec or 1% whichever is slower. If you open your ports, you will be able to receive the pictures from Octoprint and use it in your Android notification.
Now, that the print is complete, we can perform the final task. Create a notification that will give us the print summary.
For the most part, I'm following the Perfect Notifications write up. There are small changes regardless of the messages displayed by Tasker. The differences are caused by the fields being populated by variables, but not being in use.
In AutoNotification, if you add the "progress bar" variable and set it to "null" the progress bar will still display as empty. This is why I have several versions of the same notification. I also use the most important variable in Tasker way of passing the information - it's a great way of dealing with Tasker sensitive data.
I will need 2 notification types. One with the print update (progress bar) and the template for other notifications. In addition to this I have added the AutoNotification Cancel, to be able to remove the persistent settings.
Lastly I have added an option to gather information about the last completed print. It's a variable that is pushed to an array when the print has been completed.
I also made a list of custom commands. All respond to the =Ender3= prefix and each action has a differen IF condition. For Pause/Resume/Cancel these are simple HTTP requests sent back to NodeRED.
To see the LiveView I used a custom Chrome window with a defined URL. (you can get the URL in the Octoprint setting - forward port 8080 to have access to the camera on the go). Lastly, to save the print details to an array (feel free to use that data in whatever way you wish) I used Push to Array action.
Over all the Tasker part of this relies on the Perfect Notification tutorial. I have added extra JSON fields when I felt it's needed, but that's pretty much all. It show how good that Tasker project is and how flexible are these notifications.