The Remote Control Panel
The Node.js instance on the Raspberry Pi that controls the GPIO pins starts an Express web server, which provides a UI (AKA Control Panel) to control the bot.
This Pi-hosted Control Panel can be accessed on any device connected to the same WiFi network by accesing the Pi’s IP address in a web browser.
Communication between the Bot and the Remote Control
Real-time communication between the GPIO handler and the Remote Control Panel is taken care of by Socket.IO.
On the front-end, jQuery, jQuery Mobile and Bootstrap.js are used to make the Remote Control responsive.
They also help the UI to adapt to different kinds of devices like PCs, mobiles and tablets of varyng screen sizes.
These files are served statically by a middleware of Express, aptly named serve-static.
The Remote Control provides buttons to control the motors, the pan/tilt mechanism of the camera, powered by micro servos and a switch to control the headlight (LED).
At present, the camera pan/tilt mechanism is not used as its servos need PWM to function. Since the Raspberry Pi is not a Real-Time OS, using PWM has adverse effects on the timing of other GPIO pins.