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

    Posts

    Recent Best Controversial
    • RE: skywriter - python to javascript

      I’ve got following error:

      SyntaxError: Unexpected token g in JSON at position 0
      at PythonShell.asJson (/home/pi/MagicMirror/modules/MMM-skywriter/node_modules/python-shell/index.js:142:21)
      at /home/pi/MagicMirror/modules/MMM-skywriter/node_modules/python-shell/index.js:232:35
      at Array.forEach (native)
      at PythonShell.receive (/home/pi/MagicMirror/modules/MMM-skywriter/node_modules/python-shell/index.js:231:11)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:188:7)
      at readableAddChunk (_stream_readable.js:176:18)
      at Socket.Readable.push (_stream_readable.js:134:10)
      at Pipe.onread (net.js:543:20)

      Here is the script:
      `#!/usr/bin/env python
      import sys
      import json
      import time
      import signal
      import skywriter

      some_value = 5000

      last_airwheel = 0
      delay = 5000

      def to_node(type, message):
      # convert to json and print (node helper will read from stdout)
      try:
      print(json.dumps({type: message}))
      except Exception:
      pass
      # stdout has to be flushed manually to prevent delays in the node helper communication
      sys.stdout.flush()

      to_node(“status”, ‘Skywriter started…’)

      @skywriter.flick()
      def flick(start,finish):

      #slide music player div OFF the screen
      if(start == "north" and finish == "south"):
      	print "gesture is north to south"
      	to_node("gesture", "down")
      
      #slide music player div ONTO the screen
      elif(start == "south" and finish == "north"):
      	print "gesture is south to north"
      	to_node("gesture", "up")
      
      #Next track
      elif(start == "west" and finish == "east"):
      	print "Gesture is west to east"
      	to_node("gesture", "next")
      
      #previous track
      elif(start == "east" and finish == "west"):
      	print "Gesture is east to west"
      	to_node("gesture", "previous")
      
      #else:
      	# print "Invalid"
      

      @skywriter.airwheel()
      def spinny(delta):
      global some_value
      global last_airwheel
      global delay
      some_value += delta
      if some_value < 0:
      some_value = 0
      if some_value > 10000:
      some_value = 10000
      now = int(round(time.time() * 1000))
      if(now - last_airwheel > delay):
      print(“TV & Digibox: power”)
      # system(“irsend SEND_ONCE TV KEY_POWER”)
      # system(“irsend SEND_ONCE Digibox KEY_POWER”)
      last_airwheel = now

      signal.pause()`

      I do not really understand what is wrong? Anybody an idea?

      posted in Development
      K
      kclemen
    • Images issue on forum

      Since day 1 I have issues with all the images posted on this board. They only load for a part of the image?!

      alt text

      posted in General Discussion
      K
      kclemen
    • RE: skywriter - python to javascript

      fixed it…

      posted in Development
      K
      kclemen
    • RE: logitech media server (Squeezebox)

      Found 2 github repositories:

      If anybody could implement this, would be highly appreciated.

      [card:piotrraczynski/squeezenode]
      [card:mozz100/node-logitechmediaserver]

      posted in Requests
      K
      kclemen
    • RE: iFrame

      [card:desertblade/iFrame]

      posted in Requests
      K
      kclemen
    • RE: skywriter - python to javascript

      ok, first steps are being taken… https://github.com/Kclemen/MMskywriter

      posted in Development
      K
      kclemen
    • RE: skywriter - python to javascript

      @Jopyth Thanks for your wonderful reply. Will take a look at it as soon the skywriter is delivered.

      posted in Development
      K
      kclemen
    • RE: MMM-NetworkScanner

      @ianperrin I tough the problem was solved by what I stated in the edit of the previous post. But my mobile just went to offline on the mirror, even though wifi is still on…

      {
      module: ‘MMM-NetworkScanner’,
      header: ‘Aanwezig in huis’,
      position: ‘top_left’,
      config: {
      devices: [
      { macAddress: “1xxx”, name: “mom”, icon: “mobile”},
      { macAddress: “xxx”, name: “dad”, icon: “mobile”},
      /**** { macAddress: “xxxc”, name: “Laptop”, icon: “laptop”}, /
      /
      { macAddress: “xxx”, name: “Mobile”, icon: “mobile”}, ****/
      ],
      showUnknown: false,
      showOffline: true,
      keepAlive: 300,
      updateInterval: 60
      }
      },

      posted in Utilities
      K
      kclemen
    • RE: MMM-NetworkScanner

      Cool module, shows directly the mobiles based on their MAC adress nicely. However, the online status is not displayed (yes, wifi is on and the mac addresses are correct :)). Any idea?

      EDIT; seems that only lowercase MAC adress work. My mobile phone just popped up, after changing the MAC address from uppercase (copy of advanced ip scanner) to lowercase.

      posted in Utilities
      K
      kclemen
    • RE: skywriter - python to javascript

      Thanks for your reply. First glance at the link, seems to be rather difficult to implement what I want.

      Following code can be generated in py to link an action to a certain “gesture”:
      if(start == “north” and finish == “south”):
      print “Volume: down”
      system(“irsend SEND_ONCE TV KEY_VOLUMEDOWN”)
      elif(start == “south” and finish == “north”):
      print “Volume: up”
      system(“irsend SEND_ONCE TV KEY_VOLUMEUP”)

      I would like to slde in a certain dev when I wave from “north” to “south”… Searches on the net results that py and javascript do not work ery well together?

      posted in Development
      K
      kclemen
    • 1 / 1