Not feeling the love : Pymakr will not sync project to LoPy
I am not feeling the love of 5-10 faster development so far in my experience of pycom. Certainly when compared numerous other other emdedded IDE's and dev boards.
My latest stumbling block with getting going with LoPy is that I can't get PyMakr to sync a simple test project to the LoPy. I could progress on with using FTP and Telnet instead but this is more clunky and a slower development approach.
So to the issue when syncing, I see this in console :
>>> Syncing the project with the LoPy. Please wait... Syncing failed! Lost connection with the LoPy! (click to attempt to reconnect) Connecting to a LoPy... Error while communicating with the LoPy! (click to attempt to reconnect) Connecting to a LoPy... Connected >>>
And this on my usb/serial putty session
>>> import os; [os.uname().sysname, os.uname().machine, os.uname().release] ['LoPy', 'LoPy with ESP32', '1.5.0.b1'] >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> raw REPL; CTRL-B to exit >OK> MicroPython v1.8.6-409-gc86bfcc on 2017-01-27; LoPy with ESP32 Type "help()" for more information. >>> import os; [os.uname().sysname, os.uname().machine, os.uname().release] ['LoPy', 'LoPy with ESP32', '1.5.0.b1'] >>> >>>
I have the latest firmware loaded on the LoPy 1.5.0.b1 and I am using PyMakr 1.0.0.b8.
I have this in my boot.py, note I haved added the fix to stop the connection being lost after a soft boot.
# NAU - 25/01/17 from network import WLAN import machine import os uart = machine.UART(0, 115200) os.dupterm(uart) wlan = WLAN(mode=WLAN.STA) nets = wlan.scan() if machine.reset_cause() != machine.SOFT_RESET: for net in nets: if (net.ssid == 'KITCHEN') or (net.ssid == 'DINING') or (net.ssid == 'BTHOMEHUB') : print('Found Network : ' + net.ssid) wlan.connect(net.ssid, auth=(net.sec, '................'), timeout=5000) while not wlan.isconnected(): machine.idle() # save power while waiting print('WLAN connection succeeded!') break
So is something broke or am I using it incorrectly in someway ??
Ok, after the serial connection sync from PyMakr which worked I noticed I could no longer see by LoPy on the network. On investigation I find it seems to have changed my boot.py.
Is this expected behavior ?? because if it is does not make sense. If syncing changes boot.py it is going remove my custom code to connect to my Wifi network. So syncing via Wifi is never going to work if it breaks the connection setup it is trying to use. It is in effect shooting itself in the foot.
The serial sync change boot.py to this :
# boot.py -- run on boot-up import os from machine import UART uart = UART(0, 115200) os.dupterm(uart)
The Putty connection is via serial. I have set the preferences in PyMakr to recognize my LoPy via its machine name (ie via TCP/IP) . The console window is working so I know its connected ok.
Even if I close the serial Putty connection and try to sync I get the same problem.
What I have just tried and does some to work is to change PyMakr to use the my COM port connection to the LoPy then I can get the sync to succeed.
So it looks like syncing via TCP/IP is broken.
Are you trying to use Putty and Pymakr at the same time by any chance?
You can't have two applications trying to use the same serial port at the same time, you'll have to close Putty to use Pymakr and vice-versa.