Pages: [1]   Go Down
Author Topic: enc28j60 tcp server  (Read 1283 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this seems to be the best, most up to date library for the ethershield. https://github.com/jmccrohan/EtherShield so that's what I'm using. it has a web server example, but what I need is a tcp server. it sounds easy enough, but no. does the library have the code to support it already? I see constants for things like WWW_client or server, but I don't see anything like TCP_server. it's a complicated library. I first need to figure out if the functions I need exist, or do I have to modify the library and add functions?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still haven't found any useful libraries online. I've found more posts where people talk about creating a library that's compatible with both shields, but I can't find that anyone has ever started such a project. I know I can't handle a project like that on my own, but I will gladly offer any help I can if someone else heads up the project. my plan right now, is to create a semi-simple library to just act as a compatibility layer to make the ethershield library in my previous post act more like the official ethernet library. if I run into any road blocks, and I expect I will, I'll end up having to modify the library itself and release my own version of it. in either case, the code will be in my own subversion repository, so I can patch in updates to the library I'm basing mine from. anyone care to help with any of this?

edit: I found this library https://github.com/thiseldo/EtherShield seems the most up to date version, so that's what I'm working with. I think what I need to do is make copies of the functions that are called in http server examples, and strip out the http code. every time I look at the code, it's much more complicated than it seemed it would be.
« Last Edit: December 29, 2011, 07:40:17 pm by lorenzop » Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is all that worth saving ~$23?

http://www.ebay.com/itm/New-version-W5100-Ethernet-Shield-Arduino-328-UNO-Mega-1280-2560-/250961684667?pt=LH_DefaultDomain_0&hash=item3a6e7b68bb
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is all that worth saving ~$23?

quick answer, no it's not. I have one with the bigger sd card holder, and it works fine. but my goal is to have my project working with both types of ethernet shields. when I upload my finished code to the internet, I want people to be able to download it and use it with either shield without trouble.

I think I'm close to having a compatibility layer I can use, but I'm having trouble with the packets. the library does some complex stuff in the packetloop_icmp_tcp function. I can get my code to show that it is getting packets, but I can't get it to detect the right kind of packet so I can grab the data from it.

edit: it would even help if I knew how to properly debug the library. there's some kind of debugging built into it, but I don't have a clue how to use it. UDR0? I was taking a guess that it's some internal name for the serial port, but it doesn't send anything to the usb serial port. swapping that code out for Serial.print() just gives errors that it hasn't been defined yet.
« Last Edit: December 30, 2011, 01:03:23 am by lorenzop » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

figured out why I wasn't getting the packets with the usual es.ES_packetloop_icmp_tcp function. it's not looking for the GET line of the http protocol, but it is waiting for the double line endings \r\n\r\n to signify the end of the http header. that is the hidden problem when trying to convert the web server example into a tcp server. it must be hidden in that function. I'll dig into it more tomorrow.

edit: or maybe the packet was to short. my test data was "12345". it seems to only work when sending strings at least 8 characters long.
« Last Edit: December 30, 2011, 03:48:23 am by lorenzop » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm close to having working code. I have to figure out why it's not sending data back with the ethershield, and figure out some other bugs. I have one set of functions I can call from my project, then I define either UsingWizNet or UsingEtherShield and my library does all the rest.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello i am also facing the same problem. I need to make a TCP server, the best and small ethernet library in the link below use only HTML. How can i strip the HTML parts and extract the message? I use C# visual studio application as client which use TCP. I think the arduino replies only to HTTP requests if this library is used

Arduino Library: http://trollmaker.com/article11/arduino-1-0-with-enc28j60-ethernet-shield-v1-1
Logged

Pages: [1]   Go Up
Jump to: