lopy not running main.py
I re-open a post I started here https://forum.pycom.io/topic/511/run-script-on-boot-for-lopy .
Let me explain you my issue :
- i have a lopy with only the recommended code in boot.py (for serial connections), and my script in the main.py
- when power plugged, it doesn't run main.py but arrives on REPL (so it stops in boot.py if i'm right ? )
It may be a step I passed.. any help will be appreciated!
Furthermore, do you know what the sync button in pymakr does ?
I'm having a similar issue now.
main.py will run after CTRL-D or machine.reset(). But, power cycling the Lopy (on expansion board) will connect REPL to pymakr, but main does not seem to run.
I've done an os flash, and rewritten all the files. Problem continues though.
I'm wondering if it is going to safe boot, factory mode as here:
How can I can tell which mode is used?
I've reset the expansion board jumpers and tightened them up as best I can. Could these be the problem?
yes i connet to Wipy AP (wipy-wlan)
and one hint
to simplify developing process and speed it up
i put always in the while true loop check if some button is pressed and break this loop
this elimiminate need to restart board and reconnect to it :)
Of course if you do not need to change from AP to STA mode
This is not what I meant, but while you are doing it, are you connected to the "wipy-wlan" network ?
I have connected filezilla permanently to Wipy and do modifications and send it back.
But i do modifications on files on computer and do not use option to edit file on board "directly"
I modify on left panel not on the right panel ;-)
- For filezilla, are you perma connected on the lopy-wlan or you have some software settings in order to modify and transfer files while the lopy connected in serial, without establish a connection on the wlan ?
- True it works well :)
I use this setup:
- filezilla to modify files and write it back + Notepad++(to nicely edit files)
- Arduino IDE-and from it COM port monitor to see repl and send command back by repl
I use Windows OS but it is avaiable on linux also
After install you must only set COM number and baud rate - and if you need not only read data by repl but also send commands - change line break termination - and it work like a charm :)
For now it's ok for me concerning the FTDI drivers, but I agree it's a bit confusing in the first place.
Now I can connect on it e.g. REPL, I am curious about what other options @livius is talking about, because I actually encounter some connection issues with pymakr.
I didn't try this on linux.
Here they say there are two types of FTDI drivers. VCP and D2XX. I can't remember which one I used. But the first one I tried said it installed the missing driver, but when I wanted to connect to the LoPy it didn't work. After research I deleted the driver and tried the other. After that I was able to connect to the LoPy.
It was very confusing because the driver said it was installed correctly.
i had the same issue, so i flashed the lopy , and it went well. Do you know the procedure ?
Did you try this on linux ? I had to install FTDI driver too but seems that it isn't enough.. That's why I can't even update de firmware, because of an error : Something failed trying to connect to the device.
I guess it's because of what I explained bellow on the authorization issues.
I can connect through pymakr, but after power plug I have to click in console to reconnect.
On my windows it also didn't work at first. I had to install a driver for USB serial converter by hand, mine called FTDI. After that i could use it in pymakr.
Are you able to update the firmare?
Well, pymakr is perma failing to establish a connection with the board, I don't know if you had that error too ?
I can't even see my output e.g. putty screen (issue I explained below) and now pymakr.
I have checked it with a simple flash to green in the main.py.
That is working on reset and on power plug.
In my other program it is only printing to console. So like I said earlier, it seems that it wont show it in pymakr when power plug. But it was a nice confirmation it does boot on power plug!
I have also had some trouble with pymark and curious about what other options there are.
Actually @jmarcelino was right and checking the lopy's folders helped me : the main.py file had some issues i fixed so now it can run the scripts after reboot and on power plug. Do you have the 3 ">>>" in Pymakr or you get only "Connected" ?
I suggest you to check this too thanks to a FTP connection, and tell us if your issue persists!
On a second hand I have a problem with the REPL with for example Putty or Screen, so I need the help of the Linux users please :)
An error occurs :
Unable to open connection to :
Unable to open serial port
After many searchs I guessed it's an authorization issue, and I already tried some things :
- execute putty as super-user : "gksudo putty"
- the user is already in the dialout group, and still not working except with the command before
- chmod 777 /dev/ttyUSBx on each boot
On the REPL i dont have the output i expect, instead of a sentence i have a character. It may be a speed problem, isnt it 115200 as I wrote on boot.py ?
Do you know how can I give all permissions to my ttyusb ports in order to avoid all authorization issues in the future wich is active on boot ?
Thank you all.
livius last edited by
What do you see on repl output?
Maybe you have some error in main.py and it is on the REPL output?
And what do you use to see REPL? If Pymakr i recomend you to do not use it at all.
I have the same thing as you.
But when I hit the reset button on the LoPy, it will reboot and run the main.py.
But when I plug the power in, it doesn't seem to run the main.py.
Maybe it is running, but can't we see it in pymakr.
Thanks for your fast reply!
I will try FTP client.
I refered on this page and entered this code below https://docs.pycom.io/pycom_esp32/pycom_esp32/getstarted.html
from machine import UART
uart = UART(0, 115200)
jmarcelino last edited by jmarcelino
Have you tried connecting over FTP and checking if main.py is really there and has the contents you expect?
If so can you post your boot.py file? You mentioned you made some changes to have the serial console.