PP call home.

More
20 Nov 2019 15:38 #150768 by Vmax549
PP call home. was created by Vmax549
If anyone is interested here is a script to be able to send messages to an email account from PathPilot.

How you use it and how you trigger it is up to you.

(;-) TP


#!/bin/bash
# send message to email
import smtplib
server = smtplib.SMTP( "smtp.YourSmtpServer.com", 587 ) ## there is a known list of servers for email providers
server.starttls()
server.login( 'This email address is being protected from spambots. You need JavaScript enabled to view it.', 'YOUR_PASSWORD' )
from_mail = 'This email address is being protected from spambots. You need JavaScript enabled to view it.'
to = 'This email address is being protected from spambots. You need JavaScript enabled to view it.'
body = 'Router #1 ERROR , Broken tool bit' ### actual message string
message = ("From: %s\r\n" % from_mail + "To: %s\r\n" % to + "Subject: %s\r\n" % '' + "\r\n" + body)
server.sendmail(from_mail, to, message)
server.quit()
The following user(s) said Thank You: Leon82

Please Log in or Create an account to join the conversation.

More
24 Nov 2019 23:48 #151162 by andypugh
Replied by andypugh on topic PP call home.
I think that this is not limited to Pathpilot? It could be run as a user M-code by any LinuxCNC version.

Please Log in or Create an account to join the conversation.

More
25 Nov 2019 01:23 #151182 by Vmax549
Replied by Vmax549 on topic PP call home.
Yes it is a simple Python script. It can be used in anything Python based.

(;-) TP
The following user(s) said Thank You: Clive S

Please Log in or Create an account to join the conversation.

Moderators: cncbasher
Time to create page: 0.060 seconds
Powered by Kunena Forum