Arduino

From XennisWiki
Jump to: navigation, search

Installation

Arch Linux

Install the Arduino IDE

pacman -S arduino arduino-avr-core

Add the user starting the IDE to the groups uucp and lock.

Arduino CLI

Installation

Further installation methods can be found in the README.md

curl --location https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz | tar --extract --gzip

Usage

Install a core

arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core install esp32:esp32 --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Install a library

arduino-cli lib install FastLED

NodeMCU

Expressif ESP32 DevKitC V4

Further information: ESP32-DevKitC V4 Getting Started Guide

Install the board

  • File > Preferences
  • Add to the comma separated list Additional Boards Manager URLs the URL from the Arduino core for the ESP32
  • Next go to Tools > Boards > Boards Manager > search for esp32 and install esp32 by Expressif Systems

To select the board: Tools > Board > ESP32 Dev Module

Hello world

void setup() {
  Serial.begin(9600); 
  Serial.println("Hello World!");
}

void loop() {
}

Errors and problems

Arch Linux: NullPointerException onBoardOrPortChange on startup

Error message
java.lang.NullPointerException
	at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:679)
	at processing.app.Base.onBoardOrPortChange(Base.java:1313)
	at processing.app.Base.<init>(Base.java:276)
	at processing.app.Base.main(Base.java:145)
Solution

Install the arduino-avr-core package.

ImportError: No module named serial

Error message
ImportError: No module named serial
Solution

Install the missing module via pip: pip install pyserial

External links