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.

    Syntax error in python-shell

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 2 Posters 1.6k 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.
    • R Offline
      Radu_Stancu
      last edited by

      Hi,

      I keep getting this error:

      SyntaxError: Unexpected token d in JSON at position 0
      at JSON.parse ()
      at PythonShell.asJson (/home/linaro/node_modules/python-shell/index.js:350:21)
      at /home/linaro/node_modules/python-shell/index.js:300:42
      at Array.forEach ()
      at PythonShell.recieveInternal (/home/linaro/node_modules/python-shell/index.js:298:15)
      at PythonShell.receive (/home/linaro/node_modules/python-shell/index.js:272:21)
      at Socket.emit (events.js:182:13)
      at addChunk (_stream_readable.js:279:12)
      at readableAddChunk (_stream_readable.js:260:13)
      at Socket.Readable.push (_stream_readable.js:219:10)

      I`m not entirely sure what causes it and how to fix it… the mirror seems to be working fine.

      Any help would be apreciated.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil
        last edited by

        usually that error means that somehow an object was passed into the JSON.parse() routine, which expects are string…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • R Offline
          Radu_Stancu
          last edited by

          Yea, I kind of found out what is triggering it, however I`m not sure how to stop it. The flick Large module is sending direction == OUTPUT messages continuously for some reason. Any idea what this is or how to make a filter to stop it?

          1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil
            last edited by

            Sorry know nothing about flick

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • R Offline
              Radu_Stancu
              last edited by

              https://forum.magicmirror.builders/topic/8907/flick-large-gesture-control

              Here is the code I`ve written and adapted to work as MMM module.

              1 Reply Last reply Reply Quote 0
              • R Offline
                Radu_Stancu
                last edited by

                Solved. It was actually the GPIO library for the ASUS tinker board, its RPi.GPIO implementation actually. It had a useless printf that sent that annoying message that messed up the json message. I removed that line and rebuilt from source and now it`s working flawlessly. Thanks.

                S 1 Reply Last reply Reply Quote 1
                • S Offline
                  sdetweil @Radu_Stancu
                  last edited by

                  @radu_stancu great debugging! and thanks for the detailed feedback… someone else might fall into this same trouble

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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