Let’s sum up what we have done so far :
- we ordered a pair of color tracking cameras
- we modified them into Infrared tracking cameras
- we updated their firmware to track Infrared and tested them
- we built a small case to give them a nice look
There is one last modification we have to bring to the cameras, and that modification is a game changer : we are going to make them wireless !
Of course we won’t send the video, but the coordinates of the points the camera is tracking. In this article we are going to connect an ESP8266 Wifi shield to the CmuCam to send coordinates over Wifi.
Here is what we are going to do, step by step. All you need to know for this part is how to program an Arduino (I have seen 8 years old doing it so…I’ll give you a link just in case).
Here we’ll go through all you need to know to make it out of this tutorial alive.
First if you don’t know what is Arduino, please read about it here : Arduino.
We are not going to use a regular Arduino board but an ESP8266, which has been made compatible with Arduino. To make it easier, we will start with a NodeMCU dev board which includes an ESP12E (which includes an ESP8266 ^^) and a USB programmer :
You will need one per camera, but luckily you can find them starting at 3.28$, shipping included on Aliexpress.
Connect NodeMCU to CmuCam
Here is how to wire the CmuCam to your brand new ESP8266 :
Program the ESP8266
We won’t go through “How do we install Arduino IDE”, if you are still reading this then I’m sure you’ll be smart enough to know how to use Google 😉
For this part first go here to learn how to use Arduino with an ESP8266 and configure your Arduino IDE.
Make sure to download (from the Arduino library manager) all the libraires required for Wifi connection.
And here is the code you have been waiting for. Here is what is does :
- Turn the ESP8266 into an Access Point so you can connect to it and enter your Wifi informations
- Try to auto update from a server
- Start communication with the camera, and broadcast datas over Websocket (it acts as a websocket server)
Please note that it is a very early version for tests purposes. Major fixes and improvements are yet to come.