There have already been several sets of instructions for this, but none worked for me.
In case you got stuck like I did for awhile, this is what worked for me
first install fresh image raspberry pi wheezy firmware downloaded from raspberrypi.org
fire it up and change your password!
cd ~
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install dh-autoreconf build-essential git-core htop rng-tools libusb-1.0.0-dev
sudo modprobe bcm2708-rng
cd /tmp
sudo git clone https://github.com/joyent/node.git
cd node
git checkout v0.12.4
./configure --without-snapshot
make
{takes a couple of hours}
node --v
npm --v
cd ~
sudo wget http://dfu-util.sourceforge.net/releases/dfu-util-0.8.tar.gz
sudo tar -zxvf dfu-util-0.8.tar.gz dfu-util-0.8
cd dfu-util-0.8/
./autogen.sh
./configure
make
sudo make install
sudo npm install -g serialport@1.5.0
sudo npm install -g serialport@1.5.0 particle-cli
particle cloud login
cd ~
sudo git clone https://github.com/spark/spark-server.git
cd spark-server
sudo npm install
sudo node main.js
Good luck!
Iāve also found you can also compile and flash from raspberry pi 2 comfortably
(earlier models probably too slow)
*****to add repository for gcc-arm-none-eabi to raspberry pi:
pi@raspberrypi ~ $ sudo nano /etc/apt/sources.list
then add line below:
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
then:
sudo apt-get update {DO NOT enter sudo apt-get upgrade! or youāll be very sorry,
because A LOT of other stuff will get āupgradedā to untested versions}
sudo apt-get install gcc-arm-none-eabi
{I wanted 4.9.2 , but got 4.8.4 20141219, still seems to work for master & dev branch!}
You SHOULD comment out the line you added earlier,
"deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi"
in /etc/apt/sources.list after you install gcc-arm-none-eabi to prevent future unwanted changes
cd ~
git clone https://github.com/spark/firmware.git
cd firmware
git checkout develop
git pull
cd main
sudo make all PLATFORM=core APP=whatever_your_app_is_called program-dfu v=1
also works with master branch, but doesnāt work with v0.4.2 unfortunately;
v0.4.2 and photon probably require the newer arm-none-eabi-gcc
Anybody that can get arm-none-eabi-gcc 4.9.2 installed on rpi1 let me know!