Category Archives: javascript

New Panel Layout for the V3 Wow Suit

Here are 2 video demo of the new panel layout:

This one runs a simple pixel pusher to test each pixels colour and location:

This one runs part of the Wow Suits full software rendering suite:

Each panel consists of 255 APA102 LED Pixels. There will be a total of 12 of these panels, however the panels on the arms and body may be smaller.

Wow Suit V 3 – Production Update

I have used up the last of my APA102 strips from my previous order to make the 1st prototype panel for the 3rd Iteration of the Wow Suit.

wpid-20151029_184110-1.jpg

This is the panel for the bottom right leg. With this prototype i have 17 strips x 15 Pixels Per Strip totaling at 255 LEDs for one panel. The previous iteration of the Wow Suit had 10 x 16 pixel strips, which were 160 Pixels per block).

wpid-20151029_184345-1.jpg

I’m trying to get them as tightly packed as possible. The base block is a piece of felt secured to a thin piece of plastic sheet. Its both rigid and flexible enough to adhere to the cat suit Ill be putting this on to.

wpid-20151029_184402-1.jpg

I have also added a pixel inside the RPI casing as the driver Pixel. This pixel is directly connected to the SPI bus on the RPI and is driven by the RPI’s 3.3v Power Supply. Its the best way to get a reliable signal at very high SPI speeds. I’m essentially using the pixel as a voltage level converter. When driving LEDs, the software ignores pixel 0 and sends a blank pixel to it each render.

The Wow Suit V3 – Building has begun

wpid-20151029_160232-1.jpg

Above is the brains of the Wow Suit. The Raspberry Pi A+. I have 2, one is a backup in case I step on the 1st :)  For $50 you cant really pass up on this power house. The RPI runs the following stack of software:

I have also placed an order for a body suit, and will be building the 1st panel in the coming days to test out a new layout . Also in the pipeline is 20 Meters of APA102 144ppm LED Strips.

Building MRAA from source on a Raspberry Pi A+

I am using Raspbian (Kernel 4.1) http://downloads.raspberrypi.org/raspbian_latest

You will also need “python” and “git” however these are pre-installed on the device.

Update apt-get

sudo apt-get update
sudo apt-get upgrade

Install NodeJS on a Raspberry Pi A+

latest version of Node for RPI is not supported, gra barchived:
   wget http://node-arm.herokuapp.com/node_archive_armhf.deb
Install it using dpkg
   sudo dpkg -i node_archive_armhf.deb
Test Node and NPM
   node -v
   npm -v
Update npm
   npm update npm
Change npms registry path from https to http
   npm config set registry http://registry.npmjs.org/

Install PCRE

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.bz2
tar jxf pcre-8.37.tar.bz2
chmod 777 configure
./configure
make
sudo make install
sudo ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so
sudo ldconfig

Install SWIG 3.07 or higher

http://downloads.sourceforge.net/swig/swig-3.0.7.tar.gz
tar -xzf swig-3.0.7.tar.gz
./configure
make
sudo make install

Install python-dev

sudo apt-get install python-dev

Install cmake

sudo apt-get install cmake

install mraa

git clone https://github.com/intel-iot-devkit/mraa.git
cd mraa

Comment out the following from /src/spi/spi.c
(line 144)
// if (ioctl(dev->devfd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) != -1) {
// if (speed < hz) {
// dev->clock = speed;
// syslog(LOG_WARNING, "spi: Selected speed reduced to max allowed speed");
// }

mkdir build
cd build
cmake .. -DBUILDSWIGNODE=ON -DBUILDSWIGPYTHON=OFF
make

This is where it got weird and i tried something random and it worked

Go into your project directory and install mraa via npm

cd ~projectdirectory
npm install mraa

You then need to copy mraa.node from

~/mraa/build/src/javascript

To

~/projectdirectory/node_modules/mraa/build/Release

LED Helmet V1a – Project update

I am still waiting on the Mega modules, ordered last week. Not sure what the postage hold up is. In the meantime, I managed to get the Galileo Gen1 to work!! So many bugs and wrong turns on this device.

●The firmware update instructions are very unclear…the device must have NO sd card inserted and then booted up with the usb port plugged in. It then comes up as a serial.port for the firmware update to work.

●To my surprise, i ran the latest IOT image, the same one used on the Gen2 board. It worked…with bugs..

●SPI functionality via MRAA is non existent on the Gen1. Even with the lastest 7.3 mraa moduke. The clock signal on my scope was garbage! Very disapointing

●SPI via arduino sketches is also flaky, at a setting of 8mhz i was only able to get around 2-3mhz clock before it skewed into noise

On a whim i ended up trying the pi-spi nodejs module and it worked at 3mhz!!! But when i rebooted i got noise on the spi pins…hours later i realised that if I ran an arduino sketch that uses spi before hand, spi was usable again…so i wrote an arduino sketch that initialised the spi and did nothing else…at boot time the sketch starts and about 10 seconds later the xdk daemon launches the main.js script…and bam!!!

Raspberry Pi A+ Update

wpid-20150728_112955-1.jpg

Today I have completed the initial set up of my RPi A+. Wow that took a while. I needed a specific set of tools ready on the device:

  • Network connected via WiFi
  • Basic Apache install to host the Client interface page
  • Basic FTP to simplify uploading code and files
  • Node JS to run the Wow Suit software
  • Node-SPI module to enable NodeJS to use the SPI port on the device

Installing and configuring Node and the SPI modules was the MOST difficult part. I was initially planning on using the MRAA module, but it has so many prerequisites and build failures that i bailed on it. I may go back to it if the current node module I’m using does not suffice.

This post was by the far the only advise that worked on the A+ board. I initially attempted to compile the latest version of NodeJS directly but the board kept crashing mid way. So I’m copying the instructions here for anyone else and for future reference for myself:

                     Update apt-get
sudo apt-get update
                     Upgrade apt-get
sudo apt-get upgrade
                     Download the latest node build
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
                     Install the package using dpkg
sudo dpkg -i node_latest_armhf.deb
                     Test Node and NPM
node -v
npm -v

At this point Node works perfectly as well as npm. Now on to the next issue. SPI!

This is the “pi-spi” nodejs module. It is the ONLY one that would compile and run. I have not yet tested that it works as I’m at the office, but its good to know that it compiles and runs!

Rendering a Line in a 2D bitmap…who would have thought that was hard? Here is some code I hacked up from the Rosetta archive lineTest

Galileo GEN2 Javascript shiftOut() function progress

gen28bit

 

I used the MRAA library to get a pretty good rate out of  the GEN2 Galileo. Above is 8 Bits being latched via the clock pin. I made a VERY hacky bit-bang function that pushes out data to the WS2803. And success.

Below is a video of a fully working shiftOut() function written in JS for the Galileo GEN2, driving the suit

Ta Da! Im running a simple test program I developed to test a single WS2803 chip and its working as intended .

Now onto integrating the HTTP server via NodeJS and interactivity here we come

 

 

Cheap & fast VR

I have started working on a small VR web-app. I think 3D headsets will only get better and better as tech progresses and people start to get into it. I have owned the 1st gen Sony HMD unit HMZ-T1

186261

This thing is great, but it lacks any kind of tracking like the Oculus Rift and the new Google Cardboard(which really got me thinking about this whole thing again). I have in the past used old Android phones to get tracking data. There is  a great little app called Sensor UDP it lets you send UDP messages to a pc/tablet/phone etc.. with the sensor data from any android phone! This has been done before, Im working on a different angle!

Image1

A phone will be stuck to the HMD unit and track your head movements. It will then send this data via WIFI to the PC connected to the HMD via HDMI. I can then make really cool 3D web apps in Chrome or any HTML5 enabled browser.

VibraGlove V3 – no more serial port

vibraglovev3

Thanks to the Intel Galileo board, I can remove the wired part of the system. No more serial port, no more special buffering functions, a huge load off the implementation.

Whats different

The Galileo board now sits on the same network as the client pc. It runs an simple web server at port 80. It reads requests from an incoming client connection. The client PC, connected to the Leap Motion, continuously polls the Galileo board by sending a GET request with the calculated PWM values. The Galileo board received the request, parses out the PWM values and send that data to the assigned PWM pins that control the feedback to each finger.

I also put in a lot of special feedback functions. Instead of simple strength values, i can now code it to accept specif patters of vibration.

There is no More Serial driver, so the NodeJS app i wrote that accepts GET requests and translates them into serial data is no more.