Navigation Menu

Skip to content

Wireless communication

open-ephys edited this page Feb 20, 2012 · 8 revisions

The current plan is to send outputs from the GUI computer via WiFi. This is a cheap, flexible, fast, and (hopefully) reliable way to transmit signals to the experimental setup. Most likely we'll have an Arduino that can be configured with various programs, which will give us 13 lines of digital output (and analog output with some extra effort). Obviously the output of the Arduino will have to run back to the GUI computer so we can verify the timing.

The following setup is working extremely well for testing purposes:

Hardware

Arduino Uno with SparkFun WiFly Shield

Software

WiFly Library (note: doesn't work with Arduino IDE 1.0 or higher)

Practical C++ Sockets Library; includes a Makefile to compile everything

Setup

Here's how we got things working:

  • Plug the Arduino + WiFly shield into the USB port

  • Upload "SpiUartTerminal.pde" to the board

  • Open the Arduino serial monitor and set to "No line ending"

  • Type $$$ and hit return

  • Set the serial monitor to "Carriage return"

  • Type the following commands (hitting return after each):

    set wlan join 4

    set wlan sid open_ephys The name of the ad-hoc network

    set wlan chan 1 Pick a channel, 1-13

    set ip address 169.254.1.1

    set ip netmask 255.255.0.0

    set ip dhcp 0

    set ip proto 1 select UDP

    set ip host 169.254.187.27 host address

    set ip remote 6000 port number

    save save configuration

    reboot restart the WiFly module with the new settings

  • Now there should be an ad hoc network named "open_ephys" visible to your computer. Connect to it. Note that this will disable your internet access (unless you also have an Ethernet connection).

  • Open a terminal and run ./BroadcastSender 169.254.1.1 2000 message from the folder with the Practical C++ Sockets code.

  • The Arduino serial monitor should display the word 'message' every few seconds

The WiFi Output module

The WiFiOutput module is designed to interface with a WiFi-capable Arduino with the above settings. In combination with an EventNode as its source, it can be used to send periodically trigger some output from the Arduino. We'll want something a bit more general in the future, but this setup is working well for demonstration purposes.


<< Back to NI DAQ-based data acquisition | Continue to C++ >>