Debugging Using Your Browser?

Meet Arduino Create Agent and Live Debugger Console

July 8, 2024 by Alessandro Colucci
Arduino Create Agent image

Introduction

 

The Arduino Create Agent is an essential component for developers who work with Arduino hardware and use tools like the Live Debugger Console in Pleasedontcode. This article explores the functionality, installation, and usage of the Arduino Create Agent, highlighting its role in facilitating seamless debugging and interaction with Arduino boards.

 

What is Arduino Create Agent?

 

The Arduino Create Agent is a lightweight, open-source application that enables your web browser to communicate directly with Arduino boards. It acts as a bridge between your local development environment and the Arduino Cloud, allowing for tasks such as uploading sketches, monitoring serial output, and debugging.

 

Why Use the Arduino Create Agent?

 

Key Benefits:

 

    • Seamless Integration: The agent allows for easy integration with the Arduino Cloud and web-based IDEs like Pleasedontcode, providing a unified development experience.

    • Cross-Platform Compatibility: Available for Windows, macOS, and Linux, ensuring all developers can utilize its features regardless of their operating system.

    • Enhanced Debugging: When used with tools like the Live Debugger Console in Pleasedontcode, it facilitates real-time debugging and monitoring of Arduino projects.

 

How the Arduino Create Agent Works with the Live Debugger Console

 

Live Debugger Console in Pleasedontcode

 

The Live Debugger Console in Pleasedontcode is a powerful tool that allows developers to debug their Arduino code in real-time. By leveraging the Arduino Create Agent, the console can interact with the connected Arduino board, enabling the following features:

    • Real-Time Monitoring: View live data from your Arduino's serial monitor directly in the browser.

    • Breakpoint Management: Set breakpoints in your code to pause execution and inspect variables and states.

    • Variable Inspection: Monitor and change variable values on the fly to test different scenarios and responses.

 

Installation Guide

 

Step 1: Download the Arduino Create Agent

 

To use the Arduino Create Agent, download the appropriate installer for your operating system from the links below:

 

Step 2: Install the Arduino Create Agent

 

Run the downloaded installer and follow the on-screen instructions to complete the installation process. Ensure you have administrative permissions to install software on your machine.

 

Step 3: Launch the Arduino Create Agent

 

After installation, launch the Arduino Create Agent from your applications menu. The agent should run in the background, and you should see its icon in the system tray (Windows and Linux) or top menu bar (macOS).

 

Step 4: Reconfigure the Agent

 

    • Open the Arduino Create Agent menu from the icon in the system tray.

    • Click on "Open Configuration" to open the config.ini file in your default text editor.

    • Modify the original configuration changing the line 11 ("origins" parameter):

Original config.ini

# Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)
gc             = std
# Override the hostname we get from the OS
hostname       = unknown-hostname
# Regular expression to filter serial port list
regex          = usb|acm|com
# show debug logging
v              = true
appName        = CreateAgent/Stable
updateUrl      = https://downloads.arduino.cc/
origins        = https://local.arduino.cc:8000
# httpProxy = http://your.proxy:port # Proxy server for HTTP requests
# enable crashreport logging
crashreport    = false
# the Arduino Create Agent is able to start automatically after login on macOS (launchd agent)
autostartMacOS = true
installCerts   = true


 

Modified config.ini needed to run communication with Live Debugger Console

# Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)
gc             = std
# Override the hostname we get from the OS
hostname       = unknown-hostname
# Regular expression to filter serial port list
regex          = usb|acm|com
# show debug logging
v              = true
appName        = CreateAgent/Stable
updateUrl      = https://downloads.arduino.cc/
origins        = https://local.arduino.cc:8000, https://www.pleasedontcode.com
# httpProxy = http://your.proxy:port # Proxy server for HTTP requests
# enable crashreport logging
crashreport    = false
# the Arduino Create Agent is able to start automatically after login on macOS (launchd agent)
autostartMacOS = true
installCerts   = true


 

The alternative way is to modify the config.ini file which is located in the default directory for your operating system. Open the file with a text editor, adjust the settings, then save and restart the agent.

    • Windows: C:\Users\<YourUsername>\AppData\Roaming\ArduinoCreateAgent\config.ini

    • Mac: /Users/<YourUsername>/Library/Application Support/ArduinoCreateAgent/config.ini

    • Linux: /home/<YourUsername>/ArduinoCreateAgent/config.ini

 

Troubleshooting Common Issues

 

General Tips

 

    • Administrator Permissions: Ensure you have administrator permissions on your machine.

    • Firewall/Antivirus: The installation might be blocked by firewall or antivirus software. Add the agent to your Antivirus whitelist if necessary.

 

Old Agent Installation Detected (macOS)

 

If you encounter the error "Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one," follow these steps:

    1. Open Finder and go to your user folder. Press Shift + ⌘ + H if needed.

    2. Navigate to the Applications folder within your user folder: ~/Applications.

    3. Remove the ArduinoCreateAgent folder or run the uninstall.app inside it.

    4. Relaunch the Arduino Create Agent.

 

Using the Arduino Create Agent with Live Debugger Console in Pleasedontcode

 

Connecting to Arduino Board

 

Once the agent is running, open Pleasedontcode in your web browser and navigate to the Live Debugger Console. The console should automatically detect the Arduino board connected to your computer.

 

Debugging Your Code

 

With the board connected, you can now upload sketches, set breakpoints, and monitor serial output directly from the Live Debugger Console. This setup provides an efficient and streamlined workflow for debugging and developing Arduino projects.

 

Conclusion

 

The Arduino Create Agent is a crucial tool for developers using the Live Debugger Console in Pleasedontcode. Its seamless integration, cross-platform support, and real-time debugging capabilities make it an invaluable asset for any Arduino project. By following the installation and troubleshooting steps outlined in this article, you can ensure a smooth and productive development experience.

 

 

Chat with us on WhatsApp