send mail when machining finished
- northmeade
- Offline
- New Member
- Posts: 5
- Thank you received: 0
is it possible to automatically send an email when machining has finished, and if so, how would i do it?
cheers, paul
Please Log in or Create an account to join the conversation.
This thread deals with having a notification when at a particular stage of a program using user M codes
www.linuxcnc.org/index.php/english/compo...=21&id=16878&limit=6
Simply substitute sending an email for displaying a graphic (or playing a sound file)
This gives a basic guide to command line email using sendmail
www.simplehelp.net/2008/12/01/how-to-sen...-linux-command-line/
regards
Please Log in or Create an account to join the conversation.
- northmeade
- Offline
- New Member
- Posts: 5
- Thank you received: 0
getting Unknown M code used error though when i try to run it???
Please Log in or Create an account to join the conversation.
The file must be executable, in the correct directory, the call is case sensitive and emc must be restarted if open when the file was transferred.
Regards
Please Log in or Create an account to join the conversation.
- northmeade
- Offline
- New Member
- Posts: 5
- Thank you received: 0
thanks for your help on this i wouldn't know where to start
Please Log in or Create an account to join the conversation.
Just to make sure we are talking about the same thing
All M1xx must be located in the directory set out in your .ini file
eg.
[DISPLAY]
.....
PROGRAM_PREFIX = /home/me/emc2/ngc
If they are not they will not work, but you should get an error to stderr saying the file could not be found.
Next all M1xx files must be executable by all users, ie permissions set at least to 755 and maybe 777 to be ultra sure.
If you try to create file permissions as a user with limited access, that often is the source of the problem.
Log in a root to be sure before using chmod or at least use 'sudo chmod'
Additionally the case sensitivity is slightly strange due I think to emc's conversion of g code to lower case and linux's strict separation of lower and uppercase in file names. I name all my M code files with uppercase M and call them the same way.
For instance if you name a file m112 and call it from the MDI command line with m112 or M112 you often get this error, albeit sometimes m112 will work!
Unknown M code used:
/emc/task/emctask.cc 357: interp_error : Unknown M code used
However if you name it M112 it can be called with m112 or M112 !
regards
Please Log in or Create an account to join the conversation.
- northmeade
- Offline
- New Member
- Posts: 5
- Thank you received: 0
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
- northmeade
- Offline
- New Member
- Posts: 5
- Thank you received: 0
I installed postfix and mailx then it just worked fine straight off. The M112 goes above M30 and once it sends the mail the code just carries on to M30.
As ArcEye says, The M112 must be located in the directory set out in your .ini file
eg.
[DISPLAY]
.....
PROGRAM_PREFIX = /home/me/emc2/ngc
Make sure you add the address to your contacts in your normal email client (gmail or hotmail or whatever) or it will be spam filtered
Thanks again, paul
Please Log in or Create an account to join the conversation.
Glad you got it sorted. As you have found user M codes can be a very flexible and powerful tool.
If you wanted to continue immediately having called some command line app via a user M code, just suffix the command with an ampersand so that it is spawned into a background task.It shows the image fine but does not continue on the the M30 line which in need to record the time taken machining.
eg
#!/bin/bash
eog ~/emc2/ngc/message.png &
exit 0
regards
Please Log in or Create an account to join the conversation.