Skip to content
slaff edited this page Feb 9, 2018 · 45 revisions

Prerequisites:

(You might already have it)

Xcode command line tools
xcode-select --install
Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Eclipse

(Optional)

brew install Caskroom/cask/eclipse-cpp

Install build toolchain

brew install binutils coreutils automake wget gawk libtool gettext gperf grep
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"

Install gnu-sed and make sure that it is the default sed command line application. For the installation use the commands below:

brew install gnu-sed --with-default-names

If you have already installed gnu-sed but it is not the default one then make sure to uninstall it and install it again with the correct options. This can be done using the commands below:

brew uninstall gnu-sed
brew install gnu-sed --with-default-names

Install prebuilt Open ESP SDK

cd ~/
curl -L -O  https://dl.bintray.com/sminghub/toolchain/esp-open-sdk-2.0-macosx.tgz
sudo mkdir -p /opt/
sudo tar -zxf esp-open-sdk-2.0-macosx.tgz -C /opt/
sudo chmod -R 775 /opt/esp-open-sdk

You can also build it yourself with Homebrew or with MacPorts.

Get And Build Sming Core:

cd <your-favourite-development-folder>/

git clone https://github.com/SmingHub/Sming.git
# Warning: Do NOT use the --recursive option for the command above. 
#          Our build mechanism will take care to get the third-party sources and patch them, if needed.

cd Sming/Sming

# You will get a copy of our `develop` branch which intended for developers 
# and it is the one where all new cool (unstable) features are landing. 

# If you want to use our stable branch type the command below
git checkout origin/master

# And finally set the SMING_HOME environment variable to point to <your-favourite-development-folder>/Sming/Sming

export SMING_HOME=`pwd`

make

Configure Environment Variables

Open with a text editor the .profile file in your home directory. And add at the end the following lines:

export ESP_HOME=/opt/esp-open/sdk
export SMING_HOME=<your-favourite-development-folder>/Sming/Sming

Make sure to replace in the command above with the actual directory on your local disk.

(Optional step)

(used by Make and Eclipse - make sure to quit Eclipse first)

If you installed Eclipse manually, substitute /opt/homebrew-cask/Caskroom/eclipse-cpp/4.5.1/Eclipse.app to /Applications/Eclipse/eclipse.app

sudo /usr/libexec/PlistBuddy -c "Add :LSEnvironment:ESP_HOME string '/opt/esp-open-sdk'" /opt/homebrew-cask/Caskroom/eclipse-cpp/4.5.1/Eclipse.app/Contents/Info.plist
sudo /usr/libexec/PlistBuddy -c "Add :LSEnvironment:SMING_HOME string '/opt/sming/Sming'" /opt/homebrew-cask/Caskroom/eclipse-cpp/4.5.1/Eclipse.app/Contents/Info.plist
sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /opt/homebrew-cask/Caskroom/eclipse-cpp/4.5.1/Eclipse.app

Compile Sming Examples

You can find all examples coming with Sming under the samples folder.

cd $SMING_HOME/../samples/

If you want to test some of the examples the following sequence of commands can help you:

cd $SMING_HOME/../samples/
cd Basic_Blink
make
# The command below will upload the sample code to your ESP8266 device
make flash