Flashing the OpenLapse binary

In order to use the OpenLapse controller, it’s necessary to flash the firmware onto it. This article describes how to do that, and when you’re complete, you should be able to connect into the ‘openlapse’ WiFi hotspot with your smartphone and control your DSLR and motor. Even if you don’t have the additional hardware, you can still play with the user interface. I’d appreciate feedback. 🙂

It assumes that you don’t need (or want to) install the full Arduino IDE development environment, and walks you through the steps needed to install and use esptool to flash the firmware onto the WeMos.

Install Python

Download and install Python 3.5.3 from here.

If you’re on windows, you can use a custom install to change the path to something convenient, otherwise it’ll end up in somewhere like C:\Users\dave\AppData\Local\Programs\Python\Python35. No matter, you can add it to your cmd/powershell path by using “Edit the System Environment Variables” in control panel:

then:

Edit the path, and add a new line with your python location, with \scripts on the end.

Then, it seems we need to log out and in again so the new setting for the PATH is applied.

No need for any of that guff on Linux.

Install esptool.py

So, now that we’ve python installed, we should be able to open up a command prompt (or powershell), and install esptool.

There’s a very easy way to do this, and that’s with pip using the command ‘pip install esptool’

PS C:\Users\dave\AppData\Local\Programs\Python\Python35\Scripts> pip install esptool
Collecting esptool
 Downloading esptool-2.0.tar.gz (67kB)
 100% |################################| 71kB 624kB/s
Collecting pyserial>=2.5 (from esptool)
 Downloading pyserial-3.3-py2.py3-none-any.whl (189kB)
 100% |################################| 194kB 881kB/s
Collecting pyaes (from esptool)
 Downloading pyaes-1.6.0.tar.gz
Collecting ecdsa (from esptool)
 Downloading ecdsa-0.13-py2.py3-none-any.whl (86kB)
 100% |################################| 92kB 1.1MB/s
Installing collected packages: pyserial, pyaes, ecdsa, esptool
 Running setup.py install for pyaes ... done
 Running setup.py install for esptool ... done
Successfully installed ecdsa-0.13 esptool-2.0 pyaes-1.6.0 pyserial-3.3
PS C:\Users\dave\AppData\Local\Programs\Python\Python35\Scripts> ls

   Directory: C:\Users\dave\AppData\Local\Programs\Python\Python35\Scripts

Flashing the Binary

Now get the openlapse bin file, as we’re about to flash it to the Wemos. It’s available in the binaries sub-directory on the GitHub openlapse repo here.

First connect the wemos to a USB port on your PC. Please ensure that the switch that is labelled “Ext – USB”  is switched to USB, so that the power from the DC-DC converter and the USB power don’t conflict. Or just as a matter of habit, only flash when the motor power is disconnected. It’s safer that way. 🙂

Then find out which port it’s been assigned with Device Manager:

So in this case it’s COM9.

Make sure you can run the command ‘esptool.py.exe’, it should show the help. If not, check your installation steps again.

The command we use to flash is:

     esptool.py.exe --port COM9 write_flash 0x00000 sonoff-openlapse.ino.bin

And the output should be something like:

esptool.py v2.0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 16MB
Flash params set to 0x0290
Compressed 305008 bytes to 212947...
Wrote 305008 bytes (212947 compressed) at 0x00000000 in 19.3 seconds (effective 126.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

So the “Hard resetting…” at the end has rebooted the Wemos, so we should now be able to open up our smartphone and associate to a WiFi Hotspop called ‘openlapse’

The esptool.py parameters should be similar for Linux, I’ll get around to testing that out when I get a few spare moments.

Flash Burn Complete! 🙂

 

 

 

This entry was posted in Uncategorized.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*