MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED Syntax error in python-shell

    Troubleshooting
    2
    7
    1146
    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
      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
        sdetweil last edited by

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

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • R
          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
            sdetweil last edited by

            Sorry know nothing about flick

            Sam

            Create a working config
            How to add modules

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

                  Create a working config
                  How to add modules

                  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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy