Well I'm sure the Particle team is working hard on the Linux DEV tool which will make the following obsolete very soon, I hope (and thanks by the way).
Here is my toolchain to get setup in Ubuntu 14.04 (I create a folder called ~/particle to contain this stuff). I queried tool versions as I went so you can see just how old this is (made 12/30/2015).
in linux install keys and github following the instructions on these links:
First install the node.js and npm packages following these instructions that also install Homebrew
When I was done:
node -v
v0.10.37
npm -v
1.4.28
now at linux cli:
add_ppa() { grep -h "^deb.*$1" /etc/apt/sources.list.d/* > /dev/null 2>&1; if [ $? -ne 0 ]; then echo "Adding ppa:$1"; sudo add-apt-repository -y ppa:$1; return 0; fi; echo "ppa:$1 already exists"; return 1; }
add_ppa terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get -y install gcc-arm-none-eabi git
mkdir particle && cd particle
git clone https://github.com/spark/firmware && cd firmware && git checkout latest && cd main && make clean all PLATFORM=photon && cd ../build/target/user-part/platform-6-m
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs sudo apt-get install build-essential libusb-1.0-0-dev
sudo npm install -g particle-cli
particle --version
1.8.20
particle cloud login
# answer the login questions
cd ~/particle
git clone git@github.com:spark/core-communication-lib.git
git clone git@github.com:spark/core-firmware.git
git clone git@github.com:spark/core-common-lib.git
git clone git://git.code.sf.net/p/dfu-util/dfu-util
cd dfu-util
sudo apt-get build-dep dfu-util
./autogen.sh
./configure
make
sudo make install
cd ..
# Test on Photon
# Hold down the mode button and press and release the reset button until the core starts flashing yellow, then release the mode button.
# Virtual Box - Devices - USB - select the "DFU Mode" device
sudo dfu-util -l
Should look something like:
Found DFU: [2b04:d006] ver=0200, devnum=3, cfg=1, intf=0, alt=1, name="@DCT Flash /0x00000000/01*016Kg", serial="00000000010C" Found DFU: [2b04:d006] ver=0200, devnum=3, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"
Build and flash tinker
cd /home/davegutz/particle/firmware/main && make clean all PLATFORM=photon
cd ~/particle/firmware/build/target/user-part/platform-6-m
cd ~/particle/firmware
particle setup
particle list
Threw error:
#Error loading command /usr/local/lib/node_modules/particle-cli/commands/SerialCommand.js Error: Cannot find module '/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/node-v47-linux-x64/serialport.node'
#THIS IS OK.
IT SIMPLY MEANS YOUR VIRTUAL BOX SETTINGS FOR USB ARE UNSET. THE PARTICLE CLI WILL STILL FIND THE PHOTON.
The following should now work
particle flash PhotonExp9HYK tinker
Now load your project
cd ~/particle
git clone git@github.com:davegutz/myThermostat-Particle-Photon.git
Note: Have to revert you Particle.variable statements from
Particle.variable("stat", statStr);
# to
Particle.variable("stat", statStr.c_str(), STRING);
Now the redo loop for a project:
# redo loop for project in ~/particle/Thermostat-Particle-Photon/myThermostat_Particle_DEV
# and device PhotonExp9HYK
cd ~/particle
cp myThermostat-Particle-Photon/myThermostat_Particle_DEV/* firmware/user/src
cp firmware/user/src/myThermostat.ino firmware/user/src/application.cpp
cd /home/davegutz/particle/firmware/main && make clean all PLATFORM=photon
cd ~/particle/firmware/build/target/user-part/platform-6-m
# put your photon into flash safe mode (flash purple)
particle flash PhotonExp9HYK user-part.bin
####Update from git
cd ~/particle/myThermostat-Particle-Photon
git pull