New Ethernet library with improved TCP/IP Stack
- darko.jola
- Posts: 51
- Joined: 03 Aug 2011 16:18
Re: New Ethernet library with improved TCP/IP Stack
Such function is not in our plan in the near future.
Best regards,
Darko
Best regards,
Darko
Re: New Ethernet library with improved TCP/IP Stack
Is possible that the SPI library not support to load javascript libraries (to create charts, for example highcharts or Line Graph)?
Re: New Ethernet library with improved TCP/IP Stack
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)?
Re: New Ethernet library with improved TCP/IP Stack
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.....
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.....
Re: New Ethernet library with improved TCP/IP Stack
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.
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.
-
- Posts: 4
- Joined: 27 Feb 2011 11:14
Re: New Ethernet library with improved TCP/IP Stack
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.......
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.......
- darko.jola
- Posts: 51
- Joined: 03 Aug 2011 16:18
Re: New Ethernet library with improved TCP/IP Stack
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
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
-
- Posts: 7
- Joined: 29 Apr 2010 15:57
Re: New Ethernet library with improved TCP/IP Stack
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.
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.
Re: New Ethernet library with improved TCP/IP Stack
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:
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 - ?
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: New Ethernet library with improved TCP/IP Stack
Hello,
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.
Port number via which you wish to open a socket, chose the one you like (0 - 65 535). (I suggest using > 1023)My port - ?
All incoming packets are handled in _UserTCP() function.Great. Where and how would I handle the incoming TCP packets that are the .TXT file?
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.
Re: New Ethernet library with improved TCP/IP Stack
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?
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?
Re: New Ethernet library with improved TCP/IP Stack
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:
Crash seems to happen about 50 chars into the request.
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;
}
Re: New Ethernet library with improved TCP/IP Stack
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
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?
So, my guess was that the
Code: Select all
const unsigned int MY_MSS_28j60 = 128; // Our maximum segment size.
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?
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: New Ethernet library with improved TCP/IP Stack
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.
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.
Re: New Ethernet library with improved TCP/IP Stack
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 agree, have any tips or examples you could direct me to?I would suggest implementing routine which will process the multiple package GET requests.