First of all, thank you for reading this demonstration project as to how to utilize TheAmplituhedron IoT Services. If you want to see previous projects, please click here. I have always excited about exploring new ways of adding IoT features on my projects hence the fact that I programmed my own IoT Services on my website :) In this project, I wanted to show you how to create a private chat room over the Internet through a communication path or channel by using ESP8266. Of course, you can use any other device that can make an HTTP Get Request to a server instead of ESP8266. As I said before, I used TheAmplituhedron IoT Services for creating a connection path so that the private chat room is confined for three entry processes. In other words, only three devices are capable of reaching the dedicated server path to change the integrated variables as messages at the same time. Not surprisingly, this system is not the fastest communication service on the Internet; it, approximately, has four second lag time while retrieving the message string from the database after saving.So, I can say that this tutorial is more like a fun project about the Internet of Things than creating a full version communication system like WhatsUp but it provides new and significant additions in the extent of the embedded IoT features on ESP8266. To summarize, you can create a private chat over the Internet through TheAmplituhedron database for three different devices by taking the following steps below.
As explained at the source code below, it works like a turn-based recovery system.Each of the message string transmitters changes the same connection path saving the message string to the database to be displayed. And therefore, each HTTP Request changes other devices' message strings to notify the user whether a new message string is sent by other devices or not. In other words, every time you send a message string your connection path, you change other data packets that are sent by external devices along with yours. So that you can think of the connection path as a hub which collects data packets from three different resources and saves them synchronously. In that regard, if you are the Guest_1 defined at the source code; when you send a message string from your device, you overwrite other guests messages at the same time. For instance, you sent HELLO as the message string to the connection path then other message strings are turned into Waiting… automatically as if other devices sent them.
Guest_1 = HELLO
Guest_2 = Waiting…
Guest_3 = Waiting…
For entering the message string, I used an 8 LED 4x4 Keypad Module which has the integrated push buttons. But, unfortunately, it occupies all available GPIO pins on the NodeMCU so that I had to monitor the message string through the serial monitor on Arduino IDE. However, you can use an LCD screen if you have extra GPIO pin to spare on your development board.
When you enter a symbol by using the keypad, it is saved as the message string to be displayed on the serial monitor after it notifies you when the WiFi connection is successful.And, when you write your message on the serial monitor, you can send it to your connection path by pushing the send button defined at the source code.
Every time you enter a new character by using the keypad, this character is saved to the message string to be monitored on the serial monitor.
And, when you decide to send the message string, you can send it to the connection path and other devices by merely pushing the send button.
NodeMCU pin mapping is not coherent so that occupying its all GPIO pins can be tricky. Most of them has already a predefined value for booting as depicted below. But only one of them can be a problem for you in this project tutorial. The reason is as follows. I had to attach D8 to the send button in input mode but it has already an internal current for activating sleep mode in boot process. In that regard, do not forget to detach D8 when booting the NodeMCU.
Download the keypad library here.
ConnectionsConnect the keypad module as showed at the source code introduction in which all connection details are well-explained.
And sturdier the keypad by using a hot glue gun to make it easy to enter a new character.
Now, after all these steps, there is one thing to do to use TheAmplituhedron IoT Services in a proper way. Before uploading the source code, enter your WiFi settings, account information and SSL FingerPrint.
After uploading the source code, you can communicate two other devices which have the same connection path(Guest_1, Guest_2 and Guest_3), sending message strings to the database. I hope that this tutorial is useful and effective for you :)
By using TheAmplituhedron Mobile App, you can monitor all the data packets being sent to the database without needing to signing in to your account on computer.
Free IoT Services | Make a Private Chat w/ ESP8266 | Serial Monitor Settings and Hedron
Free IoT Services | Make a Private Chat Room w/ ESP8266 | Sending Message Strings via WiFi
Free IoT Services | Make a Private Chat Room w/ ESP8266 | Communicate on Android
What is TheAmplituhedron IoT Services?Aside from the cloud system of TheAmplituhedron used in other projects of mine, TheAmplituhedron IoT Services is for displaying and saving data packets received from NodeMCU etc. in HTTP Get Request Method only. Like the cloud system of TheAmplituhedron that can receive and transmit data packets through web server in either HTTP Get Request or HTTP Post Request, specialized for Arduino Ethernet Shield and Raspberry Pi, TheAmplituhedron IoT Services is programmed by myself in PHP, jQuery and AJAX as an available system for only my website subscribers. But, as opposed to the cloud system of TheAmplituhedron, it can only receive data packets in HTTP Get Request Method, and display recent data packets only; TheAmplituhedron IoT Services is dedicated to showing the recent data gathered by NodeMCU etc. via sensor readings properly through TheAmplituhedron database and server. To use this feature, please follow the steps down below and subscribe to my website if you have not yet.
How can I subscribe to TheAmplituhedron?It is very simple to subscribe to benefit all available system provided by me; you just have to sign up to TheAmplituhedron.com, which is programmed by myself.As showed by the figure down below, you have three options to sign up - Sign In with Google Plus, Continue with Twitter and Sign Up(Create an account).
1) Sign In with Google Plus
Just click Sign In with Google Plus and accept permissions. After that, you are ready to use IoT Services freely.
2) Continue with Twitter
Just click Continue with Twitter and authorize TheAmplituhedron. After that, you are ready to use IoT Services freely.
3) Sign Up
Or, if you do not want to use a third party account for verification, you can create your own account on TheAmplituhedron, as depicted down below.
After signing up process, your hedron - the unique 20-digit ID that used as an identifier in your connection path URL - generated by the server; you can display it under personal information section
.Personal Information -> Hedron -> Display
After subscribing, you have to create your unique connection path URL under IoT Services on your dashboard. Just click Create+ to auto-generate your connection path URL; after clicking, a pop-up bar will re-direct you to your connection path URL, containing your username and hedron.
Do not forget that you can create one connection page named with your username, and save in a constricted database - up to 6 entry.
Your secure connection path should be like this;
/dashboard/IoTServices/USERNAME-HEDRON
Now. you can send data packets - up to 6 entry - by using HTTP Get Request Method like here.
Syntax :
?dataNameFirst=
&dataNameSecond=
&dataNameThird=
&data1=
&data2=
&data3=
NodeMCU is an open source IoT platform, and also the name of an ESP8266 integrated development board. I used a ESP-12E V2.0 2.4Ghz in this demonstration project.
First of all, download its default board along with libraries from GitHub on here.
Add, the included libraries in the source code from example files - the rest of it is well-explained at the source code down below.
To make an HTTP Get or Post Request is simple and easy with HTTPClient Library, but if you make this request to a website protected with SSL Certificate like my website(TheAmplituhedron.com), you may need to learn how to manage to glean a website SSL FingerPrint or ThumbPrint from here.
http.begin(connectionPath, "SSL FingerPrint or ThumbPrint");
Comments