0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« on: October 30, 2008, 03:06:49 am » |
I have just get my first Arduino boards, Duemilanove and a Arduino Ethernet Shield. I have installed the Windows software and loaded the Web Server example to the unit. Everything worked fine and I was able to communicate with the unit from Windows Explorer when I had the USB cabel connectet to my Laptop (with drivers) But when I try to power the units from a routers USB port (I just want 5V from the router) I have to press the reset button on the Ethernet Shield to have the Ethernet up and running. The router have no drivers for the Arduino units. ??
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 430
Arduino rocks
|
 |
« Reply #1 on: October 30, 2008, 04:00:57 am » |
Your USB port may not be able to provide enough power What kind of router do you have? 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #2 on: October 30, 2008, 04:24:15 am » |
It's no problem with the power I got 5 Volt from the router. The router is an Dlink DIR-451 mobil broadband. It seems that when I have the USB cabel connected to the PC there are some handshaking who trigger the Ethernet link to go up.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 430
Arduino rocks
|
 |
« Reply #3 on: October 30, 2008, 04:43:20 am » |
Have you tried using an external power supply? The Duemilanove can take 6-12VDC from an AC to DC adapter using the power plug on the edge of the board -- make sure you move the PWR jumper from USB to EXT PWR Please give it a try and let us know if it works 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #4 on: October 30, 2008, 06:05:10 am » |
I got 5 Volt from the router. That's half the equation - how much current do you get? I second (or third) the recommendation to try a different power source. -j
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #5 on: October 30, 2008, 07:19:38 am » |
Same result with external power, the "FULLD" Led is blinking until I push the reset button.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #6 on: October 30, 2008, 07:49:39 am » |
I have done another test, external power and then I have cut of the power cable (pin1 VCC) from the USB cable. Same result when I connect the USB cable to my PC the link go up! It seems to be some magic talk between the board and the driver in the PC. No program is running in the PC.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #7 on: October 30, 2008, 08:06:29 am » |
Time to post your code...
-j
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 430
Arduino rocks
|
 |
« Reply #8 on: October 30, 2008, 08:08:30 am » |
Some pictures may help too http://flickr.com/ is good for high-res pictures 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #9 on: October 30, 2008, 08:13:33 am » |
Here comes the code, I have just changed the IP address from the example:
/* * Web Server * * A simple web server that shows the value of the analog input pins. */
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte ip[] = { 192, 168, 0, 120 };
Server server(80);
void setup() { Ethernet.begin(mac, ip); server.begin(); }
void loop() { Client client = server.available(); if (client) { // an http request ends with a blank line boolean current_line_is_blank = true; while (client.connected()) { if (client.available()) { char c = client.read(); // if we've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so we can send a reply if (c == '\n' && current_line_is_blank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); // output the value of each analog input pin for (int i = 0; i < 6; i++) { client.print("analog input "); client.print(i); client.print(" is "); client.print(analogRead(i)); client.println("<br />"); } break; } if (c == '\n') { // we're starting a new line current_line_is_blank = true; } else if (c != '\r') { // we've gotten a character on the current line current_line_is_blank = false; } } } client.stop(); } } :-X :-[
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #10 on: October 30, 2008, 08:43:08 am » |
I don't know the Ethernet library, but there is nothing obvious to me wrong with the code.
Try putting a resistor, 1k to 10k, between arduino pin 0 and ground (but only when the arduino is not connected to a computer for programming, etc).
I wonder if some noise on the RX line is causing the bootloader to hang. If your router is a wifi router, there could be plenty of RF noise to go around.
Does a single press of the reset button fix it every time, or do you have to try a few times before it starts working?
Do you hook up the ethernet cable before the USB cable? maybe try powering up the Arduino before you plug in the ethernet cable. If this seems to help, put a delay() of a few seconds in setup() to see if that helps.
-j
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 430
Arduino rocks
|
 |
« Reply #11 on: October 30, 2008, 09:33:28 am » |
Great advice kg4wsvA Faraday cage would also help 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #12 on: October 30, 2008, 09:45:52 am » |
I have tried all proposals without any success. I have even switched to another router. Only USB connect or ONE single push on the reset button start up the ethernet link.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #13 on: October 30, 2008, 11:12:34 am » |
Sorry, I'm stumped. I see no reason for the behavior you observe.
Which ethernet shield are you using?
-j
|
|
|
|
« Last Edit: October 30, 2008, 11:13:31 am by kg4wsv »
|
Logged
|
|
|
|
|
|
|
|