Local Cloud on Beaglebone Black - install steps

Hello all,

Spend some time now here with my first photon, and wanted to share this tuto that i wrote as a documentation for myself…

Hope it helps, … PS… lots of Kudo’s to several members here on the forum for pointing me in the right direction with previous posts to help me overcome several bumps on the road the first few times… :wink:
Mainly @kennethlimcp with his post “tutorial-local-cloud-1st-time-instructions-01-oct-15”

  1. Flash the BBB with the latest Debian Image as per instruction on following page:
    I used the following image at the time of writing this Tuto (includes hyperlinks):
    Jessie for BeagleBone, BeagleBone Black, Seeed BeagleBone Green and Arrow BeagleBone Black Industrial via microSD card
    Debian 8.3 (BeagleBone, BeagleBone Black, Seeed BeagleBone Green, Arrow BeagleBone Black Industrial - 4GB SD) 2016-01-24 - more info - bmap - sha256sum: da97d7794d834ee785265162635aedcca80fd6dc374593dd05473c0a25f0ac73

  2. SHORT GUIDE FOR FLASHING BBB (skip if you followed above guide
    behind links)
    a)Download the image
    b)Burn it to an SD card with win32diskimager
    c)Unplug power from BBB, indert SD, old down boot button and re-aply power
    d)In the GUI, edit the /boot/uEnv.txt to remove the # from the last line
    e)In the GUI, perform a reboot
    f)Wait for the BBB to flash (circling led’s)
    g)Once the BBB is shut down, remove SD and re-apply power.
    h)Your BBB should now start via the onboard eMMC into the debian Gui

  3. UNINSTALL APACHE
    a)Apache is default installed on the BBB image and uses port 8080.
    b)Uninstall with following commands:
    c)sudo service apache2 stop
    d)sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
    e)sudo apt-get autoremove
    f)Next clean up any old directories… This is not required, yet keeps the place clean
    g)whereis apache2
    h)You will get a list of directories back… Perform a remove command as below:
    i)sudo rm -rf /etc/apache2
    j)Replace in above command the directory with each of the returned directories from step h.

  4. Install particle CLI
    a)Log into the BBB via Putty - with Root (no password)
    b)In the shell, perform following command:
    npm install -g particle-cli
    c)You may get a warning early on, yet it should not cause any problem

  5. Install dfu-util
    a)First update the repositories with:
    b)sudo apt-get update
    c)Install the dfu-util with:
    d)apt-get install dfu-util

  6. Install particle Cloud
    a)Perform following command each after another via Putty, logged in as ROOT:
    b)git clone https://github.com/spark/spark-server.git
    c)cd spark-server
    d)npm install

  7. Start up the server one time
    a)Run the command:
    b)Node main.js
    c)You should see the following screen, however without the error in the bottom (exception error):

  8. Configure the local cloud
    a)Start a new Putty window under root
    b)Run the command:
    c)particle config <NEW_PROFILE NAME> apiUrl “http://:8080”
    d)Select the config with comman:
    e)particle config <NEW_PROFILE NAME>
    f)Run command:
    g)Particle setup
    h)You should get the following screen:
    i)With the arrow keys, select “create a new account” (!!!its highlighted in black, so you actually dont see it… The selection with the green-blue “á” infront of it is actually selected.
    j)Enter an email address and password twice
    k)It will confirm that it worked
    l)Now kill the particle CLI window with “ctrl+C”

  9. Load the keys into the Photon
    a)Make certain that your photon is connected to the BBB via USB
    b)Set the Photon in DFU mode (yellow blinking led’s)
    c)Make certain that you are in the folder “spark-server” on your BBB. If not, change to this directory with command:
    d)Cd spark-server
    e)Run the following command in the “SECOND” Putty window on the BBB:
    f)particle keys server default_key.pub.pem <IP of LOCAL CLOUD - BBB>
    g)You should get a notification “file downloaded successfully”

  10. Load the photon ID into the local cloud
    a)Put your photon into listening mode (blue blinking led)
    b)Run the command:
    c)Particle serial identify
    d)The particle will give you the DEVICE ID of the connected photon back in blue, list it correctly, you will need it!!!
    e)Put the Photon back in DFU mode (yellow blinking leds)
    f)Change the directory to the core keys directory (its a sub dir of spark-server) with:
    g)Cd core_keys
    h)Save the identity of the photon into your local cloud with command:
    i)Particle keys save
    j)If successfull, you get a “saved!” result

  11. Check the connection
    a)Go to your first putty window, still running the server
    (if no longer open, create a new one and run “node main.js” in the spark-server folder)
    b)Reset the photon and see if it connects to your local cloud

!!! Additional remark: I ran this procedure twice myself… The second time I had to run the installer for spark server twice before it started up correctly for some unknown reason. !!!

Hope it helps for the BBB users out there… If there is anything wrong \ missing or not clear, let me know so I can adjust…

PS: once again: I’m far from an expert, just writing down the experience learned from the community here … :wink:
cheers,

Davy

3 Likes