Development Cycle for the Wemos D1 Mini from Windows
Development Cycle for the Wemos D1 Mini from Windows
I have been developing my MicroPython application for a few weeks now and wonder how everyone is doing their edit-load-test development. What tools and procedures they are using to develop with MicroPython.
I am working with Wemos D1 Mini Boards from a Windows PC and mostly use the ampy utility from Adafruit. I use it so much in fact, I wrote a little gui to list and edit files directly from the board.
It utilizies the Scintilla editor control so that the syntax highlighting is nice... but it is far from being a true editor... no search and replace, etc...
How does everybody else do their development?
I am working with Wemos D1 Mini Boards from a Windows PC and mostly use the ampy utility from Adafruit. I use it so much in fact, I wrote a little gui to list and edit files directly from the board.
It utilizies the Scintilla editor control so that the syntax highlighting is nice... but it is far from being a true editor... no search and replace, etc...
How does everybody else do their development?
Re: Development Cycle for the Wemos D1 Mini from Windows
I don't develop for hardware boards but if so I'd likely use SublimeText: it has all the python goodies including 'go to definition'/pep8/flake/... support and can easily be extended so commands can be added (and bound to keyboard shortcuts) to load code onto the board. You typcially spent most of your time in the editor anyway so it seems logical to select a good one even though it might take some time to setup or you might need a seperate program to deal with the boadr (then again, you'd be using that only a fraction of the time)
-
- Posts: 28
- Joined: Wed Mar 30, 2016 4:09 pm
Re: Development Cycle for the Wemos D1 Mini from Windows
Hello Bitninja,
My process is actually harder, I upload the bin files with NodeMCU Flasher https://github.com/nodemcu/nodemcu-flasher after uploading a empty bin to all memory addresses (crazy I know).
Then I use the WebREPL to upload the code but to run my code changes I have to import it and then run any function I have inside my code. (even more crazy).
Do you mind sending what you are using?
Thanks!
My process is actually harder, I upload the bin files with NodeMCU Flasher https://github.com/nodemcu/nodemcu-flasher after uploading a empty bin to all memory addresses (crazy I know).
Then I use the WebREPL to upload the code but to run my code changes I have to import it and then run any function I have inside my code. (even more crazy).
Do you mind sending what you are using?
Thanks!
Re: Development Cycle for the Wemos D1 Mini from Windows
Sure!
Here is the EXE. Make sure you have ampy installed and running.
https://dl.dropboxusercontent.com/u/112 ... nager2.zip
For the record... the source code can be found here.
https://github.com/joewez/AmpyFileManager
Notes:
- Sometimes ampy will fail on it's own and the app will seem not to work. Just try again.
- The program saves the backups under the same directory as the EXE
- Use at your own risk!
Here is the EXE. Make sure you have ampy installed and running.
https://dl.dropboxusercontent.com/u/112 ... nager2.zip
For the record... the source code can be found here.
https://github.com/joewez/AmpyFileManager
Notes:
- Sometimes ampy will fail on it's own and the app will seem not to work. Just try again.
- The program saves the backups under the same directory as the EXE
- Use at your own risk!
Last edited by bitninja on Tue Nov 29, 2016 12:20 am, edited 1 time in total.
Re: Development Cycle for the Wemos D1 Mini from Windows
Hi bitninja and thanks for sharing. I will give it a try.
However, for me a combination of makefile and esptool and ampy are the fastest devop cycle. Actually mine looks a lot like:
I cannot imagine a faster cycle and I thank the community to have pointed me to ampy (before I was using my own ugly tool do upload code via serial port)
However, for me a combination of makefile and esptool and ampy are the fastest devop cycle. Actually mine looks a lot like:
- 1. make flash
2. edit with editor or ide. I stick to vi/vim and sometimes use geany
3. make install
Code: Select all
# Serial port settings
# Windows
#PORT=/dev/cu.SLAB_USBtoUART
# MAC
#PORT=/dev/ttyACM0
# Linux Debian/Ubuntu
PORT=/dev/ttyUSB0
SPEED=115200
# Path to setup firmware and programs. configure your paths here
MPYCROSS=/opt/ESP8266/micropython/mpy-cross/mpy-cross
ESPTOOL=/opt/ESP8266/esp-open-sdk/esptool/esptool.py
# Install with sudo pip2 install adafruit-ampy
AMPY=ampy -p $(PORT)
FIRMWARE=/opt/ESP8266/micropython/esp8266/build/firmware-combined.bin
DATE=$(shell date +"%Y-%b-%d %H:%M:%S")
VERSION=1.0.1
######################################################################
# End of standard config
######################################################################
FILES := \
main.py \
version.py
yoursourcefile.py
MPYFILES := \
version.mpy \
yoursourcefile.mpy \
%.mpy: %.py
$(MPYCROSS) $<
instructions:
@echo "How to install:"
@echo "1) make erase 2) make flash 3) make install"
check: $(MPYFILES)
python3 -m py_compile *.py
rm -rf __pycache__
rm -f *.pyc
erase:
$(ESPTOOL) --port $(PORT) erase_flash
flash:
@echo "Be sure about MEMORY SIZE"
$(ESPTOOL) --port $(PORT) --baud 115200 write_flash --verify --flash_size=32m --flash_mode=qio 0x00000 $(FIRMWARE)
@echo 'Power device again'
# Upload all
install: check $(MPYFILES) main.py
sed -i -e "s/^version=.*/version="${VERSION} ${DATE}"/" version.py
for f in $^ ; \
do \
echo installing $$f ;\
$(AMPY) put $$f ;\
done;
reset:
$(AMPY) reset
Re: Development Cycle for the Wemos D1 Mini from Windows
I actually have a split working environment... I run Linux at home mostly and that's where I build my images, but then switch to Windows to use my little GUI to edit and load the application scripts. There I alternate between editing scripts with the GUI and testing them with PuTTY over the serial REPL.
I appreciate the information for using make in Linux. I will have to look into what I can do on that front so I don't have to switch.
Then again... I'm stuck on Windows at work, so that's why I put up the original post.
I appreciate the information for using make in Linux. I will have to look into what I can do on that front so I don't have to switch.
Then again... I'm stuck on Windows at work, so that's why I put up the original post.
Re: Development Cycle for the Wemos D1 Mini from Windows
Window with maybe cygwin or even with the ubuntu shell will do the same I guess. Not to mention with Mac. Many platforms, same way to develop.. that's my motto. Enjoy!
Re: Development Cycle for the Wemos D1 Mini from Windows
If you look at a toosl which is available for both Linux and Windows,you could try pycom's pymakr. It detects and supports an Wemos D1 at the serial interface. I do not like pymakr's multicolored-on-black style, and it is still in a kind of alpha release (even if they call it beta), but it works somehow. You can run code from the edit window, but it is not stored on the target device.
For the Wemos I started to use my esp8266 based ftp server, which allows to edit the file in-place on the D1, if you like and use an graphical ftp client. Still you have to use a terminal emulator. I use picocom on linux and putty or teraterm on Windows.
For the Wemos I started to use my esp8266 based ftp server, which allows to edit the file in-place on the D1, if you like and use an graphical ftp client. Still you have to use a terminal emulator. I use picocom on linux and putty or teraterm on Windows.
Re: Development Cycle for the Wemos D1 Mini from Windows
I'm so saddened. Among all mini-IDEs posted here on the forum (5+), I liked the screenshot of this one the most. And turned out, it's Windows-only. .bitninja wrote:Sure!
Here is the EXE. Make sure you have ampy installed and running.
https://dl.dropboxusercontent.com/u/112 ... anager.zip
For the record... the source code can be found here.
https://github.com/joewez/AmpyFileManager
Btw, the fastest way to run a simple, standalone script on any compliant MicroPython device is by using standard "pyboard.py" utility from the MicroPython distribution.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Development Cycle for the Wemos D1 Mini from Windows
OK, OK
I've run into this before.
There is hope though. If you can still stand the odor of C# I might be able to port this over to Mono with a bit more effort. It's not a complex app and I've done it before so I will give it a try. The result should work on Linux, Mac and Windows.
The only question is embedding the Scintilla control into the GTK+ framework. I'm sure it can be done... I just don't know how at the moment.
I've run into this before.
There is hope though. If you can still stand the odor of C# I might be able to port this over to Mono with a bit more effort. It's not a complex app and I've done it before so I will give it a try. The result should work on Linux, Mac and Windows.
The only question is embedding the Scintilla control into the GTK+ framework. I'm sure it can be done... I just don't know how at the moment.