2021年5月19日 (水)



Arduino-CLI Install

Arduino-CLI Install





cd ~ curl -fsSL | sh #出力例 Installing in /home/USER/bin ARCH=64bit OS=Linux Using curl as download tool TAG=0.18.3 CLI_DIST=arduino-cli_0.18.3_Linux_64bit.tar.gz Downloading arduino-cli not found. You might want to add /home/USER/bin to your $PATH arduino-cli alpha Version: 0.18.3 Commit: d710b642 Date: 2021-05-14T12:36:58Z installed successfully in /home/USER/bin # 実行パスを設定する(.bashrcにも登録する) export PATH=$PATH:$HOME/bin/


mkdir ard_ws cd ard_ws/ # configファイルを初期化する arduino-cli config init #出力例 Config file written to: /home/USER/.arduino15/arduino-cli.yaml # arduino-cli.yamlファイルが$HOME/.arduino15/にできる # 新規のスケッチの作成 arduino-cli sketch new MyFirstSketch #出力例 Sketch created in: /home/USR/ard_ws/MyFirstSketch # 新規スケッチの内容の確認 cat MyFirstSketch/MyFirstSketch.ino void setup() { } void loop() { } # インストールされているボード・ライブラリの確認 arduino-cli board listall uno #出力 Board Name FQBN Arduino Uno arduino:avr:uno Arduino Uno WiFi arduino:avr:unowifi arduino-cli board listall xiao #出力 Board Name FQBN Seeeduino XIAO Seeeduino:samd:seeed_XIAO_m0 arduino-cli board listall wio #出力 Board Name FQBN Seeed Wio Link esp8266:esp8266:wiolink Seeeduino Wio GPS Board Seeeduino:samd:WioGPS Seeeduino Wio Terminal Seeeduino:samd:seeed_wio_terminal Seeeduino Wio lite MG126 Seeeduino:samd:Wio_Lite_MG126 arduino-cli board listall pico #出力 Board Name FQBN Adafruit Feather RP2040 (Picoprobe) rp2040:rp2040:adafruitfeatherpicoprobe Generic RP2040 (Picoprobe) rp2040:rp2040:genericpicoprobe Raspberry Pi Pico rp2040:rp2040:rpipico Raspberry Pi Pico arduino:mbed_rp2040:pico Raspberry Pi Pico (Picoprobe) rp2040:rp2040:rpipicopicoprobe #--------------------------------- # Install the core for your board arduino-cli core install Seeeduino:samd #出力 Platform Seeeduino:samd@1.8.1 already installed #Arduino-IDEでインストール済みなので「already installed」 arduino-cli core update-index #出力 Updating index: package_index.json downloaded Updating index: package_index.json.sig downloaded #---------------------------------- # 任意のスケッチに編集する gedit MyFirstSketch/MyFirstSketch.ino # Compile and upload the sketch #compile arduino-cli compile -b arduino:avr:uno MyFirstSketch #出力例 Sketch uses 932 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. #upload arduino-cli upload -p /dev/ttyUSB0 -b arduino:avr:uno MyFirstSketch #特に出力はないようだ



cd ~/Arduino # ディレクトリ内容の確認 ls ASCIITablePico ASCIITable_M5Atom BlinkPico MB_graphicstest libraries # ビルドしたいスケッチのディレクトリに入る cd ASCIITablePico # compile arduino-cli compile -b rp2040:rp2040:rpipico #出力例 Sketch uses 214480 bytes (10%) of program storage space. Maximum is 2093056 bytes. Global variables use 17064 bytes (6%) of dynamic memory, leaving 245080 bytes for local variables. Maximum is 262144 bytes. # upload arduino-cli upload -p /dev/ttyACM0 -b rp2040:rp2040:rpipico #出力例 Resetting /dev/ttyACM0 Converting to uf2, output size: 442880, start address: 0x2000 Flashing /media/USER/RPI-RP2 (RPI-RP2) Wrote 442880 bytes to /media/USER/RPI-RP2/NEW.UF2 #------------------------------ # 同じスケッチでboardを切り替える # ボード確認 arduino-cli board listall Atom #出力例 Board Name FQBN M5Stack-ATOM m5stack:esp32:m5stack-atom # compile arduino-cli compile -b m5stack:esp32:m5stack-atom #出力例 Sketch uses 213585 bytes (16%) of program storage space. Maximum is 1310720 bytes. Global variables use 15380 bytes (4%) of dynamic memory, leaving 312300 bytes for local variables. Maximum is 327680 bytes. # upload arduino-cli upload -p /dev/ttyUSB0 -b m5stack:esp32:m5stack-atom #出力例 v3.0-dev Serial port /dev/ttyUSB0 Connecting..... Chip is ESP32-PICO-D4 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 50:02:91:90:04:e4 Uploading stub... Running stub... Stub running... Changing baud rate to 1500000 Changed. Configuring flash size... Auto-detected Flash size: 4MB Compressed 8192 bytes to 47... Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 15527.2 kbit/s)... Hash of data verified. Compressed 15856 bytes to 10276... Wrote 15856 bytes (10276 compressed) at 0x00001000 in 0.1 seconds (effective 1129.5 kbit/s)... Hash of data verified. Compressed 213696 bytes to 108970... Wrot  e 213696 bytes (108970 compressed) at 0x00010000 in 1.8 seconds (effective 960.5 kbit/s)... Hash of data verified. Compressed 3072 bytes to 128... Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 6202.5 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin...



# install arduino-cli core update-index --additional-urls #出力例 Updating index: package_index.json downloaded Updating index: package_index.json.sig downloaded Updating index: package_esp8266com_index.json downloaded # check arduino-cli core search esp8266 --additional-urls #出力例 ID Version Name esp8266:esp8266 3.0.0 esp8266 # ボード・ライブラリ確認 arduino-cli board listall 8266 #出力例 Board Name FQBN 4D Systems gen4 IoD Range esp8266:esp8266:gen4iod Adafruit Feather HUZZAH ESP8266 esp8266:esp8266:huzzah Amperka WiFi Slot esp8266:esp8266:wifi_slot Arduino esp8266:esp8266:arduino-esp8266 DOIT ESP-Mx DevKit (ESP8285) esp8266:esp8266:espmxdevkit Digistump Oak esp8266:esp8266:oak ESPDuino (ESP-13 Module) esp8266:esp8266:espduino ESPectro Core esp8266:esp8266:espectro ESPino (ESP-12 Module) esp8266:esp8266:espino <省略>


Arduino-cli: compile, upload and manage libraries, cores, and boards

Platform specification


続きを読む "Arduino-CLIのインストール"

| | コメント (0)