I'm trying to setup home automation system controlled with webpage stored in SD card of Arduino, I was thinking if it was possible to set a login page, only combination of correct user id & password will be able to access the control page.
5 Answers
I have a page about a tiny web server for the Arduino Uno or similar boards. It simply isn't true that you can't make one, or that a much more powerful processor would be better. There are some limitations imposed by small amounts of RAM, but the library described there decodes incoming HTTP information "on the fly" so it can handle a reasonably large page.
You could put the data to be display into PROGMEM (more information here) or onto an SD card as someone suggested.
The login and password could be stored in EEPROM.
-
I would also suggest making your UI a "one page" Javascript application. This means all the UI is loaded into the browser up front and all further interactions with your Arduino can be made with simple GET/POST requests eg AJAX/RESTful requests. This approach also has the advantage of allowing you to pre-compress the JS/CSS application code with GZip (just add a Content-Encoding: gzip header) greatly reducing the amount of flash required and overhead of streaming content from flash to the browser. The main point here being push as much processing as possible into the browser.– TimMar 14, 2016 at 14:03
Arduino cannot run a web server so it is not possible to do what you want with just using an Arduino board?.
It seems we can run a web server, look at the answer by @Nick Gammon below.
By using a wifi shield and connecting to a local or public web server where your page is hosted you should be able to to do it.
Don't expect to load a full fledged page on an Arduino you have to try posting a few post and get requests to get this working. It will look like a terminal based login.
What is the control page you are trying to do?
If you are ok with spending more money try using a Raspberry pi + Arduino combination.
-
1A ESP8266 would be the cheapest and easiest to use solution. Then you could run the webserver, connect the SD card and the sensors to one device without much hassle. Feb 26, 2016 at 12:42
-
1It is possible to do web servers (even with the Ethernet Shield). Here are a few examples; github.com/mikaelpatel/Cosa-HTTP/blob/master/examples/…, github.com/mikaelpatel/Cosa-HTTP/blob/master/examples/… and github.com/mikaelpatel/Cosa-Shell/blob/master/examples/… Feb 26, 2016 at 12:43
-
@Avamander ESP8266 wifi shield gives Arduino the ability to connect to a network not to run a webserver. Still we has to depend on other devices to get this working.– Mr.XFeb 29, 2016 at 9:04
-
@Mr.X Using an ESP8266 as a shield is a total waste, it's like attaching a mortar to a golf cart. ESP itself can handle a web server and much more at once. (Plenty of examples on the web) Feb 29, 2016 at 14:54
Have you tried to change Arduino Uno board to Arduino Yun board? Yun has a Linux distribution onboard and you can easy configure a web page to control physical objects.
Here some examples: http://scuola.arduino.cc/lesson/b4EoRkV/Arduino_Yn_Intro_to_web_server https://github.com/mat-lo/yun-examples
Make simple webpage and put it in sd card. If it's just one page with few buttons and bit js even flash memory of controller would suffice.
In arduino code add lines that can detect click on particular button of webpage and control relay/motor etc.
Knowledge of basic post request using js can help. You can't implement php page in arduino as it needs complex processing at arduino side
-
How exactly would this process you described work? What tools are needed? Currently your answer needs more information, if you improve your answer you'll definitely get a few upvotes. Feb 26, 2016 at 15:10
I guess you could do it with Javascript and HTML, and put the pages in the micro SD card.
But it will make it harder (if not impossible) to make the automation.
-
I read a tutorial, in which Node.js was use for automation, stored in SD card, if that can be done, then login? Feb 24, 2016 at 14:21
-
here you can found some help (but only with html) How to make a login form using HTML that connects to the next page though with nodejs it would be awesome– Fabian WFeb 24, 2016 at 14:45
-
-
1
but it will make it harder (if not impossible) to make the automatization
- why? Your answer will be more helpful if you explain your thinking here.– Nick Gammon ♦Feb 24, 2016 at 20:00 -
@Fabian W. the link u provided is a very good resource, thank you Feb 26, 2016 at 17:59
arp -a
will show MAC addresses of other devices, and that can easily be spoofed... MAC filtering is not secure at all.