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

    Kereknjek

    @Kereknjek

    4
    Reputation
    309
    Profile views
    22
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Kereknjek Unfollow Follow

    Best posts made by Kereknjek

    • MagicMirror electrical cabinet door

      So, here is my build…

      Electrical cabinet:
      Holds circuit brakers, patch pannel, network switches and NAS
      cabinett

      How it should look:
      test
      My wife and daughter likes it.

      And my test setup:
      test setup

      For now, I’m runnung it on VirtualBox running Raspbian like distro.
      I have one Raspberry PI 3 runing Pihole and tor proxy for now.
      I’ll add MagicMirror to that PI once I learn to fine tune MagicMirror and when my kids let me.

      I never expected it to look so good! :drooling_face:

      Technical:
      Rear is OSB board 12mm painted black
      Glass is blue(ish) tinted 6mm thick
      22" LED display, only VGA, working with RPI using adapter
      Aluminium L profiles 20x10x2mm to hold glass in place
      Dimensions are 205 cm tall, 33cm wide, 2 cm tick, heavy as f***.
      Between glass and board there is black cloth. Behind glass it has texture like display.
      On strong light, diplay is just visible because i taped black electrical tape to metal edges. And it slightly reflects light.

      posted in Show your Mirror
      K
      Kereknjek

    Latest posts made by Kereknjek

    • Black screen with cursor fixed it self?

      I had magic mirror for, about a year and a half. There was one failure due to bad sd card, so it was upgraded to SSD. Started having random blank screen with cursor and I couldn’t find any problems. Made update to version 2.20. It worked for a few weeks and problem came back. I didn’t shut it off because I was runnung pihole on the same RPI3.
      A week a go, i replaced my airlive router with OPNsense running on thin client, and MagicMirror simply started working again.
      One thing i noticed is slightly better latency on the internet. And pihole is still running on that same Pi.

      posted in Troubleshooting
      K
      Kereknjek
    • RE: MMM-ArduPort

      I tried that.

      @Kereknjek said in MMM-ArduPort:

      Now, when running

      python arduport.py
      

      I get this:

      {"debug": "SerialPort shell started..."}
      {"debug": "Waiting Ardunio to connect on port..."}
      {"status": {"data": "connected", "name": "connect"}}
      {"status": {"data": "starting", "name": "setup"}}
      {"status": {"data": "started", "name": "setup"}}
      {"sensor": {"data": "0.02", "name": "Baterija"}}
      {"sensor": {"data": "-0.00", "name": "Struja"}}
      {"sensor": {"data": "0.00", "name": "Solarno"}}
      {"sensor": {"data": "-0.12", "name": "Panel"}}
      {"sensor": {"data": "-0.00", "name": "Inverter"}}
      {"sensor": {"data": "0.04", "name": "Baterija"}}
      {"sensor": {"data": "-0.00", "name": "Struja"}}
      {"sensor": {"data": "0.00", "name": "Solarno"}}
      
      posted in Troubleshooting
      K
      Kereknjek
    • RE: MagicMirror electrical cabinet door

      Well, I have abandoned ArduPort. Never got it to work. So I switched to json-feed.

      It wasn’t easy for me because I had zero knowledge about http requests. But I got it working.

      For anyone, with limited knowlege, like me, here is the code I’m sending from arduino ethernet server:

      void sendjson(EthernetClient cl)
      {
          // send a standard http response header
          cl.println("HTTP/1.0 200 OK");
          cl.println("Content-Type: application/json");
          cl.println("Connection: close");
          cl.println();
          // 
          cl.println("{"); // start of json data
          cl.print("\"Info\":\" ");
          if(y==true){cl.print("ERR COM");} // error in comunication
          if(y==false){
            if(inverterukljucen==1){
              cl.print("ON"); // system is on
              }
              else
              {
                cl.print("OFF"); // system is off i.e. no sun
              }
            }
          cl.println("\",");
          
          cl.print("\"Baterija\":\" "); // battery voltage
          cl.print(naponbaterije);
          cl.println(" V\",");
      
          cl.print("\"Struja\":\" "); // current going in or ouf trom battery
          cl.print(strujabaterije);
          cl.println(" A\",");
      
          cl.print("\"Proizvodnja\":\" "); // production of electricity
          cl.print(snagapanela);
          cl.print(" W / ");
          cl.print((snagapanela/560)*100);
          cl.println("%\",");
      
          cl.print("\"Teret\":\" "); // load at inverter side
          cl.print(snagainvertera);
          cl.print(" W / ");
          cl.print((snagainvertera/1200)*100); // load percentage
          cl.println(" %\"");
      
          cl.println("}"); //end of json data
      }
      

      And json data received by MM:

      {
      "Info":" ON",
      "Baterija":" 26.15 V",
      "Struja":" -0.79 A",
      "Proizvodnja":" 6.72 W / 1.20%",
      "Teret":" 27.52 W / 2.29 %"
      }
      

      And result:
      alt text

      Back of the cabinet (I have to tie those cables):
      alt text

      posted in Show your Mirror
      K
      Kereknjek
    • RE: MMM-ArduPort

      It seems I’m having isues with Python.

      I have reinstaled Python and Python3, npm, python-shell and node js. Nothing worked. It was sending errors even with blank arduino, arduino sending only “starting” and “started” commands…
      So, due to my lack of knowlege of Python or anything else surrounding ArduPort, I’m abandoning it…

      To bad. It is very elagant module.

      posted in Troubleshooting
      K
      Kereknjek
    • RE: MMM-ArduPort

      How do I do that?

      posted in Troubleshooting
      K
      Kereknjek
    • RE: MMM-ArduPort

      I have reinstaled all original files for arduport and started debuging… Again.:smiling_face_with_open_mouth_cold_sweat:

      I didn’t mention it before, but I’m running MM on Raspbian lite.
      I’ve found I had problems with python. Force reinstalling modules solved it.

      I have allso found some errors in arduino.py,
      Had to change:

      rgxData = re.compile("[\[][a-zA-Z0-9-].*[\:][a-zA-Z0-9-].*[\:][a-zA-Z0-9-.].*[\]]")
      

      to

      rgxData = re.compile("[\[][a-zA-Z0-9\-].*[\:][a-zA-Z0-9\-].*[\:][a-zA-Z0-9\-\.].*[\]]")
      

      and

      incoming = self.arduino.readline(self.arduino.in_waiting).decode('ascii').replace('\r', '').replace('\n', '')
      

      to

      incoming = self.arduino.readline(self.arduino.in_waiting).decode('ascii', errors="ignore").replace('\r', '').replace('\n', '')
      

      Now, when running

      python arduport.py
      

      I get this:

      {"debug": "SerialPort shell started..."}
      {"debug": "Waiting Ardunio to connect on port..."}
      {"status": {"data": "connected", "name": "connect"}}
      {"status": {"data": "starting", "name": "setup"}}
      {"status": {"data": "started", "name": "setup"}}
      {"sensor": {"data": "0.02", "name": "Baterija"}}
      {"sensor": {"data": "-0.00", "name": "Struja"}}
      {"sensor": {"data": "0.00", "name": "Solarno"}}
      {"sensor": {"data": "-0.12", "name": "Panel"}}
      {"sensor": {"data": "-0.00", "name": "Inverter"}}
      {"sensor": {"data": "0.04", "name": "Baterija"}}
      {"sensor": {"data": "-0.00", "name": "Struja"}}
      {"sensor": {"data": "0.00", "name": "Solarno"}}
      

      I’m guesing, this should be working now. But ArduPort is still stuck at “Waiting for connection…”

      Here is C/P from my config.js

                    {
                    module: "MMM-ArduPort",
                    position: "top_right",
                    header: "Solarni sustav",
                    config:{
                            portname: "/dev/ttyUSB0",
                            updateInterval: 1,
                            animationSpeed: 1000,
                            displayIcons: false,
                            showDescriptopn: true,
                            hideLoading: false,
                            hideWaiting: false,
                            useColors: false,
                            sensors: [
                                    {
                                    name: "Solarno",
                                    description: "Solarni sustav",
                                    maxValue: 5,
                                    maxFormat: "({0}) ",
                                    highestValue: 4,
                                    highestFormat: "({0}) Greska - pregrijavanje",
                                    highValue: 3,
                                    highFormat: "({0}) Greska - preopterecenje",
                                    lowValue: 2,
                                    lowFormat: "({0}) Backup mod",
                                    lowestValue: 1,
                                    lowestFormat: "({0}) Ukljuceno",
                                    minValue: 0,
                                    minFormat: "({0}) Iskljuceno"
                                    },
                                    {
                                    name: "Baterija",
                                    description: "Stanje baterije",
                                    maxValue: 26,
                                    maxFormat: "({0} V) Balansiranje",
                                    highestValue: 25.5,
                                    highestFormat: "({0} V) 100%",
                                    highValue: 24.87,
                                    highFormat: "({0} V) 75%",
                                    lowValue: 24.2,
                                    lowFormat: "({0} V) 50%",
                                    lowestValue: 11.74,
                                    lowestFormat: "({0} V) 25%",
                                    minValue: 23.2,
                                    minFormat: "({0} V) 0%"
                                    },
                                    {
                                    name: "Struja",
                                    description: "Punjenje ili praznjenje",
                                    maxValue: 20,
                                    maxFormat: "({0} A) Punjenje",
                                    highestValue: 10,
                                    highestFormat: "({0} A) Punjenje",
                                    highValue: 0,
                                    highFormat: "({0} A) ",
                                    lowValue: -20,
                                    lowFormat: "({0} A) Praznjenje",
                                    lowestValue: -40,
                                    lowestFormat: "({0} A) Brzo preznjenje",
                                    minValue: -60,
                                    minFormat: "({0} A) PREOPTERECENJE"
                                    },
                                    {
                                    name: "Panel",
                                    description: "Snaga solarnih panela",
                                    maxValue: 500,
                                    maxFormat: "({0} W)",
                                    highestValue: 400,
                                    highestFormat: "({0} W)",
                                    highValue: 300,
                                    highFormat: "({0} W)",
                                    lowValue: 200,
                                    lowFormat: "({0} W)",
                                    lowestValue: 100,
                                    lowestFormat: "({0} W)",
                                    minValue: 0,
                                    minFormat: "({0} W)"
                                    },
                                    {
                                    name: "Inverter",
                                    description: "Potrosnja invertera",
                                    maxValue: 1000,
                                    maxFormat: "({0} W)",
                                    highestValue: 800,
                                    highestFormat: "({0} W)",
                                    highValue: 600,
                                    highFormat: "({0} W)",
                                    lowValue: 400,
                                    lowFormat: "({0} W)",
                                    lowestValue: 200,
                                    lowestFormat: "({0} W)",
                                    minValue: 0,
                                    minFormat: "({0} W)"
                                    }
                                    ]
                            }
                    },
      

      EDIT:

      Here is C/P from chrome console:

      Starting module: MMM-ArduPort
      MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: status
      MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: {
          "action": "status",
          "name": "initialized"
      }
      MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: error
      MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: "pyshell-throw"
      MMM-ArduPort.js:123 [socketNotificationReceived::error]:
      
      posted in Troubleshooting
      K
      Kereknjek
    • MMM-ArduPort

      I’m having trouble setting up MMM-ArduPort. So if anyone can help…

      I have to point out that I’m using SAME serial port on arduino for communication with raspberry and RS485 network. For transmiting and receiveing data on RS485 I use fantastic EasyTransfer arduino library.

      Posible problem:
      When arduino receives data from RS485, it gets to TX pin on USB side and never gets to raspberry. Wich is good.
      When arduino is sending data, to transmit over RS485, it first have to activate transmision mode on RS485 module.
      In this situation, data is being sent from arduino TX to RS485 RX. But it is allso sent to USB RX, and to raspberry. Wich is bad. I gues.

      Here are symptoms:
      MM starts and ArduPort is waiting for arduino.
      I connect arduino, ArduPort receives “[status:setup:starting]” and “[status:setup:started]”
      ArduPort shows my sensors list and then it removes them and returns to “Waiting for connection…”

      My arduino code sends “[status:setup:starting]”, waits for 3 seconds and sends “[status:setup:started]” witch is normaly received by Arduport.
      But! Arduino then sends request for sensors status to RS485 wich is allso transmited to raspberry. I think that in this moment it switches to “Waiting for connection”.

      But, again, I have modified MMM-ArduPort.js so it doesen’t disconnect (commented ), and I have aded “this.isArduinoStarting = false;” and “this.isArduinoStarted = true;” right after "case ‘sensor’: "
      I modified this so arduino always stays connected, and data should be displayed whenever and whatever sensor data is received. And it actualy does switch to listing my sensors, but, again, sensor data isn’t shown.

      I taught that EasyTransfer requests that get to PI are chrashing communication, but after my mod, I can see that data is passed normaly and is not affected by EasyTransfer part.
      I gues, that part is discarded at this part in arduino.py

      match = re.match(rgxData, data)
      if match:
                  data = data[1:-1]
                  case, name, value = data.split(":")
                  to_node(case.lower(), {"name": name, "data": value})
      

      Here is photo of data being received on screen /dev/ttyUSB0 (yes… photo. I was in a hurry…)
      0_1578411025419_IMG_20200107_120847384 (Small).jpg

      Pictograms between [sensor:name:data] are EasyTransfer requests.

      I’ve even tryed this modification. It didn’t help.

      posted in Troubleshooting
      K
      Kereknjek
    • RE: MagicMirror electrical cabinet door

      I’m having trouble uploading pictures…

      But, I’m allso having trouble with MMM-ArduPort. It connects to arduino, shows sensors, and then returns to “waiting for connection…” :confused_face:

      posted in Show your Mirror
      K
      Kereknjek
    • RE: MagicMirror electrical cabinet door

      It’s been a while…

      So, I mounted my MM in place, customized it to my preference and enjoyed it for a while.

      If you read my other post about sending data from arduino to MM over ethernet, I’ve given up from it as I realy suck at programming web aplications.

      But, it’s not all lost. I’m running my “not so smart” home on multidrop RS485 network and my master node is right behind RPI3 running MM.

      So I made packet sniffing node using arduino nano.
      In short, it listens for packets that are interesting to be shown on MM, translates them to format for MMM-ArduPort and sends them over usb. If no packet is received in 5 minutes, than it sends request.

      So I installed MMM-ArduPort, configured config.js and then…
      Disaster! I was only getting black screen! I taught: “NOOOOO!!! I’m to ugly to watch my self in a mirror!”
      Started to remove modules one by one and nothing helped.
      So I deleted MagicMirror folder and went to reinstal. But instalation got frozen at “Updating packages”.
      Fortunatly, manual instalation worked. I reinstalled all modules and copied configuration from old config.js (yes, i made backup :D ), and finaly got it to work.

      Problem was that i have updated it prior installing MMM-ArduPort and somehow update crashed MM.

      Now it is 1:57 am so I’m going to sleep. Arduport will have to wait till morning.

      I’ll slap some new pictures tomorrow!

      posted in Show your Mirror
      K
      Kereknjek
    • MagicMirror electrical cabinet door

      So, here is my build…

      Electrical cabinet:
      Holds circuit brakers, patch pannel, network switches and NAS
      cabinett

      How it should look:
      test
      My wife and daughter likes it.

      And my test setup:
      test setup

      For now, I’m runnung it on VirtualBox running Raspbian like distro.
      I have one Raspberry PI 3 runing Pihole and tor proxy for now.
      I’ll add MagicMirror to that PI once I learn to fine tune MagicMirror and when my kids let me.

      I never expected it to look so good! :drooling_face:

      Technical:
      Rear is OSB board 12mm painted black
      Glass is blue(ish) tinted 6mm thick
      22" LED display, only VGA, working with RPI using adapter
      Aluminium L profiles 20x10x2mm to hold glass in place
      Dimensions are 205 cm tall, 33cm wide, 2 cm tick, heavy as f***.
      Between glass and board there is black cloth. Behind glass it has texture like display.
      On strong light, diplay is just visible because i taped black electrical tape to metal edges. And it slightly reflects light.

      posted in Show your Mirror
      K
      Kereknjek