<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Episode 21: GUI-O push notification from any device]]></title><description><![CDATA[<p dir="auto">This example shows how to create custom push notification on any Internet enabled device (WiFi, Ethernet) and send it to a targeted Android device.</p>
<p dir="auto"><strong>NOTE</strong>: Push notifications are available in GUI-O <strong>PRO</strong> version only.</p>
<p dir="auto"><strong>The code from this example can be combined with other GUI-O examples using MQTT, Classic Bluetooth or Low Energy Bluetooth</strong>. See <a href="https://www.gui-o.com/examples/gui-o-and-boards" rel="nofollow ugc">https://www.gui-o.com/examples/gui-o-and-boards</a>.</p>
<p dir="auto"><strong>Software prerequisites:</strong></p>
<ul>
<li>
<p dir="auto">Arduino IDE (<a href="https://www.arduino.cc/en/software" rel="nofollow ugc">https://www.arduino.cc/en/software</a>)</p>
</li>
<li>
<p dir="auto">Arduino source code (you can copy the source code from the snippet below, or download it <a href="https://drive.google.com/uc?export=download&amp;id=1tjrAR50XXDZ9dEz2BJah4jy11zTFT4Be" rel="nofollow ugc">here</a></p>
</li>
</ul>
<pre><code>/*
 * GUI-O Basic Push notification example
 *
 * Copyright (C) 2024, GUI-O Team
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */


#include &lt;WiFiClientSecure.h&gt;
#include &lt;HTTPClient.h&gt;
#include &lt;ArduinoJson.h&gt;

static const char* ssid = "&lt;ssid&gt;"; // router name
static const char* pass = "&lt;pass&gt;"; // router password
static const char* appUuid = "&lt;appUuid&gt;"; // application uuid (retrieve from GUI-O app)
static const char* resource = "https://apis.gui-o.com:9501/gui-o/resources/api/sendPushNotification"; // request resource / endpoint

static const char* letsencrypt_ca = \
"-----BEGIN CERTIFICATE-----\n" \
"MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw\n" \
"TzELMAkGA1UEBh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gMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\n" \
"HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq\n" \
"hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL\n" \
"ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ\n" \
"3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK\n" \
"NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5\n" \
"ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur\n" \
"TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC\n" \
"jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc\n" \
"oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq\n" \
"4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA\n" \
"mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d\n" \
"emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=\n" \
"-----END CERTIFICATE-----\n";

// Connection and requests handling
WiFiClientSecure client;
HTTPClient http;

// Icoming data buffer
String in;

void setup() {
  // Debug output
  Serial.begin(115200);
  
  // Connect WiFi (keep trying...)
  Serial.print("Connecting to ");
  Serial.println(ssid);
  
  // Start WiFi
  WiFi.begin(ssid, pass);
  while(WiFi.status() != WL_CONNECTED) { 
    Serial.print(".");
    delay(500); 
  }

  // Set root CA
  client.setCACert(letsencrypt_ca);
  
  Serial.println("WiFi connected!");
}

void loop() {
  while(Serial.available()) {
    const char c = Serial.read();
    in += c;
  
    if(c == '\n') {
      // Send push notification
      sendPushNotification("GUI-O push notification example", in.c_str(), appUuid);
      // clear buffer
      in = "";
    }  
  }  
}

void sendPushNotification(const char* title, const char* message, const char* appUuid) {
  DynamicJsonDocument jsonPayload(512);
  jsonPayload["appUuid"] = String(appUuid);
  jsonPayload["messageTitle"] = String(title);
  jsonPayload["messageText"] = String(message);

  String payload;
  serializeJson(jsonPayload, payload);

  if (http.begin(client, resource)) {
      http.addHeader("Content-Type", "application/json");

      const int httpCode = http.POST(payload);

      if (httpCode == HTTP_CODE_OK) {
        String response = http.getString();
        Serial.print("Response: ");
        Serial.println(response);
      } 
      else {
        Serial.print("Request failed. Status code: ");
        Serial.println(httpCode);
      }

      http.end();
  }
}
</code></pre>
<ul>
<li>GUI-O application (<a href="https://play.google.com/store/apps/details?id=com.guio.guioapp" rel="nofollow ugc">https://play.google.com/store/apps/details?id=com.guio.guioapp</a>)</li>
</ul>
<p dir="auto"><strong>Hardware prerequisites:</strong></p>
<ul>
<li>Any Internet enabled board (WiFi, Ethernet) that is compatible with Arduino IDE</li>
</ul>
<h3>1. Retrieve application's universally unique identifier (UUID)</h3>
<ul>
<li>
<p dir="auto">Open GUI-O application, navigate to settings and select "Info"</p>
</li>
<li>
<p dir="auto">Verify that the text "Available" is displayed under "Push notifications" entry</p>
</li>
<li>
<p dir="auto">Make a note of "Application UUID" (you can share the "Application UUID" by tapping on it)</p>
</li>
</ul>
<h3>2. Modify and upload the code</h3>
<ul>
<li>
<p dir="auto">Open Arduino IDE</p>
</li>
<li>
<p dir="auto">Select "File -&gt; Open"</p>
</li>
<li>
<p dir="auto">Navigate to location where BasicPushNotification.zip archive was extracted (if downloaded)</p>
</li>
<li>
<p dir="auto">Select BasicPushNotification.ino and confirm</p>
</li>
<li>
<p dir="auto">Set your router name and password</p>
</li>
<li>
<p dir="auto">Set your "Application UUID" (retrieved in form the GUI-O app)</p>
</li>
<li>
<p dir="auto">Make sure that your board is connected to your PC</p>
</li>
<li>
<p dir="auto">Ensure that the correct port and baud rate are selected</p>
</li>
<li>
<p dir="auto">Press upload button to start code upload</p>
</li>
</ul>
<h3>3. Send a push notification</h3>
<ul>
<li>
<p dir="auto">Open any serial terminal and connect to your board (baud rate 115200)</p>
</li>
<li>
<p dir="auto">Enter your push notification message on the serial terminal - the text must be terminated with the <strong>\n</strong> (new line) character.</p>
</li>
<li>
<p dir="auto">Observe the response on the serial terminal - if successful, message "Push notification sent" will be displayed</p>
</li>
<li>
<p dir="auto">Check the push notification on your Android device</p>
</li>
</ul>
<p dir="auto"><strong>NOTE</strong>: Customize the sound, vibration, LED light, and priority of GUI-O app notifications by navigating to "Android settings -&gt; Apps -&gt; Manage apps".</p>
<hr />
<p dir="auto">If you have any questions or run into any problems, please let me know!</p>
<p dir="auto">Best regards,<br />
kl3m3n</p>
]]></description><link>https://forum.gui-o.com/topic/171/episode-21-gui-o-push-notification-from-any-device</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 20:54:08 GMT</lastBuildDate><atom:link href="https://forum.gui-o.com/topic/171.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Jan 2024 15:43:07 GMT</pubDate><ttl>60</ttl></channel></rss>