Dev Kit 2 Testing
SEE THE BOTTOM OF THE DOCUMENT LABELED BUGS IF YOU RUN INTO ISSUES
๐ฏTwo Key Testsโ
There are two important characteristics to test:
- ๐พ Storage
- ๐ Button
Write commands (Sd card)โ
Whenever the device is not connected to the phone (light is red), mic data is sent to the sd card instead
All commands to the sd card are written in the form
[a b c d e f]
A is the command byte
B is the file number
C,d,e,f is the offset , c is the least significant byte, f is the most significant byte
The command byte can be the following:
Command | Action |
---|---|
0 | Read specified file |
1 | Clear all bytes in specified file |
2 | Clear ALL files in directory |
3 | Stop transmission of specified file |
Example: If you want to read file 1 starting at byte 255, then send the following packet
[0 1 255 0 0 0]
Error Codesโ
You may get the following return command bytes if you send a packet
Code | Meaning |
---|---|
0 | Command successful - means the command was successfully carried out. |
100 | End of read transmission - This is the last byte that gets sent at the end of a read transmission. Use this to determine the end of a file transmission. |
200 | Delete process finished |
3 | Invalid file size. This gets returned if you request a file that does not exist. Note that file 0 never exists, the files always start at 1. |
4 | File size is 0 |
6 | Invalid command. The command sent is not one of the commands listed above |
โ ๏ธ Note: If you don't receive 100 or 200, the file request wasn't carried out.
๐งช Testing Processโ
There are 5 python files for testing. Please run them in the order shown here. This process is meant to test individual devices, since multiple could be on at any time. Before testing, please ensure you have all the python packages needed for running(in requirements.txt) . Also ensure that you have ffmpeg and opus for decoding.
Prerequisitesโ
- โ Python packages (see requirements.txt)
- โ ffmpeg and opus for decoding
โ ๏ธ WARNING: NEVER remove the SD card while the device is on! It's not hot-swappable.
Safe SD Card Removalโ
- Double tap the reset button inside the kit
- Remove SD card to view contents
- Reinsert SD card when finished
- Tap the button to restart
Testing Stepsโ
- Run
discover_devices.py
- Lists all Bluetooth device IDs
- Look for: "Omi", "Omi Devkit 2", or "Omi Devkit 2". Use this id in the next files
- Run
get_info_list.py
- Lists the sizes of the sdcard files in bytes.
- To run this, replace line 6 with the device id found in discover devices. It should return the file size of all current audio files.
- Run
get_audio_file.py
- Downloads the first file (For now only one file is allowed to be created so only worry about downloading one file)
- Replace line 9 with your device ID (Hopefully youโve been talking into the mic)
- Data streams to
my_file.txt
in current directory
- Run
decode_audio.py
- Run this file after finishing the stream in get_audio_file.py.
- Creates WAV file from downloaded data.
- If successful, a wav file should be created containing audio data from when you spoke into the mic.
- Optional: Run
delete_audio_file.py
- Run this if you want to clear the specified audio file
- Replace line 6 with your device ID. This removes all speech data from that file
๐ก Tip: Run files in this order. Expect playback of your recorded audio.
๐ฑ SD Card Behavior (App Side)โ
Expected behavior
Connection | Light | Action |
---|---|---|
No Bluetooth | ๐ด Red | Writing to SD card. If you do not have a bluetooth connection, then the device will start reading to the sdcard. In this case the light should be red. |
Bluetooth | ๐ต Blue | Stops writing to SD card. When you connect to the app and the app connects your bluetooth device, the light should turn blue and writes to the sdcard should stop. |
In the following screens, assume this is all done in one session, as in no sudden disconnects or new sdcard bytes being added, as this is behavior that we currently do not expect to happen/handle (for now.)
Lets say youve been talking for a whileโฆโฆ
If you are also connected to the internet then a green banner appears when you first connect that states how much time it will take to download all your files. You should be presented with this screenโฆ.. Note that this can also be a test to see if the sdcard is writing properly. Green banner == good to go | |
---|---|
Click the green banner to go to the sd card screen. If you dont catch the banner in time then you can go to Settings-> device settings-> storage, where you will be presented with the same screen (shown below) | |
If you have a version 1 device, then NO green banner denoting storage should pop up, ever. Attempting to click the Sd Card import button in device settings with a v1 device should result in this screen: | |
d. This is what the screen should look like when you either click the green banner or click the sd card import button with a v2 device (ignore the sound bar) For a new file, the percentage should be 0.0%, with a nonzero, positive time in the line โabout xx seconds remaining.โ | |
E. If you press the button, the bar should start filling up. After a bit the bar should look like this: |
๐ Button Behaviorโ
After connecting to the notification service, the following events will be sent depending on the button actions
1 - single tap
2 - double tap
3 - long press, usually about 2-3 seconds
4 - button pressed down
5 - button released (button let go)
Expected behavior: pressing should make the device fire a ble packet. The number depends on the actions you take. Make sure the button presses correspond to the ble packets.
โ๏ธ Config Fileโ
Config file should include:
Names-names customizable to be set by the user
User id-user id after bonding
๐ Known Bugsโ
Bug 1 (Version 2.0.1)
Some users are experiencing issues with the sd card streaming. One cause is the fact that sometimes the audio file is empty, and since the a01.txt file, which audio data is streamed into, does not exist, nothing is actually written.
Fix:
- Delete the audio file
- Reboot device (press reset button)
- Device auto-generates required files
๐ก Tip: Always check for empty audio files if streaming issues occur.