Notifications
Clear all

Connecting to email/messaging  

  RSS
Just1Ivan
(@just1ivan)
Active Member
Connecting to email/messaging

Is there a way to connect either PrusaConnect or PrusaLink to an email system via SMTP/other protocol for notifications on alerts, status, etc.?  I didn't see anything in the threads about this, but it would be a great addition.

Napsal : 28/03/2023 1:08 am
Zoltan
(@zoltan)
Member Moderator
RE: Connecting to email/messaging

This feature is not implemented - take in account it is as small CPU with limited amount of operational memory and having the main purpose  - "PRINT"

even an old man can learn new things 🙂
Standard I3 mk3s, MMU2S, Prusa Enclosure, Fusion 360, PrusaSlicer, Windows 10
PRUSA MINI+ Prusalink + Prusa Connect

Napsal : 28/03/2023 8:00 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE: Connecting to email/messaging
Posted by: @just1ivan

Is there a way to connect either PrusaConnect or PrusaLink to an email system via SMTP/other protocol for notifications on alerts, status, etc.?  I didn't see anything in the threads about this, but it would be a great addition.

In combination with a Raspberry Pi, this could easily be implemented. Use a bash or python script to query the printer status and send a corresponding email. I have done this on my MKx, Klipper and RepRap (Duet) projects.

wbr,

Karl

Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen.

Napsal : 28/03/2023 8:57 am
Tojik
(@tojik)
Member Moderator
RE:

Hi Connect supports Discord, Slack and Telegram. "Guides" for Discord and Telegram are on the forum. Official ones do not exist yet, but it's a webhook notification thing, so you can find guides freely floating on the internet too. You just give whatever web address the setup gives you at the end to PrusaConnect and that's it.

E-mails are planned, but are not the priority right now.
I'm almost sure a webhook to an email service has to exist somewhere too
Hope this helps

Napsal : 28/03/2023 11:36 am
Just1Ivan se líbí
Just1Ivan
(@just1ivan)
Active Member
Topic starter answered:
RE: Connecting to email/messaging

I figured I could -ctail a log file looking for the different statuses.  All good - Thank you for the information.  #encouraging.

Napsal : 28/03/2023 10:51 pm
Tojik
(@tojik)
Member Moderator
RE: Connecting to email/messaging

You can use the web API for monitoring PrusaLink - docs: https://github.com/prusa3d/Prusa-Link-Web/tree/master/spec
Don't use legacy if you can. Let me know if you get stuck 😉

Napsal : 29/03/2023 9:17 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE:

If you are working with Octoprint, you can use a small bashscript to get some information from the printer:

 

#!/bin/bash

home="/home/pi"

API=`sed -n "/api:/,/key:/p" $home/.octoprint/config.yaml | tail -n 4 | grep "key: " | cut -d ':' -f 2 | cut -c2-`

printstat=$(curl --silent -H "X-Api-Key: $API" -X GET http://your_ip/api/printer)

echo $printstat

 

will send back f.e.:

# {"sd":{"ready":true},"state":{"error":"","flags":{"cancelling":false,"closedOrError":false,

# "error":false,"finishing":false,"operational":true,"paused":false,"pausing":false,"printing":false,

# "ready":true,"resuming":false,"sdReady":true},"text":"Operational"},"temperature":{"bed":{"actual":25.0,

# "offset":0,"target":0.0},"tool0":{"actual":26.2,"offset":0,"target":0.0},"tool1":{"actual":26.2,

# "offset":0,"target":0.0},"tool2":{"actual":26.2,"offset":0,"target":0.0},"tool3":{"actual":26.2,

# "offset":0,"target":0.0},"tool4":{"actual":26.2,"offset":0,"target":0.0}}}

 

after the return has been analyzed, you can send an email via mail app.

wbr,

Karl

Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen.

Napsal : 29/03/2023 2:29 pm
SeattleDavid
(@seattledavid)
Estimable Member
RE: Connecting to email/messaging

You can use the web API for monitoring PrusaLink - docs: https://github.com/prusa3d/Prusa-Link-Web/tree/master/spec

Words. Words and sentences are a really nice communications technique.

It would be nice if this "spec" included the use of both words and sentences in a human language, rather than only code. It would vastly enhance usability.

I do realize that writing a short document in a language using both words and sentences would take several hours, but it would save so many hours of other people's time that it would be a gracious thing to do.

 

 

Napsal : 03/04/2023 9:30 pm
Tojik
(@tojik)
Member Moderator
RE: Connecting to email/messaging

Hi, sorry, not everything goes through user review and the still changing API most likely never will. I would really like to use words and sentences to help to make the spec better but I have a hard time figuring out what exact parts of the API would most benefit the user so I could spend less time writing about stuff that's obvious.

I really want to smack back with "please graciously use words and sentences to desceibe what you got hung up on" but I get that that would be unproffesional. So. Please give us more specific feedback on what would you like we touch up on. Of course you can submit a pull request with the stuff you found missing yourself to benefit the next person.

I feel like the authorization method probably did not get enough attention but that's just a guess.

Sorry for the inconvenience

Napsal : 03/04/2023 10:08 pm
SeattleDavid
(@seattledavid)
Estimable Member
RE:

I really want to smack back with "please graciously use words and sentences to desceibe what you got hung up on" but I get that that would be unproffesional.

The difference between being unprofessional and being polite is all in how the request is made. When smacking back and then stating that you didn't just smack back and then declaring that what you just did would be unprofessional is self-evident for what it is. On the other hand, a polite request for opinions and thoughts about what documentation would be most useful would fall into the "polite" category.

May I suggest that what would be useful would be a document of 1 to 4 pages in length that has these components:

  1. An introductory paragraph that explains the types of things that the API can do, such as be notified when a print completes, or to submit a job. Whatever it can do. This prepares the reader for what to expect and the general type of functionality.
  2. A simple, almost trivial example of how to do it. This not only frames the structure of the API in the simplest way, and serves as a prototype, but it helps the reader understand if they have the technical ability to use the API.
  3. A listing of each function, with the function as a header and two sentences describing what it does, and then the syntax. Finally, any error or result returns. (Errors and results last as those aren't interesting until after the function has been executed.
  4. A more complex example, so that options and complex API functions can be seen how they go together. This shows how to combine options, etc. It also might throw in more detail sent and returned data structures.

Lastly, let me suggest that I am especially fond of API interfaces that use URLs. They are easily to construct and test in a browser. They are simpler for more users. And, they are easily understood. As APIS delve into more complex or multi-step operations they begin to exclude less technical people or persons who just want to get things working quickly without having to become subject matter experts on something complex.

-----

The above is for documentation on an API.

I am also a believer in "Cookbooks" that have frequently needed tasks laid out step-by-step. Take the three or five things that people commonly need to do and guide them through. This allows the most people to use an API without really having to understand it.

-----

Both of these types of documents demonstrate empathy and a desire to help other people. They are inherently the opposite of being intellectually arrogant.

Napsal : 03/04/2023 10:49 pm
Tojik se líbí
SeattleDavid
(@seattledavid)
Estimable Member
RE: Connecting to email/messaging

The one thing that I would like most is the ability to access the PrusaLink using a single URL that includes whatever authentication is required. I presume that this is possible, but I couldn't find it. It's probably easy information to find once you know where it is.

This would allow me to establish a bookmark with the authentication in it, so that I can access PrusaLink on one of my Mini's without having to enter the rather inconvenient API key.

 

Napsal : 03/04/2023 10:55 pm
Tojik
(@tojik)
Member Moderator
RE: Connecting to email/messaging

Thanks for the reply, I cannot promise anything. There's a lot to work on. I'll bring it up and we'll see if we get to do anything about it. Thanks for not getting offended. I found the words and sentences thing passive agressive and funny at the same time.

We are after all a company that wants to make money, so the docs if they don't need to be used by a business partner or ourselves get a really low priority, so please don't get mad if nothing happens.

I really struggle to approach these kinds of assignments, your answer would really help me get started on this one.

Napsal : 03/04/2023 11:03 pm
Tojik
(@tojik)
Member Moderator
RE: Connecting to email/messaging

 

This would allow me to establish a bookmark with the authentication in it, so that I can access PrusaLink on one of my Mini's without having to enter the rather inconvenient API key.

 

Oh, the mini probably has an older version of the local interface and I do not participate on its implementation. Nobody likes writing that character mess. I hope it gets changed, but don't know the status of that. I imagine it's gonna be a while. The focus is now primarily on supporting Connect

Napsal : 03/04/2023 11:08 pm
SeattleDavid
(@seattledavid)
Estimable Member
RE:

It’s the latest released version.

I imagine it's gonna be a while.

Of course it would be a while. I don’t think anybody has ever accused Prusa of:

  1. Being prompt.
  2. Delivering anything new that is reasonably feature complete

I imagine that Prusa is a great place to work, with a level of customer obliviousness and apparent indifference rarely enjoyed in other industries. (Admittedly a bit of a snarky remark but nevertheless undeniably true.)

 

 

Napsal : 03/04/2023 11:19 pm
SeattleDavid
(@seattledavid)
Estimable Member
RE:

I found the words and sentences thing passive agressive and funny at the same time.

Definitely not Passive Aggressive (See: Definition of Passive Aggressive).

I do have a dry sense of humor, especially enjoy irony of the type you exhibited, and I tend to be caustic in direct proportion to the arrogance of the other party.

-----

I generally like Prusa products because I like quality and reliability. I do think that Prusa tends to quit when they are at the 80% mark (PrusaLink for the Mini and the extraordinarily late delivery of WiFi for the Mini are great examples.) I also think that Prusa undermines its own credibility by doling out disappointment to thousands of people such as by pre-pre-pre-announcement of products like the XL. (The short-term thrill of announcing a product-idea is more than offset by the complete lack of credibility and believability that results from announcements like was done on the XL.)

I am hopeful that the Prusa Mk4 is a new direction of credibility for Prusa. I am also hopeful that in two years we won't have a Model Mk4S+Plus+U2 version.

Napsal : 04/04/2023 3:01 am
Zbigniew Trzepizur
(@zbigniew-trzepizur)
Trusted Member
RE: Connecting to email/messaging
Posted by: @seattledavid

I found the words and sentences thing passive agressive and funny at the same time.

Definitely not Passive Aggressive (See: Definition of Passive Aggressive).

I do have a dry sense of humor, especially enjoy irony of the type you exhibited, and I tend to be caustic in direct proportion to the arrogance of the other party.

Unlike @Tojik, I'm just a rando on the Internet and I don't work for Prusa so I don't have to maintain any vail of politeness or respect towards you. So let me explain how you actually get across versus what you apparently like to think about yourself. What you show here is neither "snarky" or a "dry sense of humor", it's just you being a total, raging a-hole. You're this guy in a restaurant making a huge scene over some irrelevant s#it, denigrating the workers, making sure everyone is able to hear you, while you keep repeating loudly how actually polite you are. You should begin going out more and try this kind of attitude with real people, face to face, see where it gets you.

Napsal : 05/04/2023 9:49 pm
Tojik se líbí
Diem
 Diem
(@diem)
Illustrious Member

I would like most is the ability to access the PrusaLink using a single URL that includes whatever authentication is required.

Not so trivial securitywise.

connect either PrusaConnect or PrusaLink to an email system via SMTP/other protocol for notifications on alerts, status, etc.?

But this is straightforward to implement for yourself.  The printer doesn't have the spare capacity for messaging beyond the api so write a script as @karl-herbert suggests (bash/perl/python) and either background it or run as a chron job on your own mailserver, a Raspberry Pi would be enough.

It's the sort of service that's much easier to maintain locally than as an open service that would quickly become a target for malicious attacks.

Cheerio,

Napsal : 06/04/2023 4:26 am
(((GRIFFCOMM
(@griffcomm)
Estimable Member
RE: Connecting to email/messaging

Email at the most basic is text level stuff, can be done with SSH sending commands with the message to an SMTP server, implementing an SMTP / Email system isnt hard.  The issue now-a-days are the security implications and the hoops required to jump through to get it working with current high usage company's like office.com and gmail.com.  Implementing a basic SMTP server itself isnt hard, however its unlikely the email would get to any of the above systems directly as they would bounce it based on the sending IP address.

 

Having the system be a client to the above systems via POP although possible has its own problems based on the fact they dont make money on this so generally results in a very sporadic level of reliability, although Google (Gmail) still use it, not sure about outlook.com.

Many Thanks

Napsal : 07/04/2023 4:47 pm
Share: