Project owner: | lichnak, PeterBay |
Interested: | |
Related: | |
Reference: | https://Espressif.com |
License: | Creative Commons Attribution-ShareAlike; CC BY-SA |
Goal of this guide is to build Integrated Developement Environment (IDE) for work and development of nodeMCU solutions on operating system Windows 10.
In guide Linux Firmware Build Environment we went through steps how to compile nodeMCU firmware. Now we need upload firmware into ESP8266. For this purpose are available virious scripts and programs on the internet. Here we describe tool for Windows written in DelphiNodeMCU-Flasher.
Enable FLASH
mode before start uploading firmware. Flash mode can be enabled by pushing FLASH
button on nodeMCU or before reboot set GPIO0
pin to LOW
. Important warnings
Project's page on GitHub: NodeMCU Flasher
Download from GitHub NodeMCU Flasher.
Opinion: Personally I'm using on Windows 10 for work with GIT software GIT scm.
It is good to remeber where you downloaded ESP8266Flasher binaries from GitHub.
%PATHNODEMCUFLASHER%\Win64\Release\ESP8266Flasher.exe
Verify in Device Manager serial port number for communication with nodeMCUO.
%SYSTEMROOT%\System32\devmgmt.msc
Tools for uploading LUA scripts areavaile in big variety and tools are documented for example here.
ESPlorer is IDE for ESP8266, primary supporting LUA, MicroPython and sevel AT commands for ESP8266. ESPlorer requirers installed package JAVA Standard Edition verion 7 and higher.
Project's page on GitHub: ESPlorer
Download ESPlorer here.
Supported platforms:
Output from ESPlorer console
> =node.heap() 45264 >
For Datastorage engin with communication with Node.js was choosen MondoDB. MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is free and open-source, published under a combination of the GNU Affero General Public License and the Apache License.
Original install guide is here.
PS C:\> $env:path += ";" + "C:\Program Files\mongodb\Server\3.2\bin" PS C:\> [Environment]::SetEnvironmentVariable("PATH", $env:path, "Machine")
PS C:\> New-Item -ItemType "directory" -Path c:\data -Force PS C:\> New-Item -ItemType "directory" -Path c:\data\db -Force
PS C:\> New-Item -ItemType "directory" -Path "c:\data\log" -Force
PS C:\> New-Item -ItemType "file" -Path "c:\data\log\mongo.log" -Force
PS C:\> New-Item -ItemType "file" -Path "C:\Program Files\MongoDB\Server\3.2\bin\mongod.cfg" -Force PS C:\> $MONGODBCONF = "systemLog:`n destination: file`n path: c:\data\log\mongo.log`nstorage:`n dbPath: c:\data\db" PS C:\> $MONGODBCONF | Out-File -FilePath "C:\Program Files\MongoDB\Server\3.2\bin\mongod.cfg" -Append PS C:\> more "C:\Program Files\MongoDB\Server\3.2\bin\mongod.cfg" systemLog: destination: file path: C:\Data\log\mongod.log storage: dbPath: C:\Data\db
PS C:\> Invoke-Expression "& `"C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe`" --config `"C:\Program Files\MongoDB\Server\3.2\bin\mongod.cfg`" --install"
For semi-automated I wrote in PowerShell 5 MongDB Installation PowerShell Script
Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of server tools and applications. Although Node.js is not a JavaScript framework,[4] many of its basic modules are written in JavaScript, and developers can write new modules in JavaScript. The runtime environment interprets JavaScript using Google's V8 JavaScript engine.
Project documenation of Node.js API
Warning: If you use node.js version v7.1.0, it is recommended to reinstall node.js to version v7.0.0. Node.js v7.1.0 has know error on Windows platform, error causes node.js to crash when you use for node.js consoles Powershell or CMD.
node-v7.0.0-x64.msi
package, deafault install path is C:\Program Files\nodejs
Add PATH
, then add node.js install path to system variable PATH
PATH
variable is set correctly, you will still encounter errors. Manually go into the AppData directory and you will find that there is no npm directory inside Roaming. Manually create this directory.PS C:\> $NPMPATH = $Env:USERPROFILE + "\AppData\Roaming\npm" PS C:\> New-Item -ItemType "directory" -Path $NPMPATH PS C:\> $Env:PATH += ";" + $NPMPATH + ";C:\Program Files\nodejs" PS C:\> [Environment]::SetEnvironmentVariable("PATH", $Env:PATH, "Machine")
Next steps are to install Python in version 2.7, because node.js package node-gyf is dependent on Python2.7 and haven't started to support Pyhthon v3.x.x yet.
python-2.7.12.amd64.msi
packagePATH
and PYTHON
PS C:\> $Env:PATH += ";C:\Program Files\Python27" PS C:\> [Environment]::SetEnvironmentVariable("PATH", $Env:PATH, "Machine") PS C:\> [Environment]::SetEnvironmentVariable("PYTHON", "C:\Program Files\Python27", "Machine")
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>npm config set python "C:\Program Files\Python27\python.exe" C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
To aviod dependency conflicts first step is to install Microsoft compilator windows-build-tools
for Node.js packages.
And sedcond step is now to install rest of Node-Red dependency packages.
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>npm install -g --production windows-build-tools C:\Program Files\nodejs>npm install -g node-gyp C:\Program Files\nodejs>npm install -g bindings C:\Program Files\nodejs>npm install -g bcrypt C:\Program Files\nodejs>npm install -g bson C:\Program Files\nodejs>npm install -g bufferutil C:\Program Files\nodejs>npm install -g kerberos C:\Program Files\nodejs>npm install -g mqtt C:\Program Files\nodejs>npm install -g mongodb C:\Program Files\nodejs>npm install -g nan C:\Program Files\nodejs>npm install -g node-sass C:\Program Files\nodejs>npm install -g options C:\Program Files\nodejs>npm install -g phantomjs C:\Program Files\nodejs>npm install -g pm2 C:\Program Files\nodejs>npm install -g pm2-windows-startup C:\Program Files\nodejs>npm install -g sqlite3 C:\Program Files\nodejs>npm install -g ultron C:\Program Files\nodejs>npm install -g utf-8-validate C:\Program Files\nodejs>npm install -g ws C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
Configuration of package pm2-windows-startup
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>pm2-startup install C:\Program Files\nodejs>pm2 save C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
Install Node-Red
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>npm install -g node-red C:\Program Files\nodejs>npm install -g node-red-dashboard C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
Start Node-Red
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>node "%USERPROFILE%\AppData\Roaming\npm\node_modules\node-red\red.js" C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
Configure Node-Red for automatic start
PS C:\> cd "C:\Program Files\nodejs\" PS C:\Program Files\nodejs> cmd Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. Všechna práva vyhrazena. C:\Program Files\nodejs>pm2 start "%USERPROFILE%\AppData\Roaming\npm\node_modules\node-red\red.js" C:\Program Files\nodejs>pm2 save C:\Program Files\nodejs>exit PS C:\Program Files\nodejs>
Now your can find your Node-RED editor installation at http://localhost:1880
For role MQTT Brokera in IDE was chosen software Mosquitto.
Win32OpenSSL_Light-1_0_2j.exe
mosquitto-1.4.10-install-win32.exe
pthreadVC2.dll
to Mosquitto install folder.PS C:\> dir "C:\Program Files (x86)\mosquitto\pthreadVC2.dll" Directory: C:\Program Files (x86)\mosquitto Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 27.5.2012 1:00 55808 pthreadVC2.dll
libeay32.dll
and ssleay32.dll
to Mosquitto install folderPS C:\> dir "C:\Program Files (x86)\OpenSSL-Win32-102j\*eay32.dll" Directory: C:\Program Files (x86)\OpenSSL-Win32-102j Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 26.9.2016 10:00 1265664 libeay32.dll -a---- 26.9.2016 10:00 274432 ssleay32.dll PS C:\> copy "C:\Program Files (x86)\OpenSSL-Win32-102j\*eay32.dll" "C:\Program Files (x86)\mosquitto\" PS C:\> dir "C:\Program Files (x86)\mosquitto\*eay32.dll" Directory: C:\Program Files (x86)\mosquitto Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 26.9.2016 10:00 1265664 libeay32.dll -a---- 26.9.2016 10:00 274432 ssleay32.dll
PS C:\> notepad "C:\Program Files (x86)\mosquitto\mosquitto.conf"
PS C:\> Set-Service Mosquitto -Status Running PS C:\> Get-Service Mosquitto Status Name DisplayName ------ ---- ----------- Running mosquitto Mosquitto Broker