GUI-O Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. kl3m3n
    K
    • Profile
    • Following 0
    • Followers 0
    • Topics 35
    • Posts 251
    • Best 0
    • Controversial 0
    • Groups 2

    kl3m3n

    @kl3m3n

    0
    Reputation
    22
    Profile views
    251
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.gui-o.com

    kl3m3n Unfollow Follow
    Global Moderator administrators

    Latest posts made by kl3m3n

    • RE: GUI-O with Nano 33 BLE and the ArduinoBLE Library

      @VNB Hi!

      Can you open GUI-O and navigate to "Settings->Info" and tap on "Powered by GUI-O version" 10 times. At the bottom, a new menu (Developer mode) should appear. From this menu, you can enable "Log incoming messages".

      You can then repeat the procedure with Arduino Nano and exit the GUI-O application when done. Then you can open the GUI-O files folder (best viewed on PC) and check the contents of the incoming log file. Does the log show setting the CB value to 100 (or higher, but gets limited at 100) when the CB widget "jumps" to 100?

      Note that the log file is overwritten on next GUI-O start.

      Don't forget to disable logging when done.

      Best regards,
      kl3m3n

      posted in Comments & Feedback
      K
      kl3m3n
    • RE: GUI-O with Nano 33 BLE and the ArduinoBLE Library

      @VNB said in GUI-O with Nano 33 BLE and the ArduinoBLE Library:

      2.) Once the brightness is adjusted then the Nano Yellow LED STAYS on at the selected brightness even though the "on" and "off" light bulb image toggles okay and Serial Monitor correctly displays "GUI-O app is requesting LIGHT ON!" and "GUI-O app is requesting LIGHT OFF!". That was fixed by always keeping the 'ledPin' in the 'analog' mode by changing digitalWrite(ledPin, HIGH); to analogWrite(ledPin, 0); and digitalWrite(ledPin, LOW); to analogWrite(ledPin, 255);

      Ok, my mistake. The digitalWrite overrides the analogWrite, disabling the PWM.

      @VNB said in GUI-O with Nano 33 BLE and the ArduinoBLE Library:

      1.) The Slider Control knob always stayed at 100% even if it is set to a low brightness. That was fixed by adding the following instruction in the "led drive" section.
      sendMsg("@brightness VIS:1 VAL:val\r\n");

      This is strange and requires further investigation... It seems that the @light_on is called - this can be the only reason that sets the slider value to 100... Something is not working correctly.

      @VNB said in GUI-O with Nano 33 BLE and the ArduinoBLE Library:

      sendMsg("@brightness VIS:1 VAL:val\r\n");

      This sends the literal "val", not the actual brightness value.

      I suggest you put some Serial.print's at the beginning of the message parsing function to see what happens.

      Best regards,
      kl3m3n

      posted in Comments & Feedback
      K
      kl3m3n
    • RE: Read text file in to TA widget

      @Sato You currently cannot read the file from the back. This functionality can be added though. I will see what I can do with the next release.

      You can read individual lines with FAC:2 and FP: parameter (the last 10), but you need to know the number of lines in the file upfront...

      Best regards,
      kl3m3n

      posted in Comments & Feedback
      K
      kl3m3n
    • RE: GUI-O with Nano 33 BLE and the ArduinoBLE Library

      @VNB Hi.

      I have not tested this (don't have Arduino Nano 33 BLE), so I don't guarantee correctness of the code (it compiles fine). It should get you started though (I suggest using serial to debug). Please give some feedback.

      Best regards,
      kl3m3n

      /*
        GUI-O BLE example (Nano 33 BLE)
      */
      
      #include <ArduinoBLE.h>
      
      const int ledPin = LED_BUILTIN; // set ledPin to on-board LED
      const int maxMsgLength{256};
      
      BLEService guioService("0000FFE0-0000-1000-8000-00805F9B34FB"); // create service
      
      // create gui-o (string) characteristic and allow remote device to read and write
      BLEStringCharacteristic guioCharacteristic("0000FFE1-0000-1000-8000-00805F9B34FB", BLERead | BLEWrite | BLENotify | BLEIndicate, maxMsgLength);
      
      void setup() {
        Serial.begin(9600);
        while (!Serial);
      
        pinMode(ledPin, OUTPUT); // use the LED as an output
      
        // begin initialization
        if (!BLE.begin()) {
          Serial.println("starting Bluetooth® Low Energy module failed!");
      
          while (1);
        }
      
        // set the local name peripheral advertises
        BLE.setLocalName("GUI-O_BLE");
        // set the UUID for the service this peripheral advertises:
        BLE.setAdvertisedService(guioService);
      
        // add the characteristics to the service
        guioService.addCharacteristic(guioCharacteristic);
      
        // add the service
        BLE.addService(guioService);
      
        // assign event handlers for connected, disconnected to peripheral
        BLE.setEventHandler(BLEConnected, [](BLEDevice central) -> void {
          Serial.println("Connected!");
        });
        BLE.setEventHandler(BLEDisconnected, [](BLEDevice central) -> void {
          Serial.println("Disconnected!");
        });
      
        // assign event handlers for characteristic
        guioCharacteristic.setEventHandler(BLEWritten, parseGuioMsg);
      
        // start advertising
        BLE.advertise();
      
        Serial.println("Bluetooth® device active, waiting for connections...");
      }
      
      void loop() {
        // poll for Bluetooth® Low Energy events
        BLE.poll();
      }
      
      /***************************/
      /* IMPLEMENT YOUR GUI HERE */
      /***************************/
      void sendMsg(const String &msg) {
        guioCharacteristic.writeValue(msg);
        delay(50);
      }
      
      void parseGuioMsg(BLEDevice central, BLECharacteristic characteristic) {
        const uint8_t* value = characteristic.value();
        const int length = characteristic.valueLength();
      
        const String msg(reinterpret_cast<const char*>(value), length);
      
        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
          digitalWrite(ledPin, HIGH);
        }
        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
          digitalWrite(ledPin, LOW);
        }
        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
              analogWrite(ledPin, static_cast<uint8_t>(val * 2.55));
            }            
          }    
        }  
      }
      
      
      
      posted in Comments & Feedback
      K
      kl3m3n
    • RE: failure in v1.0.53.1

      @Hub said in failure in v1.0.53.1:

      @kl3m3n Hello,

      I checked the simple project (labels, buttons). In version 1.0.53.1 everything worked fine. In version 1.0.54.1 there is also no problem.

      Best regards,
      Hub

      Thank you very much for the feedback!

      Can you just let me know what is your Android version?

      Best regards,
      kl3m3n

      posted in Report Bugs
      K
      kl3m3n
    • RE: failure in v1.0.53.1

      @Sato Thank you for the info.

      I see based on application uid that you made an update, not reinstall. Is this correct?

      Does your solution use NFC? I am trying to establish if NFC caused your problems.

      Best regards,
      kl3m3n

      posted in Report Bugs
      K
      kl3m3n
    • RE: failure in v1.0.53.1

      @kl3m3n update v1.0.54 is being released today, which includes some fixes that were left out in v1.0.53. Can you also check this?

      Thank you.
      Best regards,
      kl3m3n

      posted in Report Bugs
      K
      kl3m3n
    • RE: failure in v1.0.53.1

      @Sato Hello Sato.

      There was a problem with GUI-O v1.0.52 update, but v1.0.53 update should work.
      How do you know you are using v1.0.53? Can you tell me your Android version?

      Can you try re-installing (removing and installing again)?

      Please let me know.

      Best regards,
      kl3m3n

      posted in Report Bugs
      K
      kl3m3n
    • RE: GUI-O with Nano 33 BLE and the ArduinoBLE Library

      Hi!

      Give me a couple of days, and I will try to modify the example you've provided.

      I will post the result here.

      Best regards
      kl3m3n

      posted in Comments & Feedback
      K
      kl3m3n
    • RE: GUIO File System Access

      @enniom Hi!

      Currently there is no such feature to store the files outside the application folder. I will take a look into this a bit after I make some necessary adjustments to fully support targeting Android 13.

      Best regards,
      kl3m3n

      posted in General Discussion
      K
      kl3m3n