Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Disconnect client from Server/EthernetServer. on: January 31, 2013, 09:43:34 pm
Thank you!

 smiley-sweat What was on my mind!?  smiley-lol
2  Using Arduino / Networking, Protocols, and Devices / Disconnect client from Server/EthernetServer. on: January 30, 2013, 10:22:15 pm
From the docs, EthernetServer class doesn't seem to have a disconnect method for disconnecting connected clients. If there are more than 4 clients connected, EthernetServer would froze until one or two of the clients disconnect. This is a limitation of the shield:

The Arduino Ethernet Shield allows an Arduino board to connect to the internet. It is based on the Wiznet W5100 ethernet chip (datasheet). The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP. It supports up to four simultaneous socket connections. Use the Ethernet library to write sketches which connect to the internet using the shield. The ethernet shield connects to an Arduino board using long wire-wrap headers which extend through the shield. This keeps the pin layout intact and allows another shield to be stacked on top.

Is there a way to disconnect clients from the EthernetServer once they're done doing their stuff?
3  Using Arduino / Programming Questions / Re: How do I declared an array of ip address? on: January 16, 2013, 06:57:12 pm
I haven't test it out yet so the error that might happen isn't obvious to me.
Thanks for the heads up! smiley
4  Using Arduino / Programming Questions / Re: How do I declared an array of ip address? on: January 16, 2013, 06:35:23 pm
byte ip[][4] =
      { 10, 0, 0, 177 }
    , { 10, 0, 0, 178 }
    , { 10, 0, 0, 179 }

Hi lloyddean, that's even more succinct!
Thank you! smiley
5  Using Arduino / Programming Questions / Re: How do I declared an array of ip address? on: January 16, 2013, 06:33:11 pm
Ok, so if I have 3 IP addresses,is the following declaration correct?
byte ips [3][4];
ips [0] = {192, 168, 1, 1};
ips [1] = {192, 168, 1, 2};
ips [2] = {192, 168, 1, 3};

Thanks for the link! smiley
6  Using Arduino / Programming Questions / How do I declare an array of ip address? on: January 16, 2013, 06:09:40 pm
In the Ethernet code sample, an IP address is declared like this:
byte ip[] = { 10, 0, 0, 177 };

How do I declared an array of them? I would like to be able to loop through the array and access them one by one using their index. Adding a length into the square bracket doesn't seemed to work.
7  Using Arduino / LEDs and Multiplexing / Re: Does an Arduino Mega able to power 13 74HC595 shift registers and 104 LEDs? on: March 23, 2011, 10:01:09 pm
Yes, the wallwart will provide 5V to the shift register power pins. Can use it to provide 5V to the Arduino as well, connect to the 5V pin and bypass the Vin/Voltage regulator circuit.

M5451 35-bit shift register with 15mA-25mA SINK current (must pull cathodes low to turn on LEDs).

Thanks a lot for these information! smiley I'll give the datasheet a read.
8  Using Arduino / LEDs and Multiplexing / Re: Does an Arduino Mega able to power 13 74HC595 shift registers and 104 LEDs? on: March 23, 2011, 09:08:10 pm
Mwahahaha smiley-grin

Maybe use something that drives a few more LEDs to start with (like an M5451 chip or similar - drives 35 LEDs per chip)

I am new to this M5451 chip and it's interesting. If I were going to use it, I am going to need 3 M5451 chips right?

It also depends on how long you keep those LEDs on. There are LED shields out there with 256 LEDs and they are powered from arduino.
I am going to be able to control every single LEDs, their on and off time. This is like a running LEDs except that the delay between each lighted up LEDs would be different. Some would have 3 secs and some shorter. At the end, all LEDs would light up and stay for half an hour maybe.

Get yourself a wallwart.
I use this one a lot
So I can use this adapter to connect directly to the shift registers?
9  Using Arduino / LEDs and Multiplexing / Re: Does an Arduino Mega able to power 13 74HC595 shift registers and 104 LEDs? on: March 23, 2011, 08:04:32 am
Thanks for the reply. smiley How do I setup an external regulated power source as exactly what you said? What extra components am I going to need for this? Can you shed some more light?

Thanks a lot! smiley
10  Using Arduino / LEDs and Multiplexing / Does an Arduino Mega able to power 13 74HC595 shift registers and 104 LEDs? on: March 23, 2011, 05:45:27 am
I am about to use an Arduino Mega to control 13 shift registers (74HC595) which in turn control 104 LEDs. Does Arduino Mega connected to a DC going to have enough power for those 104 LEDs? If not what should I supply extra power to those LEDs?
11  Forum 2005-2010 (read only) / Troubleshooting / Re: How do I make sure Arduino is working properly? on: November 07, 2010, 08:49:16 pm
Does the failure of the sensor to trigger action occur when the ethernet shield is not connected, too?

If so, remove the ethernet shield, and write a simple sketch to react to the sensor. Only when the hardware and software is known to work should you try to integrate it into the whole sketch/hardware setup.

I forgot to say that out of roughly 20 times, the sensor didn't trigger for 2 or 3 times. The same thing happened to the relay, it didn't turn on for a few times. And it was random, like in one test the motion sensor fail to trigger but relay was ok. Next the sensor triggered ok but relay didn't seem to on. I'll do another isolated test case to make sure these 2 things work as expected.

Do you really need to log the output, or are you just looking to view the data?

If I wanted to log it, I'd use Processing to interface with the serial port (there are examples provided), and write all data received from the serial port to a file.
I am just looking to view the data. Part of the reason is, there's this computer with display software installed on and we've set it to start the project and lighting control automatically upon receiving button click from Arduino. And I resisted using the serial monitor because whenever it opens, Arduino would restarts. And also, it needs to be opened to see what's Arduino is printing. So I am more keen on to have a simple yet automated logging to see what excatly Arduino has been sending and receiving.

Is the Arduino acting as a client or a server? If it is a client, you can't force it to be connected if the server refused the connection request.

If it is a server, you can't force a client to be connected, either. Clients have to connect on their own. The server needs to allow the connection.
It is both client and server. Acting as client when it sends data to the computer of the display software and as server when it listen to any incoming data from the said computer.

Do you really have enough experience with the library to determine if there is a bug, or is it that you haven't successfully developed a project using the shield, so you aren't positive of what you are doing, and whether or not the library is working properly?
I apologize if 'buggy' is too strong a word for this case. I was saying that it seemed to me (based on a number of tests I did), the client.connected() function didn't return any result at all (as expected), both when the ethernet shield is connected and disconnected to LAN.
Here's a block of code with extra detail removed. The reconnection in the loop part is where the oddity is.

void setup(){
Ethernet.begin(mac, ip);



  while (!client.connect()) {
    if(client.connect()) {  
    else {  
      Serial.println("connecting failed");
  client.println("run\n"); //when connected at startup, do run

void loop(){

  if (!client.connected()) { //reconnection in loop
    if (client.connect()) {
      show = false;
      buttonLock = false;
    else {
      Serial.println("Reconnect failed");
12  Forum 2005-2010 (read only) / Troubleshooting / How do I make sure Arduino is working properly? on: November 07, 2010, 11:35:15 am
I am using Arduino Duemilanove and Ethernet Shield with 2 buttons and 1 motion sensor attached. There's also a relay attached which turns on when a certain condition is met. The ethernet shield is used to send command to a display software which is set on port 3040. When upon receiving any command (basically text) from Arduino, would change the projection. This software also controls DMX lighting. The working of the whole stuff goes like this.

At the beginning, all DMX lighting were set to off. When any motion is detected by the sensor, Arduino would send command to the display software to run any images or video into projection and turn the lights on. This would run for a while until this display software sends a text back  to Arduino and sets the relay on for a few seconds. This relay is actually used to trigger a custom radio which upon on would start outputting some sound until it end itself which is some 30 seconds. After this radio ends, all DMX lighting would light up. The lights would go off after 10 minutes and this thing repeats.

The odd thing, based on a number of test we've done (~20 times):
  • Two or three times, Arduino didn't detect anything from the motion sensor even though there's someone walking through it.
  • The relay doesn't trigger even though (assuming) Arduino receives command from the display software.
So my questions is:
  • How do we make sure Arduino is actually working properly? I read about logging, is there any other way of making sure Arduino is behaving like the way it is programmed? Either through hardware component logging or software logging (gobetwino).
  • Can anybody shed some light on their first hand experience on logging, preferably software logging, like gobetwino?
  • This is more of a connectivity issue, how do I make sure that Arduino with its Ethernet Shield is always connected? I put the following block of code inside the loop() but when I tried to check the connection availability, it doesn't show anything. Looks to me the ethernet library is buggy.
if(!client.connected()) {
Thanks and appreciated!
Pages: [1]