Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on February 16, 2019, 12:14:48 PM
-
I have been using the EMAIL instruction successfully for quite some time. I am now trying to send a message via 5551234567@vtext.com. However, it's not working for me. In the System Info > System Status Tab I see MSG toggling:
Connecting to SMTP Server
MAIL FROM: <email@gmail.com>
RCPT TO: <5551234567@vtext.com>
HELO [192.168.IP.address]
SMTP Connected!
The ERR reads: Unexpected response from SMTP server in EMAIL @000028A8 (EMAIL at AlarmEmailPrgrm@1557)
I can send the same message to an email address, and I can forward that successfully to the vtext.com address. The total message is 128 characters
What am I doing wrong here?
-
Probably nothing. I'm guessing the email provider has changed some stuff that is causing the controller some issues. It may require a minor firmware tweak.
-
I see. In V2.4?
On a similar note, how do I get my emails sent via the BRX to not be received as spam with the attached warning? Probably something about SPF or DKIM but how do I go about setting that up in this application?
-
I sent a vtext via GMail and had no problem. I used TLS and AUTH LOGIC.
-
Okay, didn't have any of those settings enabled, I was still running the old setup from 2.1.
Now I have all those features (TLS, AUTH LOGIN) enabled in the device setup, and hitting "Test settings and verify server credentials" results in "Your settings are good", but upon using the EMAIL instruction (even to a regular email address) results in "Couldn't open TCP connection with specified device in EMAIL at ....."
Any more ideas?
-
Okay, didn't have any of those settings enabled, I was still running the old setup from 2.1.
Now I have all those features (TLS, AUTH LOGIN) enabled in the device setup, and hitting "Test settings and verify server credentials" results in "Your settings are good", but upon using the EMAIL instruction (even to a regular email address) results in "Couldn't open TCP connection with specified device in EMAIL at ....."
Any more ideas?
Make sure DNS and gateway are set correctly. Other than that, not sure. Lots of networking possibilities.
-
Hmmm, not much luck. The PLC can do a DNS lookup via ladder logic. All my local network TCP connections still work fine. I also create an app password for the gmail account, and successfully implemented it on all my other devices using this account.
I went back to the old settings I had, just using an IP address, port 25, no SSL and no account authentication and it "works" like before, to another gmail address.
I have it setup basically the same as in https://www.youtube.com/watch?v=olaJdWGCX6o (https://www.youtube.com/watch?v=olaJdWGCX6o). Does anyone else care to post a screenshot of their known working SMTP Client Settings?
-
i don't think @gmail.com should be part of the user name.
-
Additionally, set $EnableMsgDump (ST36) and run DMLogger. This will allow you to capture more info from the interaction with the email server.
-
This works for me...
-
Thanks. The @gmail.com seems to be the only real difference between our settings. Both Gmail tutorials and the YouTube video show it in there, but that's easy enough to test. Currently just having a hard time to get enough system downtime to do the program updates. It's unfortunate that changing a username/password for a device requires a plant shutdown. I understand, but annoying non the less.
Thanks for the heads up on $EnableMessageDump. Just what I was looking for. Already found a (minor) error with and STRSUB instruction I had not been able to troubleshoot. If only all my issues were that easy to fix!
-
You don't have to shut it down. DEVWRITE gives you access to device properties at runtime.
-
Cool. Does it give access to Enable/Disable SSL/TLS? Right now I have that turned off again when I reverted all my settings to a known working setup.
-
Cool. Does it give access to Enable/Disable SSL/TLS? Right now I have that turned off again when I reverted all my settings to a known working setup.
No. That one is harder due to the certificates needing to be read and stored in the config. I guess it would be possible to downgrade from a full SSL config, but we ddidn't make it possible to change that because there were ways it could cause issues. User names and passwords and such can be though.
-
With user@gmail.com or user as username, I get the following log file dump.
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:17.858 ,"Couldn't open TCP connection with specified device in EMAIL @0000023E"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:17.856 ,"SMTP disconnected!"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:17.855 ,"Server connection lost. Shutting down..."
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.871 ,"Starting TLS handshake..."
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.870 ,"220 2.0.0 Ready to start TLS"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.802 ,"STARTTLS.."
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.801 ,"250 SMTPUTF8"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.801 ,"250-CHUNKING"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.800 ,"250-PIPELINING"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.799 ,"250-ENHANCEDSTATUSCODES"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.726 ,"250-STARTTLS"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.725 ,"250-8BITMIME"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.724 ,"250-SIZE 35882577"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.723 ,"250-smtp.gmail.com at your service, [12.345.678.901]"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.722 ,"EHLO [192.168.0.91].."
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.722 ,"220 smtp.gmail.com ESMTP e9sm98844pfb.52 - gsmtp"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.636 ,"SMTP connected!"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.565 ,"Connecting to SMTP server..."
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.564 ,"DNS lookup complete"
192.168.0.91 Port 29298(0x7272),02/21/19 16:41:07.563 ,"Beginning DNS lookup..."
-
My guess is that the server is only waiting 10 seconds for the handshake to be acknowledged, and then dumping the connection. In this case, the combination of normal PLC work + HandshakesAreHardWork is taking longer than that.
You might try turning off the certificate validation. That might reduce the time a bit.
-
No luck there. Same 10ish second SMTP disconnect.
-
I'll add my scantime is showing to be 4.9 ms Avg and 8.4 ms Max. The max doesn't climb higher while EMAIL instruction is running.
-
Current firmware has the priority to that thread increased relative to the last released version, but it isn't configurable. I'll test tomorrow with a higher scan time to see how we do. Might end up making that configurable.
-
I get the same result as you when I force it over 10 seconds for the handshake. With the way the firmware is currently set, I had to get the sustained scan time over 12ms for it to take that long. So you should be in good shape when we roll that out next month. In the meantime...sorry.
-
I finally had time to play with it, on version 2.5.2 everything works as intended now. I can log in as an app via Gmail, and send to non Gmail addresses.