Giter Site home page Giter Site logo

Comments (15)

lorenzos avatar lorenzos commented on June 14, 2024 2

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.

from arduino-upload.

lorenzos avatar lorenzos commented on June 14, 2024 2

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

from arduino-upload.

Puzzlepack avatar Puzzlepack commented on June 14, 2024

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

from arduino-upload.

donaca4555 avatar donaca4555 commented on June 14, 2024

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.

from arduino-upload.

LuvaiCutlerywala avatar LuvaiCutlerywala commented on June 14, 2024

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.

from arduino-upload.

donaca4555 avatar donaca4555 commented on June 14, 2024

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

from arduino-upload.

lorenzos avatar lorenzos commented on June 14, 2024

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?

from arduino-upload.

jackik1410 avatar jackik1410 commented on June 14, 2024

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.

from arduino-upload.

LuvaiCutlerywala avatar LuvaiCutlerywala commented on June 14, 2024

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

from arduino-upload.

LuvaiCutlerywala avatar LuvaiCutlerywala commented on June 14, 2024

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.

from arduino-upload.

LuvaiCutlerywala avatar LuvaiCutlerywala commented on June 14, 2024

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

from arduino-upload.

steeley avatar steeley commented on June 14, 2024

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

Never had a problem with other Atom extensions.

from arduino-upload.

maccacino avatar maccacino commented on June 14, 2024

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

from arduino-upload.

CarterSnich avatar CarterSnich commented on June 14, 2024

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.

from arduino-upload.

lorenzos avatar lorenzos commented on June 14, 2024

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

from arduino-upload.

Related Issues (20)

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.