Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: maciek on August 24, 2017, 09:54:58 PM

Title: brx plc (email)
Post by: maciek on August 24, 2017, 09:54:58 PM
still failing at sending e mail
Couldn't open TCP connection with specified device in EMAIL @00000188 (EMAIL at $Main@289)
Title: Re: brx plc (email)
Post by: Greg on August 28, 2017, 03:14:04 PM
Before email (SMTP protocol) can be sent, a TCP connection must be established with the email server. This error simply means that the IP address of your BRX cannot communicate with the IP address of the email server. Compare the IP settings (IP address, subnet mask, gateway address) with the IP address of your email server. Can they logically talk?
Title: Re: brx plc (email)
Post by: maciek on August 29, 2017, 08:37:44 PM
this is all i did set up my e mail smtp client
how do i establish that tcp connection
Title: Re: brx plc (email)
Post by: maciek on August 29, 2017, 09:09:01 PM
IP address, subnet mask, gateway address of my plc i set up so that i can connect to it with my pc and since i program the plc through the ethernet of my computer then i think that it is set up correctly
i sent you the picture of the email set up i dont know what else there is to do
and i need to add that i am a noob with brx and do more
Title: Re: brx plc (email)
Post by: Greg on August 30, 2017, 09:36:26 AM
When you attempt to do the EMAIL instruction (or whenever a PC (or phone for that matter) attempts to send/receive email, the first thing it does is establish a TCP connection. This is nothing that you do manually; it is something that is done automatically. But it is fundamentally the FIRST thing that needs to happen. If a TCP connection cannot be established, then the process does not even get to the email part. Thus, when I mentioned that a TCP connection is not being established, this is very fundamental and is merely indicative that the very basic connection is not happening. Bottom line is that it simply means, for whatever reason, your PLC cannot "see" the email server to even establish the fundamental connection. All this is basic TCP stuff and not unique to BRX or Do-more.

So, basically what this means for your particular scenario is your PLC cannot contact 173.194.198.27 (aspmx.l.google.com). What are the IP settings (IP address, subnet mask, gateway address) of your BRX? You can see these by going to the Dashboard and moving your mouse over the Ethernet port. You'll see something like the pic I have attached. Or you can use the menu and select PLC --> System Information, and click on the <Set Node and IP Configuration> button.
Title: Re: brx plc (email)
Post by: PLCGuy on August 30, 2017, 11:16:59 AM
Reading the text it sounds like maciek set the plc to the address to talk to his pc. His pc is not necessarily the mail server. At work our mail server is not the same ip as my desk top.
Title: Re: brx plc (email)
Post by: maciek on August 30, 2017, 06:09:13 PM
does the ether/net ip server have to be enabled
and my pc connects to the internet through wireless router if that has anything to do with that
Title: Re: brx plc (email)
Post by: plcnut on August 30, 2017, 08:41:04 PM
Could you please post your code for the email?
Either screenshots or zip file would be fine. Otherwise it is a shot in the dark on what is going on.
Title: Re: brx plc (email)
Post by: maciek on August 30, 2017, 09:54:55 PM
i feel like a moron but really want to be able email
Title: Re: brx plc (email)
Post by: MikeR on August 30, 2017, 10:06:45 PM
yes, please follow the above suggestions and post your code.

I'm not sure that this is a problem or the only problem but I've had some ISPs that block port 25. you might try SMTP port 587, 465, or 2525...
might not solve it, but couldn't hurt to try.
Title: Re: brx plc (email)
Post by: BobO on August 31, 2017, 08:36:31 AM
Google rotates SMTP server IPs, so you have to do the IPLOOKUP immediately before sending, then update the device via DEVWRITE. Surely we have the details of how to do that in an FAQ...
Title: Re: brx plc (email)
Post by: franji1 on August 31, 2017, 09:14:44 AM
Google rotates SMTP server IPs, so you have to do the IPLOOKUP immediately before sending, then update the device via DEVWRITE. Surely we have the details of how to do that in an FAQ...

DNSLOOKUP - Name to IP Address.

I recommend using 8.8.8.8 (Google's DNS) as the Primary DNS initially.  And if THAT fails, we know that the PLC does not have Internet access (network routing issue, either configuration or physical), which is where the desired SMTP Server exists.
Title: Re: brx plc (email)
Post by: BobO on August 31, 2017, 09:46:24 AM
Google rotates SMTP server IPs, so you have to do the IPLOOKUP immediately before sending, then update the device via DEVWRITE. Surely we have the details of how to do that in an FAQ...

DNSLOOKUP - Name to IP Address.

I recommend using 8.8.8.8 (Google's DNS) as the Primary DNS initially.  And if THAT fails, we know that the PLC does not have Internet access (network routing issue, either configuration or physical), which is where the desired SMTP Server exists.

Dang...I never can remember the final instruction name. I usually have DmD open in front of me to check... :P