Pages: [1]   Go Down
Author Topic: Webserver and Measurement at the same time  (Read 734 times)
0 Members and 1 Guest are viewing this topic.
Avellino
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 216
Posts: 13663
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Rob Tillaart

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

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9541
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Avellino
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Avellino
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 216
Posts: 13663
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Rob Tillaart

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

Pages: [1]   Go Up
Jump to: