Close



Results 1 to 5 of 5
  1. #1

    How to talk to Marlin?

    In my quest to put together a 3D printer using a Raspberry Pi, I realized that with all the bells and whistles I was thinking of loading the Raspberry Pi up with (receiving files via network, possibly a camera, a color display), since it's running Linux, there may be a very real chance of jitter when printing that could potentially screw up prints.

    Also, I'm not super-proficient in C++, but okay with Python. I imagine I'd need C++ to make a suitably fast enough Rpi-only system. With possible jitter using a Pi alone and programming in Python, it makes me think it may be more bullet-proof in the long run if I focus on making a printer that uses a Pi for the transferring of files, networking, camera and display functions, but also have a dedicated real-time Arduino-based board controlling the steppers.

    My question is then: is there any reasonably easy-to-read documentation that explains the data format an interpreter like Marlin uses when receiving G-code? And, is there an already existing Linux-based man-in-the-middle G-Code forwarder like I'm proposing that I can run on the Pi to send the G-code to the Atmel driver board?

    Thanks for the help!!!

  2. #2
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    Whatever you write it in you will have problems. The Raspi is not fast enough to run any real time operations because the kernel is not a real time kernel so even with the most basic installation of Linux it will not even allow a stepper motor to tick once per second accurately.

    Marlin is fairly well documented all the way through. The top of marlinmain has a list of the Gcodes it supports and further down there are the routines that operate on them. The hardest thing to follow in the data path is that you have no way to know what file a particular function is in once it is called from marlinmain but there are Linux utilities that will help with that.

    So to make this work your starting point is a rewrite of the Raspi Linux kernel. People have tried already to do this and as far as I know they have all given up. Good luck.

  3. #3
    Okay, I have re-written the entire Linux kernel. Wow, it took me the entire weekend. I'm calling it Jimix, and it's available for $5,000 (pm me).

    Once per second? Seriously? I expected someone to cite millisecond delays, but once per second? Wow.

    My question about Marlin was more around the format it uses to receive data, both in software and hardware. For the hardware, is it simply monitoring a serial port waiting for commands? For the software, can anyone point me to a reference (other than the source code itself)? There has to be a simple handshake followed by sending data/acknowledging it from the sender, etc.

    Thanks.
    -J

  4. #4
    Engineer Marm's Avatar
    Join Date
    Sep 2014
    Posts
    629
    Add Marm on Thingiverse
    What was the License for the original Linux you rewrote? If it was open-source, wouldn't selling the rewritten code for profit be illegal?

    And he didn't say one second delays. He said it would not be accurate to 1hz ticks.

  5. #5
    Sorry, that was meant as a joke. I wouldn't be able to differentiate my head from a hole in the ground if it came to re-writing the Linux kernel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •