Problems with my iot Power Relay

Hi there, so I will say I have a work around for my problem, I would like to better understand why or what to do.

Basically, sometimes, the command to turn off the router and vacuum are not heard.

I use Aspire, and and the iOT Power relay, my controller is a RAMPS 1.4 with an octopi for receiving the code.

so, I export the tool path, and update the .gcode with the following command.

M106 P0



M107 P0

and the command to turn off is almost always ignored.
G1 Z-15.000 F60.0
G1 Z5.000
G1 Z5.000 ;goto safe z
G1 X0.000 Y0.000 ; goto xy home
M107 P0

however, if I modify the file, to turn off the router and vacuum sooner, it always works.
G1 Z-15.000 F60.0
G1 Z5.000
M107 P0
G1 Z5.000 ;goto safe z
G1 X0.000 Y0.000 ; goto xy home

since really, its turned off just as its lifting off the work, its fine.
but why is it not working after the go home.
but works before it does.

I don’t really know but I wonder if you copied the command twice if it would make a difference.

Maybe preceding the M107 with an M400 would help. The M400 causes it to wait for all the moves in the planner to complete before continuing.

1 Like

Octoprint has settings for what gcode to send after cancelling, or finishing jobs. Maybe one of those is turning it back on? But that wouldn’t explain why it wouldn’t work at the end of the gcode file…

I am in bed sick with a headache so I will look tommorow,

Thanks peeps

Thanks Peeps, I am going to try these to see what happens.

though I am very curious of the behavior if I load the script using Octopi, but send it to the SD card ,and start and stop the code from the Ramps board.

it never occurred to me, that behavior would be different, though it makes sense.

my head is pounding, so Thinkink is optional at the moment.

for my first test, I am going to set:

“Before print job starts”
M106 P0

“After print job completes”
M400
M107 P0

for the time being, I think I am going to have every Tool change to be a new script, so I dont get ahead of myself.