Arduino Distributed Chat is a project that consists of a web application, that enables the communication between users via chat by using a microcontroller for synchronization and messages storage.
The whole infrastructure consists of the web application, that every user should have and the web server that is an Arduino based microcontroller. A microcontroller in this network can publish every message, that it receives.
Infrastrucutre main benefits:
- Low power consumption.
- Easy maintenance of web server.
- Low-cost infrastructure.
Single message information:
- The maximum length of ID is 4 characters: LI.
- The maximum length of the username is 8 characters: LU.
- The maximum length of a message is 35 characters: LM.
- Separators(~) amount is 3 characters: SA.
- The maximum length of message = LI + LU + LM + SA = 50 characters.
- MQTT Broker: broker.hivemq.com, Port: 1883.
- Microcontroller: ESP8266.
- Web Application: HTML, CSS, Javascript, MQTT Paho Library, Bootstrap Library.
- Arduino IDE (PubSubClient Library for MQTT connection).
Download repository code from:
https://github.com/georgealexakis/hybrid-chat-application.git (master branch)
Or get a copy of the source from:
$ git clone https://github.com/georgealexakis/hybrid-chat-application.git (master branch)
Run:
$ npm install
to install dependencies.
- In your browser: https://georgealexakis.github.io/hybrid-chat-application/.
- Build the Hybrid Applications for different devices using Apache Cordova for mobile devices. Rename /docs folder to /www folder before build. Use the template for a cordova application, as presented in this repository https://github.com/apache/cordova-app-hello-world.
- For android in API 28 and above, you have to set android:usesCleartextTraffic="true" in your manifest in the application tag.
Upload the code distributed-chat.ino from the folder /distributed-chat to the Wemos D1 mini microcontroller board.
Every user must run the application as a web page and follow the steps below:
- Enter the username.
- Press the login button (last from right).
- Wait until the status be 'Online'.
- Text input is activated.
- Enter the message and press the send button.
- When the someone sends a message, the message will be send also to the sender to be sure that the message has been sent.
Usage of multiple microcontrollers, which will be synchronized with each other, in case of switch off when the next one is ready. Furthermore, a future improvement will be the tasks sharing and user status caching between microcontrollers.
This project is licensed under the MIT License - see the LICENSE file for details.