190424-linux-dev-esp32

开发环境

安装Linux下的软件需求

1
sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-cryptography python-future python-pyparsing python-pyelftools

linux环境设置

下载地址:

1
2
3
mkdir -p /home/username/esp
cd /home/username/esp
tar -xzf /home/username/Downloads/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz

2.设置环境变量PATH,以便能搜索到我们的编译工具链 在/home/username/.profile中添加

1
export PATH=$PATH:/home/username/esp/xtensa-esp32-elf/bin

具体操作: /usrname路径下

.profile```, 然后在文件尾部输入`o`,写入上面内容,输入`wq`退出。
1
2
```
source .profile

执行echo $PATH查看环境变量结果

git clone SDK ESP-IDF

在esp目录下

1
2
git clone --recursive http://github.com/espressif/esp-idf.git
git submodule add https://github.com/tuanpmt/espmqtt.git components/espmqtt

…等一会 如果没有安装git

1
sudo apt install git

环境变量

1
2
echo "export IDF_PATH=~/esp/esp-idf" >> ~/.bashrc
source ~/.bashrc

编译helloworld

1
2
cd examples/get-started/hello_world/
make

烧写固件

识别到ttyUSB0设备后执行命令

1
2
sudo chmod 777 /dev/ttyUSB0
make flash monitor

提示recipe for target 'flash' failed,输入sudo chmod 777 /dev/ttyUSB0即可

ESP-TOUCH

https://github.com/EspressifApp/ESP-TOUCHForAndroid

bug

  1. /esp/esp-idf/components/espmqtt/目录下执行mv mqtt_client.c mqtt_client.c.bak
  2. /esp/esp-idf/components/espmqtt/include目录下执行mv mqtt_client.h mqtt_client.h.bak