Tutorial: Particle-cli on Mac OSX [26 Sep 2015]


#185

You can grab the binary here: http://dfu-util.sourceforge.net/releases/


#186

@kennethlimcp Thanks for responding. I didn’t mention that I’m using macOS, but I guess you inferred that from my mentioning homebrew.

I had already installed the Particle CLI using the advanced method. The install and login were successful. I then downloaded the dfu-util from the mirror link in that section of the guide. I extracted the contents using gzip and tar and then moved the contents of the linux-i386 folder (the three binaries) to a folder in my path (my npm global bin folder).

When I tried to use $ particle flash --usb tinker command, I got the following error: Error writing firmware…dfu-util is not installed. Did I miss something? Are there macOS-specific binaries somewhere? Is particle-cli hard-coded to look for the binaries in a specific folder?


#187

Yes basically cli is looking at a globally accessible path to search for dfu-util.,

You can either have it in a common path known by terminal or modify your PATH variable accordingly. :slight_smile:


#188

@kennethlimcp That’s what I did and then I got that error message.

@KyleG Any idea?


#189

what do you get when you run dfu-util on the terminal?


#190

@kennethlimcp Sorry about the delay. I get the following error:

cannot execute binary file

Some research informed me that the likely cause is that the binary is not the right architecture for my processor (64-bit). Is there a precompiled dfu-util binary for macOS that works on 64-bit Macs?

npm is installed on my computer, but I am not willing to install Homebrew or MacPorts (or other package management softwares) because of their required permissions.


#191

Probably can compile using the files here: https://downloads.sourceforge.net/project/dfu-util/dfu-util-0.9.tar.gz


#192

@kennethlimcp I’ve never complied anything but I’ll take a stab at it. Researching gcc, clang, make etc. now.


#193

This might also work:

git clone git://git.code.sf.net/p/dfu-util/dfu-util
cd dfu-util
./autogen.sh
./configure
make
sudo make install

#194

I’m going to stop pursuing this at this point since there’s no prebuilt dfu-util binary for x64 Mac machines. It would be nice for Particle to build all of the necessary cli binaries for popular platforms.

@nrobinson2000 Thanks for the input. autoreconf is not included with macOS, so the autogen script fails.


#195

Whoops, my bad. Those were Linux instructions.

EDIT: They work on my mac too.

I just tried this on my mac and produced a binary successfully:

curl -LO https://downloads.sourceforge.net/project/dfu-util/dfu-util-0.9.tar.gz
open dfu-util-0.9.tar.gz
cd dfu-util-0.9/
./autogen.sh
./configure
make

The binary is produced in src

You may be missing Command line developer tools, which includes things like git, make, gcc, etc:

Try doing:

xcode-select --install

Here is the dfu-util binary I just built if you want it. Just click on the download button. (You will need to make it executable with chmod +x dfu-util)


#196

@nrobinson2000 Thanks, again—especially for building the binary. In response to the rest of your post:

Xcode command line tools don’t seem to include autoconf. I already had them installed, but the binary is not present:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ which autoconf
$ 

Might you have installed Homebrew? I know it includes more build tools than are provided by Xcode.


#197

I do have Homebrew installed on my mac. It’s kind of essential these days if you’re going to do any compiling or development.


#198

rm -r ~/.node-gyp

This worked for me.