Arduino doesn't have a network monitor?

After downloading the ESP32 routine BasicOTA.ino, I can see the network port on Arduino. But when I want to open the network monitor, it will say it doesn't have this feature.
May I ask if the latest version has this feature now? Or do you have any related plugins? If there are none, can I provide some examples or reference documents if I want to write a related plugin myself?

Serial monitor is not supported on network ports such as 192.168.2.100 

Take a look at the TelnetStream library

1 Like

Thank you very much, but I would like to view the network log information directly on Arduino without using telnet.

1 Like

The Arduino Pluggable Monitor Specification:

https://arduino.github.io/arduino-cli/latest/pluggable-monitor-specification/

In case you want to write your pluggable monitor in the Go programming language, here is a Go module that provides the port protocol-independent functionality for pluggable monitor tools in a reusable form:

https://github.com/arduino/pluggable-monitor-protocol-handler

Here is a simple "dummy" example pluggable monitor project:

https://github.com/arduino/pluggable-monitor-protocol-handler/tree/main/dummy-monitor

Here is the repository of Arduino's pluggable monitor for the serial protocol (which is used by the Arduino IDE Serial Monitor when you have a serial port selected);

I am curious how do you want to redirect Serial on the esp32 to network?

You can redirect the log output using esp_log_set_vprintf. Or just encapsulate one like TelnetStream.

Thank you very much for the information you provided.

The plan you provided yesterday is a bit difficult for me.
What I envision is to write a tool similar to EspExceptionDecoder, where you can directly listen to udp packets and print them to this window.
me-no-dev/EspExceptionDecoder: Exception Stack Trace Decoder for ESP8266 and ESP32 (github.com)
Are there any tutorials and examples for writing such plugins?

Which version of Arduino IDE are you using? Because you selected the IDE 2.x forum category for your topic, I assumed you are using Arduino IDE 2.x, but the screenshot you shared is from Arduino IDE 1.x. The support for extending the capabilities of Arduino IDE is different between the 1.x and 2.x version series of Arduino IDE so it is important to know which series is being targeted by your endeavor.

Sorry, my expression is not clear.
Currently, I am using both IDE1. x and IDE2. x. Both are compatible and best. If only one is compatible, then I tend to prefer IDE2. x.

I'll provide some information for each of the version series. My recommendation is for you to target Arduino IDE 2.x since Arduino IDE 1.x is increasingly a tool of the past for the Arduino community and 2.x is increasingly the tool of the present and future.

Arduino IDE 1.x

Arduino IDE 1.x has a "Tool" (often referred to as "plugin") system, which allows additional capabilities to be added to the IDE without modifying the IDE source code. You might be familiar with it already if you have used something like the "ESP Exception Decoder" or "ESP32 filesystem uploader".

Arduino has not provided any documentation of the "Tool" system, but Arduino IDE inherited this "Tool" system from its origin circa 2005 as a fork of the Processing IDE and there is some information about the feature in the Processing IDE (I don't know what sort of divergences there might have been in the Tool system of the two IDEs in the years since the fork):

https://github.com/processing/processing4/wiki/Tool-Overview

You will also find some information in the files under the tools subfolder of the Arduino IDE 1.x installation folder:

https://github.com/arduino/Arduino/blob/master/build/shared/tools/howto.txt

and a simple example Tool named "Mangler":

https://github.com/arduino/Arduino/blob/master/build/shared/tools/Mangler/src/Mangler.java

Arduino IDE 2.x

The way to add additional capabilities to Arduino IDE 2.x is through VS Code extensions:

https://code.visualstudio.com/api

Due to the tremendous popularity of VS Code, you will find a lot of information available on the Internet about creating VS Code extensions.

Although it was possible to do quite a lot with that existing support, previously extensions didn't have any way of getting Arduino-specific data (e.g., the currently selected board, the path to the sketch build folder) from Arduino IDE. That made it either difficult or impossible to create VS Code extensions that would be equivalent to the popular Arduino IDE 1.x "Tools" the community has created.

In addition to the general capabilities of the extensions framework, starting from Arduino IDE 2.2.0, Arduino-specific data is also made available to extensions by Arduino IDE. For your project, you might use this to get the IP address of the network port the user has selected from the Tools > Port menu in Arduino IDE.

That Arduino-specific data availability has already been leveraged to create an Arduino IDE extension equivalent to the popular "ESP Exception Decoder" Tool for Arduino IDE 1.x. You might find the code in that extension to be a useful reference for your own project:

https://github.com/dankeboy36/esp-exception-decoder

Thank you very much, this is a very useful suggestion.

I'm running into a little problem right now. I downloaded the latest 2.2.1 version, but its OTA is not working.
I am using the esp32-s3 development board. Except for the different arduino IDE versions, everything else is the same. But OTA doesn't work in 2.2.1 version. I used a packet capture tool and found that the port that should be 3232 became 8266.
Please tell me how can I fix this problem?

The upper part of the figure is the packet capture situation of Arduino IDE 2.2.1, and the lower half is the packet capture situation of Arduino IDE 1.8.15.

This issue seems to have been resolved. I used the arduino-esp32 environment port of 2.0.12 and it was correct.

1 Like

@ptillisch
I wrote a test plug-in with reference to GitHub - dankeboy36/esp-exception-decoder: ESP8266/ESP32 Exception Decoder Extension for the Arduino IDE. It works very well under vscode, but does not work in Arduino 2.2.1.

The main difference is that the terminal.sendText function does not work on Arduino.

As far as I know, the terminal displays only keyboard input and terminal.sendText . Now terminal.sendText cannot be used. Is there any other way for me to display data to the terminal?

Here is the link to the published test firmware, Arduino-helloworld - Visual Studio Marketplace.

 terminal.sendText
import { stringify } from 'querystring';
import * as vscode from 'vscode';

class  pseudoterminalTest implements vscode.Pseudoterminal{
	readonly onDidWrite: vscode.Event<string>;
	readonly onDidClose: vscode.Event<number | void>;
  
	private readonly onDidWriteEmitter: vscode.EventEmitter<string>;
	private readonly onDidCloseEmitter: vscode.EventEmitter<number | void>;
	private readonly toDispose: vscode.Disposable[];
  
	constructor(){
		this.onDidWriteEmitter = new vscode.EventEmitter<string>();
		this.onDidCloseEmitter = new vscode.EventEmitter<number | void>();
		this.toDispose = [
			this.onDidWriteEmitter,
			this.onDidCloseEmitter,
		  ];
		  this.onDidWrite = this.onDidWriteEmitter.event;
		  this.onDidClose = this.onDidCloseEmitter.event;
	}
	open(): void{
		this.onDidWriteEmitter.fire("open");
	}
	close(): void{
		
	}
	
	handleInput(data: string): void {
		this.onDidWriteEmitter.fire(data);
	}
}

const pty = new pseudoterminalTest();
// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

	console.log(' your extension "helloworld" is now active!');

	let disposable = vscode.commands.registerCommand('helloworld.helloworld', () => {
		const options: vscode.ExtensionTerminalOptions = {
				name: 'hello_terminal',
				pty,
				iconPath: new vscode.ThemeIcon('debug-console'),
			};
		let terminal: vscode.Terminal;
		terminal=vscode.window.createTerminal(options);
		terminal.show();
		terminal.sendText('\x1b[31mHello world\x1b[0m',true);
	});
	context.subscriptions.push(disposable);
}

Hi @naviman. I'm glad to see you have initiated this project.

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the related discussion here:

https://github.com/arduino/arduino-ide/issues/58#issuecomment-1725026196

I see @dankeboy36 has noticed your inquiry there.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.