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.

    MMM-SunnyPortal not reading data - more then one plants not showing any values on MM2

    Scheduled Pinned Locked Moved Utilities
    14 Posts 2 Posters 1.3k Views 2 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.
    • F Offline
      frits.erasmus @sdetweil
      last edited by

      @sdetweil

      npm install
      
      up to date, audited 58 packages in 6s
      
      2 packages are looking for funding
        run `npm fund` for details
      
      2 moderate severity vulnerabilities
      
      Some issues need review, and may require choosing
      a different dependency.
      
      Run `npm audit` for details.
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ ^C
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ npm fund
      mmm-sunnyportal@1.4.0
      +-- https://github.com/sponsors/feross
      |   `-- safe-buffer@5.2.1
      `-- https://github.com/sponsors/epoberezkin
          `-- ajv@6.12.6
      
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ ^C
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ ^C
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ ^C
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ ^C
      frits@raspberrypi:~/MagicMirror/modules/MMM-SunnyPortal $ npm audit
      # npm audit report
      
      request  *
      Severity: moderate
      Server-Side Request Forgery in Request - https://github.com/advisories/GHSA-p8p7-x288-28g6
      Depends on vulnerable versions of tough-cookie
      No fix available
      node_modules/request
      
      tough-cookie  <4.1.3
      Severity: moderate
      tough-cookie Prototype Pollution vulnerability - https://github.com/advisories/GHSA-72xf-g2v4-qvf3
      No fix available
      node_modules/tough-cookie
      
      2 moderate severity vulnerabilities
      
      Some issues need review, and may require choosing
      a different dependency.
      

      04dabdad-4dec-4144-b8ec-eb7d2f43a547-image.png

      S 1 Reply Last reply Reply Quote 0
      • F Offline
        frits.erasmus @sdetweil
        last edited by

        @sdetweil

        frits@raspberrypi:~/MagicMirror/config $ pm2 start mm
        [PM2] Applying action restartProcessId on app [mm](ids: [ 0 ])
        [PM2] mm ✓
        [PM2] Process successfully started
        ┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
        │ id │ name │ mode │ ↺ │ status │ cpu │ memory │
        ├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
        │ 0 │ mm │ fork │ 3 │ online │ 0% │ 2.8mb │

        1 Reply Last reply Reply Quote 0
        • S Away
          sdetweil @frits.erasmus
          last edited by sdetweil

          @frits-erasmus no. how do you start MagicMirror?

          if at boot w pm2, then do

          pm2 stop all
          

          then

           cd ~/MagicMirror 
          npm start
          

          see if there are any messages relative to this module

          to stop MagicMirror
          press ctrl-q

          to restart as on boot
          do

          pm2 status
          pm2 restart  xxx
          

          where xxx is the number on the line or name on the line of the app you want to start (I have 10 apps on mine, with multiple copies of MagicMirror… so I have to use the number)

          start and restart do the same when the app not running

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          F 1 Reply Last reply Reply Quote 0
          • F Offline
            frits.erasmus @sdetweil
            last edited by

            @sdetweil said in MMM-SunnyPortal not reading data - more then one plants not showing any values on MM2:

            pm2 restart

            [2024-05-10 15:27:39.078] [LOG] SocketNotification START_SUNNYPORTAL received for the first time…setting updateInterval to 900000ms
            [2024-05-10 15:27:39.083] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing day data
            [2024-05-10 15:27:39.260] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing month data
            [2024-05-10 15:27:39.275] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing year data
            [2024-05-10 15:27:39.293] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing total data

            1 Reply Last reply Reply Quote 0
            • F Offline
              frits.erasmus
              last edited by

              frits@raspberrypi:~/MagicMirror $ npm start

              magicmirror@2.27.0 start
              DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js

              [2024-05-10 16:13:26.448] [LOG] Starting MagicMirror: v2.27.0
              [2024-05-10 16:13:26.523] [LOG] Loading config …
              [2024-05-10 16:13:26.533] [LOG] config template file not exists, no envsubst
              [2024-05-10 16:13:26.543] [LOG] Loading module helpers …
              [2024-05-10 16:13:26.545] [LOG] No helper found for module: alert.
              [2024-05-10 16:13:27.288] [LOG] Initializing new module helper …
              [2024-05-10 16:13:27.289] [LOG] Module helper loaded: updatenotification
              [2024-05-10 16:13:28.046] [LOG] Initializing new module helper …
              [2024-05-10 16:13:28.048] [LOG] Module helper loaded: MMM-ImagesPhotos
              [2024-05-10 16:13:28.196] [LOG] Initializing new module helper …
              [2024-05-10 16:13:28.197] [LOG] Module helper loaded: MMM-OpenWeatherMapForecast
              [2024-05-10 16:13:28.198] [LOG] No helper found for module: MMM-FlipClock.
              [2024-05-10 16:13:29.120] [LOG] Initializing new module helper …
              [2024-05-10 16:13:29.121] [LOG] Module helper loaded: MMM-SunnyPortal
              [2024-05-10 16:13:29.848] [LOG] Initializing new module helper …
              [2024-05-10 16:13:29.849] [LOG] Module helper loaded: MMM-MQTT
              [2024-05-10 16:13:29.850] [LOG] All module helpers loaded.
              [2024-05-10 16:13:29.875] [LOG] Starting server on port 8080 …
              [2024-05-10 16:13:32.692] [LOG] Server started …
              [2024-05-10 16:13:32.695] [LOG] Connecting socket for: updatenotification
              [2024-05-10 16:13:32.698] [LOG] Starting module helper: updatenotification
              [2024-05-10 16:13:32.699] [LOG] Connecting socket for: MMM-ImagesPhotos
              [2024-05-10 16:13:32.701] [LOG] Starting node helper for: MMM-ImagesPhotos
              [2024-05-10 16:13:32.703] [LOG] Connecting socket for: MMM-OpenWeatherMapForecast
              [2024-05-10 16:13:32.706] [LOG] ====================== Starting node_helper for module [MMM-OpenWeatherMapForecast]
              [2024-05-10 16:13:32.710] [LOG] Connecting socket for: MMM-SunnyPortal
              [2024-05-10 16:13:32.712] [LOG] Starting node helper for: MMM-SunnyPortal
              [2024-05-10 16:13:32.714] [LOG] Connecting socket for: MMM-MQTT
              [2024-05-10 16:13:32.717] [LOG] MMM-MQTT: Starting node helper
              [2024-05-10 16:13:32.718] [LOG] Sockets connected & modules started …
              [2024-05-10 16:13:33.281] [LOG] Launching application.
              [2024-05-10 16:13:39.304] [INFO] System information:

              SYSTEM: manufacturer: ; model: ; raspberry: undefined; virtual: false

              OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.28+rpt-rpi-v8

              VERSIONS: electron: 29.1.6; used node: 20.9.0; installed node: 20.13.0; npm: 10.5.2; pm2: 5.3.1

              OTHER: timeZone: Africa/Johannesburg; ELECTRON_ENABLE_GPU: undefined

              [2024-05-10 16:13:40.158] [LOG] Config based debug=module_2_MMM-ImagesPhotos
              [2024-05-10 16:13:40.166] [LOG] SocketNotification START_SUNNYPORTAL received for the first time…setting updateInterval to 900000ms
              [2024-05-10 16:13:40.170] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing day data
              [2024-05-10 16:13:40.329] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing month data
              [2024-05-10 16:13:40.346] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing year data
              [2024-05-10 16:13:40.360] [LOG] [_login] Trying to login to https://www.sunnyportal.com/FixedPages/HoManLive.aspx/Templates/Start.aspx?ReturnUrl=%2F for accessing total data
              [2024-05-10 16:13:40.472] [INFO] updatenotification: Updater Class Loaded!
              [2024-05-10 16:13:40.473] [INFO] updatenotification: Checking PM2 using…
              [2024-05-10 16:13:40.478] [INFO] Checking git for module: MMM-ImagesPhotos
              [2024-05-10 16:13:40.721] [INFO] updatenotification: [PM2] You are not using pm2
              [2024-05-10 16:13:40.818] [INFO] Checking git for module: MMM-OpenWeatherMapForecast
              [2024-05-10 16:13:40.881] [INFO] Checking git for module: MMM-FlipClock
              [2024-05-10 16:13:40.950] [INFO] Checking git for module: MMM-SunnyPortal
              [2024-05-10 16:13:41.071] [INFO] Checking git for module: MMM-MQTT
              [2024-05-10 16:13:41.213] [INFO] Checking git for module: MagicMirror
              [2024-05-10 16:13:41.406] [LOG] [MMM-OpenWeatherMapForecast] 10-May-24 16:13 ** ERROR ** null
              [2024-05-10 16:13:41.643] [LOG] [_login] Cookie Value: BIGipServerPool_P_SunnyPortal=3053758656.20480.0000
              [2024-05-10 16:13:41.647] [ERROR] Whoops! There was an uncaught exception…
              [2024-05-10 16:13:41.656] [ERROR] TypeError: Cannot read properties of null (reading ‘1’)
              at Request._callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_helper.js:86:103)
              at self.callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:185:22)
              at Request.emit (node:events:514:28)
              at Request. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1154:10)
              at Request.emit (node:events:514:28)
              at IncomingMessage. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1076:12)
              at Object.onceWrapper (node:events:628:28)
              at IncomingMessage.emit (node:events:526:35)
              at endReadableNT (node:internal/streams/readable:1408:12)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
              [2024-05-10 16:13:41.657] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
              [2024-05-10 16:13:41.659] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
              [2024-05-10 16:13:41.676] [LOG] [_login] Cookie Value: BIGipServerPool_P_SunnyPortal=3120867520.20480.0000
              [2024-05-10 16:13:41.678] [ERROR] Whoops! There was an uncaught exception…
              [2024-05-10 16:13:41.680] [ERROR] TypeError: Cannot read properties of null (reading ‘1’)
              at Request._callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_helper.js:86:103)
              at self.callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:185:22)
              at Request.emit (node:events:514:28)
              at Request. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1154:10)
              at Request.emit (node:events:514:28)
              at IncomingMessage. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1076:12)
              at Object.onceWrapper (node:events:628:28)
              at IncomingMessage.emit (node:events:526:35)
              at endReadableNT (node:internal/streams/readable:1408:12)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
              [2024-05-10 16:13:41.681] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
              [2024-05-10 16:13:41.682] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
              [2024-05-10 16:13:41.696] [LOG] [_login] Cookie Value: BIGipServerPool_P_SunnyPortal=3120867520.20480.0000
              [2024-05-10 16:13:41.698] [ERROR] Whoops! There was an uncaught exception…
              [2024-05-10 16:13:41.700] [ERROR] TypeError: Cannot read properties of null (reading ‘1’)
              at Request._callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_helper.js:86:103)
              at self.callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:185:22)
              at Request.emit (node:events:514:28)
              at Request. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1154:10)
              at Request.emit (node:events:514:28)
              at IncomingMessage. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1076:12)
              at Object.onceWrapper (node:events:628:28)
              at IncomingMessage.emit (node:events:526:35)
              at endReadableNT (node:internal/streams/readable:1408:12)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
              [2024-05-10 16:13:41.701] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
              [2024-05-10 16:13:41.702] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
              [2024-05-10 16:13:41.718] [LOG] [_login] Cookie Value: BIGipServerPool_P_SunnyPortal=3053758656.20480.0000
              [2024-05-10 16:13:41.722] [ERROR] Whoops! There was an uncaught exception…
              [2024-05-10 16:13:41.723] [ERROR] TypeError: Cannot read properties of null (reading ‘1’)
              at Request._callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_helper.js:86:103)
              at self.callback (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:185:22)
              at Request.emit (node:events:514:28)
              at Request. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1154:10)
              at Request.emit (node:events:514:28)
              at IncomingMessage. (/home/frits/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1076:12)
              at Object.onceWrapper (node:events:628:28)
              at IncomingMessage.emit (node:events:526:35)
              at endReadableNT (node:internal/streams/readable:1408:12)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
              [2024-05-10 16:13:41.724] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
              [2024-05-10 16:13:41.724] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
              [2024-05-10 16:13:42.376] [LOG] MMM-MQTT: Starting client for 192.168.1.23:1883 user erasmi
              [2024-05-10 16:13:42.377] [LOG] MMM-MQTT: Connecting to mqtt://192.168.1.23:1883
              [2024-05-10 16:13:42.598] [LOG] MMM-MQTT connected to mqtt://192.168.1.23:1883
              [2024-05-10 16:13:42.600] [LOG] MMM-MQTT: subscribing to sbfspot/2130438237 Topic.PDC1

              S 1 Reply Last reply Reply Quote 0
              • S Away
                sdetweil @frits.erasmus
                last edited by

                @frits-erasmus yep. either didn’t get data or api changed

                1000025938.jpg

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  frits.erasmus @sdetweil
                  last edited by

                  @sdetweil
                  Sam,

                  I think it is because I have two plants registered and manually logging onto the site incurs another step where one has to select the correct plant. That step is not a usual step when you only have one plant registered. That, I think causes MMM-SunnyPoprtal to fail.

                  I also have two SunnyBow inverters that might contribute to this complexity.

                  I will then go the MQTT route until the SunnyPortal is resolved. I also left a message for the developer in Github.
                  I have an MQTT server running on my LAN and I have feeds of everything I would like to monitor, so that could potentially be the better route to take

                  To play save I am going to start fresh with an SSD /NVME - M.2 for stability

                  In your message starting with " no. how do you start MagicMirror?" I learned quite a lot.
                  Is that way of starting supposed to give no RED messages when I connect via SSH?

                  I saw several lines withRED text.

                  c8b0edfe-8af1-4ce5-80bf-9cac99638b3d-image.png

                  I suppose there should be no RED text when there are no errors?

                  I will also do a little more reading now that I have a basic understanding of how MM2 works

                  See you in my next post (Sorry for being such a nuisance)

                  S 1 Reply Last reply Reply Quote 0
                  • S Away
                    sdetweil @frits.erasmus
                    last edited by

                    @frits-erasmus yes the red is a fatal error on the module.

                    request is a li rare to get data (request it). many developers did not properly handle errors.

                    in this case it looks like the data is supposed to contain an array xxx[1] and that is not the case. oops…

                    I don’t know if it because of error, or api change , or multiple sources.

                    how MagicMirror works
                    the modulename.js runs in the browser (electron is a browser), but as such it cannot directly access the system it runs on for security (can’t read files, fiddle w hardware , reformat your disks…)

                    so the module has a helper, that runs o the server side which CAN do all that.

                    so the modulename.js sends a request to the helper to get data. the helper does it, and sends back. … the modilenane.js is waiting (loading… on the screen)
                    but if there is an error most helpers do not send back. so both sides are waiting…
                    helper gor another request modulename.js a response to last request…

                    stalemate…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • F Offline
                      frits.erasmus
                      last edited by

                      Thanks Sam for that info.
                      Although I do not understand it 100% it gives me an idea why there is an issue with that module.

                      I started from scratch and this time took it slow.
                      Used your script on your github page made the install so much cleaner.
                      THANKS for your effort there!!

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • 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