Problem to do the connection in TCP-IP client

Discuss with MikroElektronika software developers about current library development.
Post Reply
Author
Message
Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Problem to do the connection in TCP-IP client

#1 Post by Prof.Wagner » 06 Oct 2014 20:46

Hi Everyone,

I developed a product using the TCP_IP libary from MikroEletronika and my product works well. I am using PIC32 microcontroler, mikrobasic and my product works in client operation.
The problem is that if I turn off my product and turn on again I dont get to connect again. I need to re start the App in the server and start again my product to connect again. I think that I have a problem with socket, but the IPs, port are ok, such as that it connects in the first time.
Somebody can help me?

Thank you in advanced.

prof. Wagner

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: Problem to do the connection in TCP-IP client

#2 Post by JimKueneman » 21 Oct 2014 03:36

Professor,

I am currently struggling with the same thing on a PIC32 and the library. I had it connecting for about 30 minutes the other day now I can't get it to connect to save my life. If you find anything please post it....

Jim

Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Re: Problem to do the connection in TCP-IP client

#3 Post by Prof.Wagner » 27 Oct 2014 18:10

JimKueneman wrote:Professor,

I am currently struggling with the same thing on a PIC32 and the library. I had it connecting for about 30 minutes the other day now I can't get it to connect to save my life. If you find anything please post it....

Jim
Hi Jim,

I got some progress. If I put to the client port a random number (remember that I am work in client mode) I get to receive data after that I turn off and turn on again my product (the server remains running) but I don't get to send data yet. I have fixed the port_server but a random Port_client. I get to receive data from server but I don't get to send data from client (my device) to server. This problem occurs if I turn off and turn on again my device without turn off the server.

Net_Ethernet_28j60_connectTCP(@IP_SERVER,PORT_SERVER,RANDOMICO,@SOCKET)

Regards

Prof. Wagner
Last edited by Prof.Wagner on 06 Nov 2014 18:29, edited 1 time in total.

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: Problem to do the connection in TCP-IP client

#4 Post by JimKueneman » 27 Oct 2014 19:03

Thanks. I found my problem. The MMI config bit got flipped and the mE compiler dialog box has bugs and does not reflect the correct state of the bits.

Jim

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: Problem to do the connection in TCP-IP client

#5 Post by JimKueneman » 28 Oct 2014 14:11

I just realize you are using the 28J60. The reason I moved from the dsPIC family to the PIC32 was the build in ethernet module. I have had little to no success with robust solutions with either of the Microchip SPI ethernet chips, SPI CAN chips or serial FTDI USB to UART chips at very high speeds. These days I use a micro that has the module built in (Ethernet, CAN and USB). Since moving this direction my aggravation level has dropped drastically in working with these technologies (I still fight my own bugs though :D )

Jim

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Problem to do the connection in TCP-IP client

#6 Post by filip » 29 Oct 2014 15:41

Hi,
Thanks. I found my problem. The MMI config bit got flipped and the mE compiler dialog box has bugs and does not reflect the correct state of the bits.
Which MCU were you using ?

Regards,
Filip.

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: Problem to do the connection in TCP-IP client

#7 Post by JimKueneman » 29 Oct 2014 18:56

Fusion 7 with the big PIC32 795 (I think) with built in Ethernet. The microprog does not reflect some of these bits correctly in the mcu settings. If you read in a mcu hex it won't update correctly either



Jim

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Problem to do the connection in TCP-IP client

#8 Post by filip » 30 Oct 2014 16:06

Hi,

Ethernet RMII/MII Enable should have value RMII enabled (instead of Disabled, which is now present) and MII enabled (instead of Enabled, which is now present).
Ethernet I/O Pin Select should have value Default Ethernet I/O (instead of Enabled, which is now present) and Alternate Ethernet I/O (instead of Disabled, which is now present).

These bits are correctly passed to the mikroProg (I have verified this with MPLAB, the correct bits were set), just the bit value names are not intuitive.

Regards,
Filip.

Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Re: Problem to do the connection in TCP-IP client

#9 Post by Prof.Wagner » 06 Nov 2014 18:31

Prof.Wagner wrote:
JimKueneman wrote:Professor,

I am currently struggling with the same thing on a PIC32 and the library. I had it connecting for about 30 minutes the other day now I can't get it to connect to save my life. If you find anything please post it....

Jim
Hi Jim,

I got some progress. If I put to the client port a random number (remember that I am work in client mode) I get to receive data after that I turn off and turn on again my product (the server remains running) but I don't get to send data yet. I have fixed the port_server but a random Port_client. I get to receive data from server but I don't get to send data from client (my device) to server. This problem occurs if I turn off and turn on again my device without turn off the server.

Net_Ethernet_28j60_connectTCP(@IP_SERVER,PORT_SERVER,RANDOM_port,@SOCKET)

Regards

Prof. Wagner
Hi Everyone,

Nobody can help me about my problem above?
Thank you in advanced.
Prof. Wagner

Post Reply

Return to “Library Development Discussion”