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

    Stupid question.

    Scheduled Pinned Locked Moved LoPy
    7 Posts 6 Posters 1.8k Views 6 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.
    • G Offline
      gump103
      last edited by

      I've just received my lopy's and started having a play with them. I'm new to micro python but have manged to get the lora gateway and node example working.

      What i want to know is if there is a command that I can run to execute a .py script without needing to reference it in the main.py and then reboot. It's a pain having to reconnect to the wifi and then reconect putty and winscp for every change.

      thanks
      James

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

        HI @gump103,
        One way to do this is using Pymakr, which can connect either over usb or telnet. It has a sync button to sync all project files to the device, and a 'run' button that runs the code from one file on the board.

        Another useful thing to do is to setup the wifi script in boot to connect to your wifi with a fixed IP, and telnet to that, so you don't have to keep reconnecting to the wifi. There is example code in the docs and another one this post

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

          connect to your board by telnet and then you can use this command
          execfile('filename.py')

          think about people first, then computers

          1 Reply Last reply Reply Quote 1
          • G Offline
            gump103
            last edited by

            Hi @Ralph
            I tried pymakr but (it may be something to do with my setup) found it kept causing the LoPy to freeze when using the run button. The sync option in pymakr coppied blank .py files as well even through they were save before syncing.

            Using winscp and putty is working well for me just needed to understand how to run the code without having to reset it each time. Thanks @livius for the info.

            1 Reply Last reply Reply Quote 0
            • rcolisteteR Offline
              rcolistete
              last edited by

              I recommend :

              • using USB-serial communication, the simple way is using the Expansion Board (for WiPy/LoPy/SiPy) and microUSB cable;
              • connect with "screen /dev/ttyUSB0 115200" to have REPL (interactive prompt);
              • or better use rshell and connect with
                "rshell -p /dev/ttyUSB0 -b 115200 --buffer-size 32"
                rshell is reliable and very easy to manipulate files, open REPL, etc.

              PS: "/dev/ttyUSB0" is the USB device in Linux. Windows and Mac OS have different names.

              My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

              1 Reply Last reply Reply Quote 0
              • J Offline
                jeorry @gump103
                last edited by

                @gump103 Can I ask where you got the documentation for the gateway/node examples. I've been looking all over but can't seem to locate it. Thanks.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sakis @jeorry
                  last edited by

                  Hi @jeorry,

                  Check the following: https://forum.pycom.io/topic/236/lopy-nano-gateway

                  We are planning to move it in our official documentation (https://docs.pycom.io) but that hasn't happened yet.

                  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