Pymakr: connected but cannot run script over serial
-
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 addressesand 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!
-
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 telnetespecially 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 -
-
@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 -
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 -
Hi,
thanks for your replies. Ok, I'll look into ftp for now and check back for new firmware versions. Thanks for your help!
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