🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    CORE2 HIVEMQ

    Core 2
    7
    33
    48.9k
    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.
    • J
      Javi @ajb2k3
      last edited by

      @ajb2k3 I don´t think the cert name is the problem, it is only 4 letters in its name. HiveMQ is free, you can create a private cluster and connect to it. For example when I try to connect to HiveMQ with mosquitto it works perfectly, but when I try to connect it with the uiflow it doesn´t.

      ajb2k3A 1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3 @Javi
        last edited by

        @javi give me a week and I will see what I can work out.

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • felmueF
          felmue
          last edited by felmue

          Hello guys

          I've setup a HIVEMQ account and I can connect with Arduino or CLI, but I cannot connect with UiFlow. Tried both AWS and Azure backend - same result.

          That said, I can connect to my own MQTTs broker using UiFlow and both (my own and HIVEMQ) use the same certificate which makes me wonder about whether the certificate really is the issue here.

          I think that maybe the hostname (which for HIVEMQ is rather long) might actually be the issue.

          @ajb2k3 : looking forward to your findings.

          Thanks
          Felix

          GPIO translation table M5Stack / M5Core2
          Information about various M5Stack products.
          Code examples

          ajb2k3A J 2 Replies Last reply Reply Quote 0
          • ajb2k3A
            ajb2k3 @felmue
            last edited by

            @felmue said in CORE2 HIVEMQ:

            Hello guys

            I've setup a HIVEMQ account and I can connect with Arduino or CLI, but I cannot connect with UiFlow. Tried both AWS and Azure backend - same result.

            That said, I can connect to my own MQTTs broker using UiFlow and both (my own and HIVEMQ) use the same certificate which makes me wonder about whether the certificate really is the issue here.

            I think that maybe the hostname (which for HIVEMQ is rather long) might actually be the issue.

            @ajb2k3 : looking forward to your findings.

            Thanks
            Felix

            It Could be the host name but until I can sort out some issues with MQTT and Adafruit I'm not sure when I will get around to it.
            I have someone checking the grammar of my IoT books first draft as we speak but its slow going.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • J
              Javi @felmue
              last edited by

              @felmue Hi, same problem, I can connect HiveMQ with Mosquitto and another clients but not with UiFlow.

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by felmue

                Hi guys

                with UiFlow I can also connect to test.mosquitto.org port 8886 (which uses a Lets Encrypt certificate - same as HIVEMQ I believe).

                For that to work in UiFlow I do not need to upload any certificate or key. I presume UiFlow has some root certificates built in which are used when SSL is set to true. The root certificates are used to verify the broker.

                I believe that in UiFlow keyFile and certFile are used if the client was to be verified on the broker side, but for that to actually work the public client key would need to be uploaded to the broker, but I don't see an UI on HIVEMQ where I could do that.

                I also experimented with long host names on my local MQTT broker and that worked fine, so my current conclusions are:

                • either UIFlow has an issue if a host name has multiple dots in it
                • the MQTT version used in UiFlow is not compatible with whatever version is used in HIVEMQ

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                J 1 Reply Last reply Reply Quote 0
                • J
                  Javi @felmue
                  last edited by

                  Hi @felmue
                  But I don´t see how it could be a compatibility problem between UiFlow and HIVEMQ as I can connect to HIVEMQ public server. And I also can connect to my private HIVEMQ server with mosquitto. Let´s see if @ajb2k3 find a solution when he is available.
                  Another question, how could I generate a Lets Encrypt certificate for doing some test with the 8886 port?
                  Thanks
                  Javi

                  1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue
                    last edited by felmue

                    Hello @Javi

                    I did not have to load any root certificate in UiFlow to connect to test.mosquitto.org on port 8886. The only thing I did is turn on SSL.

                    Too bad the HIVEMQ public broker is a) not using TLS and b) has a short (only two dots) domain. Not really useful for comparison. But yes I agree, the MQTT version argument gets a bit weak (unless TLS required a different version).

                    Edit: I've just modified my local MQTT broker so it has a similar domain name (same length, same amount of dots) as the HIVEMQ broker and using UiFlow still worked ok. So I guess the number of dots in the domain name is not the issue.

                    Thanks
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

                    1 Reply Last reply Reply Quote 0
                    • felmueF
                      felmue
                      last edited by felmue

                      Hi guys

                      after long hours of searching and trying different things I finally stumbled over the missing piece here.

                      For HIVEMQ the server_hostname seems to be required which is part of the SSL parameters. In order to add that the regular MQTT block cannot be used, but the Execute block can fix that. Here is what works for me:

                      0_1646259139268_UiFlow_HIVEMQ_20220302.png

                      Thanks
                      Felix

                      GPIO translation table M5Stack / M5Core2
                      Information about various M5Stack products.
                      Code examples

                      J ajb2k3A J 3 Replies Last reply Reply Quote 1
                      • J
                        Javi @felmue
                        last edited by

                        Hi @felmue

                        Thanks for everything but what should I write instead of 'server_hostname' in my case?. When I create my cluster in HiveMQ I only recieve a host url that is what I write in 'HOST'. Maybe I do not have to write anything. I am going to test it and I will say you is something is going wrong.

                        Javier

                        1 Reply Last reply Reply Quote 0
                        • ajb2k3A
                          ajb2k3 @felmue
                          last edited by

                          @felmue said in CORE2 HIVEMQ:

                          Hi guys

                          after long hours of searching and trying different things I finally stumbled over the missing piece here.

                          For HIVEMQ the server_hostname seems to be required which is part of the SSL parameters. In order to add that the regular MQTT block cannot be used, but the Execute block can fix that. Here is what works for me:

                          0_1646259139268_UiFlow_HIVEMQ_20220302.png

                          Thanks
                          Felix

                          Thanks @felmue Have you contacted @IAMLIUBO about this issue and reported it in the UIFlow 1.9.2 discussion?

                          UIFlow, so easy an adult can learn it!
                          If I don't know it, be patient!
                          I've ether not learned it or am too drunk to remember it!
                          Author of the WIP UIFlow Handbook!
                          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                          L 1 Reply Last reply Reply Quote 0
                          • J
                            Javi
                            last edited by

                            Hi @felmue @ajb2k3

                            It finally works. Thank you so much guys for everything. Now I need to change the Qos of the messages I publish to 2, but I think UiFlow does not have that function implemented yet and will add in a future version.

                            Javier

                            1 Reply Last reply Reply Quote 1
                            • L
                              LBP of MO @ajb2k3
                              last edited by

                              @ajb2k3 Thanks so much! This worked perfectly on my M5stickcplus. We have been testing this about a week with no issues other than battery life.

                              Today for some reason it just stopped publishing the message. If we try it from MQTT.fx it still works. Now I am just confused. Could HiveMQ cloud have made a recent change that effected how this works?

                              This is the first time I have "MQTT'd" or used the M5StickCplus and until tonight it has been a hoot!

                              The M5sick still looks like it is functioning as it did yesterday. Is it possible it failed in someway? I have burned it and reinstalled the UIFlow program to no avail.

                              Thanks in advance BTW!

                              Paul

                              1 Reply Last reply Reply Quote 0
                              • felmueF
                                felmue
                                last edited by

                                Hello guys

                                I think the issue is in UiFlow 1.9.5. The MQTT publish command now supports QoS, but it seems that breaks the publishing to HiveMQ. :-(

                                Thanks
                                Felix

                                GPIO translation table M5Stack / M5Core2
                                Information about various M5Stack products.
                                Code examples

                                L J 2 Replies Last reply Reply Quote 0
                                • L
                                  LBP of MO @felmue
                                  last edited by

                                  @felmue - I use the desktop 1.0.17 UiFlow version. Also, I did not reload the M5stick but it just stopped working. (??) Is there a way to access/load an older version of UiFlow to try to get this working again? Thanks for all you have done BTW.

                                  Background: I found a digital signage offering that has both live TV and the customers content. We discovered that it can switch back and forth between the content feeds with MQTT commands.

                                  We wanted a wearable button that would switch to the client content when annoying TV commercials come on. When we see a TV commercial it can be made to disappear with one press of a button. - FUN!

                                  We decided to start with HiveMQ because will need fewer than 100 devices but need to sort them into user groups.

                                  Even at 57 and with no programming skills I can grasp Blockly.

                                  So........

                                  Is there another broker similar to HiveMQ Cloud?

                                  Is there another way to program the M5Stick other than UiFlow so it can publish to HiveMQ knowing that I have no skills?

                                  We we turn on the M5StickC Plus and it automatically connects to WIFI
                                  Connect to Hive
                                  Display "Connected" for 5 seconds
                                  Send command: {"operation": "layout/set", "parameters": {"layoutId": 2, "length": 360}}
                                  Display "Published" for 5 seconds
                                  Display Battery percentage for 5 seconds
                                  Power off the M5stick. (This gives us 3 to 4 days of use on a single charge)

                                  This has been a fun project so far - A few weeks ago I did not even know what MQTT was!

                                  • Paul
                                  1 Reply Last reply Reply Quote 0
                                  • felmueF
                                    felmue
                                    last edited by

                                    Hello @LBP-of-MO

                                    In M5Burner for each M5Stack device there is a drop-down menu through which you should be able to select older UIFlow firmware versions to download and burn.

                                    Good luck!

                                    Thanks
                                    Felix

                                    GPIO translation table M5Stack / M5Core2
                                    Information about various M5Stack products.
                                    Code examples

                                    1 Reply Last reply Reply Quote 0
                                    • ajb2k3A
                                      ajb2k3
                                      last edited by

                                      The desktop version is broken and unsupported at present. I'm hoping that it will be rebuilt for version 2.0.

                                      @lbp-of-mo said in CORE2 HIVEMQ:

                                      Even at 57 and with no programming skills I can grasp Blockly.

                                      • Paul

                                      This is what brought me to UIFlow!

                                      I have been writing an ebook on IOT and would appreciate any help https://www.amazon.co.uk/IoT-M5Stack-UIFlow-ebook/dp/B09XF22QV9/ref=sr_1_2?crid=39P4GN2F0YL6F&keywords=IoT+with+M5Stack+and+UIFLow&qid=1649573615&sprefix=iot+with+m5stack+and+uiflow%2Caps%2C67&sr=8-2

                                      I'm working through Blynk at present and haven't had time to invest in Hive MQ but have you looked into setting up a private MQTT server on a raspberry pi?

                                      UIFlow, so easy an adult can learn it!
                                      If I don't know it, be patient!
                                      I've ether not learned it or am too drunk to remember it!
                                      Author of the WIP UIFlow Handbook!
                                      M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        Javi @felmue
                                        last edited by

                                        @felmue Hi,
                                        I used the new publishing method with Qos in UiFlow with HiveMQ last Friday and it worked perfectly I do not understand why today it does not work.

                                        1 Reply Last reply Reply Quote 0
                                        • J
                                          Javi
                                          last edited by

                                          Ok guys,
                                          I have seen where is the problem. Last week messsages with QoS 2 did not work and I told to m5stack support team. Maybe they are now working on it as now if you put QoS 0 or Qos 1 it works with HiveMQ as always. I hope they fix that soon and we can work with Qos2.

                                          L 1 Reply Last reply Reply Quote 0
                                          • J
                                            Javi
                                            last edited by

                                            Hi again and I hope this is the last one.
                                            Now I have discovered another thing. Due to the bug that skip 2 characters of the message you publish when you are working with Qos2 in UiFlow, if the message you are sending is less than 2 characters the server seems to do not even receive the message. So try to always send a message longer than 2 characters when you use the Qos2 in UiFlow.

                                            Another thing M5Stack should fix is that you do not really send a QoS 2 message when you send it, it sends a QoS 1 as maximum.

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post