There's a forum post demonstrating a running instance of Cannyblocks. I've had a dig around in the source code but can't seem to find the node-js app that runs cannyblocks. Ideally, I'd like to get this up-and-running for some code clubs I have this Friday & Saturday. Any pointers to the app are appreciated.
There is a set of installation instructions here: http://forum.bluebrain.io/t/raspberry-pi-installation-instructions/47
Part of that install process creates the NodeJS, and required NodeRed dependancy, which hosts the webapps such as Cannyblocks.
Are you using Pi2's by any chance? I ask because there is a soon to be committed change to support installing NodeJS for a Pi2 and also a BLE support fix. I should be able to get that in today so you can test before your CodeClubs.
Ok, so I think I was expecting to run it via alternative means.
In bluebrain/src/www I could create a package.json with the following(ish) contents that
- describes the project dependencies, and
- specifies the entry point
"require" : ">=0.0.0",
"description": "Web applications to control a Canybots",
"test": "echo \"Error: no test specified\" && exit 1"
"author": "Wayne Keenan",
The dependency list above is incomplete, furthermore I can't yet identify the entry point...working on it!
The advantage of the above is that I can then type
and have all the dependencies install for me.
This mode of running it suits me as I'm trying to run the webapps on a wide array of machines (primarily Fedora Linux, but Windows & OSX too). I suspect using npm package.json mechanism would also help you guys carry around fewer dependencies in your source repository.
Ah, ok, if your wanting to a more fine grained install then I can point you at this:
in there is the package.json:
"start": "node ./bin/www"
and to start the app, run:
sudo node ./bin/www
(this started life as an 'express' based template, hence the 'bin/www')
an installer step copies that 'www' folder (which is shared across iOS, Android and Pi ) into the 'cannybox' folder.
The .tar.gz of dependancies were intended to be a convenience to save time (no compilation) at setup time but thats gotten harder to manage and was an (incorrect) assumption that everyone would target a Pi/raspbian based on the SD image used in the instructions.
So, the deps will be removed in the next github commit and 'npm install' mechanism is now used in the installer scripts.
Fantastic. No idea how I missed that package.json file.
you should end up with a folder structure of:
www <---- copied from [repo]/src/www
I also changed the /dev//ttyAMA0 to /dev/ttyS0 in my renamed nodered/flows_localhost.localdomain.json. Now I just have to get out of class to test this!
When using the serial port you will need to use a 'spare' bluebrain connected to TX/RX 3.3v and GND on the Pi and load a custom sketch to the attached BB.
The sketch (with wiring info) is here
There is a value in that sketch, and also the sketch on the bot (e.g. maze solving) that needs to match, the line is near the top of the sketches and looks like:
#define GZLL_HOST_ADDRESS 0x12ACB010
May I suggest you twiddle the last couple of digits to what ever you want. the first 2 digits have a restriction, must avoid values that have alternating bit patterns in their binary representation (it's a radio limitation)
There is a 'noble' and NodeRed version that does away with the above 'serial proxy' and uses a USB BLE dongle. I will let you know more soon...
@Wayne Thanks a lot. I'm beginning to understand it much more now. I'll use a Pi with attached bluebrain on the GPIO pins for this week and wait for any NoBLE updates before deploying on other devices.
ok cool. When you browse to the index page check out the second cannyblocks link, it has a slightly different view than the first one, namely it supports import/export of Blocky code.
After putting some blocks in you can use the XML tab to view and then export (copy/paste elsewhere) and also import (paste into the XML tab and then go back to the "blocks tab")
In time there should be better blocky code storage & sharing, local and/or integration with github or some such.