Skip to content

Commit

Permalink
add openglass
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcohenhillel committed Aug 6, 2024
1 parent cdedb23 commit 6d6e24a
Show file tree
Hide file tree
Showing 157 changed files with 19,233 additions and 2 deletions.
3 changes: 3 additions & 0 deletions OpenGlass/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXPO_PUBLIC_GROQ_API_KEY=
EXPO_PUBLIC_OLLAMA_API_URL=
EXPO_PUBLIC_OPENAI_API_KEY=
7 changes: 7 additions & 0 deletions OpenGlass/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
// import App from './sources/app';
import { Main } from './sources/app/Main';

export default function Root() {
return <Main />;
}
7 changes: 7 additions & 0 deletions OpenGlass/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 Based Hardware Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
90 changes: 90 additions & 0 deletions OpenGlass/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# OpenGlass - Open Source Smart Glasses

Turn any glasses into hackable smart glasses with less than $25 of off-the-shelf components. Record your life, remember people you meet, identify objects, translate text, and more.

![OpenGlass](https://github.com/BasedHardware/OpenGlass/assets/43514161/2fdc9d9d-2206-455c-ba60-10dbd6fb3dfb)

## Video Demo

[![OpenGlass Demo](https://img.youtube.com/vi/DsM_-c2e1ew/0.jpg)](https://youtu.be/DsM_-c2e1ew)

## Want a Pre-built Version?

We will ship a limited number of pre-built kits. Fill out the [interest form](https://basedhardware.com/openglass) to get notified.

## Community

Join the [Based Hardware Discord](https://discord.com/invite/ZutWMTJnwA) for setup questions, contribution guide, and more.

## Getting Started

Follow these steps to set up OpenGlass:

### Hardware

1. Gather the required components:

- [Seeed Studio XIAO ESP32 S3 Sense](https://www.amazon.com/dp/B0C69FFVHH/ref=dp_iou_view_item?ie=UTF8&psc=1)
- [EEMB LP502030 3.7v 250mAH battery](https://www.amazon.com/EEMB-Battery-Rechargeable-Lithium-Connector/dp/B08VRZTHDL)
- [3D printed glasses mount case](https://storage.googleapis.com/scott-misc/openglass_case.stl)

2. 3D print the glasses mount case using the provided STL file.

3. Open the [firmware folder](https://github.com/BasedHardware/openglass/tree/main/firmware) and open the `.ino` file in the Arduino IDE.

- If you don't have the Arduino IDE installed, download and install it from the [official website](https://www.arduino.cc/en/software).
- Alternatively, follow the steps in the [firmware readme](firmware/readme.md) to build using `arduino-cli`

4. Follow the software preparation steps to set up the Arduino IDE for the XIAO ESP32S3 board:

- Add ESP32 board package to your Arduino IDE:
- Navigate to File > Preferences, and fill "Additional Boards Manager URLs" with the URL: `https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json`
- Navigate to Tools > Board > Boards Manager..., type the keyword `esp32` in the search box, select the latest version of `esp32`, and install it.
- Select your board and port:
- On top of the Arduino IDE, select the port (likely to be COM3 or higher).
- Search for `xiao` in the development board on the left and select `XIAO_ESP32S3`.

5. Before you flash go to the "Tools" drop down in the Arduino IDE and make sure you set "PSRAM:" to be "PSRAM: "OPI PSRAM"

![Like this](image.png)

6. Upload the firmware to the XIAO ESP32S3 board.

### Software

1. Clone the OpenGlass repository and install the dependencies:

```
git clone https://github.com/BasedHardware/openglass.git
cd openglass
npm install
```

You can also use **yarn** to install, by doing

```
yarn install
```

2. Add API keys for Groq and OpenAI in the `keys.ts` file located at [https://github.com/BasedHardware/OpenGlass/blob/main/sources/keys.ts](https://github.com/BasedHardware/OpenGlass/blob/main/sources/keys.ts).

3. For Ollama, self-host the REST API from the repository at [https://github.com/ollama/ollama](https://github.com/ollama/ollama) and add the URL to the `keys.ts` file. The URL should be http://localhost:11434/api/chat
4. go to terminal and type "ollama pull moondream:1.8b-v2-fp16"

5. Start the application:

```
npm start
```

If using **yarn** start the application with

```
yarn start
```

Note: This is an Expo project. For now, open the localhost link (this will appear after completing step 5) to access the web version.

## License

This project is licensed under the MIT License.
39 changes: 39 additions & 0 deletions OpenGlass/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"expo": {
"name": "Dude where’s my car?",
"slug": "find-anything",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.basedhardware.find",
"infoPlist": {
"UIBackgroundModes": [
"fetch",
"remote-notification",
"bluetooth-central"
]
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.basedhardware.find"
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": ["react-native-ble-plx"],
"experiments": {
"baseUrl": "/llama3-hackaton"
}
}
}
Binary file added OpenGlass/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenGlass/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenGlass/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenGlass/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions OpenGlass/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
Loading

0 comments on commit 6d6e24a

Please sign in to comment.