Showing posts with label Arduino IDE. Show all posts
Showing posts with label Arduino IDE. Show all posts

Friday, October 29, 2021

Arduino IDE, open two independent Serial Monitor

To open two Arduino IDEs, with independent board and Serial Monitor. Tested on Arduino IDE 1.8 in Raspberry Pi OS, Windows 10 and Ubuntu 21.10.

- Open new Arduino IDE from system, or
- from File Explorer.


Thursday, July 8, 2021

Change Arduino IDE Tab size, by editing preferences.txt.

This video show how to locate Arduino IDE's preferences.txt, and edit it to change Arduino Editor Tab size.

Wednesday, June 9, 2021

Arduino Nano RP2040 Connect

Just receive Arduino Nano RP2040 Connect:





Install Nano RP2040 Connect to Arduino IDE and fix "An error occurred while uploading the sketch":
 

Install Arduino Nano RP2040 Connect board to Arduino IDE.

- Open Board Manager in Arduino IDE.
- Search and install Arduino Mbed OS Nano Boards by Arduino. It's version 2.1.0 currently.


- Once installed, Arduino Mbed OS Nano Boards > Arduino Nano RP2040 Connect will available in board selection list.

If you have XIAO BLE Sense also, check Remark on "Arduino Nano RP2040 Connect" of "Arduino Mbed OS Boards" vs "Arduino Mbed OS Nano Boards".


Fix "An error occurred while uploading the sketch".

In my case on Raspberry Pi, sketch cannot be uploaded; with "An error occurred while uploading the sketch".

To fix it:
- Switch to mbed_rp2040 installed folder:
/home/pi/.arduino15/packages/arduino/hardware/mbed_rp2040/2.1.0
- Run post_install.sh:
$ sudo ./post_install.sh

- Then, you can upload the sketch again.


More exercise:
read onboard LSM6DSOX IMU module (accelerometer and gyroscope)

Tuesday, April 27, 2021

Install arduino-esp32 2.0.0-alpha1 on Arduino IDE, Alpha preview with support for ESP32-S2 and ESP32-C3.

Currently (as on 2021-04-28), arduino-esp32 support ESP32-S2 and ESP32-C3 in development release 2.0.0-alpha1.


To install development release to Arduino IDE board manager:

Click in Arduino IDE Menu > File > Preferences

Enter development release link () in Additional Boards Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

Open board manager:

Tools > Board > Boards Manager
Search and select esp32 by Esoressif systems, install the latest version, currentlt 2.0.0-alpha1.


After then, ESP32C3/ESP32S2 Dev Modules are available in board list.


~ release note of 2.0.0-alpha1



Exercise:
ESP32-S2:

ESP32-C3:

Saturday, July 11, 2020

BasicOTA: Program ESP32 (or ESP8266) via ArduinoOTA, on Windows 10/Arduino IDE

One of the very useful feature of ESP32/ESP8266 is OTA (Over-The-Air) programming; such that you can update the firmware without physically connect to the device.

With ESP32/ESP8266 core for Arduino installed to your Arduino IDE, you can find ArduinoOTA examples of BasicaOTA and OTAWebUpdater under Examples for ESP32 Dev Module.


This post show trying BasicOTA examples on ESP32-DevKitC using Arduino IDE running on Windows 10, and fix the problem I faced:  Network Ports no shown and No response from device.


Basically, the default DevKitC firmware have no OTA function. So you have to flash the first firmware with OTA function using serial port (USB). After then, you can update your firmware via OTA without physical connected serial port. Both the computer used to update the firmware and the ESP devices to be updated have to be in the same network.

The ESP device I used in this example is ESP32-DevKitC with ESP32-WROOM-32 module. It should be a relatively old and original version.


Somebody (include me) reported there are no Network Ports shown up. 


Somebody suggested to install Python, somebody suggested to reboot router, or install Bonjour... All of them not work for me. In order to eliminate the problem outside my computer, I decide to use Windows 10's Mobile hotspot.


Open BasicOTA example and change ssid and password according to my network setting. Upload the ESP32 device via serial port (USB, or COM5 in this example).

Turn on Windows 10's Mobile hotspot with matched ssid/password.

Now the Network ports shown, with attached device (the programmed ESP32 with OTA function) and its assigned ip.


Once Network port selected, the Arduino IDE's Serial Monitor not work on network. So I run Putty to monitor the output from ESP device via serial port.

Now, upload your second program via OTA. But still fail due to No response from device.


Now, open Windows Security and Allow espota.exe to communicate through Windows Defender Firewall.

Upload again, and Done uploading.
(In the various steps, the assigned ip of the ESP device may be changed. Double check the ip in Putty and select the Network port accordingly.)


Thursday, June 25, 2020

Install ESP32/ESP8266 to Arduino IDE on Ubuntu 20.04, with setup Pythton & serial

After install JDK (OpenJDK) and Arduino IDE on Ubuntu 20.04, you can add support of ESP32 (or ESP8266).

May be you will be with Python 2 related error of:
exec: "python": executable file not found in $PATH
ModuleNotFoundError: No module named 'serial'

In 20.04 LTS, the python included in the base system is Python 3.8. Python 2.7 has been moved to universe and is not included by default in any new installs. (referene: Ubuntu 20.04 LTS (Focal Fossa) release notes)

Here show how to fix it:


First, install board to Boards Manager:

Menu > File> Preferences
Enter the url in the "Additional Board Manager URLs":
https://dl.espressif.com/dl/package_esp32_index.json (for ESP32)
http://arduino.esp8266.com/stable/package_esp8266com_index.json (for ESP8266)

To enter more than one URL, separate it with a comma.

Menu > Tools > Board > Boards Manager…
Search and install ESP32 (or ESP8266)

When you build your code for ESP32/ESP8266, if you report with error of :
exec: "python": executable file not found in $PATH

It's because Python 2 is not installed on Ubuntu 20.04. You can create a symlinks /usr/bin/python to python3 by installing python-is-python3.

$ sudo apt install python-is-python3

Optionally, you can prevent Python 2 from being installed as a dependency of something in the future:

$ sudo apt-mark hold python2 python2-minimal python2.7 python2.7-minimal libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib

Then you may be report with error:
ModuleNotFoundError: No module named 'serial'

Because pyserial is not installed in Python 3 by default. Install with pip:

$ sudo apt install python3-pip
$ pip3 install pyserial

Additionally, if you cannot download your code to board caused by:
avrdude: ser_open(): can't open device "/dev/xxx": Permission denied

Add permission to your user:

$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/xxx


Next:
ESP32-DevKitC + 2.8inch 240x320 SPI TFT (ILI9341) using TFT_eSPI library
ESP32 + 1.3 inch 240x240 IPS LCD (ST7789 SPI interface), using TFT_eSPI library
NodeMCU (ESP8266) + 1.44" 128x128 TFT with ST7735 SPI driver (KMR1441_SPI V2), using ssd1306 library

Wednesday, June 24, 2020

Install Arduino IDE 1.8.13 on Ubuntu 20.04

To run Arduino IDE, you have to install Java on Ubuntu, refer last post Install JDK (OpenJDK) on Ubuntu 20.04.


Visit https://www.arduino.cc/ to download Linux 64 bits version.

Extract the downloaded file and more to where you want. Switch to the folder and run:
$ sudo ./install.sh

You will be reported with error of:

An error occurred while uploading the sketch
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied

You can add you (the user) to the group own permission of the upload port:

$sudo usermod -a -G dialout <username>
$sudo chmod a+rw /dev/ttyACM0

change username and ttyACM0 according to your setup.

logout and login.



Basically, the steps to install Arduino IDE on Ubuntu 20.04 are same as install on previous version of Ubuntu. But if you target to develop for ESP32/ESP8266, very likely you will be with error of:
exec: "python": executable file not found in $PATH
ModuleNotFoundError: No module named 'serial'

Check next post - Install ESP32/ESP8266 to Arduino IDE on Ubuntu 20.04, with setup Pythton & serial

Thursday, October 24, 2019

Arduino Pro IDE (alpha preview) released

Arduino announced a completely new development environment for Arduino, Arduino Pro IDE (alpha preview) released. Available in Windows, Mac OS X and Linux64 versions.

The main features in this initial alpha release of the new Arduino Pro IDE are:

  • Modern, fully featured development environment 
  • Dual Mode, Classic Mode (identical to the Classic Arduino IDE) and Pro Mode (File System view)
  • New Board Manager 
  • New Library Manager
  • Board List
  • Basic Auto Completion (Arm targets only)
  • Git Integration
  • Serial Monitor
  • Dark Mode

Source and download link:
~ Arduino Blog - Arduino Pro IDE (alpha preview) with advanced features





Wednesday, April 10, 2019

Install Arduino IDE 1.8.9 on Ubuntu 18.10 and set permission for serial port

This video show how to install the latest Arduino IDE 1.8.9 on a fresh new Ubuntu 18.10 (on VirtualBox 6.0/Windows 10).



This installation is very straightforward:
- visit Arduino Software download page to download the Linux 32 bits or 64 bits version corresponding to your system.
- Extract the downloaded file to the where you want to install.
- Open Terminal to run the install.sh with sudo.
$ sudo ./install.sh

After finished, you can start Arduino IDE with arduino command or from Application launcher.

But...up to this step, you have no permission to access the serial port. When you download the code to Arduino devices, you will be reported with error:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied


To fix it, you have to add permission:
- Open Terminal, enter the command:
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyACM0


Friday, March 15, 2019

Arduino IDE 1.8.9 released

Arduino IDE 1.8.9 released, visit HERE to download.

It's noted in the Software Release Notes, Arduino 1.8.9 added new target of ARM64 boards (Nvidia Jetson and RaspberryPi3 with 64bit operating system).


Related:
- Install Arduino IDE 1.8.9 on Ubuntu 18.10 and set permission for serial port

Monday, April 3, 2017

Program the Siemens IOT2000 With Arduino IDE

The new Internet of Things gateway from Siemens (Simatic) has been released! It's based on the Intel Galileo Gen2 chipset.

This tutorial show how to "Program the New IOT2000 From Siemens With Arduino IDE!".

Tuesday, May 10, 2016

ARDUINO 1.6.9 is available now


ARDUINO 1.6.9 is available, download the Arduino Software now.


Release Notes:
https://www.arduino.cc/en/Main/ReleaseNotes

ARDUINO 1.6.9 2016.05.10

[ide]
* Catch and report errors during parsing contributed index files
* Fixed IDE version color on about dialog box. Thanks @ivanebernal
* The "always-on-top update notification" popup is now less intrusive.
* Fixed untraslated string during IDE startup splash window. Thanks @ivanebernal
* New arduino-builder: better core library detection, faster operations when recompiling and more.
  See https://github.com/arduino/arduino-builder/compare/1.3.9...1.3.15
* Fixed multitab error reporting
* Rework serial port discovery to be faster, less cpu intensive and FTDI friendly
* Avoid launching multiple concurrent compile and upload operation
* Use hi-res icons for Serial monitor and plotter
* Make http://librarymanager and http://boardmanager links clickable from the editor window
* Cut/Copy actions are disable when there is no text selected. Thanks @avargas-nearsoft
* Added more OSX native (emacs-like) keybindings. Thanks @nopdotcom
* Fixed Ctrl+Del: now deletes the word behind the cursor instead of the entire line. Thanks @avargas-nearsoft
* Fixed "Verify code after upload" option in preferences. Thanks @gh-megabit

[core]
* String class now supports iterators. Thanks @Chris--A
* sam: Allow 3rd party boards that depend on SAM core to use their own
       USB vid/pid and manufacturer/product strings. Thanks @philmanofsky.
* avr: Check at runtime if 32u4 boards are shipped with new bootloader; if so
       write bootloader magic value in an unproblematic RAM location
* avr, sam: Added "reciper.ar.pattern" to plaform.txt to allow compatibility
  with older version of Arduino IDE. Thanks @per1234

[libraries]
* Bridge / bridge.py: added support for SSL sockets (Yun firmware >=1.6.2 is
  needed).


Wednesday, April 13, 2016

Install Arduino/Genuino 101 to Arduino Software and run Blink on Genuino 101


To install Arduino/Genuino 101 to Arduino Software, click Tools > Board: > Boards Manager and install "Intel Curie Boards by Intel".


This video show how to, and open example of Blink to run on Genuino 101.


Monday, April 4, 2016

Serial Plotter in Arduino IDE



Start from ARDUINO 1.6.6 (2015.11.03), Serial Plotter is added under Tools > Serial Plotter.

This video show how to use it.


Example running on Arduino Uno in the video, read Analog Input from A0, and println to serial port.
const int AnalogIn  = A0;

int readingIn = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  readingIn = analogRead(AnalogIn);
  Serial.println(readingIn);
}

remark: This code can run on NodeMCU also.


Friday, November 6, 2015

Install ESP8266 Board to Arduino IDE


With ESP8266 Board installed on Arduino IDE, we can program ESP8266 modules as a standalone microcontroller/board, as simple as program Arduino.


Installing with Boards Manager

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. The ESP8266 packages available for Windows, Mac OS, and Linux (32 and 64 bit).
  • Install Arduino 1.6.5 from the Arduino website.
  • Start Arduino and open Preferences window.
  • Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
  • Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

With ESP8266 Board Library installed, you can build more project on Standalone ESP8266, without controller such as Arduino.


Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE
Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module

Thursday, October 15, 2015

adk.h: No such file or directory and Install USBHost library to Arduino IDE


adk.h (Accessory Development Kit) is part of USBHost library. In current Arduino IDE 1.6.5, it's not included by default.

To install USBHost:
> Sketch > Include Library > Manage Libraries
> Search to install USBHost.



Wednesday, October 14, 2015

No Arduino Due in Arduino Software


In current Arduino Software (IDE) 1.6.5, Arduino Due is not in default Board list. To install Arduino Due:
> Tools > Board > Boards Manager
> Select to install the item for Arduino Due


Monday, October 5, 2015

Arduino Uno + RFID-RC522, MFRC522 library example DumpInfo




This post show how Arduino Uno + RFID-RC522 (RFID reader) to dump info of RFID key and RFID card, using Arduino RFID Library for MFRC522.

Arduino library for MFRC522 and other RFID RC522 based modules (https://github.com/miguelbalboa/rfid) read and write different types of Radio-Frequency IDentification (RFID) cards on your Arduino using a RC522 based reader connected via the Serial Peripheral Interface (SPI) interface.

Install MFRC522 library to Arduino IDE:

You can download ZIP file from the library web page, and it to Arduino library, read the video below. After library added, it will be in the folder your_Documents\Arduino\libraries\,


and fritzing parts is in your_Documents\Arduino\libraries\rfid-master\doc\fritzing\.


Connect Arduino Uno and RFID-RF522 module:


In Arduino IDE, Open Example of DumpInfo in MFRC522:



/*
 * ----------------------------------------------------------------------------
 * This is a MFRC522 library example; see https://github.com/miguelbalboa/rfid
 * for further details and other examples.
 * 
 * NOTE: The library file MFRC522.h has a lot of useful info. Please read it.
 * 
 * Released into the public domain.
 * ----------------------------------------------------------------------------
 * Example sketch/program showing how to read data from a PICC (that is: a RFID
 * Tag or Card) using a MFRC522 based RFID Reader on the Arduino SPI interface.
 * 
 * When the Arduino and the MFRC522 module are connected (see the pin layout
 * below), load this sketch into Arduino IDE then verify/compile and upload it.
 * To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M).
 * When you present a PICC (that is: a RFID Tag or Card) at reading distance
 * of the MFRC522 Reader/PCD, the serial output will show the ID/UID, type and
 * any data blocks it can read. Note: you may see "Timeout in communication"
 * messages when removing the PICC from reading distance too early.
 * 
 * If your reader supports it, this sketch/program will read all the PICCs
 * presented (that is: multiple tag reading). So if you stack two or more
 * PICCs on top of each other and present them to the reader, it will first
 * output all details of the first and then the next PICC. Note that this
 * may take some time as all data blocks are dumped, so keep the PICCs at
 * reading distance until complete.
 * 
 * Typical pin layout used:
 * -----------------------------------------------------------------------------------------
 *             MFRC522      Arduino       Arduino   Arduino    Arduino          Arduino
 *             Reader/PCD   Uno           Mega      Nano v3    Leonardo/Micro   Pro Micro
 * Signal      Pin          Pin           Pin       Pin        Pin              Pin
 * -----------------------------------------------------------------------------------------
 * RST/Reset   RST          9             5         D9         RESET/ICSP-5     RST
 * SPI SS      SDA(SS)      10            53        D10        10               10
 * SPI MOSI    MOSI         11 / ICSP-4   51        D11        ICSP-4           16
 * SPI MISO    MISO         12 / ICSP-1   50        D12        ICSP-1           14
 * SPI SCK     SCK          13 / ICSP-3   52        D13        ICSP-3           15
 */

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN     9       // 
#define SS_PIN      10      //

MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance

void setup() {
    Serial.begin(9600);     // Initialize serial communications with the PC
    while (!Serial);        // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
    SPI.begin();            // Init SPI bus
    mfrc522.PCD_Init();     // Init MFRC522
    ShowReaderDetails();    // Show details of PCD - MFRC522 Card Reader details
    Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
    // Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }

    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial()) {
        return;
    }

    // Dump debug info about the card; PICC_HaltA() is automatically called
    mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}

void ShowReaderDetails() {
    // Get the MFRC522 software version
    byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
    Serial.print(F("MFRC522 Software Version: 0x"));
    Serial.print(v, HEX);
    if (v == 0x91)
        Serial.print(F(" = v1.0"));
    else if (v == 0x92)
        Serial.print(F(" = v2.0"));
    else
        Serial.print(F(" (unknown)"));
    Serial.println("");
    // When 0x00 or 0xFF is returned, communication probably failed
    if ((v == 0x00) || (v == 0xFF)) {
        Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
    }
}



- Similarly example run on Android: Android NFC: readBlock() for MifareClassic, to dump data in RFID tag
Step-by-step to make MFRC522-python work on Raspberry Pi 2/raspbian Jessie, read RFID tags using RFID Reader, RFID-RC522.
Raspberry Pi 2 + MFRC522-python - Dump RFID Tag data using mxgxw/MFRC522-python

Thursday, October 1, 2015

Install Arduino driver on Windows 10


Due to any reason, you cannot install the Arduino driver on Windows, you can try to update the driver manually in your Device Manager.
  • Plug in your board and wait for Windows to begin it's driver installation process. After a few moments, the process will fail, despite its best efforts
  • Click on the Start Menu, and open up the Control Panel.
  • While in the Control Panel, navigate to System and Security. Next, click on System. Once the System window is up, open the Device Manager.
  • Look under Ports (COM & LPT). You should see an open port named "Arduino UNO (COMxx)". If there is no COM & LPT section, look under "Other Devices" for "Unknown Device".
  • Right click on the "Arduino UNO (COmxx)" port and choose the "Update Driver Software" option.
  • Next, choose the "Browse my computer for Driver software" option.
  • Finally, navigate to and select the driver file named "arduino.inf", located in the "Drivers" folder of the Arduino Software download (not the "FTDI USB Drivers" sub-directory). If you are using an old version of the IDE (1.0.3 or older), choose the Uno driver file named "Arduino UNO.inf"
  • Windows will finish up the driver installation from there.

reference: Getting Started with Arduino on Windows - Install the drivers