R
Ricardo Jasinski
Hi everyone,
I'm supposed to build a test application where a PC would communicate
with many other devices (say, temperature sensors) via TCP/IP sockets,
and display their current status on a web page. Furthermore, all
gathered information should be stored on a database.
I just started learning ruby/rails but I'm already hooked on it. In a
week I could do two things:
- communicate with the sensors, and show incoming messages on a
text/command line window. This could be easily extended to store the
information on the database;
- access the database and present formatted data on a dynamically
generated web page.
What I really can't imagine right now is how to put these two things
together, in a way that whenever a sensor sends new status
information, the corresponding line in the webpage gets updated
asynchronously.
My first guess would be having two separate processes or applications,
one in charge of communicating with the devices, and the other would
be the web server itself. These two should communicate with each other
as well, though it's not clear to me how this would happen (maybe a
socket between the two applications? I would rather not use the
database for the kind of transitory message they will be exchanging).
I'd be glad to hear your thoughts, and implement as many suggestions
as possible. I'll give you feedback as I go on with this; I was hoping
to have something working in a month or so.
I'm very new to this (I'm more of a hardware designer), so even a
short comment could be extremely valuable to me. Thanks in advance!
Ricardo Jasinski.
I'm supposed to build a test application where a PC would communicate
with many other devices (say, temperature sensors) via TCP/IP sockets,
and display their current status on a web page. Furthermore, all
gathered information should be stored on a database.
I just started learning ruby/rails but I'm already hooked on it. In a
week I could do two things:
- communicate with the sensors, and show incoming messages on a
text/command line window. This could be easily extended to store the
information on the database;
- access the database and present formatted data on a dynamically
generated web page.
What I really can't imagine right now is how to put these two things
together, in a way that whenever a sensor sends new status
information, the corresponding line in the webpage gets updated
asynchronously.
My first guess would be having two separate processes or applications,
one in charge of communicating with the devices, and the other would
be the web server itself. These two should communicate with each other
as well, though it's not clear to me how this would happen (maybe a
socket between the two applications? I would rather not use the
database for the kind of transitory message they will be exchanging).
I'd be glad to hear your thoughts, and implement as many suggestions
as possible. I'll give you feedback as I go on with this; I was hoping
to have something working in a month or so.
I'm very new to this (I'm more of a hardware designer), so even a
short comment could be extremely valuable to me. Thanks in advance!
Ricardo Jasinski.