Lua code to convert a toy traffic light into a extreme feedback device
-
Install python
-
Install virtualenvwrapper
apt install virtualenvwrapper
. /usr/local/bin/virtualenvwrapper_lazy.sh # add to .bashrc as well- Create a virtualenv
mkvirtualenv nodemcu- Install esptool
workon nodemcu
pip install esptool
pip install nodemcu-uploader-
Change to this repo
-
Make sure the microcontroller is connected to ttyUSB0 (needs: timer, gpio and string module)
esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py --port /dev/ttyUSB0 write_flash --flash_mode dio 0x00000 nodemcu-master-*-integer.bin- Check if flashing worked (press the reset button while doing this and wait about 10 sec for the repl to appear)
cu --nostop -s 115200 -l /dev/ttyUSB0-
Customize config.lua
-
Upload the source the lua source to the nodemcu
./upload.sh- To mitigate driver issues and platform hassle, just install VirtualBox and Vagrant.
- Call
vagrant up && vagrant reloadfrom the repository root. - Call
vagrant sshto access the VM. - Continue with chapter 'Firmware for nodemcu' as all reguired dependencies have already been installed. Repository root is available as shared folder
/vagrant, changes are immediately propagated to the host.