Page 1 of 1

Net_Ethernet_28j60_connectTCP NOT COMPILE

Posted: 29 Mar 2018 14:02
by KrEn
Hello,
i try to redesign my project.

Im download library for ethernet from LIBSTOCK.

and i try to compile example.

at code:
i := Net_Ethernet_28j60_connectTCP(IP, 2000, 10000, @SOCKET_GLOBAL);

compiler show error.
Like this:
40 327 Incompatible types ("complex type" to "simple type") test tpcip.mpas
40 1512 Warning: Implicit typecast of integral value to pointer test tpcip.mpas
45 304 Syntax error: Expected ")" but "." found test tpcip.mpas

if i comment err then compile without errors-



I try all combination... but without any result?

I need help with this example... tnx.



BR Greg

Re: Net_Ethernet_28j60_connectTCP NOT COMPILE

Posted: 29 Mar 2018 20:32
by KrEn
Many years ago.. on this forum...
Basic and similar problem:

viewtopic.php?f=111&t=58712#


BR
Greg

Re: Net_Ethernet_28j60_connectTCP NOT COMPILE

Posted: 30 Mar 2018 11:40
by petar.suknjaja
Hi,

I downloaded the Ethernet library for Net_Ethernet_28j60
and the example is compiling and working without problem.
Looking at code I couldn't find the line that you have problems with.

Could this be that you are trying to compile the code from Help Section?
If you read it through you`ll see it's not the actually working example,
just a reference on how to use different routines from library.

If you want to try working example,
try navigating to Project Explorer window, click on Packages Example Folder, click on Network Ethernet AVR folder then on Examples folder and double click on HTTP_Demo_28j60.mppav

If the problem still persist, tell me what version of mikroPascal PRO for AVR do you have,
and zip and post project files to see what's the issue.


Kind regards,
Petar

Re: Net_Ethernet_28j60_connectTCP NOT COMPILE

Posted: 30 Mar 2018 13:50
by KrEn
hello,
tnx for support.

After 4 hours i found problem:

i := Net_Ethernet_28j60_connectTCP(@IP, 2000, 10000, @SOCKET_GLOBAL);
In all examples are IP without @.

Ok, after compiling mcu freeze at this command.
Im change timeout in library to 2 s. But problem persist.
Im debuging this problem via serial port.
Before command print msg.
Mcu wait at this program to WDT reset.


BR Greg

Re: Net_Ethernet_28j60_connectTCP NOT COMPILE

Posted: 31 Mar 2018 17:39
by KrEn
Hello,

tnx for support.


now i try next step:
Configuration:
AVR mega 128 with ENC28j60 IP: 192.168.001.101
PC witn open TCP/IP server at port:4001 at IP: 192.168.001.102

In ATT is file with my example.
If i try to send from PC to AVR via TCP or UDP port packet. AVR recive packet, blink with led and
answer TCP ( if i use TCP/IP).

But i := Net_Ethernet_28j60_connectTCP(@SLAIpAddr, 4001, 4001, @sock);
command not connect to PC.

PING from pc to avr answer with time 2ms.