Go Down

Topic: Serial communication from browser (Read 1 time) previous topic - next topic

notexa

Jun 29, 2011, 03:02 pm Last Edit: Jun 29, 2011, 03:21 pm by notexa Reason: 1
Hi everybody,

I'm trying to do the following:
I'm using a live chat application. The problem is that I'm not always looking at my monitor. To make sure I don't miss any chats I wanted to activate a flashing lamp when a chat opens.

What I've got now:
Program that talkes with Arduino through serial USB (prossessing on windows Vista), lamp connected to the Arduino through a relay. Chat window in which I can change the code (or implement an iframe if necessary).

What I still need:
A way to send serial commands (ethernet shield isn't an option) from the browser to the Arduino. It's only for 1 PC, so if I have to install software locally, that's possible.
Anybody that can point me in the right direction ?

notexa

Attached is the schema of what I'm trying to do.

Cylindric

You'll probably need something like a webserver running on your PC, so you can go to http://localhost/popupmessage.php (or whatever language you want).  Then your popupmessage.script can talk to the serial port.  You might get all sorts of issues with cross-site scripting blocks and stuff, but I've never tried.  There are some PHP classes that can talk to serial ports, I think.  Perhaps google it.
Current Projects: Rodentometer - Hamster Endurance Moni

notexa

Thanks for the tip !
Googling for serial and php gave tons of pages, but finally found something that works :)
I used serialcomm.zip from http://missionduke.com/arduino-projects/

Leds flickering with a status update on the LCD: check, next step: connecting it to my relay.

daveg360

First thought - why handle the stop button on the PC side.  Having a physical button attached to the Arduino to handle this seems far simpler and also has the additional benefit of allowing for an amusing button:
If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask.
The Arduino != PC.

Go Up