Message Me

Cute communication between someone younger in your life using EMOJIs.

Similar projects worth following
My friend and her 3-year-old grandaughter can communicate back and forth using emojis. This allows for some fun emoji messages to be sent back and forth between homes without having to know how to read. Text messages can be sent as well using the device's built-in Web server allowing for a nice message to be read to the little one or for when they are learning to read.

This uses a Nextion Display, an EPS32, and lots of Arduino C++ to allow sending messages back and forth over MQTT. Two setups are needed for this communication. I created this for my friend and her granddaughter(3yrs) to be able to communicate back and forth using EMOJIs. The ESP32 also has a built-in web server so when sending a picture is not enough, you can also send a text or some hidden images. The messages are queued and will even come in while the device is off. There is 1 button, used mostly for setting up the WIFI. Single clicking will do a random loop through the 6 visible EMOJIs, holding down for 6 seconds will reboot it and allow to set up the WIFI and MQTT details. I also used mDNS so while on your local network, you can go to HTTP://messageme.local on your home network to bring up the website. I decided I wasn't done, so I also added WebSockets to it so that if you are on the local website when messages are sent to the display, it will pop up on the website too. It's kind of like remote viewing what would have shown up on the display.

Grabbing the Data time on startup is important.  If it can't it reboots until it can.

When you receive a message and the display shows a message pending, once you click on it, it saves that datetime read to the eeprom.  Now if you receive more messages, it uses a REST query to grab the next message in the adafruit feed greater than the time the last message was read.  That is how it can know there are messages queued even after rebooting or its been off for X minutes. 

I wrote that code for a different display for friends and family to control my Christmas lights and send a message from a website.  I found if it can't grab the date, it defaults to something like 1970.  So now, I have 300 messages pending.  If I click a message, that is saved and now I have to manually click through all 300.  I was able to fix it manually, but for this device, I didn't want that to happen.  No date, no start.

  • 2 × ESP32 DevKit ESP-WROOM-32 Used the MakerFocus ESP32 Development Board
  • 2 × 2.4" Nextion Basic Display Nextion Basic Display 2.4'' NX3224T024 2.4inch TFT Resistive Touch Screen Panel 320X240
  • 2 × 3d printed 2.4 Nextion case replacing the connections with Magnets.
  • 16 × Mini Magnets Deryun 180 Pack Refrigerators Magnets Size: 6x2
  • 2 × Button OCR Tactile Push Button Switch ,8 Values 6x6mm Micro Momentary Tact Button Switches with Colorful Button Caps

View all 6 components

  • Paw Patrol update

    Trey Aughenbaugh09/29/2021 at 21:06 0 comments

    The display was changed to use Paw Patrol as the background.

    Also, update the built-in Website.

    Reorganized a few of the favorite icons so they can be sent easily from the Displays interface.

  • URL Fix / Enhancements

    Trey Aughenbaugh07/09/2021 at 04:21 0 comments

    I added this line to the document ready to prevent previous messages from getting sent from the phone's browser when the site is reopened.  This removes the get parameters from the URL.

    window.history.replaceState(null, null, window.location.pathname);

     My friend's granddaughter is now into Paw Patrol.  So I will probably change the background to that since I will have the device for a couple of days while I fix that bug.

    I might even add a few more images to be sent.  

    Oh, the top where the screen connects with screws has broken off as well.  Excited little fingers tend to push too hard.

    I'm going to print another, but increase the infill and possibly open in tinkercad and add some more bracing around the screw connections.


    Trey Aughenbaugh06/25/2021 at 15:34 0 comments

    I was using a GET request on the Build in Web form to post the message to the form, which then gets sent to the MQTT feed.

    What I found is that on my phone, sending a message, then moving onto another app, if I open chrome again, it refreshes the page and resends the same message, because its contained in the URL as a get request... /message.html?msg=GoodMorning

    So I either need to clear the url, or use a post.

    I like the get method, because that opens the door to also send messages just by typing the url and adding the required parameters.

    I found this document.

    Since I already handed off the devices, I'll have to set up something similar to test on.

  • Watchdog and Timeupdate

    Trey Aughenbaugh06/19/2021 at 18:57 0 comments

    Since there is no RTC, I added code to update the time once a week.

    I also added a watchdog timer in case it crashes.

    With the addition of the time check, I have it reboot itself every 4 weeks only after 2 AM.

    Hopefully, this keeps the device working flawlessly forever.

    The devices have been handed over for real-world testing since everything always works correctly on my bench/network/machine, etc.

  • Possible additions

    Trey Aughenbaugh06/11/2021 at 18:27 0 comments

    Find out why the web server chokes when serving all the static pages on the first load.

    If you are on the emoji screen and receive a new message, it wont know it yet.  Maybe after sending an emoji, also check the REST service again for the number of messages.

    Update the Website with a better header image for larger screens.

    If no Wifi, instead of going into a reboot frenzy, maybe after X attempts.  Display a message...  "Your wifi is down, press the button to reboot and Try again."

    There are two "modes" currently, add a 3rd for no wifi.

    Mode 0: Standard bootup and run the publish and subscribe.

    Mode 1: HOLDING down button while turning on or holding the button down for 6 seconds got into Mode 1.  It  disables publish and subscribe and be an AP for the config options.

    Mode 2: NEW..  No Wifi, do something different.

    Maybe add the ArduinoOTA library so I can send my friend any updates I think she should try so I can give this to her to enjoy now while I work on all the new fun.

  • Wrapping it all up!

    Trey Aughenbaugh06/11/2021 at 06:12 0 comments

    FInished the HTML files, resized the extra Emoji icons, including some special ones that her granddaughter will love.  One of her making a funny face as well as her mom.

    Got all the pages created on the NExtion.

    The main, page, the Emoji page and the Setup Page.

    Dumped a list of the files in a terminal window from SPIFF and created an excel formula to generate the file syntax for the 17 static files.

    example: server.serveStatic("/zepto.min.js", SPIFFS, "/zepto.min.js","max-age=86400");

    Change the credentials using the setup page to use my friend's io.adafruit credentials instead of mine.

    Put in an invalid Wifi password to make sure I would be able to reset the credentials without reprogramming it.

    Glued the MIcro USB connector and button in place. 

    Put the screen on, took the screen off, put the screen on and off a few more times enjoying the cool magnetic sound.

    Nonstick feet added too.

    Sent lots of messages back and forth from the displays as well as the webserver pages.

    No errors, seems to be ready.

  • Webserver, MQTT Publish and Subscribe

    Trey Aughenbaugh06/11/2021 at 05:21 0 comments

    The HTML file I used has %PLACEHOLDER_SENDFEED% and gets the text replaced with the details from the EEPROM before serving the page. 

    This was testing using the ESPAsyncWebServer processor. 

    Served several different files as static files but sometimes doing all those files at once causes the ESP32 to lockup and reboot.  Still looking into it.

    Only seems to happen on initial loads.  Once the files are cached, no problems.

    Setup a subscription feed to retrieve the message coming from the other device.

    All files are served, tried adding a websocket connection to send the retrieved subscribe even to the open websocket.  Worked!

  • ESP32 Webserver/AP

    Trey Aughenbaugh06/11/2021 at 04:47 0 comments

    Looked up using a captive portal and so many other wifi managers.

    Decided to just use a push button and display a simple HTML page pulling the details from EEPROM, and replacing text in a template HTML string.  Saving posts the data to EEPROM and reboots it.

    I created the webserver on start.  Learned how to serve up HTML files from SPIFFS.

    Used Visual Studio code to create the HTML file, with the images using the Miligram CSS file along with Zepto.js.

  • MQTT Test

    Trey Aughenbaugh06/11/2021 at 04:29 0 comments

    Setup a MQTT publish feed and send message on button click. 

    Tried to use 1 function for multiple buttons but could't get the button ID from Nextion so ended up creating 6 function, 1 for each emoji button.

  • Nextion/ESP32 test

    Trey Aughenbaugh06/11/2021 at 04:17 0 comments

    Setup a simple button on the Nextion display and setup the ESP32 to communicate and detect the button press.

View all 10 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates