• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
GUI-O Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login

Hello Gui-O - I'm alive

Scheduled Pinned Locked Moved
General Discussion
2
14
652
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    Sato @Sato
    last edited by 21 Feb 2024, 21:39

    @Sato

    Hello kl3m3n and community,

    I've been thinking about the question I asked about Alive and I've designed something for you to see if it might work. I think kl3m3n will be the one who can best answer this and maybe even help.

    Alive.png

    Regards

    K 1 Reply Last reply 22 Feb 2024, 19:18 Reply Quote 0
    • K
      kl3m3n @Sato
      last edited by kl3m3n 22 Feb 2024, 19:18

      @Sato Hi!

      I think the best way to achieve this is to use a redundant ESP32 just for "alive" functionality. Push notifications can than be used to deliver the failure messages to the Android device even if GUI-O app is not running (as they run on top of Google messaging service).

      But, GUI-O app cannot monitor this, because:

      1. It can only connect to a single device at a time. It does not make sense that multiple devices control a single GUI. Major changes to logic and app functionality would be needed.

      2. It cannot run reliably in the background due to Android process handling. App can be killed anytime if the Android OS deems it necessary.

      Best regards,
      Klemen

      S 1 Reply Last reply 22 Feb 2024, 19:58 Reply Quote 0
      • S
        Sato @kl3m3n
        last edited by 22 Feb 2024, 19:58

        Hello @kl3m3n,

        I also think that the solution is a redundant ESP32 that will only serve to receive and process the periodic Alive signals, and if one fails, it will send an IoT notification with the ID of the failed device.
        As such, it seems possible. What I still don't know how to do is create this subscription token of Alive channel to the redundant ESP32. Could you help with a example?

        Thank you

        Best regards

        K 1 Reply Last reply 23 Feb 2024, 20:55 Reply Quote 0
        • K
          kl3m3n @Sato
          last edited by 23 Feb 2024, 20:55

          @Sato Hi.

          For starters, you could simply use the same topic with /alive appended.

          You have a ESP32 device publishing to uuid/alive at some interval. The redundant ESP32 is subscribing to this topic and handling the alive packets. If the packet is not received within the desired time interval, it can react accordingly (send push notification).

          Regards,
          Klemen

          S 2 Replies Last reply 24 Feb 2024, 23:54 Reply Quote 0
          • S
            Sato @kl3m3n
            last edited by 24 Feb 2024, 23:54

            Hello @kl3m3n,

            Thank you for help

            Regards

            1 Reply Last reply Reply Quote 0
            • S
              Sato @kl3m3n
              last edited by 25 Feb 2024, 15:15

              Hello @kl3m3n,

              I haven't done any tests yet because I'm waiting for the ESP32 to be delivered.

              But could you please take a look to see if the way I describe it below is the right way?

              Esp_a
              In, uuid_a, alive //publish periodically that it is alive (for Esp redundant)

              Esp_b
              In, uuid_b, alive //publish periodically that it is alive (for Esp redundant)

              Esp_c
              In, uuid_c, alive /publish periodically that it is alive for (Esp redundant)

              Redundant ESP (must subscribe to all ESPs that are connected, which can be many, right?
              mqttClient.subscribe(&Out_a[0]); // subscribe to esp_a alive
              mqttClient.subscribe(&Out_b[0]); // subscribe to esp_b alive
              mqttClient.subscribe(&Out_c[0]); // subscribe to esp_c alive
              "" "" "" "" ""
              "" "" "" "" ""
              // redundant ESP sends push message to 2 cell phones
              // don“t worry, changed some Chars
              static const char Push1 = "d4f1c682-16b8-3958-5734-51dc22471e0c/alive"; // publish push to mobile1
              mqttClient.publish(&Push1[0], (const char
              ) pushNotification.c_str());

              static const char Push2 = "e4f1c792-26d8-4958-5764-16dc22471f0c/alive"; // publish push to mobile2
              mqttClient.publish(&Push2[0], (const char
              ) pushNotification.c_str());

              Thank you
              Best regards

              K 1 Reply Last reply 27 Feb 2024, 20:55 Reply Quote 0
              • K
                kl3m3n @Sato
                last edited by kl3m3n 27 Feb 2024, 20:55

                When pushing to the phone using MQTT channel...

                @Sato said in Hello Gui-O - I'm alive:

                "d4f1c682-16b8-3958-5734-51dc22471e0c/alive"

                This should not be "/alive" but "/notifications". I think other stuff looks ok!

                Regards,
                Klemen

                S 2 Replies Last reply 27 Feb 2024, 21:02 Reply Quote 0
                • S
                  Sato @kl3m3n
                  last edited by 27 Feb 2024, 21:02

                  Hello @kl3m3n,

                  You are right, thanks

                  Regards

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sato @kl3m3n
                    last edited by Sato 3 Mar 2024, 19:04 3 Mar 2024, 17:21

                    Hello @kl3m3n and community,

                    This is how i try use the Alive function I wanted to implement, but can it make it work.

                    What i need ist that one Device Esp32 publish a message and a second Device Esp32 receive it.

                    I know it don't be so, but I'm trying with both tokens to see it anything arrive. I'm a bit confused with this subject.

                    I have an Esp32 Device named "Test1" registed in the Gui-O App
                    with these tokens to which I just added /alive
                    static const char *In2 = "15cab81e-e558-4498-8994-0733c30662f4/alive";
                    static const char *Out2 = "da853476-386a-8b48-9778-047bd6acf266/alive";

                    This Device named "Test1" publish each minute with these tokens!
                    aliveNotification = "Hello";
                    mqttClient.publish(&In2[0], (const char*) aliveNotification.c_str());
                    mqttClient.publish(&Out2[0], (const char*) aliveNotification.c_str());

                    The other Device Esp32 named "It is Alive" registed in the Gui-O App
                    which is only used to receive the message published from the Esp32 Device named "Test1"
                    static const char *In2 = "15cab81e-e558-4498-8994-0733c30662f4/alive"; // Want to subscribe Device "Test1"
                    static const char *Out2 = "da853476-386a-8b48-9778-047bd6acf266/alive"; //Want to subscribe Device "Test1"

                    mqttClient.subscribe(&In2[0]); //subscribe topic alive - from Device name "Test1"
                    mqttClient.subscribe(&Out2[0]); //subscribe topic alive - from Device name "Test1"

                    The question is where in the code of the Device name "It is Alive" do I get the message "Hello"?
                    In the void parseGuioMsg(const String &msg) ???

                    ""You have a ESP32 device publishing to uuid/alive""

                    Must it be used uuid of the App?
                    I need to use Esp32 to Esp32

                    Can someone help and clarify what I'm doing wrong and indicate how I should do it?

                    Thanks
                    Regards

                    S 1 Reply Last reply 3 Mar 2024, 19:17 Reply Quote 0
                    • S
                      Sato @Sato
                      last edited by 3 Mar 2024, 19:17

                      Hello,

                      Now I've experimented with using the app's uuid and it works but not always, most of the time the message doesn't arrive. I'm going to keep testing and I'll give feedback.

                      Is it possible that it's not through the uuid but through the In and Out tokens of the Esp32 devices?

                      Regards

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sato
                        last edited by 3 Mar 2024, 21:08

                        Hello kl3m3n,

                        Now it's working, I'm not sure why.
                        I publishing every 30 seconds.
                        To control failures I send a counter with the message, so far it's 97 and there have been no failures.
                        I've also tried closing the Gui-O App, forced it to stop and finally disconnected the phone from that uuid, but it's still working.
                        As I mentioned earlier, I don't know if it's possible to send and receive between esp32

                        Regards

                        K 1 Reply Last reply 6 Mar 2024, 05:58 Reply Quote 0
                        • K
                          kl3m3n @Sato
                          last edited by 6 Mar 2024, 05:58

                          @Sato Using MQTT, it is possible to send messages from any device to any device that is connected to the same broker.

                          Best regards,
                          Klemen

                          S 1 Reply Last reply 6 Mar 2024, 11:12 Reply Quote 0
                          • S
                            Sato @kl3m3n
                            last edited by 6 Mar 2024, 11:12

                            Hello @kl3m3n,

                            You are right, tested it now with two Esp32 and it works.

                            Thanks
                            Regards

                            1 Reply Last reply Reply Quote 0
                            11 out of 14
                            • First post
                              11/14
                              Last post