File with information of axe Z?

Hi !

I try to find informations about this but I haven't find anything.
Where can I find the program which send the next layer in Octoprint ?

In fact, I know that in Repetier, the file SerialConnector.cs contains variables like "Readyfornextsend".

A equivalent file is available for Octoprint ? Whera can I find it ? It would be very necessary for my project (https://discourse.octoprint.org/t/conditions-and-communications-between-2-printers/1838/4)

Best regards

Geany, it might be useful to see how Shawn is doing this since his Gcode System Commands plugin hooks into the queuing mechanism in OctoPrint right before they are sent to the RAMPS board for printing.

His init.py for the plugin includes hook_gcode_queuing() which is called for each command. Also notice at the bottom in plugin_load() where he is binding that hook.

From what I understand in researching this hooking mechanism, OctoPrint will not continue until after this plugin hook function has returned. Think of this as your gating mechanism as I discussed earlier.


If instead, you're really looking for the Z layer information, then I think I would research Display Layer Progress which does something similar, just with respect to layer information. Again, look for the hook(s) which are bound at the bottom of the file, find the function which matches up to that and see how he's processing in each case to get the layer information.

@OutsourcedGuru thank you for your answer again.
So, we agree, Octoprint sends each line in Gcode one by one ? Or it is the RAMP who controls each line ?

Thank you I study this function !

Yes, OctoPrint sends each GCODE command to the RAMPS board and controls it. If you hook into those same functions in the example, now YOU get to control (gate) the GCODE.

Ok I try it, thank you very much for yours answers !

Hi @OutsourcedGuru
I have an another question:
Do you know in which pin of my atmega2590 I can know when I pass at the next line ? (In order to develop my program with pin on/off)
Where I can find this information given that I don't have the datasheet of the board in Scara Arm 3D Printer? In the library of firmware ?
(My firmware is Marlin)

Best regards

Um... I take it that the MEGA2590 is an Arduino and it's perhaps the RAMPS board for one or both printers. We wouldn't be using its pins in this case.

Back to the two Raspberry Pi computers, we'd be using a GPIO pin on the one you've decided is the master.

Per this page, just select a pin...

  • that's not power
  • not a ground

The pins are in groups, depending upon what they were intended to be used for. Click on their tab called WiringPi which should highlight the pins that are good candidates for you. I'd use the first one highlighted but remember, you don't have to physically connect anything to it.

17%20AM

In fact, I don't understand how I go back information about the passage of next line. It is with the plugin which working on function "hook"?
I'm sorry I'm very confuse

Yes, the function which includes the hook is what gates things. You'd want to build a plugin that is similar to the examples provided.

Great, thank you for your answer again ! :slight_smile:

@OutsourcedGuru I'm sorry, it's mes again !
For the plugin OctoPrint-GCodeSystemCommands I can't execute program on Python ? Is it only ssh command?

I think you misunderstand.

The two plugins I suggested are so that you can see how you could write your own plugin. You'll need to write a plugin for all this to work.

The reason I chose those two is because they do almost what you want to do; they hook into the part of OctoPrint where lines of GCODE are going to the printer. And that's what you need to do, too.

If it were me, I would do something like this:

  1. Remote into the Raspberry Pi
  2. mkdir ~/devel
  3. cd ~/devel
  4. git clone --depth 1 https://github.com/kantlivelong/OctoPrint-GCodeSystemCommands.git Octo-Sync
  5. cd Octo-Sync
  6. rmdir -R .git

And then, edit everything throughout so that it stops being the original plugin and starts being yours. All references to his names need to be changed. His code which looks for "OCTO" needs to be replaced with your own functionality.

Much later, you'll want to git init again in your folder to reintroduce another .git hidden folder so that you can manage changes better and to even have your own repository at github.

Hi

Thank you !
If I understand, I must work on init.py file of plugin OctoPrint-GCodeSystemCommands (you say two plugins what is the second ?) and to modify it to ? However, I must not modify setup.py file ?

In first step, I will try to do communication between 2 raspberry with GPIO port :slight_smile:

Thank you !

I suggested the Display Layer Progress plugin as another candidate but go with Gcode System Commands as an example if you'd like.

Much of the work happens in __init__.py since that's the startup code. setup.py is what happens during the time when it's getting installed. So it would be a good idea to rename a few things so that it's your new plugin instead of being called "Gcode System Commands".

I see this plugin too thank you !
I think I will work on this two plugin to obtain my plugin

Thank you for yours answers!