How To: Receive E-Mail or Text Messages during print for manual color changes
I have been wanting to do this for a while and I finally thought I would sit down and get it done. My use is to have Repetier Host send me a text message or Email and then pause the printer so I can do manual color changes at very specific points of the program without babysitting the printer. I got it working well, so I thought I would share it here for others to enjoy.
I'm running Repetier Host on Windows 7. I'm using the @execute command to run a batch file that will send my text message or email, and of course @pause to pause the printer. The tricky part was figuring out how to send a message or email with the @execute command.... both are the same actually, I'm on Verizon, so I can send a text message to my phone by sending an email to phonenumber@vtext.com where phonenumber is my phone number. Hopefully other carriers have something similar.
In order to send the email, I found that a very simple command in powershell will do exactly this! Powershell is included with windows 7, and can be installed in windows XP.. I have no idea if it still works in windows 8 but I would think it would.
Powershell by default will not allow you to execute your own scripts, so you need to turn that on. Do this by running a command prompt, then type in powershell and hit enter. once in powershell, type in the command set-executionpolicy remotesigned. this will allow you to create your own scripts and run them, but scripts off the internet, email, or downloaded will be blocked unless they include a trusted digital signature. It's best to do this from an administrator account or run the command prompt as administrator
For some reason I can't get it to work by just launching powershell with the @execute command, so I need a batch file to run powershell and run a sctipt. I made a batch file for every color of filament I have, so I have files red.cmd orange.cmd.... ect. the contents of the file is just one line:
powershell.exe "d:\3d\red.ps1"
then I need to just make a powershell script called red.ps1 this also has only one line, although it is pretty long... here is the contents of red.ps1
send-mailmessage -from "address@something.com" -to "8131234567@vtext.com" -subject "!" -body "Change 3D Printer Filament to Red" -smtp mail.productionautomation.net
and thats all there is to it!
just find where you want to get a message in the gcode program and insert
@execute d:\3d\red.cmd
@pause
and it will send the email and pause the printer when it runs these.
I also made batch files and scripts for start, and finish of the program as well.
one other tip for doing this is to position the printer off the parts by adding gcodes in the "run on pause" section.. all I needed in mine was G0 Y0 F7800 to move the Y axis to absolute zero where I normally don't have any issues with oozing while it waits for me to change the filament.
I'm running Repetier Host on Windows 7. I'm using the @execute command to run a batch file that will send my text message or email, and of course @pause to pause the printer. The tricky part was figuring out how to send a message or email with the @execute command.... both are the same actually, I'm on Verizon, so I can send a text message to my phone by sending an email to phonenumber@vtext.com where phonenumber is my phone number. Hopefully other carriers have something similar.
In order to send the email, I found that a very simple command in powershell will do exactly this! Powershell is included with windows 7, and can be installed in windows XP.. I have no idea if it still works in windows 8 but I would think it would.
Powershell by default will not allow you to execute your own scripts, so you need to turn that on. Do this by running a command prompt, then type in powershell and hit enter. once in powershell, type in the command set-executionpolicy remotesigned. this will allow you to create your own scripts and run them, but scripts off the internet, email, or downloaded will be blocked unless they include a trusted digital signature. It's best to do this from an administrator account or run the command prompt as administrator
For some reason I can't get it to work by just launching powershell with the @execute command, so I need a batch file to run powershell and run a sctipt. I made a batch file for every color of filament I have, so I have files red.cmd orange.cmd.... ect. the contents of the file is just one line:
powershell.exe "d:\3d\red.ps1"
then I need to just make a powershell script called red.ps1 this also has only one line, although it is pretty long... here is the contents of red.ps1
send-mailmessage -from "address@something.com" -to "8131234567@vtext.com" -subject "!" -body "Change 3D Printer Filament to Red" -smtp mail.productionautomation.net
and thats all there is to it!
just find where you want to get a message in the gcode program and insert
@execute d:\3d\red.cmd
@pause
and it will send the email and pause the printer when it runs these.
I also made batch files and scripts for start, and finish of the program as well.
one other tip for doing this is to position the printer off the parts by adding gcodes in the "run on pause" section.. all I needed in mine was G0 Y0 F7800 to move the Y axis to absolute zero where I normally don't have any issues with oozing while it waits for me to change the filament.
Comments