Go Down

Topic: 2 arduinos 1 shield (Read 2081 times) previous topic - next topic

wdvalenz

Hello Arduino pals

I am wondering if I can use 2 different arduinos to access the same sd card on a Ethernet shield, I am working on a web server logger but while Accessing to to the data via web browser the logging is not done, I am think on implement the logger in one UNO ant the web server in other UNO.

Best,

PaulS

Quote
I am working on a web server logger but while Accessing to to the data via web browser the logging is not done, I am think on implement the logger in one UNO ant the web server in other UNO.

While the web server has the file open for read, the logger can't open it for write. So, it really doesn't matter how many Arduinos you throw at the problem. You need to redesign your application so that the web server can serve up the file in between the times that logging occurs.

robtillaart


You can have one webserver arduino that serves pages from its local SD card, and logging messages are send (e.g. over I2C) to a second arduino that has only an SD Card (cheaper) to log them.
Rob Tillaart

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

wdvalenz

Thanks,

Do you think that using a faster Arduino, as the Due, can make the application work better?

PaulS

Quote
Do you think that using a faster Arduino, as the Due, can make the application work better?

Probably not. But, without seeing your code/having any idea WHAT you are logging, that's only a guess.

MichaelMeissner


Thanks,

Do you think that using a faster Arduino, as the Due, can make the application work better?

It depends.  I suspect in general you will be limited by network speeds on the web server, the speed of writing data to/from one Arduino to the other, and the speed that the SD card can write on the logger.  If those are your bottlenecks, then putting a faster processor in won't help at all.

It may be the Due/Mega might be useful in that they would have more memory, and you could do both the logging and the web stuff in one processor.  However, that probably requires you to be real careful so that each thread (web serving, writing to the SD card) doesn't interfere with the other.

PaulS

Quote
However, that probably requires you to be real careful so that each thread (web serving, writing to the SD card) doesn't interfere with the other.

Since the Arduino isn't running a multi-threaded operating system, that shouldn't be a problem.

MichaelMeissner


Quote
However, that probably requires you to be real careful so that each thread (web serving, writing to the SD card) doesn't interfere with the other.

Since the Arduino isn't running a multi-threaded operating system, that shouldn't be a problem.

I was thinking more  that since you have two logical threads, but no threading infrastructure, that instead of doing blocking reads and delays, you have to do polling, and use techniques like blink without delay so that both threads will be done.  It isn't rocket science, but it is attention to detail.

PaulS

Quote
It isn't rocket science, but it is attention to detail.

That I'll agree with. And, it's the point I was alluding to when I said that the web server needed to access the file only when the logger wasn't trying to write to it.

Go Up