General Approach to Controlling Arduino from Browser - WebClient or WebServer?

I would like to allow control of the Arduino from a webpage. How would you go about this? I've read a bit about the WebServer and WebClient and these look promising. However, this interaction will be initiated from a website hosted on a server somewhere in the cloud and then trigger the Arduino. It's often easier for a device to connect to the cloud, rather than the cloud connect to the device, so I'm leaning towards using the WebClient to connect to the server and listen for requests.

Any advice would be great.

If the connection is with a web application that you are writing, then the connection between the webapp and the Arduino could be any protocol you like initiated by whichever side is best for you. You're right that connecting out into the internet is simpler than connecting in. However, if you're carrying data between your own webapp and your own Arduino sketch the connection could consist of a simple TCP socket carrying your application data you don't need to carry it over HTTP.

You might want to look at Firmata as a standardised way for an Arduino to be controlled by a client - you might even find there's an existing client implementation suitable for use in your webapp.

Thank you,

I'm now looking closely at the Yaler project. Any familiarity with this?