• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

Client does not have read permissions

Scheduled Pinned Locked Moved General Discussion
11 Posts 2 Posters 1.3k Views 1 Watching
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 Offline
    jkandasa @saturn
    last edited by 24 May 2018, 14:26

    @saturn on the role you should add /# as follows,

    • Topics publish: house-in/#, house-out/#
    • Topics subscribe: house-in/#, house-out/#
    1 Reply Last reply Reply Quote 0
    • S Offline
      saturn
      last edited by 24 May 2018, 16:33

      Thank you.
      It's working now.
      Is it posible to use mask or regexp for topics in the role?

      J 1 Reply Last reply 24 May 2018, 17:30 Reply Quote 0
      • J Offline
        jkandasa @saturn
        last edited by 24 May 2018, 17:30

        @saturn

        Is it possible to use mask or regexp for topics in the role?

        I hope it should,

        You can see the actual code here.

        // _topic: defined in role
        // topic: recived from client
         _topic = _topic.replaceAll("\\+", "\\\\w+").replaceAll("#", "\\.*");
         if (topic.matches(_topic)) {
             return true;
         }
        

        This code replaces,

        • + to \w+ (Example: house-out/+/+/+ becomes as house-out/\w+/\w+/\w+)
        • # to .* (Example: house-out/# becomes as house-out/.*)

        And finally matches the received topic from the client(matches as a regular expression).

        So your regular expression on the role might work. (if it does not have + and # symbol)

        1 Reply Last reply Reply Quote 0
        • S Offline
          saturn
          last edited by 29 May 2018, 21:19

          I have got error again:

          2018-05-30 00:14:40,149 ERROR [nioEventLoopGroup-8-10] [io.moquette.spi.impl.ProtocolProcessor:851] Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+
          

          My options not help:
          Topics publish

          house-in, house-in/#, house-in/+/+/+/+/+, house-in/\w+/\w+/\w+/\w+/\w+, house-out/+/+/+/+/+, house-out/\w+/\w+/\w+/\w+/\w+
          

          Topics subscribe

          house-out, house-out/#, house-out/+/+/+/+/+, house-out/\w+/\w+/\w+/\w+/\w+, house-in/+/+/+/+/+, house-in/\w+/\w+/\w+/\w+/\w+
          

          What I do wrong again?

          J 1 Reply Last reply 30 May 2018, 05:23 Reply Quote 0
          • J Offline
            jkandasa @saturn
            last edited by jkandasa 30 May 2018, 05:23

            @saturn Use + or # only.

            use only house-in/#, house-out/# will cover everything.

            Can you elaborate how you want to control topic? I can give some examples.

            1 Reply Last reply Reply Quote 0
            • S Offline
              saturn
              last edited by 30 May 2018, 06:38

              When I use only "house-in/#, house-out/#" in "Topics publish" and "Topics subscribe" I get the same error:

              ERROR [nioEventLoopGroup-8-10] [io.moquette.spi.impl.ProtocolProcessor:851] Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+
              

              I want to control MySensors network by sending data to the "house-in" and get statistic and status information from "house-out".

              1 Reply Last reply Reply Quote 0
              • S Offline
                saturn
                last edited by saturn 30 May 2018, 20:33

                May be I misunderstand you.
                I think you mean that, I should use

                +
                

                instead of

                \w+
                

                and

                #
                

                instead of

                .*
                

                in role's settings.
                But my problems with read permissions was resolved only when I add

                house-out/.*, house-in/.*
                

                to the role's settings.
                Thank you for your help.

                J 1 Reply Last reply 31 May 2018, 11:39 Reply Quote 0
                • J Offline
                  jkandasa @saturn
                  last edited by 31 May 2018, 11:39

                  @saturn

                  This one does not work for you?

                  house-out/#, house-in/#
                  
                  S 1 Reply Last reply 31 May 2018, 17:02 Reply Quote 0
                  • S Offline
                    saturn @jkandasa
                    last edited by 31 May 2018, 17:02

                    @jkandasa
                    With

                    house-out/#, house-in/#
                    

                    I get

                    Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+```
                    J 1 Reply Last reply 4 Jun 2018, 03:00 Reply Quote 0
                    • J Offline
                      jkandasa @saturn
                      last edited by 4 Jun 2018, 03:00

                      @saturn

                      house-out/#, house-in/#
                      

                      You should add this to both subscribe and publish topics. Can you show your MQTT client code?

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

                      1

                      Online

                      636

                      Users

                      532

                      Topics

                      3.4k

                      Posts
                      Copyright © 2015-2025 MyController.org | Contributors | Localization