MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Need help with MMM-MQTTbridge not "communicating" with MMM-RTSPStream

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    68 Posts 5 Posters 16.7k Views 4 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.
    • wishmaster270W Offline
      wishmaster270 Module Developer @Cr4z33
      last edited by

      @Cr4z33
      Hi and sorry fir the late reply…
      Your config of the MQTT module is still missing a “debug: true”. The messages only get logged if debugging is enabled.

      	{
      		module: 'MMM-MQTTbridge',
      		disabled: false,
      		config: {
                              debug: true, 
      			mqttServer: "mqtt://:@ipaddress:port",
      			mqttConfig:
      			{
      				listenMqtt: true,
      				interval: 500,
      			},
      			notiConfig:
      			{
      				listenNoti: true,
      				ignoreNotiId: ["CLOCK_MINUTE", "NEWS_FEED"],
      				ignoreNotiSender: ["system", "NEWS_FEED"],
      			},
      			// set "NOTIFICATIONS -> MQTT" dictionary at /dict/notiDictionary.js
      			// set "MQTT -> NOTIFICATIONS" dictionary at /dict/mqttDictionary.js
      			},
      	}
      
      
      S Cr4z33C 3 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @wishmaster270
        last edited by sdetweil

        @wishmaster270 yes, we covered that before
        https://forum.magicmirror.builders/post/126008

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @wishmaster270
          last edited by

          @wishmaster270 i’ve come to the conclusion

          the doorbell itself does not publish to mqtt
          MqttBridge did not get any message from its subscribe

          he is going to try to build a HomeAssistant automation, as it CAN see the doorbell button thru its integration

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • Cr4z33C Offline
            Cr4z33 @wishmaster270
            last edited by

            @wishmaster270 thanks for spending some time on my issue although you’re busy.
            As sdetweil said he’s already helping me into this. 🙂

            @sdetweil my bad, my bad and again my bad! 😓

            I was going to tryout your method when I realized I actually never checked deeply what was outputting npm start… There’s A LOT of doorbell data being captured by MMM-MQTTbridge indeed! 🤦🏼

            You can see here the output.

            Can you see at this point (maybe) some additional data that needs to be added to mqttDictionary.js or do you still believe I should go your way (HA, automation, etc.)?

            While waiting for your kind reply I will play at trying your method. 😁

            R S 2 Replies Last reply Reply Quote 0
            • R Online
              rkorell @Cr4z33
              last edited by

              @Cr4z33 Good afternoon,
              I do not have the time to dig too deep into MMM-MQTTbridge …
              But what I see checking your console logfile and compare this to your first posting:
              You obviously had managed that the MQQT message arrives and is acknowledged.

              .
              The message you receive is:

              {
                  "Action": "Pulse",
                  "Code": "Invite",
                  "Data": {
                      "CallID": "5",
                      "IsEncryptedStream": false,
                      "LocaleTime": "2025-04-30 10:40:43",
                      "LockNum": 2,
                      "RealUTC": 1746002443,
                      "SupportPaas": false,
                      "TCPPort": 37777,
                      "UTC": 1746006043.0,
                      "UserID": "101"
                  },
                  "Index": 0,
                  "deviceType": "DHI-VTO3311Q-WP",
                  "serialNumber": "****"
              }
              

              This is what you trying to capture in your mqttDisctionary.js
              I’m not 100% sure if you

              1. catch the right data-value : - is your jsonpath correct?
              2. is “notiID” the right place for the module name you try to reach?

              Just spontaneous thoughts about your issue - maybe misleading …

              Regards,
              Ralf

              Cr4z33C 1 Reply Last reply Reply Quote 1
              • Cr4z33C Offline
                Cr4z33 @rkorell
                last edited by

                @rkorell hi it’s a good question indeed.

                However too bad that I am not skilled enough to know the answer lol that’s why I am posting here asking for help! 😂

                Let’s see if @sdetweil or someone else can find out.

                R 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @Cr4z33
                  last edited by

                  @Cr4z33 woohoo, i see the data, now its MQTTBridge configuration, and that part i dont know (yet)

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 1
                  • R Online
                    rkorell @Cr4z33
                    last edited by

                    @Cr4z33 OK, I guess you have to dig a little bit deeper into MMM-MQTTbridge …
                    You may give MQTTbind a try - this seems to be easier and more straightforward…

                    In addition: I’m not really sure if your RTSP-play module is able to react on notification - had you double-checked this? (If it does not react on notification, you cannot be successful…).

                    Regards,
                    Ralf

                    R S 2 Replies Last reply Reply Quote 0
                    • R Online
                      rkorell @rkorell
                      last edited by

                      @rkorell @Cr4z33 with writing the above I’ve just noticed:
                      Your RTSP module is NOT “RTSP-play” but "MMM-RTSPStream" !
                      This should be your first trial then in your mqttDisctionary.js …

                      R 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @rkorell
                        last edited by

                        @rkorell MMM-MPlayer should work for displaying on notification

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        R 2 Replies Last reply Reply Quote 0
                        • R Online
                          rkorell @sdetweil
                          last edited by

                          @sdetweil cool.
                          had played around with this and it was frickling to position - but worth a try … :-)

                          1 Reply Last reply Reply Quote 0
                          • R Online
                            rkorell @rkorell
                            last edited by rkorell

                            @rkorell said in Need help with MMM-MQTTbridge not "communicating" with MMM-RTSPStream:

                            @rkorell @Cr4z33 with writing the above I’ve just noticed:
                            Your RTSP module is NOT “RTSP-play” but "MMM-RTSPStream" !
                            This should be your first trial then in your mqttDisctionary.js …

                            @Cr4z33 just found “source” : you have copied this configuration .
                            But I bet you have to place the module name as “notiID” …
                            this is not “RTSP-play” but “MMM-RTSPStream” …
                            Regards,
                            Ralf

                            (Pay attention : it is highly probably case-sensitive …)

                            1 Reply Last reply Reply Quote 0
                            • R Online
                              rkorell @sdetweil
                              last edited by rkorell

                              @Cr4z33
                              MMM-RTSPStream is quite old and the author himself doesn’t use it anymore and recommend indeed other modules.
                              So it a a wise advice from Sam (@sdetweil ) to use MMM-Mplayer …
                              This one still have an active discussion here .

                              Ralf

                              R 1 Reply Last reply Reply Quote 0
                              • R Online
                                rkorell @rkorell
                                last edited by

                                @rkorell said

                                use MMM-Mplayer …

                                Just checked: You CAN use MMM-Pages notification to start and stop your stream …
                                (e.g. “NEW_PAGE=0” will start the stream.

                                Unfortunately you will have to care about switching OFF the stream by yourself - I guess the doorbell will not be sufficient to send a “STOP” signal - You likely would to see the stream longer that the visitor is pressing the doorbellbutton …

                                Ralf

                                1 Reply Last reply Reply Quote 0
                                • Cr4z33C Offline
                                  Cr4z33
                                  last edited by Cr4z33

                                  Thank you again @rkorell and @sdetweil for your precious help, but I am at a point where I don’t have enough skill to generate the needed code lines.

                                  What comes afterwards (ie. stop the stream, etc.) is not what worries me hehe, but all I am able to do at today is how to install a module and give it a basic config.

                                  Having two modules to “talk” to each other is another matter and that’s where I start asking for help to people who know what they are doing (I am more a copy&paste or a tutorial follower guy). 😁

                                  Once again this is the RTSP URL:

                                  rtsp://username:password@ipaddress/cam/realmonitor?channel=1&subtype=1#backchannel=0
                                  

                                  and this is the MQTT button press line:

                                  2025-04-16 11:40:58,897 INFO __main__ Publishing MQTT message DahuaVTO/Invite/Event: {'Action': 'Pulse', 'Code': 'Invite', 'Data': {'CallID': '3', 'IsEncryptedStream': False, 'LocaleTime': '2025-04-16 11:40:58', 'LockNum': 2, 'RealUTC': 1744796458, 'SupportPaas': False, 'TCPPort': 37777, 'UTC': 1744800058.0, 'UserID': '101'}, 'Index': 0, 'deviceType': 'DHI-VTO3311Q-WP', 'serialNumber': '*******'}
                                  

                                  I tried creating a Home Assistant automation, but it’s probably wrong.

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    sdetweil @Cr4z33
                                    last edited by sdetweil

                                    @Cr4z33 you are composing a service that does not yet exist
                                    button on doorbell causes window w video stream to
                                    open

                                    appears no one has done that w this video doorbell, welcome to the bleeding edge. u get to MAKE the sausage no one else wants to see!!

                                    a MagicMirror module runs inside a web browser, all in javascript. it can consume info from the outside using url based apis http get or put/post

                                    Now, sometimes, you want module A to work with data from module B. for example calendar. it reads the raw data file (ical/ics), parses all the events, gets the list of pertinent events ( dont care about 2 years ago, only next week…)

                                    and displays them. hm id like a different display, but dont want to learn about all the file reading and parsing and selecting)

                                    MagicMirror provides a way for one module to share its data with others, called Notifications. some identifying string, with some attached data. the mechanism is a broadcast. one send, every other module gets the same message.

                                    if a modules doesn’t understand the identifying string, it ignores the message
                                    if it DOES understand the identifying string, then it MUST understand the format of the attached data.

                                    so, modules that DO participate in this data sharing must document ( in their readme.md file)

                                    what notification strings they send (and its associated data format, if any)
                                    AND
                                    what notifications strings they accept (and its required data format)

                                    nothing going outside the browser is known inside the browser,
                                    to get that kind of info requires some module to be able to bridge the two environments

                                    i have a simple one
                                    id like some way for a script running outside MagicMirror to trigger a module to do something (receive a notification it knows about)
                                    so i wrote MMM-CurlToNotification
                                    from the command line outside MagicMirror you can issue the curl command to send a packet of data that turns into a notification sent to all modules
                                    there are other modules that provide similar support (as well as others), mmm-remotecontrol for example

                                    anyhow MMM-MqttBridge does that bridging for MQTT messages. in both directions

                                    mqtt -> notifi(cation) and notification) -> mqtt

                                    but you need to know a bunch of stuff, and figure out how to code the file that does the actual work

                                    i work backwards
                                    i need a video played from a url on demand
                                    what modules can do that
                                    and how do i setup for the on demand part

                                    pick a module RTSPStream or Minfo, read its doc to understand what notifications it understands, and what data it needs

                                    install and configure the selected module

                                    now you ‘could’ use my curltonotification module to verify that the video player module works

                                    then you back up to the MQTT bridge module config to send the same message you just tested with, and what mqtt message will trigger it

                                    then back up, and find/setup what will send that mqtt message
                                    and how it is triggered to to that

                                    you can draw this all out on a piece of paper

                                    coding is just making the computer fo the exact same thing over and over, just faster. if you dont know what, then it cant either

                                    someone presses the doorbell button
                                    how does something outside the doorbell know?
                                    can that something send a msg via mqtt that the bridge is listening for? if not, can i find something that that can take the first things out and get it into our expected mqtt message

                                    repeat along the way,
                                    test each step

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    R 1 Reply Last reply Reply Quote 1
                                    • R Online
                                      rkorell @sdetweil
                                      last edited by

                                      @sdetweil said in Need help with MMM-MQTTbridge not "communicating" with MMM-RTSPStream:

                                      so i wrote MMM-CurlToNotification

                                      Dear Sam,
                                      trying to help I’m struggled with your module CurlToNotification :-(

                                      { 
                                        module:"MMM-CurlToNotification",
                                        config:{
                                          url_name:"doorbell", // the path of the url for curl post
                                        }
                                      },		
                                      
                                      

                                      And consecutively running

                                      curl --header "Content-Type: application/json"   --request POST   --data '{"notification":"SHOW_ALERT","payload":{"message":"fribble"}}' http://localhost:8080/doorbell
                                      

                                      Shows an error message:

                                      pi@MagicMirrorPi5:~/MagicMirror/modules $ curl --header "Content-Type: application/json"   --request POST   --data '{"notification":"SHOW_ALERT","payload":{"message":"fribble"}}' http://localhost:8080/doorbell
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      <head>
                                      <meta charset="utf-8">
                                      <title>Error</title>
                                      </head>
                                      <body>
                                      <pre>InternalServerError: stream is not readable<br> &nbsp; &nbsp;at readStream (/home/pi/MagicMirror/node_modules/raw-body/index.js:185:17)<br> &nbsp; &nbsp;at getRawBody (/home/pi/MagicMirror/node_modules/raw-body/index.js:116:12)<br> &nbsp; &nbsp;at read (/home/pi/MagicMirror/node_modules/body-parser/lib/read.js:79:3)<br> &nbsp; &nbsp;at jsonParser (/home/pi/MagicMirror/node_modules/body-parser/lib/types/json.js:138:5)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at trim_prefix (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:328:13)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:286:9<br> &nbsp; &nbsp;at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:346:12)<br> &nbsp; &nbsp;at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:280:10)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:91:12)<br> &nbsp; &nbsp;at trim_prefix (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:328:13)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:286:9<br> &nbsp; &nbsp;at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:346:12)<br> &nbsp; &nbsp;at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:280:10)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/body-parser/lib/read.js:132:5<br> &nbsp; &nbsp;at AsyncResource.runInAsyncScope (node:async_hooks:206:9)<br> &nbsp; &nbsp;at invokeCallback (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/raw-body/index.js:238:16)<br> &nbsp; &nbsp;at done (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/raw-body/index.js:227:7)<br> &nbsp; &nbsp;at IncomingMessage.onEnd (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/raw-body/index.js:287:7)<br> &nbsp; &nbsp;at IncomingMessage.emit (node:events:518:28)<br> &nbsp; &nbsp;at endReadableNT (node:internal/streams/readable:1698:12)<br> &nbsp; &nbsp;at process.processTicksAndRejections (node:internal/process/task_queues:82:21)</pre>
                                      </body>
                                      </html>
                                      

                                      From Windows Client (changing localhost to MagicMirrors IP address a different error message:

                                      PS C:\Users\Familienbenutzer> curl --header "Content-Type: application/json"   --request POST   --data "{\"notification\":\"SHOW_ALERT\",\"payload\":{\"message\":\"fribble\"}}" http://1xx.yy.zz.157:8080/doorbell
                                      
                                      Invoke-WebRequest : Es wurde kein Positionsparameter gefunden, der das Argument "Content-Type: application/json"
                                      akzeptiert.
                                      In Zeile:1 Zeichen:1
                                      + curl --header "Content-Type: application/json"   --request POST   --d ...
                                      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                          + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
                                          + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
                                      

                                      Any hint for me?

                                      Thanks and regards,
                                      Ralf

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sdetweil @rkorell
                                        last edited by sdetweil

                                        @rkorell and you did restart MagicMirror after installing the module, right?

                                        you can also add config parm (make sure there is a trailing comma after doorbell

                                           debug:true,
                                        

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        R 1 Reply Last reply Reply Quote 0
                                        • R Online
                                          rkorell @sdetweil
                                          last edited by rkorell

                                          @sdetweil said in Need help with MMM-MQTTbridge not "communicating" with MMM-RTSPStream:

                                          and you did restart MagicMirror after installing the module, right?

                                          yes, indeed :-)

                                          And a trailing comma is there…
                                          In the meantime I had even a PI-reboot (for other reasons) - error persists.
                                          Even with debug-option enabled no debug message from your module.
                                          Neither in pm2 logs nor in developer’s console…

                                          Ralf

                                          S R 3 Replies Last reply Reply Quote 0
                                          • S Offline
                                            sdetweil @rkorell
                                            last edited by

                                            @rkorell weird

                                            i am away from my computer for most of the day helping family
                                            i will review asap

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            R 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 4 / 4
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy