{"id":40822,"date":"2021-02-19T19:19:36","date_gmt":"2021-02-19T11:19:36","guid":{"rendered":"\/blog\/?p=40822"},"modified":"2021-02-21T19:01:58","modified_gmt":"2021-02-21T11:01:58","slug":"build-an-mqtt-intercom-with-wio-terminal-with-code","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/","title":{"rendered":"Build an MQTT Intercom with Wio Terminal (with Code!)"},"content":{"rendered":"\n<p>In today\u2019s article, we are going to build an Arduino wireless intercom with our Wio Terminal! This project sets up your Wio Terminal as a desk clock, but also allows you to send and receive messages to other devices via the MQTT protocol.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1030\" height=\"601\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-1030x601.png\" alt=\"\" class=\"wp-image-40836\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-1030x601.png 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-300x175.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-768x448.png 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-1024x597.png 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png 1500w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wireless Intercom <strong>Background &amp; Overview<\/strong><\/h2>\n\n\n\n<p>I had dinner at a friend\u2019s place over the Lunar New Year holidays, and they had trouble calling everyone to the table. That\u2019s when someone aptly remarked that some kind of intercom would be so useful! Sadly, a quick online search revealed that modern intercom systems cost anywhere from USD 1500 to 6000 for hardware and installation &#8211; that\u2019s huge!<\/p>\n\n\n\n<p>In addition, for many of us, it is an absolute must to be distraction free while working. This means that our mobile phones might be put away with notifications turned off, rendering us unreachable. With the WFH (work from home) situation persisting in many areas around the globe, we\u2019re going to need an easy yet non-intrusive way of still carrying out essential household communications.<\/p>\n\n\n\n<p>All of that said, why not build our very own wireless intercom system with&nbsp;Wio Terminal and Arduino? That way, we\u2019ll gain similar conveniences at just a fraction of the cost!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Let\u2019s first take a look at the short demo video that I\u2019ve made for this project.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2021\/02\/Wireless-Intercom-Demo-Compressed-1.gif\" alt=\"\" class=\"wp-image-40824\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In summary, we will want to achieve three things on our Wio Terminal in this project:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Display the date and time in realtime<\/li><li>Be able to receive \/ send messages over WiFi<\/li><li>Build a GUI for user navigation<\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s an <strong>Intercom<\/strong>?<\/h2>\n\n\n\n<p>Intercom is short for intercommunication device. Traditionally, an intercom is any electrical device that allows for one-way or two-way communication. One common use of intercoms is in housing estates, where home owners can let guests into the compound without having to physically open the gate. Some homes or offices may also have intercom systems to allow for convenient communication.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2021\/02\/licensed-image-1030x687.jpeg\" alt=\"\" class=\"wp-image-40846\" width=\"700\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-1030x687.jpeg 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-300x200.jpeg 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-768x512.jpeg 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-1536x1025.jpeg 1536w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-1024x683.jpeg 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image-675x450.jpeg 675w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/licensed-image.jpeg 2048w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><figcaption>A Housing Estate Intercom, Source: KTLA<\/figcaption><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Brief on MQTT Communication<\/strong><\/h2>\n\n\n\n<p>To send messages over WiFi, we are going to use the lightweight <a href=\"https:\/\/mqtt.org\/\">MQTT<\/a> (or Message Queuing Telemetry Transport) protocol. MQTT is a publish\/subscribe messaging protocol that works on top of our existing internet connection (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Internet_protocol_suite\">TCP\/IP<\/a>).<\/p>\n\n\n\n<p>The pub\/sub structure works by linking different devices based on the <strong><em>topics<\/em><\/strong> that they subscribe or publish to. In the graphic below, the Temperature Sensor publishes to the <strong><em>temperature<\/em><\/strong> topic, which the Mobile device and Backend system are both subscribed to. Thus, both of them will receive the message of \u201c24 <sup>o<\/sup>C\u201d.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/6ODMRmHL0zUMJIM1Iek9nNyLP8BYS4O8DM7lryXiPuLhLfg6y0qvu65AKfnZrWBqfxxUAmGEgNJlyNCmA-l9pQDwltaPc-ZN1U7Tv45e5cyI2mLn7IRbJ8rcNC7oB3pErH--RPQ1\" alt=\"\" width=\"800\" \/><figcaption>MQTT Pub\/Sub Architecture, Source: MQTT.org<\/figcaption><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The device that coordinates the publishers and the subscribers of a given topic is known as the MQTT broker. You can think of the broker as the \u201cbrain\u201d of our IoT network that coordinates communication between all our connected devices &#8211; communication would be messy and impossible without it!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Tools Required<\/strong><\/h2>\n\n\n\n<p>To follow along or implement this project for your own use, you will need the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/Wio-Terminal-p-4509.html\">Wio Terminal<\/a> x2 (or as many as you\u2019d like in your use-case)<\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-4GB-p-4077.html\">Raspberry Pi 4B 4GB<\/a> x1 (for our MQTT Broker)<\/li><li>A working local internet connection<\/li><\/ol>\n\n\n\n<p>While a <a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-3-Model-B--p-3037.html\">Raspberry Pi 3<\/a> or a <a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-Zero-W-p-4257.html\">Raspberry Pi Zero W<\/a> would also serve our purposes as an MQTT broker, I highly recommend getting the latest Pi 4B for more computing power that might be useful for your future projects!<\/p>\n\n\n\n<p>Naturally, you can also use any Arduino compatible board with an LCD screen in place of the Wio Terminal. However, you will need to handle wiring and also add additional buttons to make full use of today\u2019s Arduino wireless intercom project, as well as reconfigure the code to work with your hardware pins!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Set up Raspberry Pi MQTT Broker<\/strong><\/h2>\n\n\n\n<p>First, we have to set up our Raspberry Pi as our MQTT broker, which will manage and route the topics and messages between our devices. If you haven\u2019t set up an internet connection on your Raspberry Pi before, please first visit our <a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/01\/25\/three-methods-to-configure-raspberry-pi-wifi\/\">How To: 3 Methods to Configure Raspberry Pi WiFi<\/a> article.<\/p>\n\n\n\n<p>Run the following two commands in your Raspberry Pi command line interface to install the Mosquitto MQTT platform.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install -y mosquitto mosquitto-clients<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Next, run the following to enable the mosquitto service. This will make the MQTT service run on your Pi at boot, so it will automatically serve as the broker whenever it\u2019s powered on and connected to the internet.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable mosquitto.service<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Finally, before we dive into how to publish and subscribe to various topics, run:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>ifconfig wlan0<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Look at the output next to \u201cinet\u201d. This is the IP address of your Raspberry Pi. Record this down for later use, as we\u2019ll need it for our Wio Terminal\u2019s Arduino code.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/v0ZPufDX7jdgqr0vc59NEBWJGEZaUXV9HjSyzDzitUGiJisP-23S2McFvD4QCQYPEXACRJtAUPDNSw_bqg3lenpBvb3ak_h9cHkoi-gKJj0EzP-EHVR3JdM2ZhxhvEfssNplKQsI\" alt=\"\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>MQTT: Publishing &amp; Subscribing<\/strong><\/h2>\n\n\n\n<p>Before we jump into programming our Wio Terminal, it\u2019s good to check that our Raspberry Pi MQTT broker is working as intended. We\u2019ll first set up a listener to a topic with the following command.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>mosquitto_sub -t \"testtopic\"<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>As you might be able to guess, the -t parameter marks the topic that we are subscribing to. In this case, it is simply <strong><em>testtopic<\/em><\/strong>.<\/p>\n\n\n\n<p>Now, open a new window on your terminal and run the following command to publish a test message to the same topic.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>mosquitto_pub -t \"topic\" -m \"test message\"<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The words \u201ctest message\u201d should now appear on your first terminal window.<\/p>\n\n\n\n<p>Congratulations! You\u2019ve just sent your very first MQTT message.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Wildcard Subscriptions<\/strong><\/h3>\n\n\n\n<p>MQTT topics are structured similarly to our computers\u2019 file directory systems. For example, under a single <strong><em>device<\/em><\/strong> topic, we can have two other subtopics such as <strong><em>status<\/em><\/strong> and <strong><em>message<\/em><\/strong>.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>device1\/status\ndevice1\/message<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>This is useful to know when we want to use a wildcard subscription. For example, a topic of <strong><em>\u201c+\/status\u201d<\/em><\/strong> will subscribe us to the <strong><em>status<\/em><\/strong> topics of all devices available. We will use this later on to reach all the devices in our network with a single publish.<\/p>\n\n\n\n<p>To learn more about wildcards in MQTT communication, <a href=\"https:\/\/www.hivemq.com\/blog\/mqtt-essentials-part-5-mqtt-topics-best-practices\/\">this article on HiveMQ<\/a> is a good read.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Wio Terminal: Installing the Required Libraries<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>If this is your first time working with your Wio Terminal, it\u2019s highly recommended that you visit <a href=\"https:\/\/wiki.seeedstudio.com\/Wio-Terminal-Getting-Started\/\">this page<\/a> to install the required basic libraries for getting started.<\/li><li>Next, follow the instructions at <a href=\"https:\/\/wiki.seeedstudio.com\/Wio-Terminal-Network-Overview\/\">this link<\/a> to set up the WiFi capabilities on your Wio Terminal. This will involve updating the firmware of your Wio Terminal and installing several Arduino libraries.<\/li><li>Following that, download the Seeed RTC Library as a ZIP from <a href=\"https:\/\/github.com\/Seeed-Studio\/Seeed_Arduino_RTC\">this link<\/a> and install it with your Arduino IDE.<\/li><li>Finally, install the PubSubClient through the Arduino Library Manager, under Tools &gt; Manage Libraries.<\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/QzSdJGTokj_iYf0Hjw4OtYxQSBmPHjmH0tFzS17mfoBdK6D6MnB90i1L6iKZQIVww9ZzBH7wxciGfVJdXfuS14nh1CEg-2u3XAw6Lh0cddFEA2T8NUhqVKHQO9OBEWKF2yYE1wwy\" alt=\"\" width=\"700\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Implementing the Arduino Code<\/strong><\/h2>\n\n\n\n<p>First, download the code from <a href=\"https:\/\/github.com\/supperted825\/WioTerminal_Intercom\">this Github repository<\/a> and open the WioTerminal_Intercom.ino file with your Arduino IDE.<\/p>\n\n\n\n<p>Although the Arduino code is mostly ready for use, there are a few things you need to adjust for your own use-case before flashing. First, find the following two lines and replace the SSID and password with your WiFi information. Take note that this has to be the same network that your Raspberry Pi is connected to.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>const char *ssid = \"YourWiFiSSID\";\nconst char *password = \"YourWiFiPassword\";<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Then, change the broker IP Address to the IP address that you took down from your Raspberry Pi in our earlier steps. Replace the \u201c.\u201d (dots) in your IP address with \u201c,\u201d (commas) for this input.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>IPAddress broker(192,168,1,111); &nbsp; \/\/ If your broker IP is 192.168.1.111<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The next step is to update the preset messages as desired. These are the messages that you can send out from your Wio Terminal. You will also need to update the number of messages in the num_messages variable accordingly.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>int num_messages = 4;\nconst char *messages&#091;] = {\n  \"I need help!\",\n  \"Food is ready!\",\n  \"Give me 5 minutes!\",\n  \"I'll take awhile.\"\n};<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Finally, for each Wio Terminal that you flash this sketch on, you will want to allocate a unique device ID to that device so that the MQTT broker can identify the device. Also update the PUBTOPIC to \u201c&lt;ID&gt;\/messages\u201d. We will use this to indicate the sender of the messages we receive in the GUI.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>const char *ID = \"&lt;MyID&gt;\";&nbsp; \/\/ Must be unique\nconst char *PUBTOPIC = \"&lt;MyID&gt;\/messages\";<\/code><\/pre>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wireless Intercom <strong>Arduino Code: Things to Note<\/strong><\/h2>\n\n\n\n<p>In this section, I will briefly cover some parts of the Arduino code which are important to enabling the functions of our Wio Terminal Arduino Wireless Intercom.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Pub\/Sub Structure<\/strong><\/h3>\n\n\n\n<p>The Arduino sketch has been designed so that all devices in the network will publish to their individual \u201c<strong><em>&lt;ID&gt;\/messages\u201d<\/em><\/strong> topics, while being subscribed to the messages published by all devices with the <strong><em>\u201c+\/messages\u201d<\/em><\/strong> topic.<\/p>\n\n\n\n<p>This essentially converges all the messages being sent through the broker into a single stream that can be accessed by all devices.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Trj9RN6iwNNIjlomiNzIjqJJnoX5CYTNyHhb6bhBy5j9jav3sk6qXJtry4X6PRbJLoqxvN5roomVP2b1CXPg6iXs2OFhDdL_JLFHFw4zR68HZGh4fhNcCxB9wBhLTcpyPatgmcan\" alt=\"\" width=\"800\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Parsing Incoming Messages<\/strong><\/h3>\n\n\n\n<p>In the setup() function, I set a callback for our PubSubClient by calling<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>client.setCallback(callback)<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>This defines a callback function that will be run every time we publish a message or when client.loop() is called to maintain the connection. In our Arduino code today, the callback function is defined as follows:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>void callback(char* topic, byte* payload, unsigned int length) {\n  String response, identity;\n  if (payload &amp;&amp; strcmp(topic,PUBTOPIC) != 0) {\n    for (int i = 0; i &lt; length; i++) {\n      response += (char)payload&#091;i];\n    }\n    for (int i = 0; i &lt; (strlen(topic)-9) ; i++) {\n      identity += (char)topic&#091;i];\n    }\n    fadetxt(identity + \":\", FSS9, 40, 250, 160, TC_DATUM);\n    fadetxt(response, FSS9, 40, 280, 240, TC_DATUM);\n    alarm();\n  }\n}<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Because our Wio Terminal is subscribed to all the<strong><em> \u201c\/messages\u201d<\/em><\/strong> topics, it is also subscribed to its own topic. In order to avoid receiving our own messages, a conditional statement is added where the received payload is only parsed and displayed if the incoming topic and the Wio Terminal\u2019s own topic is not the same.<\/p>\n\n\n\n<p>In addition, the identity of the device from which the incoming message is sent is also parsed by removing the \u201c\/messages\u201d tail of the incoming topic. For example, \u201cWioTerminal2\/messages\u201d will simply become \u201cWioTerminal2\u201d.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Keeping Time: RTC &amp; NTP<\/strong><\/h3>\n\n\n\n<p>The sharp ones among you would have noticed that the time displayed in my demo video was completely incongruent with daylight!<\/p>\n\n\n\n<p>The date and time is passed onto the Wio Terminal at compile time, and is maintained by the RTC (real time clock) module on the device. Hence, it is critical to avoid the use of the standard delay() function, since it is blocking and will introduce inaccuracies in the time kept over time. Instead, you will find that I have replaced all the delays with a millisDelay() function which is non blocking and will not affect timekeeping.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>void millisDelay(int duration) {\n    long timestart = millis();\n    while ((millis()-timestart) &lt; duration) {};\n}<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Nonetheless, relying solely on compile time and the RTC module is a limitation, since the module stops if the Wio Terminal is ever switched off after flashing. Hence, it would be ideal to obtain NTP time via the internet from the NTP server in the setup of our Arduino. This will ensure that the time displayed on the Wio Terminal is accurate, even if it has been switched off previously.<\/p>\n\n\n\n<p>Visit <a href=\"https:\/\/wiki.seeedstudio.com\/Wio-Terminal-RTC\/\">here<\/a> if you want to find out how to add this functionality to your code.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Smooth Graphics: Fading In &amp; Out<\/strong><\/h3>\n\n\n\n<p>For this project, I wanted to implement a smooth graphical user interface with the use of fading in and out of the displayed text. This can be done with a simple for loop like so:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sp.setTextColor(TFT_BLACK);\nint r = 0; int g = 0; int b = 0;\nfor (int j = 0; j &lt; 127; j++) {\n    int color = sp.color565(r += 2, g += 2, b += 2);\n    sp.setTextColor(color);\n    if (datum == TL_DATUM) sp.drawString(text, 0, 0);\n    if (datum == TC_DATUM) sp.drawString(text, 80, 0);\n    sp.pushSprite(x,y);\n}<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>We essentially initialise the text colour to the background colour of black, and continuously push the text with incremental colours towards the white RGB values of r = g = b = 255. This produces the effect of a fade in. Conversely, to achieve a fade out, we can initialise the text to white and incrementally push new colours towards the black RGB values.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>And that concludes today&#8217;s tutorial on how to build a Arduino wireless intercom with your Wio Terminal. Let me know what kind of messages you will send or interesting things you will achieve with this device!<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/pwb7xbXv6p9g6QGi2Wk3EgfnrZcZfaSd_b9skXxPpJ1KGIdX0Q8Q5uc8GcKfXukgPJCPynfy60xHkhqRN7WOC6yQYEzF0aql0Sf3yYtfwDs5kvruFjEPqD1dLLL8sTRgjteFk1bF\" alt=\"\" width=\"700\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If you are interested to try other Wio Terminal projects, please check out:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/04\/wio-terminal-arduino-customisable-timer-with-code\/\">Wio Terminal: Arduino Customisable Timer (with Code!)<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/08\/wio-terminal-arduino-smart-doorbell-with-code\/\">Wio Terminal: Arduino Smart Doorbell (with Code!)<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/01\/19\/tiny-ml-with-wio-terminal-1-intro\/\">Learn TinyML using Wio Terminal and Arduino IDE #1 Intro<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/03\/learn-tinyml-using-wio-terminal-and-arduino-ide-2-audio-scene-recognition-and-mobile-notifications\/\">Learn TinyML using Wio Terminal and Arduino IDE #2 Audio Scene Recognition and Mobile Notifications<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In today\u2019s article, we are going to build an Arduino wireless intercom with our Wio<\/p>\n","protected":false},"author":3537,"featured_media":40836,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[3229,3228,3003,3678],"class_list":["post-40822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-mosquitto","tag-mqtt","tag-wio-terminal","tag-wio-terminal-project"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio<\/title>\n<meta name=\"description\" content=\"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-19T11:19:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-21T11:01:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"875\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jonathan Tan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan Tan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/\",\"name\":\"Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png\",\"datePublished\":\"2021-02-19T11:19:36+00:00\",\"dateModified\":\"2021-02-21T11:01:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/61e29862da8741ee517eacd92f4cd094\"},\"description\":\"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png\",\"contentUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png\",\"width\":1500,\"height\":875},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build an MQTT Intercom with Wio Terminal (with Code!)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/61e29862da8741ee517eacd92f4cd094\",\"name\":\"Jonathan Tan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8dd1a4a7882386e8818e110c9322897?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8dd1a4a7882386e8818e110c9322897?s=96&r=g\",\"caption\":\"Jonathan Tan\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/jonathan-tan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio","description":"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/","og_locale":"en_US","og_type":"article","og_title":"Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio","og_description":"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!","og_url":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2021-02-19T11:19:36+00:00","article_modified_time":"2021-02-21T11:01:58+00:00","og_image":[{"width":1500,"height":875,"url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png","type":"image\/png"}],"author":"Jonathan Tan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan Tan","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/","url":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/","name":"Build an MQTT Intercom with Wio Terminal (with Code!) - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png","datePublished":"2021-02-19T11:19:36+00:00","dateModified":"2021-02-21T11:01:58+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/61e29862da8741ee517eacd92f4cd094"},"description":"Create a Wio Terminal Arduino Wireless Intercom with this detailed tutorial! Send messages conveniently over WiFi and never be late for dinner again!","breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#primaryimage","url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png","contentUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png","width":1500,"height":875},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/19\/build-an-mqtt-intercom-with-wio-terminal-with-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Build an MQTT Intercom with Wio Terminal (with Code!)"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/61e29862da8741ee517eacd92f4cd094","name":"Jonathan Tan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8dd1a4a7882386e8818e110c9322897?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8dd1a4a7882386e8818e110c9322897?s=96&r=g","caption":"Jonathan Tan"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/jonathan-tan\/"}]}},"modified_by":"Jonathan Tan","views":6762,"featured_image_urls":{"full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png",1500,875,false],"thumbnail":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-80x80.png",80,80,true],"medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-300x175.png",300,175,true],"medium_large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-768x448.png",640,373,true],"large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-1030x601.png",640,373,true],"1536x1536":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png",1500,875,false],"2048x2048":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png",1500,875,false],"visody_icon":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png",32,19,false],"magazine-7-slider-full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1.png",1500,875,false],"magazine-7-slider-center":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-936x875.png",936,875,true],"magazine-7-featured":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-1024x597.png",1024,597,true],"magazine-7-medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-720x380.png",720,380,true],"magazine-7-medium-square":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/02\/Copy-of-Clean-5-1-675x450.png",675,450,true]},"author_info":{"display_name":"Jonathan Tan","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/jonathan-tan\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/40822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/3537"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=40822"}],"version-history":[{"count":16,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/40822\/revisions"}],"predecessor-version":[{"id":40878,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/40822\/revisions\/40878"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media\/40836"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=40822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=40822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=40822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}