Loading...
  Show Posts
Pages: [1] 2 3
1  Development / Suggestions for the Arduino Project / move board and serial port menus on: January 05, 2012, 01:34:18 am
I have a suggestion. it's not a big change, but I think it would make this short process much easier. when I'm working on a project, and I'm switching between boards, trying code with different hardware. it's a pain, and I often miss the sub-menu and have to move the mouse back over it again. please move the board and serial port menus to the top, maybe between sketch and tools. a quick grab and drag down the menu to the right option would be many times faster.
2  Using Arduino / Networking, Protocols, and Devices / Re: library to support both ethernet shield types on: January 05, 2012, 12:44:22 am
here's my first library. I wanted to finish it before posting it, but this isn't functional. I've been stuck on a bug for the last few days, and I still don't know what line it's on or the nature of the problem. it would be 10 minutes from finished if I could get it to compile and work. when I do hack it into compiling, the defines don't carry over into the library and the right code isn't included. a lot of other odd symptoms like this.
http://growcontrol.com/_files/EthernetLayer-library-notworking.zip

I hate to say it, but at least for now, I give up on this part of my project. the previous code I posted works, and I can drop it into my project to get the same intended result.
3  Using Arduino / Networking, Protocols, and Devices / library to support both ethernet shield types on: January 01, 2012, 03:57:12 am
this will be my first code post of the new year. hope it's a good one. I wrote this code to easily create a tcp server on either the wiznet or 28j60 chip based shields. this wasn't easy because there aren't any examples for a tcp server using 28j60, so it took a little time to figure it all out. below is an example of my code in use, and the first file I'm posting is just a bunch of functions. I plan to convert it to a library next.

http://growcontrol.com/_files/EthernetLayer.pde

Code:
// (enable only one)
#define UsingWizNet      true // WIZ5100
//#define UsingEtherShield true // ENC28j60

// send outgoing ethernet data to serial also
#define ethPrintToSerial true

#if defined(UsingWizNet) || defined(UsingEtherShield)
static byte     eth_mac[6] = {0x54,0x55,0x58,0x10,0x00,0x25};
static byte      eth_ip[4] = {192,168,3,110};
static byte eth_gateway[4] = {192,168,3,1};
static byte  eth_subnet[4] = {255,255,255,0};
static uint16_t eth_port   = 80;
#endif


void setup(){
  Serial.begin(115200);
  EthernetLayer_Setup();
  Serial.println("Ready");
}

void loop(){
  EthernetLayer_Loop();
}

void eth_GotData(){
    Serial.println("Got data:");
    while( EthernetLayer_Available() ){
      eth_Print( EthernetLayer_ReadNext() );
    }
    Serial.println();
    Serial.println("Done");
    EthernetLayer_SendData();
    EthernetLayer_ClearBuffer();
}
4  Topics / Home Automation and Networked Objects / Re: need help with enc28j60 on: January 01, 2012, 03:47:31 am
My ethernet card enc28j60 no work after 30 or 60 minutes...need restart...no display on web....How i solve this problem?I use external power supply 9volt.Thanks.

sounds like the chip is over heating
5  Using Arduino / Networking, Protocols, and Devices / Re: enc28j60 tcp server on: December 31, 2011, 07:27:40 am
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.
6  Using Arduino / Networking, Protocols, and Devices / Re: enc28j60 tcp server on: December 30, 2011, 03:30:07 am
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.
7  Using Arduino / Networking, Protocols, and Devices / Re: enc28j60 tcp server on: December 30, 2011, 12:54:27 am
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.
8  Using Arduino / Networking, Protocols, and Devices / Re: Telnet Server for ENC28J60 Board on: December 29, 2011, 07:18:09 pm
I'm trying to do something like this. not telnet, just a straight tcp server. the last time I worked with the ethershield, I did what you did. I just gave in and used the web server example. I'm rewriting my project to make some improvements, and this time, I'm not giving in to http. I'll be working on it until I have a tcp server. I'll figure it out one way or another. I'll have my code posted on my website and a few other places.
9  Using Arduino / Networking, Protocols, and Devices / Re: enc28j60 tcp server on: December 29, 2011, 06:31:18 pm
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.
10  Using Arduino / Networking, Protocols, and Devices / enc28j60 tcp server on: December 28, 2011, 10:36:50 pm
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?
11  Development / Other Software Development / Re: Implementation for Microchip ENC28J60 Ethernet controller on: December 28, 2011, 09:34:03 pm
Unfortunately, Arduino 1.0 brakes the compatibility with this library.
If you still want to try it out, you will need the IDE in version <= 0.23
And if your on Debian Testing like me, you cannot run any older version of the IDE because it depends on some older packages... So just go do something else.

yea, I understand that feeling. a year ago I heard talk that 1.0 would support both ethernet shield types with similar calls. I haven't seen anything. I'm in search of an example of a standard tcp server, but can't find anything so far. it will take me more time to try figuring it out myself, and I hope I can get it to work right. I don't know if I'll be able to avoid customizing the library.
12  Using Arduino / Networking, Protocols, and Devices / Re: ethernet shield locks up network using a hub, switch works on: December 27, 2011, 11:00:50 pm
Quote
my desktop shows the same symptoms and seems to lose connection to the network
This would tend to point to the hub as the culprit, then. Perhaps it is in need of replacement.

good call. not sure if the hub is going bad or just finicky with the arduino, but I swapped out the hub and it's working fine. I guess now I'm back to work on my project :-)
13  Using Arduino / Networking, Protocols, and Devices / Re: Problem with networking Arduino on: December 27, 2011, 05:47:15 pm
hate to be the one to just post a google link and no other help, but it's what I have to offer you. the answer you're looking for is likely here http://www.google.com/#q=ubuntu+bridge+wireless+to+ethernet&hl=en&safe=off&biw=1680&bih=961&fp=1&bav=on.2,or.r_gc.r_pw.,cf.osb&cad=b

what you want to do is set up a bridge between the wireless and ethernet. I believe they'll have to be on different subnets. like, if your existing network is 192.168.1.x, the arduino/ethernet side of the bridge could be 192.168.2.x then you'll be able to talk over that bridge between the 2 networks.

an alternate method you may not have thought of, plug the arduino into the laptop using usb. there are programs available to bridge a tcp/udp connection to the com port.
14  Using Arduino / Networking, Protocols, and Devices / ethernet shield locks up network using a hub, switch works on: December 27, 2011, 05:16:04 pm
I've just started messing with the official ethernet shield, the older version, not the newest. I think version 4. I uploaded a webserver example and hooked it up to a near by hub that one of my desktops also plugs into. when the arduino and ethernet shield are plugged in and powered up, I can barely connect to it with a browser. it seems like a lot of interference or something. it either never connects, or it downloads part of the text then never finishes. my desktop shows the same symptoms and seems to lose connection to the network. the RX led of the ethernet shield is very active.

the hub is a hub, not a switch, so all data being sent to or from my desktop should physically make it to the ethernet shield too, but it should be ignored by that device because it's not the right destination. to me, it seems like the ethernet shield is maybe stealing the data from the desktop and causing it to not function. if I take the arduino out to my server closet and plug it into a good quality switch, it works fine. that's what leads me to my previous conclusion, because a switch only sends data to the ports of the right destination. a hub sends data to all ports. actually, now that I think about it, I do remember having a similar problem using the nu electronics ethershield on a hub also. I believe the problem I found there was it was accepting packets that don't belong to it. so is the arduino just not compatible with hubs and only works with a switch?
15  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield pin usage is unclear on: December 27, 2011, 05:00:28 pm
this website is useful for a quick pin lookup

http://shieldlist.org/nuelectronics/ethernet
http://shieldlist.org/arduino/ethernet
http://shieldlist.org/arduino/ethernet-v5
Pages: [1] 2 3