New Ethernet library with improved TCP/IP Stack

Discuss with MikroElektronika software developers about current library development.
Author
Message
User avatar
darko.jola
Posts: 51
Joined: 03 Aug 2011 16:18

Re: New Ethernet library with improved TCP/IP Stack

#31 Post by darko.jola » 14 Jun 2012 14:04

Such function is not in our plan in the near future.

Best regards,
Darko

smrz_
Posts: 50
Joined: 17 May 2012 15:12

Re: New Ethernet library with improved TCP/IP Stack

#32 Post by smrz_ » 17 Jul 2012 11:27

Is possible that the SPI library not support to load javascript libraries (to create charts, for example highcharts or Line Graph)?

smrz_
Posts: 50
Joined: 17 May 2012 15:12

Re: New Ethernet library with improved TCP/IP Stack

#33 Post by smrz_ » 17 Jul 2012 13:01

It works perfect, my mistake, sorry...
smrz_ wrote:Is possible that the SPI library not support to load javascript libraries (to create charts, for example highcharts or Line Graph)?

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#34 Post by borris » 04 Jan 2013 09:35

Is there a way to read the number of free bytes on the socket buffer?

Can I change directories like:

FAT32_ChangeDir("happy\\people");

or would I have to:

FAT32_ChangeDir("happy");
FAT32_ChangeDir("people");

I would love to transfer N bytes from a SD or Flash chip to the remaining free buffer bytes on the socket.....

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#35 Post by borris » 05 Jan 2013 10:19

I have a serious issue with the Ethernet library. Why is it that my sockets will be open before a request, serve the request and then.... not be available anymore?.. EVER

I call Net_Ethernet_28j60_disconnectTCP in multiple places, make sure it returns a 1 (1 - successful FYN transmit)!

A very frustrating problem that I truly need some insight on.

If you would like to view the code:

http://www.libstock.com/projects/view/455/avr-webserver

Please give me some feedback. I'm not the only one struggling with this issue.

Steve Hurren
Posts: 4
Joined: 27 Feb 2011 11:14

Re: New Ethernet library with improved TCP/IP Stack

#36 Post by Steve Hurren » 09 Jan 2013 12:09

I too am having serious problems with new ethernet library. PIC18F27J53 and Serial Ethernet for rainguage monitoring & data logging system with web server for display of collected data.
Have not yet attempted serious debugging but problem is similar to what Richard Lowe has identified.
All other code working OK and web server on ethernet works fine for a while but after repeated access just "dies" never to be accessed again without re-setting the whole system.

Looks like I'm not alone with this issue.......

User avatar
darko.jola
Posts: 51
Joined: 03 Aug 2011 16:18

Re: New Ethernet library with improved TCP/IP Stack

#37 Post by darko.jola » 09 Jan 2013 17:12

Hello,

I will try to reproduce your bug, but for now I'm not succeed.
There are maybe workaround. If your socket stay open after you call Net_Ethernet_28j60_disconnectTCP function you can try to reinitialize TCP stack with Net_Ethernet_28j60_stackInitTCP(). This should be close all sockets.
As soon as manage to reproduce this bug I will fix it.
Also, like I post on Libstocks Comments page, please be aware that if open field in "socket" structure is 0, that means that socket is free (1 means that socket is open/busy).

Best regards
Darko

mohammed.elsammak
Posts: 7
Joined: 29 Apr 2010 15:57

Re: New Ethernet library with improved TCP/IP Stack

#38 Post by mohammed.elsammak » 03 Feb 2013 18:10

SNMP
i really happy with the new library but i extremely need the SNMP.
the SNMP is very useful because it will allow to monitor and control the devices on the network.
it can be used for alarm when there is a change or error occur on the agent so it will be very useful and it will
support us to monitor and control a big number of devices on the network.

please try your best to add it in your new library.

i hope to you all the best :) .
Mohammed Jassim.

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#39 Post by borris » 07 Feb 2013 08:52

Question:

I would like to download a small text file from a remote server. Finding little information on how this is done.

I'm guessing this is the function I would use:

Code: Select all

char Net_Ethernet_28j60_connectTCP(char *remoteIP, unsigned int remote_port ,unsigned int my_port, SOCKET_28j60_Dsc **used_socket);
  • Resolve remoteIP - done
    Remote port - done
    My port - ?
Great. Where and how would I handle the incoming TCP packets that are the .TXT file?

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: New Ethernet library with improved TCP/IP Stack

#40 Post by dejan.odabasic » 08 Feb 2013 23:22

Hello,
My port - ?
Port number via which you wish to open a socket, chose the one you like (0 - 65 535). (I suggest using > 1023)
Great. Where and how would I handle the incoming TCP packets that are the .TXT file?
All incoming packets are handled in _UserTCP() function.
Take a look at _startSendTCP() function.

You'll need to have two parts of _UserTCP function, client part which will request file from server, and server part which will handle reception of txt file.

Best regards.

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#41 Post by borris » 20 Mar 2013 08:05

Looking at the ENC28J60 datasheet I noticed it has a external interrupt.

If I wanted to utilize sleep modes but not miss any socket requests, would it be a good idea to enable the PKTIF (Receive Packet Pending Interrupt Flag) on the ENC28J60 and wire that INT to a pin on the MCU?

Probably not a good idea to call any of the Ethernet routines from the ISR, but could be used to wake up the MCU and flip a socket flag. Would it be possible to call the do_packet call from the ISR?

Now for the silly question: How do I access the registers of a SPI peripheral and the SPI library? I know there is a writeReg type function, but I'd like to understand how that works. Anyone point me in the right direction? How about a section in the datasheet?

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#42 Post by borris » 22 Mar 2013 06:23

Have an issue:

When I am using a form and the client is requesting a fairly large GET request (151 chars), the entire system crashes and resets. Is there a limitation on how much I can call Net_ethernet_28j60_getByte()?

Here is the code:

Code: Select all

// Init new socket
static enum socketStatus_e initNewSocket(SOCKET_28j60_Dsc *s){
    #define REQBUFFERSIZE 256
     int i = 0;
     char request[REQBUFFERSIZE];

     memset(request, 0, REQBUFFERSIZE);            // Set the buffer to 0, keeps from having to set '\0' at the end of the string
     request[0] = Net_Ethernet_28j60_getByte();
     
     if((request[0] != 'G' || request[0] != 'P') && s->state != 3) return SOCKET_ERROR;
     
     while(((request[++i] = Net_Ethernet_28j60_getByte()) != '\n') && i < REQBUFFERSIZE-1);
     request[i] = '\0';
     
     if(addSocket(s) == SOCKET_NONE_FREE) return SOCKET_ERROR;
     
     if(request[0] == 'G'){
          if(getGETInfo(&request, &(socketNew->file))== SOCKET_ERROR) {  // Get file and command info as well as verify file
               removeSocket();
               return SOCKET_ERROR;
          }
     } else if (request[0] == 'P'){
          if(getPUTInfo(&request) == SOCKET_ERROR){
               removeSocket();
               return SOCKET_ERROR;
          }
     }

     return SOCKET_OK;
}
Crash seems to happen about 50 chars into the request.

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#43 Post by borris » 22 Mar 2013 08:06

See, this is the magic of the internet. As soon as I post something, I figure it out. Magic.

So, my guess was that the

Code: Select all

const unsigned int MY_MSS_28j60 = 128;           // Our maximum segment size.
is where I would change my segment size to?

I would also want to make the array count up to that size as well?

That begs the question. If I am downloading a .txt file from a remote server, how do I pull the body from the frame that I receive? Would I be limited to reading the MY_MSS_28j60 as the max size per packet?

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: New Ethernet library with improved TCP/IP Stack

#44 Post by dejan.odabasic » 22 Mar 2013 09:54

Hello,

It's important that no re-entrance occurs with _doPacket function.

If GET response is larger then MY_MSS_28j60 value, you should receive the multiple TCP packet from client.
I would suggest implementing routine which will process the multiple package GET requests, but if you wish you can increase the value of MY_MSS_28j60 variable.

Best regards.

borris
Posts: 219
Joined: 22 Aug 2011 07:13

Re: New Ethernet library with improved TCP/IP Stack

#45 Post by borris » 22 Mar 2013 10:31

dejan.odabasic wrote:Hello,

It's important that no re-entrance occurs with _doPacket function.

No ISR for do_packet but what about polling a flag instead? Do you suggest using one of the libraries methods for writing to the enc28j60 or writing directly on the spi? I tried a couple of attempts but didn't get any love from the INT pin off of the Ethernet MCU.
I would suggest implementing routine which will process the multiple package GET requests.
I agree, have any tips or examples you could direct me to?

Post Reply

Return to “Library Development Discussion”