1

I have a project where I want to remotely turn on and off a relay using an Arduino,(ESP8266) over the internet.

  1. I have a remote web server that hosts my existing hobby website, cPanel hosted by GoDaddy Sites.
  2. An Arduino (ESP8266) connects to this website listening for relay on/off commands.
  3. Open a browser and load the webpage dashboard to sent commands to Arduino.

Yes I could have the Arduino poll the website ever so often to check for a value changed in a database, but I don't want to do that, Just seems unethical to me.

I was looking at WebSockets and thought that might be what I'm looking for but I know too little about it or there's not enough relevant documentation online about it to use it in this type of project.

I am looking forward to your comments and answers, but please do not tell me to host the site on the Arduino, and also using an app or other service is not going to work either, We are working with my own webpage and thats it no thirdparty apps, Thanks.

3
  • What is the question?
    – timemage
    Dec 8 '20 at 3:17
  • why is checking a website unethical?
    – jsotola
    Dec 8 '20 at 4:41
  • Because it is like a little kid in the back seat asking every km on the road, "are we there yet"? If there could be a way to tell the client when to turn on a relay only when needed, would be much more efficient. there will be millions of checks that are essentially useless, so having it just wait until the command is sent to it would be ideal. Dec 10 '20 at 0:27
0

I don't believe you will have the capability to implement a Websocket interface on the GoDaddy cPanel web site. I think you are limited to just serving up HTML content and associated files. Websocket requires a server-side resource to talk to which you cannot implement.

I see nothing wrong with having a simple HTML page, that doesn't even need to really contain HTML that your ESP8266 can "GET" and examine and determine to turn your relay on or off.

1
  • Thanks, yes that would and will probably work, as per my previous comment, it's just not ideal that way, creates constant internet traffic that's essentially useless. Dec 10 '20 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.