ESP8266 Support WIKI

User Tools

Site Tools


toolchain

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
toolchain [2016/01/04 11:38]
terrye [How to setup a VM to host your toolchain] Update info on aligning to Travis CI VM
toolchain [2017/10/30 11:01]
albtrentadue Added missing packages needed for build
Line 1: Line 1:
 ====== How to set up manually the GCC toolchain and SDK ====== ====== How to set up manually the GCC toolchain and SDK ======
  
-An opensource toolchain is available in https://​github.com/​pfalcon/​esp-open-sdk. It is ready to run on Linux hosts only.  If you don't use a Linux development machine, then the easiest way to build and to use the toolchain is to set up a Linux Virtual Machine (VM) on your development machine, as described in the [[toolchain#​How to set a VM to host your toolchain|following section]]. ​ Another alternative is to use a low cost Linux board such as a [[https://​www.raspberrypi.org/​products/​model-b-plus/|Respberry PI2]].  Once you have your working Linux environment,​ setting up the toolchain is easy.  ​+An opensource toolchain is available in https://​github.com/​pfalcon/​esp-open-sdk. It is ready to run on Linux hosts only.  If you don't use a Linux development machine, then the easiest way to build and to use the toolchain is to set up a Linux Virtual Machine (VM) on your development machine, as described in the [[toolchain#​How to set a VM to host your toolchain|following section]]. ​ Another alternative is to use a low cost Linux board such as a [[https://​www.raspberrypi.org/​products/​raspberry-pi-2-model-b/|Raspberry Pi 2]].  Once you have your working Linux environment,​ setting up the toolchain is easy.  ​
  
   * Use Git command to clone the git repository **esp-open-sdk** into your local directory:   * Use Git command to clone the git repository **esp-open-sdk** into your local directory:
Line 60: Line 60:
   * I suggest that you run the server from now on in what is called headless mode -- that is you start and stop the VM from a command line using ''​vboxmanage''​ commands and just like a real server, you will only need to have the server console available for exceptional system maintenance. (I never bother with it and do everything over SSH.)  I use a set of aliases in my ''​.bashrc''​ on my laptop. (Windows users can use ''​doskey''​ macros to achieve the same effect.) (Replace ''​nodemcu''​ by whatever you've called your VM.   * I suggest that you run the server from now on in what is called headless mode -- that is you start and stop the VM from a command line using ''​vboxmanage''​ commands and just like a real server, you will only need to have the server console available for exceptional system maintenance. (I never bother with it and do everything over SSH.)  I use a set of aliases in my ''​.bashrc''​ on my laptop. (Windows users can use ''​doskey''​ macros to achieve the same effect.) (Replace ''​nodemcu''​ by whatever you've called your VM.
  
-  ​alias nodemcustart='​vboxmanage startvm nodemcu --type headless'​ +``` 
-  alias nodemcusave='​vboxmanage controlvm nodemcu savestate'​ +    ​alias nodemcustart='​vboxmanage startvm nodemcu --type headless'​ 
-  alias nodemcu='​ssh -p 2222 localhost'​+    alias nodemcusave='​vboxmanage controlvm nodemcu savestate'​ 
 +    alias nodemcu='​ssh -p 2222 localhost'​ 
 +```
  
   * A major advantage of the network install is that the latest versions of all packages at the point of the build are loaded into the system, so there'​s no need to do the 100s of patch updates that you typically need to do with Windows. ​ We are going to lock the system down so that the only access to the system will be from your account on the host PC or laptop; ​ in effect, no ports are exposed to the wider network. ​ The only way that the VM can be security compromised is if the host PC and host account have been compromised so there is no point in adding extra tiers of security within the VM.   * A major advantage of the network install is that the latest versions of all packages at the point of the build are loaded into the system, so there'​s no need to do the 100s of patch updates that you typically need to do with Windows. ​ We are going to lock the system down so that the only access to the system will be from your account on the host PC or laptop; ​ in effect, no ports are exposed to the wider network. ​ The only way that the VM can be security compromised is if the host PC and host account have been compromised so there is no point in adding extra tiers of security within the VM.
  
-  * Start the server and log on using your username / password combination. (If using SSH or puTTY for the first time google "​**putty ​ using ssh keys authorize_keys**" and read up on how public key based SSH access works and is configured). ​ Now copy your public key to ''​~/​.ssh/​authorized_keys'' ​and ''​chmod 600 ~/​.ssh/​authorized_keys''​. You should now be able to log off and log on from your host without needing to enter a password.+  * Start the server and log on using your username / password combination. (If using SSH or puTTY for the first time google "​**putty ​ using ssh keys `authorized_keys`**" and read up on how public key based SSH access works and is configured). ​ Now copy your public key to `~/​.ssh/​authorized_keysand `chmod 600 ~/​.ssh/​authorized_keys`. You should now be able to log off and log on from your host without needing to enter a password.
  
-  * Edit ''​/​etc/​ssh/​sshd_config'' ​and append the line ''​AllowUsers *@10.0.2.*'' ​to limit logon to access from the host PC. (You will neeed to use ''​sudo ​ nano''​ or ''​sudo vi''​ to do this). ​ And similarly do a ''​sudo visudo''​ to add ''​NOPASSWD''​ to the **''​%admin''​** and **''​%sudo''​** groups as follows; this enables you to access root privileges without having to enter a password (and log off and on again to check that these are working OK.)+  * Edit `/​etc/​ssh/​sshd_configand append the line `AllowUsers *@10.0.2.*to limit logon to access from the host PC. (You will neeed to use ''​sudo ​ nano''​ or ''​sudo vi''​ to do this). ​ And similarly do a ''​sudo visudo''​ to add ''​NOPASSWD''​ to the **''​%admin''​** and **''​%sudo''​** groups as follows; this enables you to access root privileges without having to enter a password (and log off and on again to check that these are working OK.) 
 + 
 +``` 
 +    %admin ALL=(ALL) NOPASSWD: ALL 
 +    %sudo  ALL=(ALL:​ALL) NOPASSWD: ALL 
 +```
  
-  %admin ALL=(ALL) NOPASSWD: ALL 
-  %sudo  ALL=(ALL:​ALL) NOPASSWD: ALL 
-  
   *  And lastly mangle your password so that only key-based access can work:   *  And lastly mangle your password so that only key-based access can work:
  
-  ​pwd=$(date|md5sum);​ echo -e "​$pwd\n$pwd"​|sudo passwd $USER +``` 
 +    ​pwd=$(date|md5sum);​ echo -e "​$pwd\n$pwd"​|sudo passwd $USER 
 +```
   * Now install all of the other core packages that allow you to build the toolchain, nodeMCU and ''​luac.cross''​. ​ Note that Ubuntu 12.04 doesn'​t include pre-packaged versions of some of the Lua libraries, so you need to do a ''​luarocks install''​ to build these:   * Now install all of the other core packages that allow you to build the toolchain, nodeMCU and ''​luac.cross''​. ​ Note that Ubuntu 12.04 doesn'​t include pre-packaged versions of some of the Lua libraries, so you need to do a ''​luarocks install''​ to build these:
  
 +```
   sudo apt-get install \   sudo apt-get install \
      ​build-essential zip gdb git vim make unrar autoconf automake \      ​build-essential zip gdb git vim make unrar autoconf automake \
-     bison texinfo libtool gcc g++ gperf libc-dbg ncurses-dev expat \+     bison texinfo libtool gcc g++ gperf libc-dbg ncurses-dev expat flex help2man ​\
      ​lua5.1 lua5.1-doc luarocks      ​lua5.1 lua5.1-doc luarocks
-  for m in lua-bitlib luafilesystem md5 luaposix luasocket; do sudo luarocks install $m; done  +  for m in bitlib luafilesystem md5 luaposix luasocket; do sudo luarocks install $m; done  
-   +``` 
-and now you are good to go.+and now you are good to go.  If you want to work on the nodeMCU firmware documentation then you will also need the MkDocs toolkit: 
 + 
 +``` 
 +  sudo apt-get install python-pip 
 +  sudo pip install mkdocs 
 +``` 
 +See the [[http://​www.mkdocs.org/​|MkDocs Website]] for more info. 
 + 
 =====Using the Arduino IDE.===== =====Using the Arduino IDE.=====
  
toolchain.txt · Last modified: 2018/01/06 18:53 by fabix