Go Down

Topic: How to control LCD on Arduino remotely over web site? (Read 1 time) previous topic - next topic


So my current experiment is getting a website on my computer up and running that lets my friend from across the country write strings to my 16x2 LCD. So far I have all the logic down (I have the Arduino sketch and an ASP.NET website), but can't figure out how to actually host the site.

If I use Visual Studio's built-in debugging local server, I can type a string on the web page (which uses C#) and have it send to the Arduino just fine. However, trying to set up my own website with Apache and Mono is so far fruitless. I haven't figured out an easier way to host a simple ASP.NET site on my own computer either.

So since ASP.NET and Mono don't play well together (for me anyways) I thought about using other languages. I've never used Perl in my life, but this seems pretty simple. I've always thought Perl's syntax was hideous, but if it works I don't mind. :P

I looked into Processing.js, but it doesn't support serial communication. Also, I checked out the Silverlight and Firmata page, but that seems too complicated. And I checked out Python, but there's like 5 different modules for it and none seem easy to use. PHP might work, but I'm not sure.

Has anyone had any success with serial with Arduino in web pages before, like I'm trying to do?


Apache is typically bundled with PHP and MySQL. You could sever the ties with Windows only code (ASP.NET) and use PHP, which works on any platform, to develop the web site.

PHP can write to the serial port that the Arduino is connected to.

Even better, in my opinion, as a learning exercise is to get an Ethernet shield, and let the Arduino be the server. Serving a form, with a text box and a submit button, is trivial. Responding to the GET request triggered by the submit button, as opposed to the GET request initially made by your friend's browser, is easy.

The GET request from the submit button would contain the contents of the text box, which you would then show on the LCD.
The art of getting good answers lies in asking good questions.


Yeah, I think I'll try Perl or PHP. I downloaded an Apache bundle with both, so if one doesn't work hopefully the other would.

I'd like to have a bluetooth/usb host shield and an ethernet shield, but I don't have enough money to spend another $100 on Arduino stuff right now.

As I said, all the coding I've already completed for the Arduino, and I have a working ASP.NET site, just don't know how to host the web page itself. Well, for some reason the button I had on the site to open and close the port didn't work, so I just set it to open the port on page load, which was good enough for testing.

So as long as the coding of PHP/Perl/whatever is easy enough, I just need to be able to host the site so my friend can access it. I'll try probably tomorrow; if I don't regulate how much I get frustrated with things, I get so frustrated I don't want to do it again for months. :P


I a year ago I started with php to develop this project  www.dataino.it  in order to study the language and arduino I suggest you download xamp (apache + mysql) and eclipse  link on http://www.dataino.it/help/document.php

php have a class for serial comunication http://paolosarteschi.altervista.org/wp/?p=375

other routes are:
1. Creating an extension for chrome and using SerialAPI of chrome http://redacacia.me/2013/09/23/using-the-chrome-serial-api-with-chipkit-digilent-uno32/
2. Using nodejs and using "duino" libraries,
3. flash http://playground.arduino.cc/interfacing/flash


Thanks for the info. For my purposes it seems like the PHP serial class would work fine enough. I'll hopefully give it a try soon.

Go Up