Git Product home page Git Product logo

vim-arduino's Introduction

Hello

On Github, I am primarily known for authoring and maintaining several Neovim plugins.

These days, between work and family I have very little free time available. I can no longer get to every reported issue, so I have implemented a priority queue:

  1. Pull requests - these are the highest priority for me and will be looked at first.
  2. After PRs, I will triage new issues with P0, P1, and P2 labels.
  3. P0 issues will be worked on as soon as possible.
  4. P1 issues may get worked on when I get spare time and feel like it, which is uncommon these days.
  5. P2 issues will not be worked on. Pull requests are the only way to move these forward.

vim-arduino's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-arduino's Issues

Compilation fails when using multiple source files

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.

Processing can only open its own sketches

  • I just installed the plugin with the newest version using vim Plug.
  • I installed the newest version of the arduino IDE currently available on ubuntu 20 LTS. (arduino IDE version: 2: 1.0.5+dfsg2-4.1)
  • I then configured my board, my port, and my programmer that are corret. (i checked the value with the one I use in the arduino IDE that works fine)
  • I created a folder named after my project, and created a simple file with the same name as the folder, and opened it in vim.

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 ?

Feature request: use sketch.json for per sketch fqbn and port

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:

  • When compiling / uploading, give command line arguments --fqbn and --port (using vim-arduino global settings) only if not given in the sketch.json.
  • Show board / port from 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.

Conflict with processing

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

Does not work in folders with spaces in their names

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!

Commands not found after installing with lazy.

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 loading vim-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

  • OS: Linux, Fedora 38 (KDE Plasma)
  • Vim: NeoVim v0.9.2 with lazy
  • Arduino: 1.8.19 (as flatpak)
  • CLI version: arduino-cli Version: 0.34.2 Commit: 963c1a76 Date: 2023-09-11T10:05:42Z
  • ArduinoInfo: Not appliciable

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin with lazy
  2. Try to use any command

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.

Wrong baud rate, when trying to upload a sketch

Describe the bug
Trying to upload any sketch, happens to use the wrong baud rate and fails to do so.

  • vim-arduino runs with -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"
  • While the arduino IDE runs with -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

  • OS: Arch Linux
  • Vim: Neovim v0.8.1
  • Arduino: 1.8.19
  • CLI version: 0.29.0-arch
  • ArduinoInfo:
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:

  1. Open a sketch like Blink.ino
  2. Upload it with Arduino IDE
  3. Upload it with vim-arduino

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]

The commands are not editor commands

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

:ArduinoChoose* commands do not work in Vim9

Describe the bug
Commands such as :ArduinoChooseBoard, :ArduinoChoosePort and :ArduinoChooseProgrammer, don't seem to work in Vim9, see screenshots below.

System information

  • OS: Mac Os X 13.4
  • Vim: 9.0.1276
  • CLI version: arduino-cli Version: 0.33.0 Commit: ca60d4b4 Date: 2023-05-29T15:18:18Z
  • ArduinoInfo:
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.

Screenshots
image

Additional context
Congrats for the plugin! Starred! :)

Uploading on a Uno board fails

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

  • OS: [linux]
  • Vim: [neovim v0.6.1]
  • Arduino: [Arduino: 1.8.19]
  • CLI version: [0.19.3-arch]
  • ArduinoInfo: [
    Board : arduino:avr:uno
    Programmer : avrisp
    Port : /dev/ttyACM0
    Baud rate : 9600
    Hardware dirs : /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
    Verify command: 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:

  1. open a simple arduino sketch in neovim: $ nvim [sketch].ino
  2. use AruinoChooseBoard: Arduino Uno, ArduinoChoosePort: [your system port], ArduinoChooseProgrammer: AVR ISP.
  3. use ArduinoUpload

Expected behavior

Working command

  1. $ cd /path/to/sketch
  2. $ arduino-cli board attach arduino:avr:uno [sketch].ino
  3. $ arduino-cli board attach serial://[port]
  4. $ arduino-cli compile [sketch].ino
  5. $ 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.

Serial Port/Serial Monitor Not Working

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?

ArduinoSerial outputs "executing job failed: No such file or directory "

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

Silent (or at least more discreet) compiles/uploads

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

  1. 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?

  1. The previous URL I posted refers to https://arduino.github.io/arduino-cli/latest/installation/ a new arduino cli. I have installed it using homebrew and it installs 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:

  • arduino-cli exists and 🤞 stops the splash screen issue. can we get it to work?
  • if we can get it to work, is there a simpler way of doing so than i have done?
  • why might using the cli have broken my vim-arduino plugin? are there any caches i should clear or anything?

Commands not pausing

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?

Reuse an existing tmux window

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.

Not working with vim under Ubuntu 18.04

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.

missing Arduino boards list

Hi,
maybe I do something wrong, but I'm not able to choose different board than default Uno...
I have thought that the list is generated automatically but I see none:
image

If I write any number I always get this error:
image

Should I (somehow) input available boards manually?

:ArduinoVerify executing job failed: Permission denied

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
image

and this is my vimrc
image
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
image

and :make command also got error like:
image

so i tried chmod 777 Arduino but it didn't work
image

If there is something i miss, please help me
and i'm sorry for pool English

thank for your help

ctags: no such file or directory

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

Run SerialMonitor in another tmux pane

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?

How to stop Serial Monitor

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?

Arduino boards missing from list

I'm on x64 Linux (Fedora) with Arduino IDE 1.8.5, vim 8.2 and the latest master of vim-arduino.
For some reason when i list the boards it only shows ESP8266 and ESp32 boards, but no Arduino boards:
image

In the IDE all boards show up:
image

Any ideas what's wrong here?

:ArduinoVerify fails

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!

Doesn't Appear to Be Working in NeoVim on OSX Sierra

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.

avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)

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.

How to specify output libraries?

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

E716: Key not present in Dictionary: "boards"

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

  • OS: linux (Pop!_OS 21.04x64)
  • Vim: nvim v0.6.0
  • Arduino: Arduino: 1.8.16
  • CLI version: arduino-cli Version: 0.20.1 Commit: abb21449 Date: 2021-11-29T11:34:58Z
  • ArduinoInfo:
    Board : arduino:avr:uno
    Programmer : arduino:usbtinyisp
    Port : none
    Baud rate : 9600
    Hardware dirs : /usr/local/share/arduino/hardware/arduino/avr
    Verify command: arduino-cli compile -b arduino:avr:uno -P arduino:usbtinyisp --build-path "/home/matthewrowley/Arduino/CD_Rob
    ot/build" -v "/home/matthewrowley/Arduino/CD_Robot/CD_Robot.ino"

To Reproduce
Steps to reproduce the behavior:

  1. load vim-arduino using vim-plug in .vimrc
  2. open any .ino file
  3. run command :ArduinoChooseBoard

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

Screenshots
Screenshot from 2021-12-09 12-18-37

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!

error while loading shared libraries

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!

Reusing the same console window

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.
Peek 2020-01-17 15-57

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

Not working with Ubuntu 20.04, fails in `chooser.vim`

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?

ArduinoChoosePort Broken

let labels = map(copy(items), {i, v ->
\ i < 9
\ ? ' '.(i+1).') '.v.label
\ : (i+1).') '.v.label
\ })

This code modification broke my ArduinoChoosePort.
I get an error message that "' '.(i+1).') '.v.label " is not found in Dictionary (i had to translate from german, might not be accurate)

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.

ArduinoUploadAndSerial: screen: device or resource busy

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

  • OS: linux
  • Vim: vim
  • Arduino: 1.8.19
  • CLI version: 0.24.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.