Ladvien's Lab

Latest Posts

Image source: Darius Bashar
Recording Brain Waves -- iOS SDK Setup

Step 1: iOS App

I'm going to assume you have Xcode installed.

Step 1.1: Install CocoaPods

CocoaPods is a package handler for Xcode. We will be using it to install Alamofire , which a Swift library for making HTTP requests. We will need HTTP call support as we will call our server to store the EEG samples.

sudo gem install cocoapods

After you hit Return it will prompt for your password

cocoapods-installation

Step 1.2: Setup Xcode Project

Now, let's setup a project folder. This is main folder where all the iOS app code will live. It's a bad habit, but ...

Image source: Darius Bashar
Recording Brain Waves to MongoDB

Description

This project takes brain wave readings from a MindWave Mobile 2+, transmits them to an iOS app via Bluetooth LE. The iOS app makes calls to a remote Node server, which is a minimal REST API, passing off the brain wave sample. The Node server stores the data on a MongoDB server. The MongoDB server is then exposed to business intelligence applications use with MongoDB BI Connector. Lastly, using Tableau Professional Desktop, the data is accessed and visualizations created.

Whew.

To recap: * MindWave Mobile 2+ * iOS App (tentatively named Mind Wave Journaler; Swift) * REST Server (mind-wave-journaler; NodeJS) * MongoDB BI ...

Setting up Nginx on Linode

I've used Jekyll to create my website. A lot of the heavy lifting was done by Michael Rose in the form of a Jekyll theme he created called Hpstr.

Much respect.

But, setup was pretty painful for me. I knew nothing about websites, let alone creating a static page website . I've decided to set my hand to journal a lot of the nuances I ran into. Try to save someone some time. Or, save myself some time when something goes wrong.

These articles will not be on CSS, JavaScript, or HTML. After tinkering with computers for 20 years, I ...

Creating a GPU Accelerated Deep-Learning Environment on Arch Linux

This article logs a weekend of efforts to create a deep-learning environment which meets the following criteria

It was a tough one.

UPDATE: 2019-01-19

It seems the Anaconda conda install tool now takes care of the gpu setup.

The following steps:

  • Install NVIDIA
  • Downgrade CUDA to match CDNN

Can now be replaced by installing tensorflow-gpu after installing Anaconda.

Run the following once conda is setup:

conda install -vv tensorflow-gpu

TL;DR

There was error I had a hell of a time debugging. Installing the ...

Google Vision API using Raspberry Pi and Node

This is a jumpstart guide to connecting a Raspberry Pi Zero W to the Google Vision API.

1. Get an Account

Sadly, Google Vision API is not a completely free service. At the time of writing an API account provides 1000 free Google Vision API calls a month. Then, it's a $1.00 for each 1000 calls.

I know, I know, not too bad. But this isn't a commercial project. I'm wanting to use it for a puttering little house bot. If my wife gets a bill for $40 because I decided to stream images to the API, well, it'll ...

1B1 Robot

Not too long ago there was a post on Hackaday about a little four-wheeled bot made with a Raspberry Pi and some eBay motor drivers.

Raspberry Pi Zero Drives Tiny RC Truck

I really liked the little chassis, ordered one, and was happy to find it was delivered with the motors already mounted. (As I become an aged hacker, it's the little time savers which are genuinely appreciated.)

On buying the chassis I'd already decided to use one of my Raspberry Pi Zero W's (rp0w) to control the bot. I really like Arch Linux on the rp0w. It's light weight ...

Setup NodeJS Project Space on Raspberry Pi Zero W

Setup the Arch Linux SD Card

This article will be building off a previous article, where I walked through a headless setup of Arch Linux on the Raspberry Pi Zero W (rp0w). And if you aren't familiar with the term "headless setup," essentially, we are talking about setting up the SD card so you don't have to plug it into a monitor. You can plug it in to your rp0w, boot it, and SSH in.

Now you've setup the Arch Linux card and SSH'ed lets go through setting up ...

Porting DRV8830 I2C Motor Driver Code to NodeJS

Earlier in this article series I showed how to install NodeJS -- it was pretty simple with an install script. However, I thought I better show how I actually worked with NodeJS to create my little 1b1 driver code.

Again, simple, I used others hard work. Specifically, Michael Hord with Sparkfun's MiniMoto library.

Really, all I did was tweak the code a little bit to fit JavaScript syntax.

The result

'use strict';
var i2c = require('i2c-bus');
var sleep = require('sleep');

// Commands
const FAULT_CMD         = 0x01;

// Fault constants
const CLEAR_FAULT       = 0x80;
const FAULT             = 0x01;
const ILIMIT            = 0x10;
const OTS               = 0x08 ...
Editing Raspberry Pi Code Remotely from Visual Studio Code

I'm spoiled. I love the pretty colors of modern text IDEs. My favorite among them being Visual Studio Code.

I know it'll engender a lot of bad rep with the old-timers, but I prefer the one on the right.

However, when working on a headless (no monitor) Raspberry Pi it felt like I was pretty much stuck with the nano .

Until! I discovered Visual Studio Code's remote extension.

This allowed me to edit my Raspberry Pi files from within Visual Studio Code. So, I get all the joys of writing ...

Lag() before MySQL 10.2

Recently I was required to work with MySQL 10.0. I was surprised to find MySQL 10.2 and less does not support some common Windowing Functions , specifically, Value Functions and Rank Functions .

Well, bummer. I really needed them.

On top of it, I only had read access to the database without the ability to create a stored procedure. Out of desperation, I found myself researching the possibility of creating my own functions using MySQL User Variables .

Slightly tweaking Dante, "Abandon all normal, ye who enter here." User variables are weird.

I've spent some time researching on the interweb and ...