Go Down

Topic: Webserver and Measurement at the same time (Read 835 times) previous topic - next topic

epris

Dear all,

I want control a photovoltaic system with Arduino. In particular, I want measure some voltages and currents and I want read them on a website using the Ethernet Shield. I want change the state of some components sending command over the net.

I'm a newbie and I'm starting to read examples of code. I have a doubt: Can Arduino execute webserver and make measurements at the same time? What happens if during a measurement or a computation I try to open a socket with the webserver for sending a command?

Thanks to all,
Antonio


robtillaart


Quote
Can Arduino execute webserver and make measurements at the same time?

Not at the very same time, it will be done in sequence but it is (normally) fast enough to handle both as such a project is made many times. Note that the Arduino webserver cannot handle a load comparable to a PC based or dedicated webserver. It handles one request at a time.

Start with running the tutorial examples from the arduino.cc site as they are a good sptarting proint for your project.

Can you tell more about the sensors you intend to use and the amount of them?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

zoomkat

The below has some server code that might be of interest.

http://www.scienceprog.com/getting-hands-on-arduino-ethernet-shield/
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

epris



Quote
Can Arduino execute webserver and make measurements at the same time?

Not at the very same time, it will be done in sequence but it is (normally) fast enough to handle both as such a project is made many times. Note that the Arduino webserver cannot handle a load comparable to a PC based or dedicated webserver. It handles one request at a time.

Start with running the tutorial examples from the arduino.cc site as they are a good sptarting proint for your project.

Can you tell more about the sensors you intend to use and the amount of them?



My doubt is arisen when i have read "Arduino Ethernet Shield supports up to four simultaneous socket connections". How is it possibile? Has it a buffer for socket connection and serve them one by one?

We think to use a multiplexer for reading 8 measures.
It's sure that i will use a PC based webserver that communicates with Arduino but is it possible that it loses a command if it's busy?

epris


The below has some server code that might be of interest.

http://www.scienceprog.com/getting-hands-on-arduino-ethernet-shield/


thanks, I will read surely.

robtillaart

Quote
My doubt is arisen when i have read "Arduino Ethernet Shield supports up to four simultaneous socket connections". How is it possibile? Has it a buffer for socket connection and serve them one by one?


The Arduino is not multithreading so in practice** it can't handle multiple connections in parallel. The chip used provides 4 sockets which enables that when the Arduino gets a request for something it can connect to another server, fetch some data, merge it with its own and return it to the original requester.

** you can write a server that handles multiple requests in parallel but you need additional administration to keep track of the status of every connection. Given the relative scarce resources of the Arduino doing this right might be quite a challenge.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up