OpenBCI Documentation

OpenBCI Documentation

  • Main Site
  • Shop
  • Forum
  • Documentation
  • Github
  • Citations

›WiFi Shield

Welcome to OpenBCI

  • Welcome to the OpenBCI Community

Getting Started

  • Getting Started
  • Boards

    • Cyton Getting Started Guide
    • Daisy Getting Started Guide
    • Ganglion Getting Started Guide
    • WiFi Shield Getting Started Guide

    Biosensing Setups

    • Setting up for EEG
    • Setting up for ECG
    • Setting up for EMG

    Community

    • Welcome to the OpenBCI Community

Cyton Board

  • Cyton Board
  • Cyton Specs
  • Cyton Data Format
  • Cyton Board SDK
  • Cyton Board Programming Tutorial
  • Cyton Radios Programming Tutorial
  • External Trigger on OpenBCI Cyton Board
  • Using SD Card with OpenBCI

Ganglion Board

  • Ganglion Board
  • Ganglion Specs
  • Ganglion Data Format
  • Ganglion SDK
  • Ganglion Programming Tutorial

Headwear & Electrodes

  • Add Ons
  • Headwear

    • Ultracortex Mark IV
    • Ultracortex Mark III
    • OpenBCI EEG Headband Kit Guide
    • Electrode Cap Getting Started Guide

    Electrodes

    • Electrode Guide

Third-Party Hardware

  • Third-Party Hardware
  • EmotiBit

    • EmotiBit Guide

    HEGduino Kit

    • HEGduino How-to

    IDUN Dryode

    • IDUN Dryode™

    Myoware

    • MyoWare OpenBCI Integration (Cyton Board)
    • MyoWare OpenBCI Integration (Ganglion Board)

    Pulse Sensor

    • Pulse Sensor Guide

    ThinkPulse

    • ThinkPulse™ Getting Started Guide

    WiFi Shield

    • OpenBCI WiFi
    • Wifi Shield Programming Tutorial
    • OpenBCI WiFi Shield API
    • OpenBCI Wifi SDK

Software

  • Compatible Software
  • Developed By OpenBCI

    • The OpenBCI GUI
    • GUI Widget Guide

    Compatible Third Party Software

    • MATLAB
    • Neuromore
    • OpenViBE
    • Lab Streaming Layer (LSL)
    • BrainBay
    • BioEra
    • VirtualBox Windows Guide

For Developers

  • For Developers
  • Software Development
  • Firmware Development
  • Hardware Development

Deprecated Documents

  • Deprecated Docs
  • Spiderclaw V1 & V2 (deprecated)
  • OpenBCI 8bit Board (no longer in production)
  • Ultracortex Mark 1
  • Ultracortex Mark 2
  • Ultracortex Mark III "Nova" & "Supernova" (REVISED)
  • Python and OpenBCI
  • OpenBCI Hub

Troubleshooting

  • Troubleshooting Landing
  • Minimizing Noise
  • GUI Troubleshooting
  • FTDI Buffer Fix on Linux
  • FTDI Buffer Fix on OS X
  • FTDI Buffer Fix on Windows

Example Projects

  • Example Projects
  • Arduino Focus Example

    • Send Focus Data from GUI to Arduino

    Experiments

    • Puppies and Kittens Experiment

    Community Page Projects

    • Community Page Projects

    EMG Projects and Tutorials

    • EMG Scrolling
    • EMG-controlled Stop/Start Music
    • EMG-controlled Slideshow
    • EMG-controlled LED
    • EMG Chrome Dino Game

FAQ

    FAQ

    • Frequently Asked Questions
    • General Frequently Asked Questions
    • How OpenBCI products go together?
    • Hardware & Software
    • Purchases & Payment Processing
    • Shipping & Taxes

    Policies

    • OpenBCI Cookie Policy
    • Privacy & Security
    • RETURNS & REFUNDS
    • Liability Policy
Edit

OpenBCI Wifi SDK

The purpose of this doc is to describe what's required to interface another micro-controller with the WiFi Shield.

Prerequisites

Please have the latest Arduino version downloaded and installed.

Install OpenBCI Wifi Master

There are many options for downloading the OpenBCI Wifi Master.

From Arduino Library Manager (easiest!)

Simply search for OpenBCI Wifi Master in the Arduino Library Manager. For help using the Library manager please checkout the well maintained Official Arduino Guide.

Manual Installation

  1. Download the latest (or version of choice) from arduinolibraries.info.
  2. Unzip the folder and change the name to OpenBCI_Wifi_Master
  3. Move OpenBCI_Wifi_Master to:

On Mac: /Documents/Arduino/libraries
On Windows: C:\Users\username\Documents\Arduino\libraries

If you're have trouble or want to learn more checkout the Official Arduino Guide for manual installation.

Clone From Github

Use a git client to clone the official repository for the OpenBCI_Wifi_Master_Library into your libraries folder.

Sending Data to WiFi Shield

Overview

The WiFi Shield acts a SPI slave device to the Cyton or Ganglion. The max speed the ESP8266 can seem to handle is 10MHz. A SPISlave example we based our Wifi code on. To interact with this SPI slave library, (you wanted to use this WiFi Shield for some other reason...) you should look at the SPI Master example because the commands to get data vs read a status register are strictly defined and must be followed. The first constraint the Arduino ESP8266 SPI slave places on us is to always send 32 bytes per message. This library says that each packet must be 32 bytes, so that's where we begin....

Byte Stream Format

The first byte to send is the control byte. For streaming data, that goes on the TCP socket, send 0xCX (where X is 0-F in hex) as the control byte. In the OpenBCI_32bit_Library code base:

/*  
 * @description Writes channel data and axisData array to serial port in
 *  the correct stream packet format.
 */
void OpenBCI_32bit_Library::sendChannelDataWifi(void)  {

    wifiStoreByte(OPENBCI_EOP_STND_ACCEL); // 0xC0 1 byte

    wifiStoreByte(sampleCounter); // 1 byte

    ADS_writeChannelDataWifi(); // 24 bytes

    accelWriteAxisDataWifi(); // 6 bytes

    wifiFlushBuffer(); // Flushes the buffer to the SPISlave ESP8266 device!

    sampleCounter++;

}

This code writes 32 bytes of data in the correct format and therefore as soon as it arrives at the WiFi Shield. The WiFi Shield will convert the 32 byte packet to the standard 33 byte binary format by moving the control byte 0xCn, where n is 0-F (hex), to the stop position and add add 0xA0 to the start position. This allows for a seamless integration with the tried and tested parsing systems already built for the Cyton. Important if you want to only send 20 bytes of data per packet, you still must send this 32 bytes with the proper start and stop bytes.

Last updated on 9/2/2020
← OpenBCI WiFi Shield APICompatible Software →
  • Prerequisites
  • Install OpenBCI Wifi Master
    • From Arduino Library Manager (easiest!)
    • Manual Installation
    • Clone From Github
  • Sending Data to WiFi Shield
    • Overview
    • Byte Stream Format
OpenBCI Documentation
Site
OpenBCI WebsiteOpenBCI StoreOpportunitiesDownloads
Social
TwitterInstagramFacebookLinkedIn
More
GitHubCommunityForumContact
Copyright © 2021 OpenBCI