Not working with arduino-cli on MacOS
Curs3W4ll opened this issue · 1 comments
Describe the bug
I tried using this plugin, using arduino-cli.
System information
- OS:
mac(Sonoma, 14.5 (23F79)) - Vim:
NVIM v0.11.0-dev-164+g3a1515bfe - Arduino: Not installed (not specified explicitely in the doc, should I?)
- CLI version:
arduino-cli Version: 0.35.3 Commit: 95cfd654 Date: 2024-02-19T13:15:51Z - ArduinoInfo:
Error detected while processing function arduino#GetInfo[1]..arduino#InitializeConfig[62]..ar
duino#ReloadBoards:
line 37:
Could not find any boards.txt or programmers.txt files. Please set g:arduino_dir and/or g:ard
uino_home_dir (see help for details)
Board : arduino:avr:uno
Programmer :
Port : /dev/tty.usbmodem1101
Baud rate : 9600
Hardware dirs : None
Verify command: arduino-cli compile -b arduino:avr:uno -p /dev/tty.usbmodem1101 --build-path
"/private/tmp/test/build" -v "/private/tmp/test/test.ino"
To Reproduce
Steps to reproduce the behavior:
- Install only arduino-cli only
- Install the plugin
- Open a
.inofile - See this error message
Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: .../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35:
Error executing lua: .../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /Users/corentin/.local/share/nvim/lazy/vim-arduino/ftplugin/arduino.vim[5]..function arduino#InitializeConfig[62]..arduino#ReloadBoards, line 37: Vim(echoerr):Could not find any boards.txt or programmers.txt files. Please set g:arduino_dir and/or g:arduino_home_dir (see help for details)
stack traceback:
[C]: in function 'nvim_cmd'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:36: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35>
[C]: in function 'nvim_buf_call'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_buf_call'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:10>
Expected behavior
The plugin should work without any error?
Working command
This is not an issue with arduino-cli, so I don't think this is relevant?
You shouldn't need an Arduino IDE installation for this to work, but the last time I tested it (several years at this point), arduino-cli had some bugs with listing board details
vim-arduino/autoload/arduino.vim
Lines 110 to 112 in 2ded67c
I am very far away from a computer that has arduino-cli set up and won't be able to test this myself. If you're interested you could try checking if the commands work now, and refactor the logic to rely on that instead. You could even try just making it gracefully fall back to using the arduino-cli; it's not like that would be worse than failing entirely.