Group Details Private

Global Moderators

Forum wide moderators

Member List

  • RE: Read the MAC address

    @sato

    Hello!

    GUI-O application cannot read MAC addresses due to Android security policy.

    There is no guarantee for a unique number that will persist even after factory reset. There is a ANDROID ID that persists through uninstall / install but can also change under some circumstances (such as developer using a new app signing key).

    GUI-O currently cannot return ANDROID ID value, but it is possible to implement.

    Can I ask why are you trying to achieve?

    Best regards,
    kl3m3n

    posted in Comments & Feedback
  • RE: Connects in Notify mode, but no data sent

    Here is a working example of Bluetooth LE with GUI-O, but it uses ESP32 module...

    https://forum.gui-o.com/topic/19/basic-bluetooth-le

    The tutorial video is coming soon.

    Hope this helps.
    Regards.

    posted in Report Bugs
  • Arduino & ESP32 - Basic USB

    GUI-O + Arduino + ESP32

    Developer manual: https://www.gui-o.com/assets/gui-o_developer_manual.pdf


    A DEMO project to help you quickly get started with GUI-O and USB using Esp32 board. You can expand the example for your specific project.

    Download BasicUSB.ino sketch from:
    https://drive.google.com/file/d/1IvShiEMM2jK9O2V9xGfT7XTkV95Iwk6m/view?usp=sharing

    Additional Boards Manager URLs:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

    /*
     * GUI-O Basic USB example 
     *
     * Copyright (C) 2021, GUI-O Team
     *
     * SPDX-License-Identifier: BSD-3-Clause
     */
    
    namespace led {
      static const uint8_t LED_BUILTIN = 2;
      static const uint8_t LED_CHANNEL = 0;
      static const double LED_FREQ = 5000.0;
      static const uint8_t LED_BITS = 8;
    } // namespace led
    
    // forward declare parser for incoming messages
    void parseGuioMsg(const String &msg);
    
    // icoming data buffer
    String in;
    
    void setup() {
      // setup serial
      Serial.begin(115200);
    
      // setup builtin led
      ledcSetup(led::LED_CHANNEL, led::LED_FREQ, led::LED_BITS); // channel, freq, resolution_bits
      ledcAttachPin(led::LED_BUILTIN, led::LED_CHANNEL);
    }
    
    void loop() {
      while(Serial.available()) {
        const char c = Serial.read();
        in += c;
      
        if(c == '\n') {
          // parse message string
          parseGuioMsg(in);
          // clear buffer
          in = "";
        }  
      }
    }
    
    /***************************/
    /* IMPLEMENT YOUR GUI HERE */
    /***************************/
    void parseGuioMsg(const String &msg) {
      if(msg.startsWith("@init")) {
        // clear screen and set background
        Serial.print("@cls\r\n");
        Serial.print("@guis BGC:#FFFFFF\r\n");
        delay(100);
    
        // initialize simple example GUI
        Serial.print("|LB UID:title X:50 Y:15 TXT:\"Simple light switch\" FFA:\"font8\" FSZ:3.5\r\n");
        Serial.print("|LB UID:tap_me X:50 Y:70 TXT:\"TAP ME!\" FFA:\"font8\" FSZ:3 FFA:\"font5\"\r\n");
        Serial.print("|CB UID:brightness X:50 Y:50 W:90 BTH:5 HAH:8 HAW:8 VIS:0 STA:135 ENA:45 FGC:#000000 SFGC:#FFFF00 BGC:#CBCBCB\r\n");
        Serial.print("|IM UID:light_off X:50 Y:50 IP:\"https://i.imgur.com/3VbsS0Z.png\" VIS:1\r\n");
        Serial.print("|IM UID:light_on X:50 Y:50 IP:\"https://i.imgur.com/gNdck9A.png\" VIS:0\r\n");
      }
      else if(msg.startsWith("@light_off")) {
        // "drive GUI-O app"
        Serial.print("@light_off VIS:0\r\n");
        Serial.print("@light_on VIS:1\r\n");
        Serial.print("@brightness VIS:1 VAL:100\r\n");
    
        // led enable
        ledcWrite(led::LED_CHANNEL, 255);
      }
      else if(msg.startsWith("@light_on")) {
        // "drive GUI-O app"
        Serial.print("@light_off VIS:1\r\n");
        Serial.print("@light_on VIS:0\r\n");
        Serial.print("@brightness VIS:0 VAL:0\r\n");
    
        // led disable
        ledcWrite(led::LED_CHANNEL, 0);
      }
      else if(msg.startsWith("@brightness")) {
        const int idx = msg.indexOf(' ');
        
        if(idx > 0) {
          const int val = msg.substring(idx + 1).toInt();
          
          if(val >= 0 && val <= 100) {
            // led drive
            ledcWrite(led::LED_CHANNEL, static_cast<uint8_t>(val * 2.55));
          }            
        }    
      }  
    }
    
    posted in Video Tutorials
  • Arduino & ESP32 - Basic Bluetooth LE

    GUI-O + Arduino + ESP32

    Developer manual: https://www.gui-o.com/assets/gui-o_developer_manual.pdf


    A DEMO project to help you quickly get started with GUI-O and Bluetooth Low Energy (BLE) using Esp32 board. You can expand the example for your specific project.

    Download BasicBLE.ino sketch from:
    https://drive.google.com/file/d/1a0Bu12UIyjZ9aeZ2VZ5yV6gpKvtLbs2A/view?usp=sharing

    Additional Boards Manager URLs:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

    /*
     * GUI-O Basic BLE example 
     *
     * Copyright (C) 2021, GUI-O Team
     *
     * SPDX-License-Identifier: BSD-3-Clause
     */
    
    #include <BLEDevice.h>
    #include <BLEServer.h>
    #include <BLEUtils.h>
    #include <BLE2902.h>
    
    namespace led {
      static const uint8_t LED_BUILTIN = 2;
      static const uint8_t LED_CHANNEL = 0;
      static const double LED_FREQ = 5000.0;
      static const uint8_t LED_BITS = 8;
    } // namespace led
    
    namespace uuid {
      static const char *SERVICE_UUID = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E";
      static const char *CHARACTERISTIC_UUID = "6E400002-B5A3-F393-E0A9-E50E24DCCA9E";
    } // namespace uuid
    
    // forward declare parser for incoming messages
    void parseGuioMsg(const String &msg);
    
    // custom handling of server callbacks
    class CustomBLEServerCallbacks: public BLEServerCallbacks {
        void onConnect(BLEServer* pServer) {
          Serial.println("Connected!");
        };
        void onDisconnect(BLEServer* pServer) {
          Serial.println("Disconnected!");
        }
    };
    
    // custom handling of characteristic callbacks
    class CustomBLECharacteristicCallbacks: public BLECharacteristicCallbacks {
      void onWrite(BLECharacteristic *pCharacteristic) {
        std::string msg = pCharacteristic->getValue();
        
        // parse message string
        parseGuioMsg(String(msg.c_str()));
      }      
    };
    
    // global ptr
    BLECharacteristic *pCharacteristic;
    
    void setup() {
      // debug output
      Serial.begin(115200);
    
      // setup builtin led
      ledcSetup(led::LED_CHANNEL, led::LED_FREQ, led::LED_BITS); // channel, freq, resolution_bits
      ledcAttachPin(led::LED_BUILTIN, led::LED_CHANNEL);
    
      // create device
      BLEDevice::init("BasicBLE");
      // create server and register callback
      BLEServer *pServer = BLEDevice::createServer();
      pServer->setCallbacks(new CustomBLEServerCallbacks());
      // create service
      BLEService *pService = pServer->createService(uuid::SERVICE_UUID);
      // crate characteristic, register callback and add descriptor
      pCharacteristic = pService->createCharacteristic(uuid::CHARACTERISTIC_UUID,
                                                       BLECharacteristic::PROPERTY_NOTIFY |
                                                       BLECharacteristic::PROPERTY_INDICATE |
                                                       BLECharacteristic::PROPERTY_WRITE |
                                                       BLECharacteristic::PROPERTY_READ);
      pCharacteristic->setCallbacks(new CustomBLECharacteristicCallbacks());
      pCharacteristic->addDescriptor(new BLE2902());
    
      // start the service and start advertising
      pService->start();
      pServer->getAdvertising()->start();
    }
    
    void loop() {
    }
    
    /***************************/
    /* IMPLEMENT YOUR GUI HERE */
    /***************************/
    void sendMsg(const String &msg) {
      pCharacteristic->setValue(std::string(msg.c_str()));
      pCharacteristic->notify();
      delay(50);
    }
    
    void parseGuioMsg(const String &msg) {
      if(msg.startsWith("@init")) {
        Serial.println("GUI-O app is requesting INITIALIZATION!");
    
        // clear screen and set background
        sendMsg("@cls\r\n");
        sendMsg("@guis BGC:#FFFFFF\r\n");
        delay(100);
    
        // initialize simple example GUI
        sendMsg("|LB UID:title X:50 Y:15 TXT:\"Simple light switch\" FFA:\"font8\" FSZ:3.5\r\n");
        sendMsg("|LB UID:tap_me X:50 Y:70 TXT:\"TAP ME!\" FFA:\"font8\" FSZ:3 FFA:\"font5\"\r\n");
        sendMsg("|CB UID:brightness X:50 Y:50 W:90 BTH:5 HAH:8 HAW:8 VIS:0 STA:135 ENA:45 FGC:#000000 SFGC:#FFFF00 BGC:#CBCBCB\r\n");
        sendMsg("|IM UID:light_off X:50 Y:50 IP:\"https://i.imgur.com/3VbsS0Z.png\" VIS:1\r\n");
        sendMsg("|IM UID:light_on X:50 Y:50 IP:\"https://i.imgur.com/gNdck9A.png\" VIS:0\r\n");    
      }
      else if(msg.startsWith("@light_off")) {
        Serial.println("GUI-O app is requesting LIGHT ON!");
    
        // "drive GUI-O app"
        sendMsg("@light_off VIS:0\r\n");
        sendMsg("@light_on VIS:1\r\n");
        sendMsg("@brightness VIS:1 VAL:100\r\n");
    
        // led enable
        ledcWrite(led::LED_CHANNEL, 255);
      }
      else if(msg.startsWith("@light_on")) {
        Serial.println("GUI-O app is requesting LIGHT OFF!");
    
        // "drive GUI-O app"
        sendMsg("@light_off VIS:1\r\n");
        sendMsg("@light_on VIS:0\r\n");
        sendMsg("@brightness VIS:0 VAL:0\r\n");
    
        // led disable
        ledcWrite(led::LED_CHANNEL, 0);
      }
      else if(msg.startsWith("@brightness")) {
        const int idx = msg.indexOf(' ');
        
        if(idx > 0) {
          const int val = msg.substring(idx + 1).toInt();
          
          if(val >= 0 && val <= 100) {
            Serial.print("GUI-O app is requesting LIGHT BRIGHTNESS: ");
            Serial.println(val);
    
            // led drive
            ledcWrite(led::LED_CHANNEL, static_cast<uint8_t>(val * 2.55));
          }            
        }    
      }  
    }
    
    
    posted in Video Tutorials
  • Arduino & ESP32 - Basic Bluetooth

    GUI-O + Arduino + ESP32

    Developer manual: https://www.gui-o.com/assets/gui-o_developer_manual.pdf


    A DEMO project to help you quickly get started with GUI-O and (classic) Bluetooth using Esp32 board. You can expand the example for your specific project.

    Download BasicBluetooth.ino sketch from:
    https://drive.google.com/file/d/1enW3ghvZDcW72ZqO4pWwTulHovmsBc8k/view?usp=sharing

    Additional Boards Manager URLs:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

    /*
     * GUI-O Basic Bluetooth example 
     *
     * Copyright (C) 2021, GUI-O Team
     *
     * SPDX-License-Identifier: BSD-3-Clause
     */
    
    #include "BluetoothSerial.h"
    
    // if not enabled, the SDK must be recompiled
    #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
    #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
    #endif
    
    namespace led {
      static const uint8_t LED_BUILTIN = 2;
      static const uint8_t LED_CHANNEL = 0;
      static const double LED_FREQ = 5000.0;
      static const uint8_t LED_BITS = 8;
    } // namespace led
    
    // forward declare parser for incoming messages
    void parseGuioMsg(const String &msg);
    
    // icoming data buffer
    String in;
    
    // global
    BluetoothSerial btSerial;
    
    void setup() {
      // debug output
      Serial.begin(115200);
      
      // setup bluetooth serial
      btSerial.begin("BasicBluetooth");
      
      Serial.println("Bluetooth ready to pair!");
    
      // setup builtin led
      ledcSetup(led::LED_CHANNEL, led::LED_FREQ, led::LED_BITS); // channel, freq, resolution_bits
      ledcAttachPin(led::LED_BUILTIN, led::LED_CHANNEL);
    }
    
    void loop() {
      while(btSerial.available()) {
        const char c = btSerial.read();
        in += c;
      
        if(c == '\n') {
          // parse message string
          parseGuioMsg(in);
          // clear buffer
          in = "";
        }  
      }
    }
    
    /***************************/
    /* IMPLEMENT YOUR GUI HERE */
    /***************************/
    void sendMsg(const String &msg) {
      btSerial.write((const uint8_t*) msg.c_str(), msg.length());
    }
    
    void parseGuioMsg(const String &msg) {
      if(msg.startsWith("@init")) {
        Serial.println("GUI-O app is requesting INITIALIZATION!");
        
        // clear screen and set background
        sendMsg("@cls\r\n");
        sendMsg("@guis BGC:#FFFFFF\r\n");
        delay(100);
    
        // initialize simple example GUI
        sendMsg("|LB UID:title X:50 Y:15 TXT:\"Simple light switch\" FFA:\"font8\" FSZ:3.5\r\n");
        sendMsg("|LB UID:tap_me X:50 Y:70 TXT:\"TAP ME!\" FFA:\"font8\" FSZ:3 FFA:\"font5\"\r\n");
        sendMsg("|CB UID:brightness X:50 Y:50 W:90 BTH:5 HAH:8 HAW:8 VIS:0 STA:135 ENA:45 FGC:#000000 SFGC:#FFFF00 BGC:#CBCBCB\r\n");
        sendMsg("|IM UID:light_off X:50 Y:50 IP:\"https://i.imgur.com/3VbsS0Z.png\" VIS:1\r\n");
        sendMsg("|IM UID:light_on X:50 Y:50 IP:\"https://i.imgur.com/gNdck9A.png\" VIS:0\r\n");
      }
      else if(msg.startsWith("@light_off")) {
        Serial.println("GUI-O app is requesting LIGHT ON!");
        
        // "drive GUI-O app"
        sendMsg("@light_off VIS:0\r\n");
        sendMsg("@light_on VIS:1\r\n");
        sendMsg("@brightness VIS:1 VAL:100\r\n");
    
        // led enable
        ledcWrite(led::LED_CHANNEL, 255);
      }
      else if(msg.startsWith("@light_on")) {
        Serial.println("GUI-O app is requesting LIGHT OFF!");
        
        // "drive GUI-O app"
        sendMsg("@light_off VIS:1\r\n");
        sendMsg("@light_on VIS:0\r\n");
        sendMsg("@brightness VIS:0 VAL:0\r\n");
    
        // led disable
        ledcWrite(led::LED_CHANNEL, 0);
      }
      else if(msg.startsWith("@brightness")) {
        const int idx = msg.indexOf(' ');
        
        if(idx > 0) {
          const int val = msg.substring(idx + 1).toInt();
          
          if(val >= 0 && val <= 100) {
            Serial.print("GUI-O app is requesting LIGHT BRIGHTNESS: ");
            Serial.println(val);
            
            // led drive
            ledcWrite(led::LED_CHANNEL, static_cast<uint8_t>(val * 2.55));
          }            
        }    
      }  
    }
    
    posted in Video Tutorials
  • RE: Connects in Notify mode, but no data sent

    Hello!

    Yes, you are correct - if the underlying descriptor supports notifications, the connection should be successful (a notification "Notifications for characteristic enabled" should be displayed and GUI-O should show "Connected" status).

    Yes, "Connected device not responding" means that GUI-O application received no data (which was expected in a certain time interval after pressing the initialization button).

    Firstly, you can try enabling local logging under the Developer mode menu. Navigate to Info menu and press Application version 10 times. A new menu entry should appear at the bottom (Developer mode). Please enable log incoming and log outgoing messages.

    Retry your setup and exit the GUI-O app. Use a file manager to navigate to Android/data/com.guio.guioapp/files and check in_messages and out_messages logs. Is there any data there?
    Note that for Android 11 you will probably need a PC to access this directory (due to Android restrictions).

    Next, you could also try ignoring the initialize button and send the data from your device to the GUI-O application after successful connection (you don't need to trigger the @init command, GUI-O can still receive data).

    I will try to check with my Bluetooth LE module tomorrow and will report back.

    Best regards

    posted in Report Bugs
  • RE: Add parameter to EXTF

    Hello!

    You mean like a boolean flag to enable / disable date time prepending to each line in a file. For example:

    [date_time] text
    [date_time] text2
    ...
    

    when flag is enabled and

    text
    text2
    ...
    

    when flag is disabled?

    Can you confirm this?

    Thanks.

    posted in Wishlist
  • Add touch area to image widget

    Currently, a transparent button needs to be overlaid over the image in order to achieve touch effect. Please consider implementing touch area functionality for the image widget.

    posted in Wishlist
  • RE: BSL

    Hello gammda!

    Thank you for trying the GUI-O application. I hope you will find it useful for your use cases.

    Regarding your question... The line's rotation point is located at the start of the line. Specifying the rotation of 37 degrees means that the rotation is performed CCW (counter clockwise). To perform the CW (clockwise rotation, set the value to -37 degrees).

    In order to extend the line to the edge of the screen you need to use a little trigonometry trick to calculate the new length:

    new_length = current_length / cos(37°) = 100 / cos(37°) = 125.2
    

    So, your initialization must be modified to:

    |BSL UID:bsl3 X:0 Y:50 ROT:37 LEN:125.2
    

    NOTE THAT PARAMETER AND VALUE MUST NOT BE SPACE SEPARATED, e.g., ROT:37 works, while ROT: 37 does not!

    Hope you do some interesting project with the GUI-O application. You can always share them in our Share your projects category.

    Best regards,
    kl3m3n

    posted in General Discussion