Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: January 23, 2011, 11:42:44 am
simply merge/mash/cajole the enc28j60 codes together and use the same high level interface that the default lib has.
Exactly my thinking. The library I customised is based on one of the most widespread codings for the ENC, which was encapsulated in an Arduino-compatible class. I thought why not use the "standard" interface?
Then I realised that the "standard" interface is not sufficient for operating the ENC28J60. Since even most of the TCP/IP overhead is already handled by the "standard" chip, it already supplies some kind of socket interface, similar to higher level operating systems. On the ENC, you need to handle the complete stack, including asynchronous answers to SYN packets to set up a TCP connection etc. The TCP/IP code used here is rather crude, with the advantage to be very small in coding and smaller still, if you do not need TCP.
Disadvantages: No socket interface and only one connection at a time.
Encapsulating the coding into a socket-style interface would cost a lot of RAM to store parameters for the open connections, and I was not ready to sacrifice the RAM. (Even now a full-sized Ethernet packet with 1500 Bytes would not fit in the buffer on a Mega328. And in most cases for small applications, that fit in my time schedule, one connection will be sufficient. So I stay with the current interface, which should be better documented, I agree...
But I would be looking forward to somebody trying and succeeding. As it is, the interface is a pain to port and use.
2  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: January 19, 2011, 06:13:09 pm
Cause you know, if the interfaces are the same, then its plug-n-play, and we don't have to code 2 completely different interfaces just to get ping working.
That was my original thought also. A cheap Ethernet controller as an alternative to the original one. I think I am quite good in networking, but soon found out that writing TCP/IP from scratch needs much more time than I could spend. I reviewed some stacks available for microcontrollers, and there are really nice ones, but in the end, the one I used needed the least work to get going.
Unfortunately, the library is constructed quite differently, so that I didn't even try to change the interface to adapt to the original Ethernet library. This may be because the ENC28J60 is only supporting Ethernet, whereas the original chip at least partially supports higher protocol levels. The IP, TCP, and UDP layers needed to be implemented in software completely. So the program must be able to handle e.g. ARP and the TCP handshake asynchronously to the data telegram transfer.
Thus the callback function mechanism. When I find the time, I should document a little more for you guys and implement DHCP to improve plug and play. Time is a little short at the moment, so the original authors may be faster.

Best regards,
3  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: January 14, 2011, 09:21:30 am
I have just downloaded your library and i wonder i it possible to receive "HTTP POST" ??
Certainly. First, you need to configure the Arduino as a web server. The library contains code for that already.
The tricky thing is, that you need to have a look into the handling of the received html code to implement the POST command, if it is not already in. (I did not change or use the function yet, but I think one of the examples does).
When the library receives a packet, a callback function is called that handles the received data, e.g. stores it somewhere. In there, you should find the code you have to adapt.
4  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: December 31, 2010, 08:54:52 am
I hopefully found a better possibility to store my coding. Please download the extended ENC28J60 library and example code from here:

Best regards,
5  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: December 18, 2010, 02:50:53 pm

the library is not mine, I just extended the TCP client part. It contained already a http client part that should be able to generate a http get.
I only did the POP3 mail checker and there seems to be no explicit http client example included, although there is some comment around the client functions within the library code.
With this library, you need to understand how the functions process the data.
You need the loop function "ES_packetloop_icmp_tcp()" to be run regularly to process requests to the Arduino, like Ping or just the usual TCP/IP handshake.
When you want to send a http get request, you need to use the "ES_client_browse_url()" function. Within the URL string, you must put the get statement.
Internally, the function sets up callback functions that insert the URL data into the packet and handle the returned data.

My mail checker does the same and it works the whole day, requesting the data every 10 Minutes.

Could you maybe post your code, so the community can have a look?

I am afraid that this link is not reachable, you probably need to replace "localhost" by the IP address or name of your web server.

To the community:
Unfortunately, I don't have any webspace available where I can put the library. Understandably, this forum does not have the capacity to host all user uploads. I don't really like to use these free upload providers. Can anybody recommend a free alternative?

Best regards,

6  Forum 2005-2010 (read only) / Interfacing / Re: An extended TCP/IP library for the ENC28J60 on: November 21, 2010, 02:09:06 pm
Here's my Library, Example, Schematic of my Ethernet card:
I hope the link works...
7  Forum 2005-2010 (read only) / Interfacing / An extended TCP/IP library for the ENC28J60 on: November 21, 2010, 02:07:06 pm
Dear all,

since the chip seemed quite popular and was inexpensive, I built an ethernet-board to be used with Atmel Microcontrollers, especially the Arduino. After studying the available library options, I chose the etherShield library, as used by Nuelectronics, Andy's Life, and others.
Unfortunately, the interface is not quite well documented and after some experimenting with the library and a client to display if my account holds POP3 mails, I somehow understood the concept and noticed, that the library does not seem to support continuing a TCP/IP client conversation after the initial data exchange of one telegram.
So I added a function to continue the conversation and, as an example, my pop 3 mail notifier client.
I hope, somebody has a use for this library.

Best regards,
8  Forum 2005-2010 (read only) / Interfacing / Re: Need help with Relays not switching back. on: December 18, 2010, 01:57:18 pm
Hey guys, im trying to interface my arduino with a 5v relay through a Transistor, my diagram is as follows:

Arduino Pin 13 --> 1k R --> Transistor Base
5v External Input --> Transistor Collector
Transistor Emitter --> Relay Coil

Dear Roddiy,

correct me if I'm wrong, but that is not the circuit shown in the PDF.
With the NPN transistor you are using, you should connect the Emitter to GND and the Collector to the Relay coil. The other coil connection can then be connected to your relay supply, adding the protecting diode and so on.
Your problem may result from the protection diodes built into the AVR Microcontroller.

Best regards,
Pages: [1]