Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By forlotto
#31064 My purpose of automation is control in one hand and savings in electricity on the other if I run any other devices aside from this device I lose my purpose and intent.

And if I ran another server I might as well just spend the extra money and run my raspberry pi.

The idea is to make it as secure as possible but yet remotely controlled.

I would like to turn on and off a gpio remotely like so.

http://wanip/gpio3=1 --turn on
http://wanip/gpio3=0 -- turn off
http://wanip/gpio3=? -- read current gpio status and post to webpage on page load.

Finally I would like to setup a form on the web that would store 10 timers per pin per day. (weekly timer)
Then have the timers execute the on/off automatically.
On page load have all pin status displayed.
Have manual on/off buttons to push.
Be able to label each GPIO and update the label.

I have been thinking security though...
When I think of it simple password protection of my website should help.

Or I was thinking of having a password that the nodemcu would require and check for before executing anything.

This way you could try all day to turn stuff on and off but if you did not enter the password to do so it will not work at all or respond.

So if I setup a website to print the values of each pin on the nodemcu I could use that in an Iframe for pin status then and require all control to be done only when the password is present.

I know what I want to do it is the how right now that eludes me to some extent sorry for 20 questions and thank you for your answers every little bit helps.
User avatar
By Mmiscool
#31096 If you load up the basic firmware and use the following demo program.
http://www.esp8266basic.com/gpio--pwm-- ... ample.html

Click each of the buttons and change the values for the text boxes.

Look at the URL at the top of the browser window. These URLs can be simply called for this demo program provided a CLS is never used in the program.

http://172.16.0.189/input?0=2&1=180&goto3=Set+Servo

SO this URL would execute the action for clicking the servo set button on pin 2 with 180 degrees.

YOu can easily swap values out on the URL and use it for an automated system. And you can add another text box that captures a password that can be checked before executing an action.