MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Rags
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    R
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 20
    • Posts 95
    • Groups 0

    Posts

    Recent Best Controversial
    • Missing token.json issue in MMM-Spotify

      Firstly, my screen is not touch screen. I just need this module to display the songs currently being played on spotify. Will it work only for display?

      After installing the module successfully and configuring, spotify.config.json with the client id and client secret, the module is not working. The spotify image appears on the screen but nothing else.
      While trying to debug, After running npm start , the error shown is token.json file missing.

      [SPOTIFY - xxxxxgrxqe4xps01xxxxxxx] Token file not found! /home/pi/MagicMirror/modules/MMM-Spotify/USERNAME_token.json
      [15.05.2023 08:09.37.724] [ERROR] [SPOTIFY - xxxxxxps01uyt6kxxxxxx] Token error! ./USERNAME_token.json ( (I entered the random chars of USERNAME))

      When i checked the module folder, I could not find the token.json file in MMM-Spotify folder. Does it get generated automatically when the code runs?

      I have two queries. on the spotify.config.json file that needs to be configured prior to running MMM-Spotify.
      [
      {
      “USERNAME”: “A_NAME_TO_IDENTIFY_YOUR_ACCOUNT”,
      “CLIENT_ID”: “PUT_YOUR_SPOTIFY_APP_CLIENT_ID”,
      “CLIENT_SECRET”: “PUT_YOUR_SPOTIFY_APP_CLIENT_SECRET”,
      “TOKEN”: “./USERNAME_token.json”
      }
      ]

      Is the USERNAME required to be the one on spotify account? Can the name be anything else? (my username in spotify is some random characters, can it be replaced with display name or email account)
      In the “TOKEN” config line is the “./USERNAME to be replaced with the username mentioned above or has it to be left as it is? (”./USERNAME_token.json")

      I have raised an isue in the Github repo.
      Thanks

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil Sure noted. Thanks

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @MMRIZE Finally ! Finally…
      I disabled all modules, except newsfeed, then cleared out the custom.css configs and added a fresh config for newsfeed as suggested above and finally it worked.
      So was the issue just because of the corrupt custom.css?
      Anyways, this issue has enabled me to learn working with the developer console. I am glad.
      Thank you @MMRIZE and thank you @sdetweil . Ever obliged.

      nfs2.png

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil nf4.png
      After struggling, this is what i managed to take a screenshot of. It does not show the styles of the selected content in the dev screen.

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil i am sorry but i am unable to follow correctly what u are advising. However, the HTML code does not seem to contain the newsfeed title descrp. nf32023-04-26_20-53-20.png
      i think i selected the module content to expand, and i also changed the custom.css entry as suggested. The style display window is not showing the newsfeed entry. I am again not sure if i am doing the right thing. Anyways i am learning as we go.
      On second thoughts the process of changing the font size is so tedious (as it seems to me now), I wonder if there is an alternate way.

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil nf22023-04-26_19-20-40.png

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil dev window 2023-04-26_17-35-29.png
      Obviously i am doing something wrong.
      I am unable to get to the style even when newsfeed element is highlighted. Or, the style is picking up from main.css and changing anything here will impact all styles.

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @MMRIZE I am stumped. The changes to the color happened, but the resizing still not responding.
      2023-04-25_18-49-58.png
      2023-04-25_18-48-54.png

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @MMRIZE It is still placed there ( /home/pi/MagicMirror/css/custom.css) , and configured with font-size:60px. I only copied that file into newsfeed module folder since the font size was not increasing, and thought to just try if it works by placing it into the newsfeed module folder.

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil I have made changes to both custom.css file and newsfeed.css file. I also copied the custom.css file into newsfeed module folder. Nothing seems to work.

      css/custom.css configuration;

      .MMM-pihole-stats {
      color: #fff; /* change the font color */
      }

      .MMM-pihole-stats .dimmed {
      color: #aaa; /* change the color of dimmed elements */
      }

      .MMM-pihole-stats .bright {
      color: #ff0; /* change the color of bright elements */
      }
      .MMM-pihole-stats .small.bright {
      color: red;
      }
      .MMM-pihole-stats {
      font-size: 60px;
      }

      **.newsfeed {

      font-size:70px;
      margin-bottom: 0.5em;
      }**

      newsfeed.css configuration;

      iframe.newsfeed-fullarticle {
      width: 100vw;
      /* very large height value to allow scrolling */
      height: 3000px;
      top: 0;
      left: 0;
      border: none;
      z-index: 1;
      }

      .region.bottom.bar.newsfeed-fullarticle {
      bottom: inherit;
      top: -90px;
      }

      .newsfeed-list {
      list-style: none;
      }

      .newsfeed-list li {
      text-align: justify;
      font-size:70px;
      margin-bottom: 0.5em;
      }

      Need further help please.

      posted in Troubleshooting
      R
      Rags
    • RE: Resizing font size of modules

      @sdetweil I inspected the developer page for newsfeed and it indicates that the font size configuration is being picked up from main.css. So changing the font size here is messing up all the sizes and consequently all the MM modules. How to resize only for the font size of newsfeed. How to make the custom.css priority or the newsfeed.css as the priority.

      posted in Troubleshooting
      R
      Rags
    • Resizing font size of modules

      Ok, so i have searched in the forum to find out how to do this. There is some information but confusing. I recently upgraded my monitor from 18 inch to a 27 inch monitor. I also changed the orientation to portrait. I had to reposition some modules for aesthetics. Some module fonts are too small to be clearly visible from a distance. For eg i am trying to increase the font size of the default module newsfeed. The forum answers are confusing (at least for me). SO there is a custom.css file in CSS folder in MM directory. The (CSS/custom.css) . Is the values to be defined here in this folder? Or in the modules folder .css file. There is a newsfeed.css file in newsfeed module folder. I added the configuration for size but nothing is happening.
      I also tried to change the display size (cntrl+shift+ +), but the display of modules increases disproportionately.
      So need help here.
      Thanks.

      posted in Troubleshooting
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @karsten13 said in ChatGpt developed Module MMM-Dockerstat:

      @Rags

      missed the -a

      ❯ docker ps -a --format "{{.Names}} {{.State}}"
      magicmirror running
      watchtower running
      traefik running
      

      Great !
      Yes the command is working now but locally on the docker machine only. It needs to work from the first machine after ssh ing into docker machine.
      ssh
      .exec (‘docker ps -a --format “{{.Names}} {{.State}}”’)
      .on(‘error’, (err) => {
      console.error(Error: ${err});
      this.status = ‘Error’;
      this.sendSocketNotification(‘STATUS_UPDATE’, { status: this.status, icon: this.offlineIcon });
      })

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @karsten13 said in ChatGpt developed Module MMM-Dockerstat:

      docker ps --format "{{.Names}} {{.State}}

      should this command produce an output when run directly on the docker machine? I am not getting any output.!
      2023-04-03_07-55-53.png

      Docker ps -a gives this output listing all containers whether up or exited. I need to just pickup name and status
      2023-04-03_08-12-19.png
      Now just need to workout (as Sam says ‘the fun part’) ssh into second pi retrieve the docker ps -a and display.

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @sdetweil said in ChatGpt developed Module MMM-Dockerstat:

      @Rags but are you running this on the docker host? outside any container?

      if u run this from INSIDE the container (where MM is running) , does it work?

      as I recall, it does not.

      I think the command (on the host) is

      Usage:  docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
      

      docker exec container_id “docker -ps … rest of parms”

      but you will have to use docker command to get the container_id from the name to use in the exec

      long time ago, 9 years now, I wrote a whole bunch of scripts to support using docker to deploy and manage a software api testing service…

      Sorry if i have not been clear. My MagicMirror is in the living room. The MM is running on the first pi( standalone ) not in any container. The second pi in my network is tucked away in my study. This machine is installed with Docker containing multiple containers, which include pihole, wireguard, nginx, apache etc. Occasionally, one or two containers would quit running and I would realise quite late that a particular service is down. That’s why i was trying to build this module so that the status of all containers are known in a jiffy on the MM display.
      So when the MM docker module probes the second pi it should just ssh into it and retrieve the docker status easily, format the info in an array and display it. Simple (apparently ).

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @mumblebaj said in ChatGpt developed Module MMM-Dockerstat:

      @Rags The output from the query does not return a Status of “Online”

      See below what it returns.

      6ddea81e-8969-4d68-b3c3-62dfb470ab10-image.png

      Yes you are right even i got a similar output when the command was run on the second pi directly. So at least we are getting somewhere. Good news.
      sudo docker ps -f name=wireguard --format “{{.Names}} {{.Status}}”
      wireguard Up 36 hours.
      so now i have to figure out a command line to get status of all containers in a table form with name of container and the uptime.

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @sdetweil said in ChatGpt developed Module MMM-Dockerstat:

      @mumblebaj can u see the container names from inside a container?

      ‘Docker ps’ command list all the containers that are currently running. So i guess the command will execute and should be able to confirm the status with the command
      " ‘.exec(sudo docker ps -f name=${payload.container} --format "{{.Names}} {{.Status}}")’"

      This command uses the Docker CLI (Command Line Interface) to list the running Docker containers on a host, filtering the results by the name of the container specified in payload.container. The --format option specifies how to format the output of the docker ps command. In this case, {{.Names}} {{.Status}} is used to output only the names and statuses of the containers that match the specified filter. The output is then captured and processed by the SSH library used in the code.

      anyways " work in progress ".

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @mumblebaj {
      module: ‘MMM-Dockerstat’,
      header: ‘Docker Status’,
      position: ‘top_right’,
      config: {
      host: ‘192.168.1.200’, // IP address of the second Pi running Docker
      interval: 600000, //60 seconds
      user:‘pi’,
      password:‘mypass’,
      container: ‘wireguard’, // just added to check
      offlineIcon: ‘fa-times-circle’, // Font Awesome icon for offline status
      onlineIcon: ‘fa-check-circle’ // Font Awesome icon for online status
      }
      },
      Yes i added the name of the container. It is still not displaying the status. Anyways the idea was for the module to probe and display the status of all containers running in docker.

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @mumblebaj
      Yes Sir. I noticed the changes committed by you and I immediately approved the merge commit. Please understand this is my first attempt and I had ChatGPT to help me. I guess we both are still learning. Well, I cloned the fresh updated repository and installed it. Now when i run it the constantly rotating arrow is not displayed anymore, but even the status of the containers are not being displayed. The npm start logs do not have any error messages. The dev console is also not indicating any issue. So probably some more debug is required. Sincere request to keep assisting till it is resolved.
      Thanks

      posted in Development
      R
      Rags
    • RE: ChatGpt developed Module MMM-Dockerstat

      @mumblebaj
      Thanks for the help, i am running with npm start. The display does not show the status of the docker containers. Instead the rotating arrow is continuously displayed.
      I don’t know if the these error messages will indicate something, however here goes

      The error msg with npm start;
      02.04.2023 17:12.36.528] [LOG] Host 192.168.1.200 is offline.
      [02.04.2023 17:12.36.530] [ERROR] (node:11566) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading ‘info’)
      at /home/pi/MagicMirror/modules/MMM-Dockerstat/node_helper.js:59:21
      at /home/pi/MagicMirror/modules/MMM-Dockerstat/node_modules/ping/lib/ping-sys.js:40:9
      [02.04.2023 17:12.36.531] [ERROR] (node:11566) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
      with developer console;

      Failed to load resource: the server responded with a status of 404 (Not Found)
      0.0.0.0/:1 Refused to execute script from ‘http://0.0.0.0:8088/modules/MMM-Dockerstat/fontawesome.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
      loader.js:194 Error on loading script: modules/MMM-Dockerstat/fontawesome.js
      script.onerror @ loader.js:194

      posted in Development
      R
      Rags
    • 1
    • 2
    • 3
    • 4
    • 5
    • 2 / 5