stevearc / vim-arduino Goto Github PK
View Code? Open in Web Editor NEWVim plugin for compiling and uploading arduino sketches
License: MIT License
Vim plugin for compiling and uploading arduino sketches
License: MIT License
Using all of the above, I can't verify nor upload a sketch using the vim-arduino plugin.
I have a gtk error dialog telling me:
processing can only open its own sketches and other files ending in .ino or .pde
Then it opens the arduino IDE with my sketch in it.
From the arduino IDE if I perform an upload it works straight.
Do you have any idea why the plugin can't upload the sketch ?
Nowadays, arduino only uses .ino
extension, and .pde
extension is reserved for processing.
I have the plugin sophacles/vim-processing
installed, which provides syntax highlighting and makes and runs processing sketches.
The filetype detection works perfectly, and .pde
files are detected to be processing files.
When vim-arduino isn't installed, running :make
builds and runs processing sketches (like it should). However when vim-arduino is installed, it also detects the file to be a processing file, but when running :make
, it runs :ArduinoVerify
, which obviously fails.
Could you make an option to disable ArduinoVerify on .pde
files?
Thank you
Describe the bug
Using ArduinoUpload to upload code to a Uno board whit AVR ISP programmer being chosen registers the following command:
"/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyACM0 -Uflash:w:/home/s4/Arduino/sketches/AS5048A_tester/build/AS5048A_tester.ino.hex:i"
which fails and this is the output:
"avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/s4/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : stk500v1
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Error during Upload: Failed programming: uploading error: exit status 1
doing the exact same thing with arduino-cli or the Arduino IDE registers this command:
"/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino_build_521661/AS5048A_tester.ino.hex:i "
which succeeds and this is the output:
"avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/s4/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino_build_521661/AS5048A_tester.ino.hex"
avrdude: writing flash (4120 bytes):
Writing | ################################################## | 100% 0.73s
avrdude: 4120 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_521661/AS5048A_tester.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_521661/AS5048A_tester.ino.hex:
avrdude: input file /tmp/arduino_build_521661/AS5048A_tester.ino.hex contains 4120 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.57s
avrdude: verifying ...
avrdude: 4120 bytes of flash verified
avrdude done. Thank you."
the commands that each produces and the results are different, I have tested other programmer options of the plugin but none of them worked for me. I have also tested using the plugin with g:arduino_use_cli being set and without it
.
System information
arduino:avr:uno
avrisp
/dev/ttyACM0
9600
/home/s4/.arduino15/packages/arduino/hardware/avr/1.8.4, /home/s4/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31, /home/s4/.arduino15/packages/STMicroelectronics/hardware/stm32/2.1.0
arduino-cli compile -b arduino:avr:uno -p /dev/ttyACM0 -P avrisp --build-path "/home/s4/Arduino/sketches/AS5048A_tester/build" -v "/home/s4/Arduino/sketches/AS5048A_tester/AS5048A_tester.ino
"To Reproduce
Steps to reproduce the behavior:
nvim [sketch].ino
AruinoChooseBoard
: Arduino Uno, ArduinoChoosePort
: [your system port], ArduinoChooseProgrammer
: AVR ISP.ArduinoUpload
Expected behavior
Working command
cd /path/to/sketch
arduino-cli board attach arduino:avr:uno [sketch].ino
arduino-cli board attach serial://[port]
arduino-cli compile [sketch].ino
arduino-cli upload -v
alternatively Arduino IDE application also works and produces the same result.
output:
"/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-P/dev/ttyACM0" -b115200 -D "-Uflash:w:/tmp/arduino-sketch-5C77E717031944FF3B6B05CEF0DD445F/AS5048A_tester.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/s4/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/s4/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino-sketch-5C77E717031944FF3B6B05CEF0DD445F/AS5048A_tester.ino.hex"
avrdude: writing flash (4120 bytes):
Writing | ################################################## | 100% 0.69s
avrdude: 4120 bytes of flash written
avrdude done. Thank you.
Describe the bug
When I run :ArduioChooseBoard, it throws the error in the title. I have arduino installed, and I have pointed to the directory in my ftplugin/arduino.vim with
let g:arduino_dir = "/usr/local/share/arduino"
I have checked that directory, and boards.txt is present in /usr/local/share/arduino/avr/
System information
To Reproduce
Steps to reproduce the behavior:
Expected behavior
With no argument, this command should give me a list of all installed boards and let me choose one
Working command
This bug is not regarding verify/upload issues
Additional context
I installed arduino with the install.sh script rather than using the Pop!_OS package manager because I wanted the latest stable version. I installed the binary to /usr/local/bin. This didn't seem to put the boards.txt file anywhere at all, such as in ~/.arduino15/, so I looked at the output of "verify" within the Arduino IDE and noted that it was referencing the original downloaded folder where install.sh was located. So, I removed arduino from /usr/local/bin, manually moved the downloaded folder from "Downloads" into a more permanent home at /usr/local/share, and then installed again to /usr/local/bin from there. Now the IDE output shows many references to that folder, and I felt confident to proceed to include let g:arduino_dir = "/usr/local/share/arduino" in my ftplugin/arduino.vim
I included some other sane defaults based on information from the vim-arduino help. Below is the entirety of my ftplugin/arduino.vim file right now:
let g:arduino_cmd = "/usr/local/bin/arduino"
let g:arduino_home_dir = "~/.arduino15"
let g:arduino_dir = "/usr/local/share/arduino"
let g:arduino_build_path = "{project_dir}/build"
let g:arduino_run_headless = 1
"let g:arduino_board = 'arduino:avr:pro'
"let g:arduino_programmer = 'arduino:avrispmkii'
let g:arduino_board = 'arduino:avr:uno'
let g:arduino_programmer = 'arduino:usbtinyisp'
let g:arduino_serial_cmd = 'screen {port} {baud}'
let g:arduino_auto_baud = 1 " Searches script for Serial.begin() for baudrate
" let g:arduino_serial_port = '/dev/ttyUSB0'
nnoremap am :ArduinoVerify
nnoremap au :ArduinoUpload
nnoremap ad :ArduinoUploadAndSerial
nnoremap ab :ArduinoChooseBoard
nnoremap ap :ArduinoChooseProgrammer
Thank-you for your help!
Hello, I'm beginner of vim using SpaceVim with WSL
I want to use SpaceVim for arduino so i installed this plugins
But :ArduinoVerify gave me error
and this is my vimrc
when i sudo screen /dev/ttyS15 115200, in my vimrc, i got a whole black window and there is no respond except terminating command
------------------------------------------------------------------Edit------------------------------------------------------------------
i solved No such file or directory error but...
i installed Arduino in wsl by copying my arduino in window and try :ArduinoVerify
and :make command also got error like:
so i tried chmod 777 Arduino but it didn't work
If there is something i miss, please help me
and i'm sorry for pool English
thank for your help
On Opensuse Tumbleweed
output of :ArduinoVerify
Picked up JAVA_TOOL_OPTIONS:
1 Loading configuration...
2 Initializing packages...
3 Preparing boards...
4 Verifying...
5 fork/exec {runtime.tools.ctags.path}/ctags: no such file or directory
6
7 [Process exited 1]
ctags --version
Exuberant Ctags Development, Copyright (C) 1996-2009 Darren Hiebert
Addresses: [email protected], http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
Describe the bug
Commands such as :ArduinoChooseBoard, :ArduinoChoosePort
and :ArduinoChooseProgrammer
, don't seem to work in Vim9, see screenshots below.
System information
Board : arduino:avr:uno
Programmer :
Port : /dev/tty.usbmodem101
Baud rate : 9600
Hardware dirs : /Users/ubaldot/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Verify command: arduino-cli compile -b arduino:avr:uno -p /dev/tty.usbmodem101 --build-path "/Users/ubaldot/Documents/arduino/build" -v "/Users/ubaldot/Documents/arduino/pippo.ino"
To Reproduce
Install MacVim 9.0.1276, open a .ino file and run any vim-arduino command.
Expected behavior
I can operate with my arduino uno board.
Additional context
Congrats for the plugin! Starred! :)
After installing the plugin with plug
, all the arduino commands cannot be invoked either in Vim or NeoVim. The default arduino_cmd
is installed at /usr/local/bin/arduino
.
Arduino IDE itself, everything works perfectly as expected.
In vim-arduino, it is able to upload to the board perfectly. Awesome stuff.
But, it is unable to execute the "ArduinoChoosePort" command and therefore the "ArduinoUploadAndSerial" doesn't work either, reporting:
Error detected while processing function arduino#ChoosePort:
line 7:
No likely serial ports detected!
It's strange that it is able to upload on the correct port but then can't display or allow choosing of the ports.
Any thoughts?
I'm using vim-arduino with vim-slime in tmux. Currently the SerialMonitor opens in the same tmux pane as the logging output for uploading. I think one has to close the SerialMonitor to run ArduinoUploadAndSerial again.
Would it be possible to have a third tmux pane open, where the SerialMonitor is running constantly, while one can still Upload to the Arduino and check the logs?
vim-arduino/autoload/arduino.vim
Lines 692 to 696 in 38bdd83
Reverting the code to
let labels = s:ConvertItemsToLabels(items) call map(labels, {i, l -> \ i < 9 \ ? ' '.(i+1).') '.l \ : (i+1).') '.l
Made it work again.
Can you provide details on how to use this plugin for Windows 10 ConEmu?
I just get the message
executing job failed: File or directory not found
Please update the airline status at README.md
as
autocmd BufNewFile,BufRead *.ino let g:airline_section_x='%{MyStatusLine()}'
else it keeps showing in other filetypes too.
When running :ArduinoUploadAndSerial
screen
's terminal window will open concurrently with the compile&upload terminal window but arduino cannot upload a sketch when the device is open and so prints this:
File ".../.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/pyserial/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: '/dev/ttyUSB0'
Error during Upload: Failed uploading: uploading error: exit status 1
System information
Hello,
Thanks for this project!
Trying to run ArduinoSerial a second time will result in an error port busy
because the screen command is still running.
The problem is the screen
command, which doesn't exit after closing the serial panel. (see https://stackoverflow.com/questions/6301840/how-to-stop-a-screen-process-in-linux)
I'm working-around this with pkill screen
but I don't think that's an acceptable solution.
OS: Arch
VIm: 8.1.470
Arduino: 1.87
Set the path in my .vimrc
Build and upload works, but when it comes to connecting via serial, it gives the error " executing job failed: No such file or directory "
I have chosen the port and board with the vim-arduino commands
Serial connection works in Arduino and arduino-mk
Hey, @stevearc.
Thank you so much for your plugin - super useful!
Just wondering if it's possible to reuse the same console window when you 'Upload' a sketch without creating new windows? Please see my attached gif for better understanding.
When using tmux
it creates new panes. Thou, if i m not in tmux
it simply creates new console windows within vim every time i upload.
I dont know if it's worth mentioning, but i m on neovim
Thank you
Based on the sketch specification, one may add a file named sketch.json
to a sketch folder, so set the board metadata (like fqbn and port) on a per sketch basis. This file can be created using the arduino-cli board attach
command.
Would it be possible to use the settings from this file, if it is present, and the global g:arduino_*
variables / ArduinoChoose*
commands only in case that no such file exists? In particular:
--fqbn
and --port
(using vim-arduino global settings) only if not given in the sketch.json
.sketch.json
in the tag bar if present.As another feature, would it be possible to call board attach
to save such metadata, after selecting it with ArduinoChoose*
, per sketch instead of globally (maybe as a new vim-arduino command or .vimrc
option)?
I think this would be a helpful improvement if one is working on several sketches which are compiled for different board types / uploaded on different ports, so that there is no need to change these settings when switching to another sketch. Also it would use a settings format which is compatible with using plain arduino-cli on the command line.
If I do any of the commands from this plugin it gives:
E492: Not an editor command
I am using neovim on arch linux
arduino ide is installed via pacman
I can do :help arduino
let g:arduino_serial_cmd = 'tmux {port} {baud}'
tmux /dev/ttyACM0 9600
unknown command: /dev/ttyACM0
After verifying, by calling :ArduinoUpload I get the error:
Using Port : usb
Using Programmer : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Error during Upload: Failed programming: uploading error: exit status 1)
so the port is supposed to be something like
Using Port : /dev/ttyACM0
also in the ArduinoInfo, I get the following
Board : arduino:avr:uno
Programmer : avrispmkii
Port : /dev/ttyACM0
Baud rate : 9600
I tried to find the bug inside autoload/arduino.vim but I have no idea where you declare the "arduino-cli upload", since the :echo arduino#GetCLICompileCommand('-u')
would not change the arduino-cli command.
Can you tell me how to correct this bug?? ..because your plugin seems to be very handy! nice work!
ps: compiling and uploading the sketch with arduino-cli works properly.
Hi !
@salkin-mada and I found a small error. If the arduino sketch folder has a space in it's name, like blinky sketch
, vim-arduino does not recognise it (but ARDUINO IDE does is able to verify the same sketch) and spits out the error:
Picked up JAVA_TOOL_OPTIONS:
Error: Must specify exactly one sketch file
[Process exited 3]
Removing the space from the name makes it work again :)
best regards
PS. The computer used for testing is an Arch Linux installation ,NVIM version 0.4.4, arduino 1.8.13, teensy 1.5.3.
Thanks!
Hi,
Use a core for arduino IDE which is a collection of lib.
The core is in ~/.arduino15/....
how to give this path to your module because for the moment ther are some compilations errors when type :ArduinoVerify
Ty
Hi,
Thank you so much for this amazing project. I'm wondering if it's possible reuse an existing tmux
window instead of create a new one on every upload.
Describe the bug
The commands of the plugin cannot be found when installing it with the lazy package manager, regardless of how I load
the plugin.
{
"stevearc/vim-arduino",
cmd = {
"ArduinoAttach",
"ArduinoChooseBoard",
"ArduinoChooseProgrammer",
"ArduinoChoosePort",
"ArduinoVerify",
"ArduinoUpload",
"ArduinoSerial",
"ArduinoUploadAndSerial",
"ArduinoInfo",
},
},
This config should load the plugin when I call one of the commands listed above. It tries to do so, but the commands are not found.
Command
ArduinoInfo
not found after loadingvim-arduino
When I try to load the plugin as non lazy like below, the commands just do not exist.
{
"stevearc/vim-arduino",
lazy = false,
},
E492: Not an editor command: ArduinoInfo
System information
v0.9.2
with lazyarduino-cli Version: 0.34.2 Commit: 963c1a76 Date: 2023-09-11T10:05:42Z
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The commands are found in both lazy and non lazy mode
Additional context
I have installed the arduino application as a flatpak, but arduino-cli
is installed natively through their provided install script. If I understand correctly, this should not be a problem, as the plugin uses arduino-cli
if possible and regular arduino
only as fallback. arduino-cli
is available from my regular shell, arduino
is not (only as flatpak).
In case my complete configuration becomes relevant, it can be found at my personal git server here.
I was wondering if there is a way to suppress the Arduino IDE splash screen running every time I build or upload. I saw you mentioned it here #6 (comment)
I found this arduino/Arduino#1970 which appears it's not necessarily a result of vim-arduino but the ide tooling itself.
I noticed a couple of things
When running the commands from this plugin, it starts the JVM etc with this option
JVMOptions=..."-splash:$APP_ROOT/Contents/Java/lib/splash.png"...)
I wonder if that can be changed?
arduino-cli
to my path.I dug through the vim-arduino code and spotted g:arduino_executable
which I figured I could just change to arduino-cli
but this doesn't work. Commands subsequently result in
executing job failed: No such file or directory
and on vim start up i get
Error detected while processing BufRead Autocommands for ".ino"..FileType Autocommands for ""..function 15_LoadFTPlugin[17]..scri
pt /Users/ben/.dotfiles/.vim/plugged/vim-arduino/ftplugin/arduino.vim[7]..function arduino#InitializeConfig[49]..arduino#ReloadBoards:
line 33:
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)
If I run ArduinoInfo however, I get
... Verify command: arduno-cli --verify --board ...
Which obviously is using the correct binary.
Having dug into the error above with why I might need to be setting the arduino_dir
too, the cli doesn't have boards.txt etc as far as i can tell so I needed to still point the path back to
let g:arduino_dir = '/Applications/Arduino.app/Contents/Java/'
(Working out I needed Java/ on the end took more digging.)
I appear to have cleared up the above errors now... but none of the vim-arduino commands exist... Obviously this is more likely my vim but I've reinstalled vim-arduino and removed everything relating to it from my .vimrc and simply can't get any of the commands registering.
Edit:
Having gone back to vim after a short period the commands are available. Obviously something odd going on. Anyway, now that the commands are back, if i try and run :ArduinoVerify for example, I get
executing job failed: No such file or directory
TLDR:
Hi, I'm using the default vim package on ubuntu 20.04 (vim version 8.1.2269) and added vim-arduino
using vim-plug
. I have the arduino-cli
in my path and am able to list the boards I have, etc. But when I do :ArduinoChooseBoard
, I run into a bunch of errors:
Error detected while processing /home/----/.vim/plugged/vim-arduino/autoload/arduino/chooser.vim:
line 107:
E117: Unknown function: luaeval
Error detected while processing function arduino#ChooseBoard[6]..arduino#chooser#Choose:
line 11:
E121: Undefined variable: g:arduino_telescope_enabled
Are there any dependencies I'm missing or do I need to do something else to get this working?
When I try to upload *.ino file:
/home/azamat/arduino-1.6.9/hardware/tools/avr/bin/avrdude: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
How can I solve this.
Please, help!
I am trying to get this running, but am not having much success. If I type :help arduino
within neovim, I do get the help docs, but no :Arduino*
commands seem to be working.
In the Arduino CLI docs, it states:
Note that on MacOS X, the main executable is Arduino.app/Contents/MacOS/Arduino instead of arduino.
Perhaps this is the problem? I tried aliasing the above path to arduino
to no avail, and setting
let g:arduino_cmd = '/Applications/Arduino.app/Contents/MacOS/Arduino'
let g:arduino_dir = '/Applications/Arduino.app/Contents/MacOS/'
in my init.vim
yielded no results as well.
It would be nice to have a command that could be used in a mapping to update the default debug serial baudrate.
User story: When writing more complicated arduino sketches, I want to split the code up into multiple files.
Issue: Currently if I try to use include
to inclue another source file, the compilation fails.
How to recreate
Create two files in the same directory:
// test.c.ino
#include "test.h"
void setup() {}
void loop() {}
// test.h
// this file is empty
Try to compile & upload the sketch and this error will appear:
test.c:1:10: fatal error: test.h: No such file or directory
19 #include "test.h"
20 โ โ ^~~~~~~~
21 compilation terminated.
22 exit status 1
This code, however, compiles and uploads successfully when using the arduino-ide.
Hi! Just installed the plugin. My IDE is 1.8.13, Vim is at 8.1.1401, and my OS is Debian Buster. I coudn't get :ArduinoVerify
to run --- it gives this error:
Picked up JAVA_TOOL_OPTIONS:
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
java.io.IOException: No valid code files found
at processing.app.Sketch.listSketchFiles(Sketch.java:117)
at processing.app.Sketch.<init>(Sketch.java:54)
at processing.app.Base.<init>(Base.java:423)
at processing.app.Base.main(Base.java:150)
The command it's attempting to run is:
arduino --verify --board arduino:avr:mega:cpu=atmega2560 --port /dev/ttyACM0 --pref programmer=arduino:avrisp --pref build.path='/home/jeff/Arduino/RGB_LED/build' --verbose-upload '/home/jeff/Arduino/RGB_LED/RGB_LED.ino'
Looking at the :ArduinoVerify command, it seems that we can run with TERM
being either :!
or :terminal!
. I should be using :terminal!
. Running the command using :! $VERIFY_COMMAND
works perfectly fine (and so does running it in a separate terminal). However, if I run :terminal! $VERIFY_COMMAND
, it gives the same error.
Could something be wrong with how :terminal!
is being used? Thanks!
Describe the bug
Trying to upload any sketch, happens to use the wrong baud rate and fails to do so.
-b19200
:"/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino -P/dev/ttyUSB0 -b19200 "-Uflash:w:/home/xou/Desktop/xou/programming/hardware/arduino/uno/test0/build/test0.ino.hex:i"
-b115200
:/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:/tmp/arduino_build_782589/test0.ino.hex:i
System information
Board : arduino:avr:uno
Programmer : arduinoasispatmega32u4
Port : /dev/ttyUSB0
Baud rate : 115200
Hardware dirs : /home/xou/.arduino15/packages/arduino/hardware/avr/1.8.6, /home/xou/.arduino15/packages/digistump/hardware/avr/1.6.7, /home/xou/.arduino15/packages/ATTinyCore/hardware/avr/1.5.2
Verify command: arduino-cli compile -b arduino:avr:uno -p /dev/ttyUSB0 -P arduinoasispatmega32u4 --build-path "/home/xou/Desktop/xou/programming/hardware/arduino/uno/test0/build" -v "/home/xou/Desktop/xou/programming/hardware/arduino/uno/test0/test0.ino"
(Brand new installation of Arduino and vim-arduino)
To Reproduce
Steps to reproduce the behavior:
Blink.ino
Expected behavior
It should had used the correct baud rate and get uploaded (?)
Working command
Running the command just with the correct baud rate just works and gets uploaded.
Additional context
Here's the output of vim-arduino when uploading:
...
/home/xou/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /home/xou/Desktop/xou/programming/hardware/arduino/uno/test0/build/test0.ino.elf
Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino -P/dev/ttyUSB0 -b19200 "-Uflash:w:/home/xou/Desktop/xou/programming/hardware/arduino/uno/test0/build/test0.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/xou/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/xou/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
Error during Upload: Failed programming: uploading error: exit status 1
[Process exited 1]
While the plugin works really great, i don't know how to stop/close the serial monitor after opening it and reading the serial stream.
Any pointers?
I am currently using neovim v0.2.0 and when I type a command like :ArduinoVerify there is an output but it closes as it finished. However if I use make, it prompts at the end HIT ENTER TO CONTINUE. That's OK for ArduinoVerify, but I cannot use make for the rest of the commands.
Is there any way of pausing them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.