Before I start anything, I'd like to thank /u/modtdev on the new matter subreddit for his initial work getting gcode sent to the Mod-T on Linux using python.
Hello everyone!
This will be my first post here, and hopefully a relatively eventful one for some of the Mod-T community. Over the past couple of weeks I have started to work on implementing a fully fledged native Linux application for Mod-T support. I plan on releasing this application freely and completely open source on GitHub. To preface, I have two main intentions with this application; one to bring full usability of the Mod-T to Linux users around the world - with a second goal of providing a Raspberry Pi based touchscreen standalone interface for the Mod-T. The latter is a secondary goal, and I hope to eventually allow people to have different objects saved to the Raspberry Pi, as well as being able to select items from the store and add them to a local queue (instead of the store based queue) and send them directly to the Mod-T.
Now that we all know my intentions, and what I've got planned - where are we at? What progress has been made?
Well, for starters, I've got most of the basic functionality of the New Matter desktop application wrapped into small command line utilities. These utilities will be the core on which the graphical application will build. These command line utilities so far include:
- Checking for firmware updates
- This works the same as the New Matter desktop application, it uses the same URL and authentication method to pull the exact same information
- I'm going to reach out to New Matter for approval on this, after all the web services are provided by them, and they may wish me to use a different authentication method
- Updating the firmware
- This also should work identically to the New Matter desktop application, first the printer is placed into DFU mode then the update is sent using dfu-util
- Failsafe is included in dfu-util, you won't be able to send an invalid firmware update to the printer, which should eliminate "bricks"
- Sending gcode to the printer
- This is yet another feature "stolen" from the New Matter desktop application, a few commands are sent to the printer via USB, and finally the gcode is "encoded" and then sent to the printer.
- To build on the new matter implementation, this should enable a user to send gcode files as prints are completed, instead of having to open the application every time and press the button
- Monitoring printer/print status
- This is done by "reading" the printer's output over USB. It returns a nice JSON formatted string giving me (and you!) tons of useful information:
- Current extruder temperature
- Print progress (percentage and current line, which could be used for rendering the current status of the print)
- Current Firmware version
- Serial number
- Uptime
- Total print duration
Right now not much of this is useful to anyone other than relatively advanced users. Sending gcode and updating the firmware is all usable stuff, as is querying the printer's current status. What remains is gathering that data and creating a useful interface for the end-user. So far the majority of things have been written in python since it enables easy access to the USB interface, but there is also some Bash involved. The end-user application on Linux will likely be either PyGTK or Bash based for my own ease (I am terrible at writing traditional GUI applications, perhaps someone interested can help?). For the Raspberry Pi distribution the interface will prefer the official Raspberry Pi 7" Touchscreen, and be rendered in HTML5. Communication between the HTML5 page and the various scripts for queue management and printer management will be done via Websockets and Websocketd. As far as pulling data to/from the store for the Raspberry Pi based interface, this will be something I'll need New Matter's approval and cooperation with - I can't go poking around their servers and pulling things without their permission, after all.
Anyways, I'm mostly posting this as an interest check. If you'd like to see the code, let me know!
I should be updating this post with a github link over the next week or so, once I feel comfortable with the usability of the scripts.
Thanks for reading
Garrett