A fun IOT project to control an esp8266 IOT device using voice command
Demo._.ESP8266.-.Controlled.via.voice.command.mp4
![image](https://private-user-images.githubusercontent.com/10337014/284745100-fec93f99-fd26-4d7c-be65-df9a9e33f4f0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMzkwNzAsIm5iZiI6MTczOTMzODc3MCwicGF0aCI6Ii8xMDMzNzAxNC8yODQ3NDUxMDAtZmVjOTNmOTktZmQyNi00ZDdjLWJlNjUtZGY5YTllMzNmNGYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA1MzkzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhMjE2NzdmY2FhMTA0MWM5NTRkMGI1NmUxZTljYjAyMDQ4ZWYxMGRmZTVjYmZlYTE4YjIwZjYxNDZiM2NkMzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CMEeY6BsXNhR-Oh6trR8J3caziKo9gNzqw3xM8FIioM)
- https://www.youtube.com/watch?v=fmgQ8Dcg9uM&t=2s
- https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/
- The front end is written in React because it is very easy to bootstrap a ReactJS project using
npx create-react-app
command and start developing UI! - The front end uses a library called
react-speech-kit
that helps to do the voice-to-text conversion. I followed this bloghttps://www.commoninja.com/blog/how-to-convert-speech-to-text-in-react-with-the-react-speech-kit
. Here is another nice blog on this -https://blog.openreplay.com/make-your-app-speak-with-react-speech-kit/
- When a command is received at the front end, it is sent to the backend for processing. The backend is a REST API written in golang. The backend receives the command over HTTP and sends the command to the ESP8266 device via TCP. Go code is acting as a http listener for the React App and a TCP client to the ESP8266 device, a gateway to the device to send command from the ReactApp.
- Finally there is a tcp listener written in micropython which is running in the ESP8266 device. The tcp listener receives the command and executes it on the hardware.
- Don't use cheap charing cable to connect, use proper data cable. I had no idea there is a difference. Apparently there is a difference (https://www.dignited.com/50330/usb-data-cable-vs-usb-charging-cable/) which I did not know! This blog helped (esp8266/Arduino#3551)
- Dealing with bare metal is hard, lots of trial and error , guesswork, reading and searching solution which can be a bit challenging , so be patient. Happy IOTing....