追蹤者

2021年6月14日 星期一

ESP8266, ESP32 免安裝

 整個過程 只要新增一個portable 目錄! 其他自動產生, 不用建.


Arduino 官網  https://www.arduino.cc/en/Guide/PortableIDE

1. download ZIP file  選右側 Zipfile> Justdownload

2. 
  • Open the extracted folder and in its root create a new directory called portable, alongside the others;


  • portable> 

    • portable>packages

    • portable>sketchbook>libraries

    • portable>staging

3. From now on all the sketches, libraries and additional cores will be installed in the portable folder. 

You can copy the whole main folder and bring it with you anywhere you want: it will retain all your preferences, libraries, cores and sketches.






 以下實作測試

[設定ESP32]
  
 Arduino>
     1 .  工具 >  開發板選 Arduino UNO
  2 .  工具 >  開發板選 開發板管理員> 搜尋 ESP32> 安裝 ESP32
  3 .  工具 >  開發板   >   ESP 32 Arduino >  DOIT  ESP32 DEVKIT V1
               此時 會自動產生 portable\packages\esp32  目錄

     4 .  工具 >  upload speed > 115200
     5 .  工具 >  choose com port   (此時無法點選 哪個PORT)


[偏好設定   

   Arduino>檔案>偏好設定

A.   sketchbooks
草稿碼簿的位置, 指向portable\packages\esp32  
例如  C:\arduino-1.8.15\portable\paackages\esp32

此時 Arduino>工具> 序列阜 "COM3" 可點選 (字體由灰變黑)

B.  額外的開發板管理員網址 

加上下列網址
https://dl.espressif.com/dl/package_esp32_index.json,
http://arduino.esp8266.com/stable/package_esp8266com_index.json

 
[簡易測試 

Arduino>檔案> 範例 > 01. Basics> Blink
upload
save file   此時 會自動產生 portable\packages\esp32  Blink目錄下 INO 檔案

[ 建立 PORTABLE ARDUINO 成功 ]
之後存檔 or 新增Sketch
便會存在portable\packages\esp32目錄下

也可嘗試 加上 ESP8266 portable , sketch 會存在portable\packages\esp8266
[設定ESP8266]

Step1 開啟 Arduino IDE。

Step2 點擊「檔案」>「偏好設定」,將底下那一行字貼到「Additional Boards Manager URLs:」右側欄位內

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Step3 點擊「確定」鈕,並關閉 Arduino IDE。

Step4 再次開啟 Arduino IDE。

Step5 安裝 ESP8266 工具,點擊「工具」>「板子」>「Boards Manager...」。
(出現「Boards Manager」對話窗)

Step6 捲動右側拉桿到下方,點擊「esp8266 by ESP8266 Community」那一欄,再點擊「Install」鈕。

Step7 點擊「關閉」鈕。


開啟範例程式

在自己編寫程式之前,我們先來執行內建的範例程式。這個程式會讓 NodeMCU 板載的 LED 閃爍。

Step1 開啟 Arduino IDE。

Step2 點擊「工具」>「板子」,選擇「NodeMCU 1.0 (ESP-12E Module)」。

Step3 點擊「序列埠」,選擇正確的埠。

Step4 點擊「檔案」>「範例」>「ESP8266」>「Blink」。

Step5 點擊「上傳」。


PS
產生 BIN檔案                                                                                                   Arduino>檔案>偏好設定>顯示詳細輸出: 編譯 , 上傳 打勾      , Arduino>草稿碼>匯出以編譯的二進位檔  ------>   2/27/2020 OK.                                                             但 Arduino>上傳, 卻出現"error: espcomm_open failed". <<< 不外接設備 重新上傳成功,                 如此不用每次都編譯再加上傳, 速度快很多了!

沒有留言:

張貼留言