Coder Social home page Coder Social logo

hey-rickover-firmware's Introduction

DIY Alexa ESP32 Firmware

This folder contains a copy of Atomic14's DIY-Alexa Code for testing/playing with it.

The original repository is: https://github.com/atomic14/diy-alexa

NOTE: config.h would contain private data. I instead added secrets.h for that data. You can either update the variables directly in config.h or make your own secrets.h file.

Also you need to set up a witai application and get a client access token - also stored in secrets.h

We are using Platform.io to build the firmware.

If you're having problems detecting the wakeword Rickover then you can try lowering the detection threshold:

/src/state_machine/DetectWakeWordState.cpp line 59.

if (output > 0.95)

Change 0.95 to something lower and you will increase the sensitivity. It's also worth logging this value out if you are having problems so you can see how well the detector is picking up the work.

To understand the code the best place to start is src/Application.cpp. This is a very simple state machine that switched between either waiting for a wake word or trying to interpret the user's command.

From there you can look at src/state_machine/DetectWakeWordState.cpp' and src/state_machine/RecogniseCommandState.cpp`.

If you've watched the video the code should be fairly easy to follow.

Config options

To set things up for yourself, edit the config.h file and fill in your WiFi details.

There are a number of options in this file that you can modify to suit your own setup.

If you want to use an analog microphone instead of I2S then you need to comment out this line:

// are you using an I2S microphone - comment this out if you want to use an analog mic and ADC input
#define USE_I2S_MIC_INPUT

And you will need to select the appropriate ADC channel to read data from:

// Analog Microphone Settings - ADC1_CHANNEL_7 is GPIO35
#define ADC_MIC_CHANNEL ADC1_CHANNEL_7

If you are using an I2S Microphone then you need to tell the system which channel you have configure the microphone on (left or right - generally these devices default to left).

// Which channel is the I2S microphone on? I2S_CHANNEL_FMT_ONLY_LEFT or I2S_CHANNEL_FMT_ONLY_RIGHT
#define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_LEFT
// #define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_RIGHT

And you will need to tell it which pins you have connected to the microphone:

#define I2S_MIC_SERIAL_CLOCK GPIO_NUM_33
#define I2S_MIC_LEFT_RIGHT_CLOCK GPIO_NUM_26
#define I2S_MIC_SERIAL_DATA GPIO_NUM_25

If you want to have speaker output then you will need to connect or change the following pins to your I2S amplifier:

// speaker settings
#define I2S_SPEAKER_SERIAL_CLOCK GPIO_NUM_14
#define I2S_SPEAKER_LEFT_RIGHT_CLOCK GPIO_NUM_12
#define I2S_SPEAKER_SERIAL_DATA GPIO_NUM_27

Finally, we have the access key for wit.ai - I will leave my key active for as long as possible.

// command recognition settings
#define COMMAND_RECOGNITION_ACCESS_KEY "UFFEIMRQL7LH4T2DXRHKER4HPMFB4LNH"

hey-rickover-firmware's People

Contributors

sefisher avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.