Skip to main content

Running pubnub on esp8266

                  I.            Setup esp-open-sdk

a.       Requirements and Dependencies(Debian/Ubuntu)

sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \ 
flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
    sed git unzip bash help2man wget bzip2
sudo apt-get install libtool-bin

b.      Building

git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
make

c.       Using the toolchain

sudo echo "export PATH=\$PATH:\%HOME/@localPath/esp-open-sdk/xtensa-lx106-elf/bin" >>  ~/.bashrc
example: sudo echo "export PATH=\$PATH:\$HOME/ws/esp8266/SDK/esp-open-sdk/xtensa-lx106-elf/bin" >> ~/.bashrc
source ~/.bashrc
Test compiler:
xtensa-esp32-elf-gcc -v

d.      Pulling updates


make clean
git pull
git submodule sync
git submodule update --init

                  II.            Building the toolchain

a.       Install needed dependencies (as root)

                                                               i.      32-Bit Debian (Linux)
sudo apt-get install git autoconf build-essential gperf bison flex texinfo libtool libncurses5-dev wget gawk libc6-dev-i386 python-serial libexpat-dev
(replace $customPathwith the name of the local path)
mkdir /@customPath/Espressif

                                                             ii.      64-bit Debian (Linux)
sudo apt-get install git autoconf build-essential gperf bison flex texinfo libtool libncurses5-dev wget gawk libc6-dev-amd64 python-serial libexpat-dev
(replace $customPathwith the name of the local path)
mkdir /@customPath/Espressif

b.      Install the Xtensa crosstool-NG (as local user)


cd /esp-open-sdk/crosstool-NG

./bootstrap
./configure --prefix="$pwd"
make
sudo make install

./ct-ng menuconfig
./ct-ng buildls

PATH=$PWD/builds/xtensa-lx106-elf/bin:$PATH
Document about crosstool-NG
http://crosstool-ng.github.io/docs/

c.       Setting up the Espressif SDK


cd /@customPath/Espressif

wget -O esp_iot_sdk_v0.9.3_14_11_21.zip https://github.com/esp8266/esp8266-wiki/raw/master/sdk/esp_iot_sdk_v0.9.3_14_11_21.zip
wget -O esp_iot_sdk_v0.9.3_14_11_21_patch1.zip https://github.com/esp8266/esp8266-wiki/raw/master/sdk/esp_iot_sdk_v0.9.3_14_11_21_patch1.zip
unzip esp_iot_sdk_v0.9.3_14_11_21.zip
unzip esp_iot_sdk_v0.9.3_14_11_21_patch1.zip
mv esp_iot_sdk_v0.9.3 ESP8266_SDK
mv License ESP8266_SDK
cd /@customPath/Espressif

-          cd /opt/Espressif
-          wget -O esp_iot_sdk_v0.9.3_14_11_21.zip https://github.com/esp8266/esp8266-wiki/raw/master/sdk/esp_iot_sdk_v0.9.3_14_11_21.zip
-          wget -O esp_iot_sdk_v0.9.3_14_11_21_patch1.zip https://github.com/esp8266/esp8266-wiki/raw/master/sdk/esp_iot_sdk_v0.9.3_14_11_21_patch1.zip
-          unzip esp_iot_sdk_v0.9.3_14_11_21.zip
-          unzip esp_iot_sdk_v0.9.3_14_11_21_patch1.zip
-          mv esp_iot_sdk_v0.9.3 ESP8266_SDK
-          mv License ESP8266_SDK/

d.      Patching

-          cd /opt/Espressif/ESP8266_SDK
-          sed -i -e 's/xt-ar/xtensa-lx106-elf-ar/' -e 's/xt-xcc/xtensa-lx106-elf-gcc/' -e 's/xt-objcopy/xtensa-lx106-elf-objcopy/' Makefile
-          mv examples/IoT_Demo .

e.      Installing Xtensa libraries and headers

-          cd /opt/Espressif/ESP8266_SDK
-          tar -xvzf include.tgz

f.        Installing the ESP image tool

-          cd /opt/Espressif
-          wget -O esptool_0.0.2-1_i386.deb https://github.com/esp8266/esp8266-wiki/raw/master/deb/esptool_0.0.2-1_i386.deb
-          dpkg -i esptool_0.0.2-1_i386.deb

g.       Installing the ESP upload tool

-          cd /opt/Espressif
-          git clone https://github.com/themadinventor/esptool esptool-py
-          sudo ln -s $PWD/esptool-py/esptool.py crosstool-NG/builds/xtensa-lx106-elf/bin/

                  III.            Building project

-          cd /opt/Espressif
-          cd source-code-examples/blinky
-          make

                  IV.            Uploading to ESP8266

-
-          Prepare hardware
-          cd /opt/Espressif/source-code-examples/blinky
-          make ESPPORT=/dev/ttyUSB0 flash



Comments

Popular posts from this blog

Mô Hình Hóa Và Điều Khiển Mô Hình Xe - Con lắc ngược (Cart and Pole)

Thông số của mô hình: 1.       Khối lượng thân xe : M=2.0 (kg) 2.       Khối lượng con lắc : m=0.1 (kg) 3.       Chiều dài con lắc : l=0.5( m) 4.         là góc lệch của con lắc theo phương thẳng đứng 5.       x : là chuyển vị của xe. 6.       u : input ngoại lực tác động lên xe. 7.       g=9,81 (m/s 2 )  gia tốc trọng trường . 8.       Hệ thống hoạt động trong môi trường tuyến tính. 9.       Chỉ đo được góc lệch con lắc và vị trí xe. 10. Có nhiễu tác động vào hệ thống. Nhiễu đo vị trí xe có phương sai là 0.01, nhiễu góc lệch con lắc có phương sai 0.001. 11. Sử dụng bộ lọc Kalman để ước lượng trạng thái và lọc nhiễu. Bài t...

Stm32 + MPU6050 + Bluetooth HC05 + Android App

Description: - Using Arduino Code on STM32F1xx device - Get data from Gyro sensor and send to android OS through Bluetooth Module (Using SPP profile) - Start/Stop sensor/Led from android phone.

Setup hotspots for raspberry pi 3

RPI3_HOTSPOTS 1. Features: Can install while wlan0 is connected to network. easy to switch betwwen stattion mode and hotspot mode. can share internet between eth0 and wlan0, can be config to share with wlan1 or ... 2. Introduction: This tutorial will guide you steps to setup the Wifi module of raspberry pi 3 work with Station and Access Point mode, you can easily switch between station mode and AP mode. Setup: git clone https://github.com/quangthanh010290/RPI3_HOTSPOTS.git sudo ./install.sh 3. Test: Station mode: sudo sta [SSID] [password] - Connect to a network with specific ssid name and password ,example: sudo sta mySSID myPass Station mode: sudo sta - Connect to a network with saved ssid name and password ,example: sudo sta AP mode: sudo ap [SSID] [pass] - Create an wifi hotspot with specific ssid and pass ,example: sudo ap my_ssid 12345678 AP mode: sudo ap [SSID] - Create an wifi hotspot with specific ssid and no pass ,example: sudo...