# Web server to control pan tilt hat

**URL:** <https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637>\
**Category:** Raspberry Pi\
**Created:** [April 21, 2017, 8:09pm UTC](https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637 "2017-04-21T20:09:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benhackerman](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/benhackerman/32/2335_2.png) [@Benhackerman](https://forums.pimoroni.com/u/Benhackerman)\
**Post date:** [April 21, 2017, 8:09pm UTC](https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637/1 "2017-04-21T20:09:24Z")

</div>

I have a pant tilt hat and would like to use it via a website with up down left and right buttons.

How could I make this doable via a website and python, I’m new to iot But I know HTML and css era well and would like to know: how to set up a web server and how to interface it with python?

Thanks

---

<div class="post-metadata">

**Author:** ![larsjuhljensen](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/larsjuhljensen/32/2241_2.png) [@larsjuhljensen](https://forums.pimoroni.com/u/larsjuhljensen)\
**Post date:** [April 22, 2017, 1:12pm UTC](https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637/2 "2017-04-22T13:12:52Z")

</div>

Using the [Flask framework](http://flask.pocoo.org/) would probably be the easiest way to do it. It is very light-weight and should be easy if you already know Python, HTML, and CSS.

---

<div class="post-metadata">

**Author:** ![GordonTGopher](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@GordonTGopher](https://forums.pimoroni.com/u/GordonTGopher)\
**Post date:** [April 22, 2017, 2:59pm UTC](https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637/3 "2017-04-22T14:59:07Z")

</div>

[http://forums.pimoroni.com/t/help-building-an-pan-tilt-webinterface-for-pimoroni-pan-tilt-hat-full-kit-with-webcam-server/](http://forums.pimoroni.com/t/help-building-an-pan-tilt-webinterface-for-pimoroni-pan-tilt-hat-full-kit-with-webcam-server/)

Works well

Gordon

---

<div class="post-metadata">

**Author:** ![mark-orion](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/mark-orion/32/2016_2.png) [@mark-orion](https://forums.pimoroni.com/u/mark-orion)\
**Post date:** [April 22, 2017, 4:29pm UTC](https://forums.pimoroni.com/t/web-server-to-control-pan-tilt-hat/4637/4 "2017-04-22T16:29:57Z")

</div>

You can probably adapt my STS-Pilot software for this purpose. It was designed for the explorer hat, but it should not be that difficult to adapt it for PAN / TILT.  
It uses flask as web framework and gevent as web server. Works with both native Pi camera or UVC compatible USB cameras.

> **[mark-orion/STS-PiLot](https://github.com/mark-orion/STS-PiLot)**
>
> STS-PiLot - AJAX remote control web interface with live video for the Pimoroni STS-Pi and other robotics projects
