arduino-upload icon indicating copy to clipboard operation
arduino-upload copied to clipboard

Package installation causing Atom to crash.

Open LuvaiCutlerywala opened this issue 4 years ago • 15 comments
trafficstars

The installation of the package causes the Atom Editor to simply crash. When it happened the first time, I thought some configuration of mine caused the editor to crash, so I removed the install as well cleared all the configuration files. Then, after I reinstalled Atom from scratch, I downloaded the package again, and again the editor simply crashes every time I try to load the application.

LuvaiCutlerywala avatar Apr 15 '21 15:04 LuvaiCutlerywala

The same happened here. The only solutions was to reinstall Atom...

Puzzlepack avatar Apr 21 '21 17:04 Puzzlepack

The installation of the package causes the Atom Editor to simply crash. When it happened the first time, I thought some configuration of mine caused the editor to crash, so I removed the install as well cleared all the configuration files. Then, after I reinstalled Atom from scratch, I downloaded the package again, and again the editor simply crashes every time I try to load the application.

same here. delete the package folder fix the crashes.

donaca4555 avatar Jun 02 '21 18:06 donaca4555

Funny thing is it kept on crashing even after I did that. So any help as to why it happened or what I could do to remedy it would be appreciated.

LuvaiCutlerywala avatar Jun 03 '21 09:06 LuvaiCutlerywala

In my case I couldn't wait for a fix and went with platformIO plugin, it works great for my arduino project. (upload, monitor and more..)

donaca4555 avatar Jun 07 '21 06:06 donaca4555

I tried the new official beta 2.0 IDE, but it's absolutely underwhelming compared to Atom (but still better than the legacy one, of course).

Did anyone tried to downgrade Atom? Could that work?

lorenzos avatar Jun 07 '21 21:06 lorenzos

Same issue here, none of the tools worked at any point, kept crashing atom once installed. Fix for the crashes was running apm disable arduino-upload. Really wish this worked at the moment, would have saved me a lot of time.

jackik1410 avatar Aug 12 '21 11:08 jackik1410

I ended up using the official Arduino CLI and implementing some toolbar commands launched in a terminal plugin. Not bad: Arduino CLI is a very nice piece of software, my Atom integration is a little clumsy, but I'm happy with it.

If someone is interested, I will spend some minutes to share my setup.

lorenzos avatar Aug 12 '21 13:08 lorenzos

I’d love to know the setup, as mine currently is just the beta IDE, which as described before is underwhelming.

LuvaiCutlerywala avatar Aug 12 '21 18:08 LuvaiCutlerywala

In my case I couldn't wait for a fix and went with platformIO plugin, it works great for my arduino project. (upload, monitor and more..)

PlatformIO is great, but the thing I want something truly lightweight.

LuvaiCutlerywala avatar Aug 12 '21 18:08 LuvaiCutlerywala

So, here's my setup.

First thing, I installed Arduino CLI and followed the getting started guide to make sure it runs fine from the command line.

Then, these are the Atom packages to install for toolbar and terminal:

flex-tool-bar
language-arduino
terminal-commands
tool-bar
x-terminal

This is the configuration for the terminal package:

  "x-terminal":
    spawnPtySettings:
      projectCwd: true
    terminalSettings:
      colors:
        selection: "#ffffff"
      defaultOpenPosition: "Split Down"
      leaveOpenAfterExit: false
      runInActive: true
      title: "Terminal"
    xtermAddons: {}

This is the terminal-commands.json file:

{
  "arduino-cli:compile": [
      "direnv allow \"${project}\"", 
      "arduino-cli compile -b \"$ARDUINO_FQBN\" \"${dir}\""
  ],
  "arduino-cli:upload": [
      "direnv allow \"${project}\"", 
      "arduino-cli compile -b \"$ARDUINO_FQBN\" -u -p \"$ARDUINO_PORT\" \"${dir}\" && echo \"Done uploading.\""
  ],
  "arduino-cli:board-list": [
      "test -f \"${project}/.envrc\" && atom \"${project}/.envrc\"", 
      "arduino-cli board list"
  ],
  "arduino-cli:serial-monitor": [
      "screen $ARDUINO_PORT"
  ]
}

I use direnv to store and change $ARDUINO_FQBN and $ARDUINO_PORT at will. It's optional, since those variable can be replaced by actual fixed values in terminal-commands.json (if so, remove all direnv allow commands from it). If used, here's an example .envrc file:

export ARDUINO_FQBN=arduino:avr:nano
export ARDUINO_PORT=/dev/ttyUSB0

Finally, here's the toolbar.cson:

[
  {
    type: "button"
    icon: "check"
    callback: ["window:save-all", "arduino-cli:compile"]
    tooltip: "Arduino: Save all and Compile"
  }
  {
    type: "button"
    icon: "arrow-right"
    callback: ["window:save-all", "arduino-cli:upload"]
    tooltip: "Arduino: Save all and Upload"
  }
  {
    type: "button"
    icon: "terminal"
    callback: "arduino-cli:serial-monitor"
    tooltip: "Arduino: Serial monitor"
  }
  {
    type: "button"
    icon: "plug"
    callback: "arduino-cli:board-list"
    tooltip: "Arduino: List connected boards"
  }
  {
    type: "spacer"
  }
  {
    type: "url"
    icon: "circuit-board"
    url: "https://www.arduino.cc/reference/en/"
    tooltip: "Open: Arduino reference"
  }
  {
    type: "spacer"
  }
  {
    type: "button"
    icon: "tools"
    callback: "settings-view:view-installed-packages"
    tooltip: "Atom packages settings"
  }
  {
    type: "button"
    icon: "gear"
    callback: "flex-tool-bar:edit-config-file"
    tooltip: "Edit Toolbar"
  }
]

lorenzos avatar Aug 12 '21 22:08 lorenzos

Sounds good. Thanks for giving the setup, I’ll try it when I get the chance to do so.

LuvaiCutlerywala avatar Aug 13 '21 04:08 LuvaiCutlerywala

Got the same result - totally trashed my entire Atom set up!!!!!!!!!! Thanks for that....

Never had a problem with other Atom extensions.

steeley avatar Jan 23 '22 10:01 steeley

still crashing... For Ubuntu (and most Linux systems) run this command in a terminal;

apm uninstall arduino-upload

That is using Atom's package manager to remove the broken package, without having to re-install Atom. Atoms Flight Manual

maccacino avatar Feb 04 '22 11:02 maccacino

So, here's my setup.

First thing, I installed Arduino CLI and followed the getting started guide to make sure it runs fine from the command line.

Then, these are the Atom packages to install for toolbar and terminal:

flex-tool-bar
language-arduino
terminal-commands
tool-bar
x-terminal

This is the configuration for the terminal package:

  "x-terminal":
    spawnPtySettings:
      projectCwd: true
    terminalSettings:
      colors:
        selection: "#ffffff"
      defaultOpenPosition: "Split Down"
      leaveOpenAfterExit: false
      runInActive: true
      title: "Terminal"
    xtermAddons: {}

This is the terminal-commands.json file:

{
  "arduino-cli:compile": [
      "direnv allow \"${project}\"", 
      "arduino-cli compile -b \"$ARDUINO_FQBN\" \"${dir}\""
  ],
  "arduino-cli:upload": [
      "direnv allow \"${project}\"", 
      "arduino-cli compile -b \"$ARDUINO_FQBN\" -u -p \"$ARDUINO_PORT\" \"${dir}\" && echo \"Done uploading.\""
  ],
  "arduino-cli:board-list": [
      "test -f \"${project}/.envrc\" && atom \"${project}/.envrc\"", 
      "arduino-cli board list"
  ],
  "arduino-cli:serial-monitor": [
      "screen $ARDUINO_PORT"
  ]
}

I use direnv to store and change $ARDUINO_FQBN and $ARDUINO_PORT at will. It's optional, since those variable can be replaced by actual fixed values in terminal-commands.json (if so, remove all direnv allow commands from it). If used, here's an example .envrc file:

export ARDUINO_FQBN=arduino:avr:nano
export ARDUINO_PORT=/dev/ttyUSB0

Finally, here's the toolbar.cson:

[
  {
    type: "button"
    icon: "check"
    callback: ["window:save-all", "arduino-cli:compile"]
    tooltip: "Arduino: Save all and Compile"
  }
  {
    type: "button"
    icon: "arrow-right"
    callback: ["window:save-all", "arduino-cli:upload"]
    tooltip: "Arduino: Save all and Upload"
  }
  {
    type: "button"
    icon: "terminal"
    callback: "arduino-cli:serial-monitor"
    tooltip: "Arduino: Serial monitor"
  }
  {
    type: "button"
    icon: "plug"
    callback: "arduino-cli:board-list"
    tooltip: "Arduino: List connected boards"
  }
  {
    type: "spacer"
  }
  {
    type: "url"
    icon: "circuit-board"
    url: "https://www.arduino.cc/reference/en/"
    tooltip: "Open: Arduino reference"
  }
  {
    type: "spacer"
  }
  {
    type: "button"
    icon: "tools"
    callback: "settings-view:view-installed-packages"
    tooltip: "Atom packages settings"
  }
  {
    type: "button"
    icon: "gear"
    callback: "flex-tool-bar:edit-config-file"
    tooltip: "Edit Toolbar"
  }
]

Is it worth creating a package that uses android-cli? I'm planning of creating one.

CarterSnich avatar Mar 27 '22 13:03 CarterSnich

Is it worth creating a package that uses android-cli? I'm planning of creating one.

I don't know :man_shrugging: I still think it's better fixing this issue. My setup works, but IMHO it has too many dependencies to make a package out of it (not only arduino-cli, but also multiple toolbar and terminal packages); it also has some annoyances I found later, such as: it won't work if you launch the commands while the terminal tab has focus, instead of the editor tab with your sketch...

But, if you're thinking of creating a package that relies on arduino-cli only, that implements all the rest itself, yeah, that would be definitely great. arduino-cli works great, it's well engineered, and I think it's in fact the officially suggested approach: as they say, it "contains all you need to easily build applications around the Arduino ecosystem".

lorenzos avatar Mar 28 '22 09:03 lorenzos