Page 1 of 1

ENC28J60 SMTP

Posted: Mon Feb 01, 2016 8:21 am
by cruzxia
Hi

When sending SMTP Email, I need to use a random port number.
The issue I have is that Port 80 is hard coded into the ENC28J60 component in several places.
This causes component too reply with the incorrect port (80) number, causing a TCP failure

Is it possible amend the ENC28J60 to add a parameter for the port number on the macros that use the hard coded port 80?

The user can then just define the port number prior to using the relevant macro.

Port = Random;
or
Port = 80;

Cruzxia

Re: ENC28J60 SMTP

Posted: Mon Feb 01, 2016 11:38 am
by Benj
Hello,

Ok I have removed the hard coded port property and added the port as a parameter to the macros.

Let me know how you get on.
TCPIP_ENC28J60.fcpx
(13.04 KiB) Downloaded 295 times

Re: ENC28J60 SMTP

Posted: Mon Feb 01, 2016 2:21 pm
by cruzxia
Hi Ben

I have setup the new component, That is exactly what I needed, Thanks. :D
There is a bug though.

If the port value exceeds 255, then I cant get passed "CheckForTCPPort"
Can you please check and see why it wont accept an uint above 255 for the port value.

Re: ENC28J60 SMTP

Posted: Mon Feb 01, 2016 3:36 pm
by Benj
Hello,

I might have missed something. Here is another version you can try.

Re: ENC28J60 SMTP

Posted: Tue Feb 02, 2016 9:49 am
by cruzxia
There is something strange with this, the latest version also did not work correctly.
I wrote some C code as a work around, It works with greater than 255, but it wont work with a value of 80.
Where the Enc28J60 is just the opposite. I will try to find a solution and get back to you.
Cruzxia