Skip to content

Sending Electroencephalography(EEG) data to a webpage via Firebase Real Time Database using Muse EEG headset

Notifications You must be signed in to change notification settings

jeandlouis1/MuseEEG-Firebase-and-Web

Repository files navigation

MuseEEG-FireBase and Web

Sending Electroencephalography(EEG) data to a webpage via Firebase real time database using Muse EEG headset

This is an example built on the muse Android sdk example code modified to communicate EEG data to a webpage. It contains Firebase hooks in the android app and analogus hooks on the webpage.

Installation

  1. create A Firbase account

Connect Android Project To Firebase

For the code to run you need to add a Firebase backend for the code to connect to.

  1. Open the android code and add firbase backend to the project and name the Firebase Project what you want. Click tools -Firebase->Realtime Database- save and retrieve data

    record screenshot

If this does not work you could try this video. (https://www.youtube.com/watch?v=YVu_xSzn2u0)

Connect Webpage To Firebase

  1. Open the html file in the JeanWebmuse-webView folder and add the link from firebase to the correct section.
<script src="https://www.gstatic.com/firebasejs/4.8.2/firebase.js"></script>
<script>
  // Initialize Firebase
  // TODO: Replace with your project's customized code snippet
  var config = {
    apiKey: "<API_KEY>",
    authDomain: "<PROJECT_ID>.firebaseapp.com",
    databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
    storageBucket: "<BUCKET>.appspot.com",
    messagingSenderId: "<SENDER_ID>",
  };
  firebase.initializeApp(config);
</script>

If you have any issues see this link Add Firebase to your web Project

Configure Firebase Project

  1. Import the Jason musetest.json into your the firebase database for this project

screenshot screenshot

5.set your Rules in Firebase -read and write to true for testing reasons.

{
  "rules": {
    ".read": "true",
    ".write": "true"
  }
}

Running the code

  1. Run the code on your android device
  2. Connect the muse headset to the app
  3. once you start seeing data, run the fbtest.html (located in the JeanWebmuse-webView folder) in the browser to see the data from Firebase. This show an example of pulling the data into a web app!

About

Sending Electroencephalography(EEG) data to a webpage via Firebase Real Time Database using Muse EEG headset

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published