Using python socket, you can chat with your Pi from any mobile device. The previously posted instructable by saurabh47 no longer works. I took the source script and the app and modified it to work with the latest python version and Raspbian OS. However, credits for the idea goes to saurabh47.
Step-1Download the socket server script and run it on the Pi.
wget "https://gist.githubusercontent.com/shivasiddharth/b743140fb351169957e60a95c617e709/raw/040bb060d6065985cee53ee198dd85003aaa7cf6/chatbotserver.py"
python3 ./chatbotserver.py
You should see a "Listening for connection" status on the terminal now.
Step-2Download the Android App folder from here. This folder should contain an apk file and an MIT App inventor project file. If you wish, you can edit the app in the App Inventor page. Install the apk on your android mobile.
The app interface will look like something shown below.
Enter the Pi's IP address and socket's port. If you wan an audio output of the message received from Pi, select or check the TTS option. On pressing the "Connect" button, the mobile device should be connected to the Pi's socket.
Step-3That is it. Now start chatting with Pi. You can request time, date, etc. Some basic queries have been configured by default. You can play around to get the CPU, RAM and Storage statuses.
Comments
Please log in or sign up to comment.