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.

    http request

    Scheduled Pinned Locked Moved Development
    53 Posts 7 Posters 49.2k Views 6 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.
    • E Offline
      Eunanibus Module Developer
      last edited by

      I’m replying Mobile at the moment so I can’t give you a comprehensive answer (sorry) - does it say which line the error occurs?

      Ensure that the parseData function is not within the GetDom() method, but isolated on its own. Go through and ensure that the document.createElement(“div”) function is referencing a document.

      Sorry, I mocked up that code in about 10 minutes and I’m not an expert so there may be issues.

      1 Reply Last reply Reply Quote 0
      • A Offline
        acdacd2
        last edited by

        ok no problem, I will try to check and share of course

        1 Reply Last reply Reply Quote 0
        • A Offline
          acdacd2
          last edited by

          I think I’m not sure where exactly to put the code

          1 Reply Last reply Reply Quote 0
          • E Offline
            Eunanibus Module Developer
            last edited by

            Ok. I took a look at this last night and I’m getting somewhere so let me get back to you on this. I’m just trying to create the module for you.

            1 Reply Last reply Reply Quote 0
            • A Offline
              acdacd2
              last edited by

              ok, any thanks

              1 Reply Last reply Reply Quote 0
              • E Offline
                Eunanibus Module Developer
                last edited by

                Having good success. Can I get an example of the XML you’re trying to display?

                1 Reply Last reply Reply Quote 0
                • E Offline
                  Eunanibus Module Developer
                  last edited by Eunanibus

                  Well, I’ve spent the last couple of evenings trying to build something for you. You can download it here.

                  Give it a try and let me know how it does for you.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    acdacd2
                    last edited by paviro

                    I will test it today.
                    Simple of the xml file

                    <response>
                    <led0>0</led0>
                    <led1>0</led1>
                    <led2>0</led2>
                    <led3>0</led3>
                    <led4>1</led4>
                    <led5>0</led5>
                    <led6>0</led6>
                    <led7>0</led7>
                    <led8>0</led8>
                    <led9>0</led9>
                    <led10>0</led10>
                    <led11>0</led11>
                    <led12>0</led12>
                    <led13>0</led13>
                    <led14>0</led14>
                    <led15>0</led15>
                    <led16>0</led16>
                    <led17>0</led17>
                    <led18>0</led18>
                    <led19>0</led19>
                    <led20>0</led20>
                    <led21>0</led21>
                    <led22>0</led22>
                    <led23>0</led23>
                    <led24>0</led24>
                    <led25>0</led25>
                    <led26>0</led26>
                    <led27>0</led27>
                    <led28>0</led28>
                    <led29>0</led29>
                    <led30>0</led30>
                    <led31>0</led31>
                    <btn0>up</btn0>
                    <btn1>up</btn1>
                    <btn2>up</btn2>
                    <btn3>up</btn3>
                    <btn4>up</btn4>
                    <btn5>up</btn5>
                    <btn6>up</btn6>
                    <btn7>up</btn7>
                    <btn8>up</btn8>
                    <btn9>up</btn9>
                    <btn10>up</btn10>
                    <btn11>up</btn11>
                    <btn12>up</btn12>
                    <btn13>up</btn13>
                    <btn14>up</btn14>
                    <btn15>up</btn15>
                    <btn16>up</btn16>
                    <btn17>up</btn17>
                    <btn18>up</btn18>
                    <btn19>up</btn19>
                    <btn20>up</btn20>
                    <btn21>up</btn21>
                    <btn22>up</btn22>
                    <btn23>up</btn23>
                    <btn24>up</btn24>
                    <btn25>up</btn25>
                    <btn26>up</btn26>
                    <btn27>up</btn27>
                    <btn28>up</btn28>
                    <btn29>up</btn29>
                    <btn30>up</btn30>
                    <btn31>up</btn31>
                    <day>24/06/2016</day>
                    <time0>08:55:17</time0>
                    <analog0>22</analog0>
                    <analog1>746</analog1>
                    <analog2>749</analog2>
                    <analog3>215</analog3>
                    <analog4>0</analog4>
                    <analog5>0</analog5>
                    <analog6>0</analog6>
                    <analog7>0</analog7>
                    <analog8>0</analog8>
                    <analog9>0</analog9>
                    <analog10>0</analog10>
                    <analog11>0</analog11>
                    <analog12>0</analog12>
                    <analog13>0</analog13>
                    <analog14>0</analog14>
                    <analog15>0</analog15>
                    <count0>22</count0>
                    <count1>0</count1>
                    <count2>0</count2>
                    <count3>0</count3>
                    <count4>0</count4>
                    <count5>0</count5>
                    <count6>0</count6>
                    <count7>0</count7>
                    <tinfo>---</tinfo>
                    <version>3.05.38_vsr</version>
                    </response>
                    
                    1 Reply Last reply Reply Quote 0
                    • E Offline
                      Eunanibus Module Developer
                      last edited by Eunanibus

                      Cool. It should work fine! Hurry up and try it, I made it for you :laughing:

                      More information about it is here - I posted it for everyone to download.

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        acdacd2
                        last edited by

                        some errors with nom install

                        pi@raspberrypi:~/MagicMirror/modules/default/MMM-HTTPRequestDisplay $ npm install
                        npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/package.json’
                        npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/node_modules/node_helper/package.json’
                        npm WARN modules No description
                        npm WARN modules No repository field.
                        npm WARN modules No README data
                        npm WARN modules No license field.

                        P 1 Reply Last reply Reply Quote 0
                        • KirAsh4K Offline
                          KirAsh4 Moderator
                          last edited by

                          You shouldn’t need to run 'npm install' inside the module folder unless the author specifically told you to do that.

                          A Life? Cool! Where can I download one of those from?

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            acdacd2
                            last edited by acdacd2

                            I did that,

                            Now it’s solved, I copied the .json in the right folder

                            1 Reply Last reply Reply Quote 0
                            • E Offline
                              Eunanibus Module Developer
                              last edited by

                              Awesome. @KirAsh4 is correct - The README has all the instructions so be sure to take a look.

                              Please let me know how it works cause you’ll be the first person to use it

                              1 Reply Last reply Reply Quote 0
                              • KirAsh4K Offline
                                KirAsh4 Moderator
                                last edited by

                                As a further explanation, 'npm install' is only required if the module you are installing requires other node modules to also be installed. When you first install MagicMirror you have to run 'npm install' to install all the dependencies for it to work, however generally, modules don’t need that. The exception is if someone writes a module that requires another node module that isn’t already installed. So there was no need to run that, nor to copy any '.json' package files anywhere.

                                A Life? Cool! Where can I download one of those from?

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  acdacd2
                                  last edited by KirAsh4

                                  is that correct ?

                                  {
                                  		module: 'MMM-HTTPRequestDisplay',
                                  		position: 'bottom_bar',	// This can be any of the regions. Best results in left or right regions.
                                  		header: 'MMM-HTTPRequestDisplay', // This is optional
                                  		config: {
                                  			accessToken: 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&mode=xml',
                                  			// See 'Configuration options' for more information.
                                  		}
                                  	},
                                  

                                  Note from Moderator: Please use Markdown on code snippets for easier reading.

                                  1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    Eunanibus Module Developer
                                    last edited by

                                    Sorry, I made a lot of mistakes on the README it seems.

                                    Instead of

                                    accessToken : "http://etc"
                                    

                                    use

                                    httpRequestURL: "http://etc"
                                    

                                    apologies

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      acdacd2
                                      last edited by paviro

                                      no problemo,

                                      with this config, black screen

                                      modules: [
                                      	{
                                      		module: 'MMM-HTTPRequestDisplay',
                                      		position: 'bottom_bar',	// This can be any of the regions. Best results in left or right regions.
                                      		header: 'MMM-HTTPRequestDisplay', // This is optional
                                      		config: {
                                      			httpRequestURL: 'http://192.168.1.248:8889/status.xml',
                                      			// See 'Configuration options' for more information.
                                      		}
                                      	},
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • E Offline
                                        Eunanibus Module Developer
                                        last edited by

                                        Make sure that you’re not just copy and pasting blindly into your config file.

                                        After each

                                        modules: [
                                        {
                                        etc
                                        },
                                        

                                        Note the comma , after the module. That comma should only be there if there are more modules.

                                        Likewise, if you’re pasting it last, you need to make sure the module before it has one, to let the script know there are more modules after the previous one.

                                        So the pattern is

                                        modules: [
                                        {
                                           module: ‘firstModule’,
                                           config: {
                                           option : ""
                                           }
                                        }, <<< COMMA HERE
                                        
                                        modules: [
                                        {
                                           module: ‘middleModule’,
                                           config: {
                                           option : ""
                                           }
                                        }, <<< COMMA HERE
                                        
                                        modules: [
                                        {
                                           module: ‘last module’,
                                           config: {
                                           option : ""
                                           }
                                        } <<<<< NO COMMA
                                        

                                        hope that makes sense. hopefully that’s the problem.

                                        1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          acdacd2
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • A Offline
                                            acdacd2
                                            last edited by

                                            This post is deleted!
                                            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
                                            • 1 / 3
                                            • 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