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 @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
-
connect to your board by telnet and then you can use this command
execfile('filename.py') -
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.
-
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.
-
@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.
-
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.
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