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

    Pymkr and loading programs onto SiPy [SOLVED]

    Scheduled Pinned Locked Moved Pymakr
    sipy
    5 Posts 2 Posters 2.3k 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.
    • S Offline
      sk
      last edited by sk

      I'm sure this question has been asked many times before so sorry about the repetition!
      I just wanted to confirm a couple of things about using Pymkr and loading programs onto my SiPy.

      • To load a program onto the board, do I run the main file and then sync the project?
      • Is the file which runs on the board always the main.py file? Are all other files in the project treated as helper classes?
      • Does this mean all wifi, bluetooth, sigfox, lora execution has to be done in the main.py file?
      • Is there a way to make the board sleep and wake at a trigger from the GPIO pins e.g when it gets a digital HIGH?
      • How do I make a program loop forever (I have been testing with a blinking program in a while (true): loop but it stops after a while)? When does the board automatically fall asleep?
      • What frequency does the Bluetooth operate at? (I know SiPy doesn't have Bluetooth operating yet.)
      1 Reply Last reply Reply Quote 0
      • D Offline
        daniel
        last edited by

        Hello SK,

        To load a program onto the board, do I run the main file and then sync the project?

        Just sync the project. Running the main file simply runs that file. That button is used just as a quick way to run a file.

        Is the file which runs on the board always the main.py file? Are all other files in the project treated as helper classes?

        Yes. You can change this behaviour in your boot.py by doing:

        import machine
        machine.main('/flash/other_main_file.py')
        

        Does this mean all wifi, bluetooth, sigfox, lora execution has to be done in the main.py file?

        No, you can put them in any file. MicroPython works exactly like Python 3 regarding this. It's just that by default the file that's executed by default it's main.py. Inside main.py you can import any other files which can run WiFi, Bluetooth and LoRa (and pretty much anything else).

        Is there a way to make the board sleep and wake at a trigger from the GPIO pins e.g when it gets a digital HIGH?

        Not at the moment, but this will be available in future firmware updates (this is just not available in the Espressif IDF at the moment).

        How do I make a program loop forever (I have been testing with a blinking program in a while (true): loop but it stops after a while)? When does the board automatically fall asleep?

        That while true should work. When you say it stops after a while, how much time is that?

        What frequency does the Bluetooth operate at? (I know SiPy doesn't have Bluetooth operating yet.)

        2.4 GHz. Bluetooth is working on the SiPy since yesterday. Please get the latest updater tool and upgrade the firmware on your SiPy.

        Cheers,
        Daniel

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sk @daniel
          last edited by sk

          @daniel I have the following program and after I sync it with my SiPy and then close Pymkr. The SiPy doesn't start my program. The lights don't change.
          And if I sync and then run it, it runs for 8 mins and 35 secs and then freezes on pink.
          Program:

          import pycom
          import time

          #Program for having practise using LED and time
          #colour chart = http://www.nthelp.com/colorcodes.htm

          pycom.heartbeat(False)
          while (True):
          pycom.rgbled(0xCC0000) # red
          time.sleep(3)
          pycom.rgbled(0xFF6600) # orange
          time.sleep(3)
          pycom.rgbled(0xFFFF00) # yellow
          time.sleep(3)
          pycom.rgbled(0x99FF00) # lime
          time.sleep(3)
          pycom.rgbled(0x00CC00) # green
          time.sleep(3)
          pycom.rgbled(0x009966) # aqua
          time.sleep(3)
          pycom.rgbled(0x0033CC) # blue
          time.sleep(3)
          pycom.rgbled(0x330099) # indigo
          time.sleep(3)
          pycom.rgbled(0x660099) # violet
          time.sleep(3)
          pycom.rgbled(0xCC0099) # pink
          time.sleep(3)
          pycom.rgbled(0xFF0033) # magenta
          time.sleep(3)

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

            I don't think sync is working. Is there something wrong with sync fro windows 7? similar to this? -> (Re: Pymkr "Syncing failed!")

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

              Ok I've realised that to sync I need to press the reset button on the board before clicking sync.
              But why is the question...

              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