my blog my blog

Monthly Juli 2018
Control a RaspberryPi Robot using Python and a mobile browser

Usually I use some physical buttons or joystick attached to my electronics in order to quickly test or control components like motors, relais or LEDs. I was searching for a better way, but could not really find one. In this article, I describe how I built a RESTful webserver with websockets, and a javascript-based based interface in form of a website. That way, any linux-based robot-controller can be controlled using a cellphone or a tablet. The code needed can be found here:

Interactive, low-latency javascript-based websocket-GUI for touch-devices with a python-flask backend that interfaces to robotic components. It provides virtual 2-axis joysticks (inspired by nipple.js but without the multitouch issues) and buttons that all work simulatenously. Due to the two-way websocket connection, status-messages from the robot can be displayed in the text-area.