Table of Contents:
Setting Up Python Environment
Inorder to start our python app, it is important to setup a working environment.
Since Kivy has many dependencies, I recommended you to install it in a Python virtual environment. Just open a new terminal by pressing
Ctrl + Alt + T
.
And here’s how you can create a Python virtual environment:
python3 -m venv defender
Just type the above command. "protector" is the name of the Virtual environment. Now activate the virtual environment by typing the command:
source protector/bin/activate
Great ! We have successfully activated our virtual environment. Now let's install the kivy package for python. Run the following command:
python -m pip install kivy
Now, install some essential packages by using the below commands:
python -m pip install urllib3 python -m pip install bs4 python -m pip install speechrecognition
Algorithm
The algorithm chart given below is simple explanation of our Python code.
Running the Code
I've attached the code files in this blog. If you have any queries, Kindly post in the comment section. Just Download the code file and open the main.py in the zip folder and enter the IP address of your Arduino Nano 33 IoT module in the following line:
root_url = "http://<Your Nano 33's IP>"
And now run the command using the below command:
python main.py
But make sure your PC and Arduino Nano 33 IoT is connected to the same network before launching the python app.
Building .apk File
Due to Speech Recognition package incompatibility in Android platform. I'm facing some issues in running the app in the Android platform. However, the app works well on linux and windows platform. I'm working on the issue and update once I found a solution.