Send emails / txts notifications from gcode.

More
3 years 7 months ago #267532 by nick.smith
Here is my article on how to send and receive email / txt notifications via M codes inline with your gcode.

tormachtips.com/m101.htm

I am open to any improvements from the experts on this board.

 
The following user(s) said Thank You: tommylight

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

More
3 years 7 months ago #267547 by tommylight
Very nice, thank you.
I have seen something similar quite a while back for LinuxCNC, but i could never find a use for it, besides sending camera pictures in intervals as progress notifications. This i use on 3D printers as i can stop or pause them remotely if something goes wrong. Uses Telegram bot, though.
Doing something similar using Signal (open source) would be nice.

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

More
3 years 7 months ago #267585 by Vmax549
There is something similar in PathPilot but it was turned off by Tormach. It used a message code to trigger the SMS message.

(;-) TP

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

More
3 years 7 months ago #267627 by snowgoer540
Write up looks nice!

I swore I saw something in their files before, so I did some digging.  They have two files in the V2.x.x/python folder that may be of interest to you:
sms.py
sms_test.py

Looks like they used/experimented with twilio in the past to send messages.  It might be an easy integration to skip gmail entirely, and in the words of Andy Dusfresne (Shawshenk Redemption) "if you've come this far, maybe you're wiling to come a little further". :)

One tip - geany exists on PathPilot machines.  If you use it over gedit, you can switch line ending types without having to install anything extra.  Document -> Set Line Endings -> you can choose LF (Unix).  It's more geared toward coding so can make viewing a smidge easier.

I look forward to your future write ups.



 

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

More
3 years 7 months ago #267883 by nick.smith
Dan (I think Dan) Rogge, one of the techs turned CEO, has a blurb on their own forum about using Twilio I think it is to send SMS, but he doesn't go into any detail on it.

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

More
1 year 7 months ago #324706 by chrisfischer
I am trying to get your method to work and am having trouble.

Launching linuxcnc from terminal i see errors when the m code is called:

/home/kira/linuxcnc/nc_files/m_codes//M101: 4: import: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 5: import: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 6: from: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 7: from: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 9: arg1: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 10: arg2: not found
/home/kira/linuxcnc/nc_files/m_codes//M101: 14: Syntax error: "elif" unexpected (expecting "then")

It appears python is not being called despite the magic incantation at the top.
I tried the stock #!/usr/bin/env python
as well as #!/usr/bin/python

Mentioned here as well.
forum.linuxcnc.org/10-advanced-configura...-python-script#57764

Running the M101 file as a python script from terminal does indeed send an email. Pretty sweet.

Any idea what could be prohibiting python from being run?

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

Time to create page: 0.074 seconds
Powered by Kunena Forum