Thread Rating:
  • 1 Vote(s) - 5 Average
Control Printer via UART
Hello, has anyone tried to steer him through UART yet?

I am currently using the Ethernet Enabled firmware. Works well with chitubox. But you still don't really have control over the printer.  I'm playing a bit with the UART right now and had to find out that it's easy to access via GCodes.

Any of you guys know any sources for usable gcode lists?

I post here a PDF with the G-Codes I found so far.
The photonsters have a Universal Network Controller to be able to control the printer, ie... Start, Stop, Pause, Upload Files, Delete Files...
cool. Thanks.
(10-01-2019, 12:23 AM)fips Wrote: cool. Thanks.

I bought the Mars thinking that a) I wouldn't miss Octoprint that much, and b) if I did, I'd just figure out how to use the onboard NIC to get access. Oops. Mine is a later version with no interface on the board.  
Forgive me if it's obvious, but can you explain a bit about how you are interfacing via UART?

i also didn't want to give up my octoprint surface, so there is a small PI Zero hanging in my Mars.

The UART of the PI hangs directly on the UART of the printer. 
The Pi also hangs as "Flash memory" on the mainboard. At the USB cable I have cut the positive line for safety reasons.  

The Pi is powered by a buck converter from the 12V of the printer. Next I want to control the main power supply of the printer with the PI.

[Image: IMG_1.webp]

The printer communicates with 3.3V and 115200 Baud via the Uart.

[Image: IMG_2.webp]

My TODO`s:

- control Mainpower
- a heating element controlled by the PI
- Maybe I will try to adapt to Octoprint at some point.
Very cool thread so far. I just picked up a Mars Pro and would love to help getting it to work with octoprint.

Here is the visible side of the controller:

Header "J3" seem to be the location to attach RPi Zero UART to.

Is there a more comprehensive list of available g-codes? Setting up Octoprint with a chitu board plugin and Pi Zero USB drive emulation "gadget" would be a great combo. I'm still new to all of this resin stuff, but at a high level, we would just need the ability to move/home the z-axis, start, stop, and pause prints. In order to start prints, I assume we would need a way to list the files on the "USB" drive/partition and instruct the printer to print that file. Out side of that, we could disable the temperature tab and maybe limit the controls tab to simple actions.
I know nothing of how to get this to actually work from the octoprint side, but I'm learning python and may give it an extremely poor attempt. Smile

most of what you have in mind I've already done. The printer can be controlled. The UI is customized. I'm finishing up the actual printing process right now. The transfer from chitubox directly to octoprint is also working.

My code structure is a little messed up. I'm still trying out what works and what doesn't.

For example i wanted to try to transfer the data via uart to the printer.  Unfortunately this does not work. At the moment the only possibility seems to be to supply the printer with data, which emulates the usb flash memory.

The disadvantage is that Octoprint is not supposed to run as root, but you have to execute commands under sudo for this function.
So it will be necessary to login with ssh and execute a script to provide the flash memory function.

If you are interested and maybe want to help, the repo is:

Have you actually checked if your firmware uses the uart?
Wow, great start to your plugin, I would love to help were I can. PM'd with additional info.

Front of Pro Controller:

Back of Pro Controller:

Attached to Pi ZeroW over UART:

Installed buck converter to supply the Pi:

Dupont connector has tight tolerances under the side bar of the printer frame:

Cables routed out of the back of the printer for now.
You connect the V++ on the Pi with the 5v of the printer. I don't think this is a good idea. If the two voltages are different, a current flows there and stresses the power supplies and components. I try to avoid to connect both via USB or directly the two voltages.
I can see the confusion. I one of the pictures, I'm powering the CBD from the 5V ping on the Pi. In practice, the Pi is powered from the buck converter and only TX|RX|GND are connected to the CBD. The CBD id being power as usual via the DC PSU.

Forum Jump:

Users browsing this thread: 1 Guest(s)