Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package installation causing Atom to crash. #90

Open
LuvaiCutlerywala opened this issue Apr 15, 2021 · 15 comments
Open

Package installation causing Atom to crash. #90

LuvaiCutlerywala opened this issue Apr 15, 2021 · 15 comments

Comments

@LuvaiCutlerywala
Copy link

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.

@Puzzlepack
Copy link

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

@donaca4555
Copy link

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.

@LuvaiCutlerywala
Copy link
Author

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.

@donaca4555
Copy link

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..)

@lorenzos
Copy link
Contributor

lorenzos commented Jun 7, 2021

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?

@jackik1410
Copy link

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.

@lorenzos
Copy link
Contributor

lorenzos commented Aug 12, 2021

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.

@LuvaiCutlerywala
Copy link
Author

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

@LuvaiCutlerywala
Copy link
Author

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.

@lorenzos
Copy link
Contributor

lorenzos commented Aug 12, 2021

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"
  }
]

@LuvaiCutlerywala
Copy link
Author

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

@steeley
Copy link

steeley commented Jan 23, 2022

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

Never had a problem with other Atom extensions.

@maccacino
Copy link

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

@CarterSnich
Copy link

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.

@lorenzos
Copy link
Contributor

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

I don't know 🤷‍♂️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants