Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Error while uploading files to GPy

    Scheduled Pinned Locked Moved Discussion
    upload failuregpy
    4 Posts 3 Posters 947 Views 3 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.
    • S Offline
      sprasad
      last edited by

      While I'm trying to upload files to GPy, I find the following error

        File "main.py", line 6, in <module>
        File "sensors.py", line 1
      SyntaxError: invalid syntax
      MicroPython v1.8.6-849-83e2f7f on 2018-03-19; GPy with ESP32
      Type "help()" for more information.
      

      Here is the first line of sensors.py file
      from machine import Pin, I2C, Timer, UART, ADC
      It was working all fine till yesterday and today I implemented a new function and facing this issue. Also, on running sensors.py separately using console, it isn't showing any syntax errors and running fine.
      What could have gone wrong here?

      robert-hhR J 2 Replies Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @sprasad
        last edited by

        @sprasad Micropython is sometimes 1 of in line number errors. So the actual error could be in line 2. When you say "run from console", do the start that bye:
        import sensors
        of by pasting the content? The latter case could hide a tab/space mix in the file.

        1 Reply Last reply Reply Quote 0
        • J Offline
          jmarcelino @sprasad
          last edited by jmarcelino

          Hi @sprasad

          How are you uploading the files to the GPy, using Pymakr plugin for Atom/VS Code?

          There was a bug in Pymakr causing corruption the first byte of the file in some specific cases (number of characters on the file - if your code has between 6912 and 7167 characters you’d have tripped on this problem)

          This should have been fixed in the latest release. If you're using Pymakr please update it.

          1 Reply Last reply Reply Quote 1
          • S Offline
            sprasad
            last edited by

            @jmarcelino @robert-hh Thank you for the inputs guys!
            This is what solved the issue for me,
            I thoroughly debugged the functions written in sensors.py file. There were some errors in the newly implemented functions which I corrected and then things started working fine!

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom