[arduino esp32]: arduino language server no matching member for Serial.println()

Hello everybody,

I want to write some code on Arduino esp32 core with nvim as text editor so I setup Arduino language server through mason, I had tested with a fqbn arduino:avr:uno sketch and no lsp errors show up. Now I changed the fqbn in sketch.yml to esp32:esp32:esp32 and added the platform_index_url field. Then lsp shows that there's no matching member function for call to 'println', but the auto-completion works fine.

I spend a day finding a solution but not come across with anything.

Note that the sketch compiles and uploads to the board successfully.

Setup:

nvim version: 0.11.3
arduino-cli version: 1.2.2
System OS: Arch Linux

sketch.yml:

default_profile: dev
default_fqbn: esp32:esp32:esp32
default_port: /dev/ttyUSB0

profiles:
  dev:
    fqbn: esp32:esp32:esp32
    platforms:
      - platform: esp32:esp32 (3.3.0)
        platform_index_url: 
          https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json 
    port: /dev/ttyUSB0

sketch.ino:

#define BAUD_RATE 9600

uint8_t count = 0;

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


void loop() {
  Serial.println(count);
  count++;
}

arduino-cli.yaml

board_manager:
    additional_urls:
        - https://espressif.github.io/arduino-esp32/package_esp32_index.json
library:
    enable_unsafe_install: true

I could provide the lsp log but has a ton of text and information.

Show the full error text in a code block.

The Arduino forum helpers may find it more convenient to reproduce the fault using Arduino IDE. I'll provide instructions you can follow to do that:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
    A menu will appear on the editor toolbar:
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
    You can scroll down through the list of commands to find it, or type the command name in the field.
    A "Settings" tab will open in the Arduino IDE main panel.
  3. Type arduino.language.realTimeDiagnostics in the "Search Settings" field of the "Settings" tab.
  4. Check the box under the "Arduino › Language: Real Time Diagnostics" setting.
  5. Close the Preferences tab by clicking its X icon.
  6. Open or create a sketch that contains a Serial.println call, such as the sketch @archurrito shared.
  7. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  8. Select the "View: Toggle Problems" command from the menu.
  9. Select Tools > Board > esp32 > ESP32 Dev Module from the Arduino IDE menus.
  10. Wait for Arduino Language Server to finish processing the sketch code, the progress of which is indicated by the "Building sketch" and/or "indexing" messages at the left side of the status bar at the bottom margin of the Arduino IDE window.

You should now see the message in the "Problems" panel at the bottom of the Arduino IDE window:

No matching member function for call to 'println' clang(ovl_no_viable_member_function_in_call) [Ln 11, Col 3]

1 Like

Diagnosis error:

No matching member function for call to 'println' clang (ovl_no_viable_member_function_in_call) [11, 3]

Full LSP log:

You could paste the log here, in a code block.

I can’t because it exceeds the number of characters, It has a lot of text in it.

And I can’t attach lsp log file because I’m new on the forum.

I'll attach the file from post #4 here in order to make it more accessible to the forum helpers, and to prevent the bit rot that often results from a reliance on files hosted externally:

Full LSP log.txt (361.8 KB)

1 Like

A post was split to a new topic: How to download proper platform for esp wroom 32?

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