Stupid question.



  • 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



  • 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.



  • @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.



  • 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.



  • 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.



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



  • 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


Log in to reply
 

Pycom on Twitter