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

    Pymakr: connected but cannot run script over serial

    Scheduled Pinned Locked Moved Pymakr
    6 Posts 3 Posters 2.7k 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.
    • B Offline
      Busta
      last edited by

      Hi,

      just got the WiPy 2.0 board. I updated the firmware to the latest version and am running Pymakr 1.0.0.b8 version on Win7 64bit. I can successfully connect to the wipy using a serial connection. It says "connected" in the repl prompt and I can type stuff and get proper answers. I then wanted to run a script. So I type some code in a file that I named "main.py":

      from machine import I2C
      #configure the I2C bus
      i2c = I2C(0, I2C.MASTER, baudrate=100000)
      i2c.scan() # returns list of slave addresses

      and I also added a file named "boot.py" with the following code:

      from machine import UART
      import os
      uart = UART(0, 115200)
      os.dupterm(uart)

      I then tried to sync the projecto to the Wipy by pressing Sync but every time I do that it says:

      Syncing the project with the WiPy. Please wait...
      Syncing failed!

      Resetting doesn't help. To sum it up, I can use the REPL command but I cannot run a script over serial. Did I understand the usage of the boot.py and main.py file correctly? Do I always have to put my code inside "main.py" to run it? What am I doing wrong? It seems to work over WifI but not over serial...I'm lost and very new to this micropython stuff...

      Thanks for your help!

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @Busta
        last edited by livius

        @Busta

        Do I always have to put my code inside "main.py" to run it

        No you can write any file e.g. my.py
        and exec it like:
        execfile('my.py') in e.g. REPL or telnet

        especially i do not use pymakr
        i connect by ftp(filezilla) + COM port monitor
        by filezilla i edit and upload files
        by REPL i execute and test things

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • B Offline
          Busta
          last edited by

          Ok, thanks for the info. Just tried it in Pymakr. Added a simple print statement to my "main.py" file as a test then ran:

          execfile("main.py") but nothing shows up in the repl prompt.

          Mmmm...I don't know what to do.

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @Busta
            last edited by

            @Busta
            as i say previously i do not use pymakr
            try using e.g. putty or com port monitor - e.g. from Arduino IDE
            and connect by filezilla or other ftp client - for me it is fastest way to develop

            think about people first, then computers

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

              Hi @Busta,

              The sync functionality has not been working properly since the last few firmware versions, due to issues on the available RAM. We're working hard to solve this, so keep an eye out for the next firmware releases. Sorry for the inconvenience!

              Until it is fixed, try to use FTP to upload your files, then rebooting the device (boot button) after which boot.py and main.py will automatically run. You can keep the serial connection open in pymakr (or other serial program like putty) during the process to see all the output.

              Regards,
              Ralph

              1 Reply Last reply Reply Quote 1
              • B Offline
                Busta
                last edited by

                Hi,

                thanks for your replies. Ok, I'll look into ftp for now and check back for new firmware versions. Thanks for your help!

                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