• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Can anyone revive AviationWX, PilotWX, or TAF

Scheduled Pinned Locked Moved Unsolved Requests
36 Posts 3 Posters 7.2k Views 3 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.
  • S Offline
    sdetweil @FSAHD
    last edited by Mar 15, 2024, 2:32 AM

    @FSAHD a lot of simple mistakes…

    computers do things fast. whatever we tell them… lol

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • F Offline
      FSAHD @sdetweil
      last edited by Mar 15, 2024, 7:13 AM

      @sdetweil I tried that after I cloned the git into the modules folder.

      I ended up getting this error.

      I also don’t remember if I used your script for this instance of mm or if I installed manually if that makes any difference

      20240315_030845.jpg

      S 2 Replies Last reply Mar 15, 2024, 11:15 AM Reply Quote 0
      • S Offline
        sdetweil @FSAHD
        last edited by Mar 15, 2024, 11:15 AM

        @FSAHD ok, let me look at it in a couple hours

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Mar 15, 2024, 2:38 PM Reply Quote 0
        • M Offline
          mumblebaj Module Developer @sdetweil
          last edited by Mar 15, 2024, 2:38 PM

          @sdetweil I think to resolve just do npm uninstall request and will remove request from the package,json. Else it will try to install it and you will run into the errors above.

          Check out my modules at: https://github.com/mumblebaj?tab=repositories

          S 1 Reply Last reply Mar 15, 2024, 2:42 PM Reply Quote 0
          • S Offline
            sdetweil @mumblebaj
            last edited by sdetweil Mar 15, 2024, 2:43 PM Mar 15, 2024, 2:42 PM

            @mumblebaj but the code uses request…

            It downloads a now gz folder, with one xml file in it… I tried to use fetch and couldn’t get it to unzip the file in stream…
            2 days, gave up

            I installed ok on a pi4 after doing my script install
            warnings but no failures

            npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
            npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
            npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
            npm WARN deprecated joi@13.7.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
            
            added 66 packages, and audited 67 packages in 46s
            
            2 packages are looking for funding
              run `npm fund` for details
            
            6 vulnerabilities (2 moderate, 4 high)
            
            To address issues that do not require attention, run:
              npm audit fix
            
            To address all issues possible (including breaking changes), run:
              npm audit fix --force
            
            Some issues need review, and may require choosing
            a different dependency.
            
            Run `npm audit` for details.
            sam@raspberrypi4:~/MagicMirror/modules/MMM-aviationwx $ 
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            M 2 Replies Last reply Mar 15, 2024, 2:56 PM Reply Quote 0
            • S Offline
              sdetweil @FSAHD
              last edited by sdetweil Mar 15, 2024, 2:58 PM Mar 15, 2024, 2:54 PM

              @FSAHD i just pushed a fix to package.json and a new postinstall script

              git pull to get the updates…(watch out that it doesn’t overwrite your code)
              then the postinstall script from the module folder

              ./postinstall
              

              it will be called by npm install as well…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • M Offline
                mumblebaj Module Developer @sdetweil
                last edited by Mar 15, 2024, 2:56 PM

                @sdetweil I think it is possible with axios. Let me have a look at it. Will fork module from you and see what I can do and push a PR if it works.

                Check out my modules at: https://github.com/mumblebaj?tab=repositories

                S 1 Reply Last reply Mar 15, 2024, 2:59 PM Reply Quote 0
                • S Offline
                  sdetweil @mumblebaj
                  last edited by sdetweil Mar 15, 2024, 3:01 PM Mar 15, 2024, 2:59 PM

                  @mumblebaj said in Can anyone revive AviationWX, PilotWX, or TAF:

                  I think it is possible with axios

                  really don’t want axios… better to get native fetch working…
                  thats what I was trying. and you can use node xxx.js to test it without MM in the way…

                  its ‘possible’. just all the different ‘it works like this’ didn’t work.

                  there are two fetches in the node helper… one gets the gz file
                  and one gets an xml file… that one should be easy, but I didn’t want to mix in the same code path

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  M 2 Replies Last reply Mar 15, 2024, 4:10 PM Reply Quote 0
                  • M Offline
                    mumblebaj Module Developer @sdetweil
                    last edited by Mar 15, 2024, 4:07 PM

                    @sdetweil The below code works fine. Tested it. Having issues with my system at the moment and can’t make the changes. Can you incorporate?

                    async function fetchData(metarUrl, airports) {
                      try {
                        const response = await axios.get(metarUrl, {
                          responseType: 'arraybuffer', // ensure response is treated as binary
                          headers: {
                            'Accept-Encoding': 'gzip', // request gzip compression
                          },
                        });
                    
                        // Unzip the gzip response
                        const unzippedData = zlib.gunzipSync(response.data).toString();
                    
                        let json_string = convert.toJson(unzippedData);
                        var json = JSON.parse(json_string);
                        var metarData = json.response.data.METAR;
                        var airportData = new Object();
                    
                        var airports = payload.airportList.split(",").map(function (airport) {
                            airport = airport.trim();
                            return (airport.length < 4) ? "K" + airport : airport;
                          });
                    
                        airports.forEach(function (airport) {
                            metarData.forEach(function (metar) {
                                if (airport === metar.station_id) {
                                    if (this.debug)
                                        console.log("METAR data found for " + airport);
                                    airportData[airport] = metar;
                                    return; // check next airport in list
                                }
                            });
                            console.log(metarData)
                        });
                      } catch (error) {
                        console.error('Error fetching data:', error);
                      }
                    }
                    

                    Check out my modules at: https://github.com/mumblebaj?tab=repositories

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mumblebaj Module Developer @sdetweil
                      last edited by Mar 15, 2024, 4:10 PM

                      @sdetweil I can fix the other fetch as well no issues. Give me a few on this one.

                      Check out my modules at: https://github.com/mumblebaj?tab=repositories

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      2 / 4
                      • First post
                        19/36
                        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