For anyone looking to use this project with their home automation network and printers, it is still in development. Basic features have been added, but there are still known bugs. I am still working on adding and fixing features. Many features already exist in the firmware but have not been fully implemented due to difficulties with the matter protocol.
Now that school has ended for the semester, I will be focusing the majority of my time on working out the bugs to make this device able to be daily driven one a 3D printer.
Required Prerequisites:Setup the NRF SDK in Visual Studio Code as described here in the Nordic Semiconductor documentation. I used version 2.5.0 for my development, so I would recommend using that version or any version newer than that.
Follow the tutorial linked here on the Nordic Semiconductor website to setup the Matter tools if you do not already have them installed and setup. Personally, while this should work fine in Windows or MacOS, I would recommend using Linux. I ran into problems with Windows 10, so I ended up switching to Ubuntu for development. The matter tools/connectedhomeip GitHub directory can be found here.
You will also need to install Arduino and add the line below to your JSON file in preferences to add the RP2040 boards to your options. More details about the install process can be found here on the Adafruit page. You also need to make sure Arduino has the Adafruit TinyUSB library installed.
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.jsonSDK Versions:
If you want to make your own additions to this project or modify things I recommend using the same or more recent versions of the SDK tools as I did. The minimum SDK requirements are listed below:
- NRF SDK V2.5.0
- ZCL-ZAP 2023.11.10 (feature level:99)
The goal of this project was to make a system to all interacting with and monitoring my printers when not at home. It felt a little overkill and expensive to use one Raspberry Pi per printer, so I decided to design this. Doing the math, the parts for a circuit board based on the NRF7002 and RP2040 shouldn't cost more than $20-$25 per unit compared to the $50-$100 per Raspberry Pi (particularly with the current shortage that has not ended yet). In addition, unlike Octoprint (at least when I last used it), this project allows for smart home integration and control with devices like Home Assistant or Amazon Alexa, as long as they support the Matter protocol.
Requirements to use:- Smart home network that supports the matter protocol
- 3D printer running Marlin firmware or supports Marlin GCode command schemes/logging (must have at least one USB port for the serial port monitoring and control)
- Currently only supports printers with one hotend/nozzle and one hotbed
Since none of the NRF5x series of chips have a USB host controller, an external micro-controller must be used to connect the USB serial device to one of the NRF7002DK's UART ports. For this project I left UART0 as the default option for Matter debugging and UART1 for data streaming from the 3D printer.
For handling the USB host protocol I decided to select the RP2040 due to its ease of use and cheap cost compared to other selections I considered. Other solutions considered were STM32F1 series, WCH559/WCH554, and MAX3421E, but the RP2040 ultimately won out. The RP2040 handles receiving USB serial data from the connected 3D printer and forwards it to the NRF7002DK through a logic level shifter connected to UART1. If a printer is not detected on USB the connected Neopixel will show red and if detected it will show green. When plugging a printer in the Neopixel will briefly show blue to indicate that the RP2040 is determining the correct serial baudrate to communicate to the printer with.
Forwarded serial data from the 3D printer is parsed on the NRF5340 of the NRF7002DK. Data such as temperature and print status is pulled from this serial data which is then fed to virtual Matter sensors. The NRF7002DK can also send serial data back to the RP2040 which can be used to control the 3D printer such as stopping a print or homing the axis.
Current features:- Monitor temperature of hot end and bed
- Matter communication over WiFi
- Button to trigger homing
- Button to cancel active print
- Button to preheat printer to 190 nozzle and 50 bed
- Automatic baud rate detection for USB serial monitoring
- Monitor print status completion percentage
The above features are already confirmed to be working when communicating with the printer, but there have been a few hiccups with getting the matter clusters for them to work properly, hence why they are not listed under current features yet.
Future plans for this project:- File/GCode upload capabilities
- Dedicated PCB with NRF5340, NRF7002, and RP2040 on one board
- Support for remote serial terminal
- More advanced features will most likely be handled by MQTT since that doesn't have the limitations the current Matter protocol standard has
- The zap tool could be difficult to use at times and was very picky about directories. It definitely delayed my project due to not being able to test the matter side of my project until I figured it out. Thanks goes to @NordicSemiMarte on the Hackster discord channel for helping me here.
- Matter is still relatively new and unfortunately does not like to behave well with custom sensors or data types. Temperature data is easy to deal with, but things such as percentage completion and time are a little more difficult.
- The Matter integration for Home Assistant is still in its beta stage, and as such I had problems getting it reliably setup to use with my device.
- The Adafruit team for their TinyUSB library for the RP2040
- @NordicSemiMarte and @jens for being super helpful on the Hackster.io disco
Comments