Serial monitor issue

Hello,

I've stumbled upon an issue and I don't have any idea yet about how to solve it. The problem is as follows:

I have a sketch which connects to a database using an ethernet shield and sends some data. The problem is that after I upload the sketch everything works, but if I disconnect the arduino from the computer and power it from another source. Nothing happens, I don't get anything sent to the database. If I recconect it to the computer, open the IDE and open the Serial monitor, the Arduino starts sending data to the database.

My first reaction was to get rid of all the serial.print's, and serial.begin ... but the problem persists...

Any ideas?

TurbatuAndrei: My first reaction was to get rid of all the serial.print's, and serial.begin ... but the problem persists...

Won't make any difference.

TurbatuAndrei: Any ideas?

Sounds like a problem with the power supply.

Ethernet shield takes a lot of power (6 times that of an Arduino alone I think) - so I'd agree - perhaps you have an inadequate supply?

I tested that, and this doesn't seem to be the issue.

This theory wouldn't explain the following:

After I upload the sketch everything works fine, the power supply being the usb connection with my computer. If I disconnect the Arduino from the computer and plug it back again, nothing happens unless I open the IDE and start the Serial Monitor.

From what I understand, when the Serial Monitor is started the Arduino restarts, so I tryed pressing the reset button after I power it ... but still no luck..

I also took into consideration that there might be something wrong with my microcontroller, so I changed it ... but I got the same result.

Check your GROUND connection and also make sure that all GND must be commen if you use multiple pwr. check also your serial cable GND.

Everything seems to be ok with my ground connection.