Skip to content

Commit

Permalink
Re-lint after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dheavy committed Apr 3, 2024
1 parent 403a29f commit 79ee710
Show file tree
Hide file tree
Showing 34 changed files with 418 additions and 242 deletions.
5 changes: 2 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Roadmap

Our goal is to power a billion devices with the 01OS over the next 10 years. The Cambrian explosion of AI devices.
Our goal is to power a billion devices with the 01OS over the next 10 years. The Cambrian explosion of AI devices.

We can do that with your help. Help extend the 01OS to run on new hardware, to connect with new peripherals like GPS and cameras, and add new locally running language models to unlock use-cases for this technology that no-one has even imagined yet.
We can do that with your help. Help extend the 01OS to run on new hardware, to connect with new peripherals like GPS and cameras, and add new locally running language models to unlock use-cases for this technology that no-one has even imagined yet.

In the coming months, we're going to release:

- [ ] Add support for Azure and PlayHT for fast latency
- [ ] An open-source language model for computer control
- [ ] A react-native app for your phone
- [ ] A hand-held device that runs fully offline.

4 changes: 2 additions & 2 deletions TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- [ ] Sends to describe API
- [ ] prints and returns description
- [ ] Llamafile for phi-2 + moondream
- [ ] test on rPi + Jetson (+android mini phone?)
- [ ] test on rPi + Jetson (+android mini phone?)

**OS**

Expand Down Expand Up @@ -66,7 +66,7 @@

**Hardware**

- [ ] (Hardware and software) Get the 01OS working on the **Jetson** or Pi. Pick one to move forward with.
- [ ] (Hardware and software) Get the 01OS working on the **Jetson** or Pi. Pick one to move forward with.
- [ ] Connect the Seeed Sense (ESP32 with Wifi, Bluetooth and a mic) to a small DAC + amplifier + speaker.
- [ ] Connect the Seeed Sense to a battery.
- [ ] Configure the ESP32 to be a wireless mic + speaker for the Jetson or Pi.
Expand Down
6 changes: 3 additions & 3 deletions docs/client/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ poetry run 01 --client

### Flags

- `--client`
- `--client`
Run client.

- `--client-type TEXT`
Specify the client type.
- `--client-type TEXT`
Specify the client type.
Default: `auto`.
66 changes: 33 additions & 33 deletions docs/server/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,73 +44,73 @@ For more information, please read about <a href="/services/speech-to-text">speec

## CLI Flags

- `--server`
- `--server`
Run server.

- `--server-host TEXT`
Specify the server host where the server will deploy.
- `--server-host TEXT`
Specify the server host where the server will deploy.
Default: `0.0.0.0`.

- `--server-port INTEGER`
Specify the server port where the server will deploy.
- `--server-port INTEGER`
Specify the server port where the server will deploy.
Default: `10001`.

- `--tunnel-service TEXT`
Specify the tunnel service.
- `--tunnel-service TEXT`
Specify the tunnel service.
Default: `ngrok`.

- `--expose`
- `--expose`
Expose server to internet.

- `--server-url TEXT`
Specify the server URL that the client should expect.
Defaults to server-host and server-port.
- `--server-url TEXT`
Specify the server URL that the client should expect.
Defaults to server-host and server-port.
Default: `None`.

- `--llm-service TEXT`
Specify the LLM service.
- `--llm-service TEXT`
Specify the LLM service.
Default: `litellm`.

- `--model TEXT`
Specify the model.
- `--model TEXT`
Specify the model.
Default: `gpt-4`.

- `--llm-supports-vision`
- `--llm-supports-vision`
Specify if the LLM service supports vision.

- `--llm-supports-functions`
- `--llm-supports-functions`
Specify if the LLM service supports functions.

- `--context-window INTEGER`
Specify the context window size.
- `--context-window INTEGER`
Specify the context window size.
Default: `2048`.

- `--max-tokens INTEGER`
Specify the maximum number of tokens.
- `--max-tokens INTEGER`
Specify the maximum number of tokens.
Default: `4096`.

- `--temperature FLOAT`
Specify the temperature for generation.
- `--temperature FLOAT`
Specify the temperature for generation.
Default: `0.8`.

- `--tts-service TEXT`
Specify the TTS service.
- `--tts-service TEXT`
Specify the TTS service.
Default: `openai`.

- `--stt-service TEXT`
Specify the STT service.
- `--stt-service TEXT`
Specify the STT service.
Default: `openai`.

- `--local`
- `--local`
Use recommended local services for LLM, STT, and TTS.

- `--install-completion [bash|zsh|fish|powershell|pwsh]`
Install completion for the specified shell.
- `--install-completion [bash|zsh|fish|powershell|pwsh]`
Install completion for the specified shell.
Default: `None`.

- `--show-completion [bash|zsh|fish|powershell|pwsh]`
Show completion for the specified shell, to copy it or customize the installation.
- `--show-completion [bash|zsh|fish|powershell|pwsh]`
Show completion for the specified shell, to copy it or customize the installation.
Default: `None`.

- `--help`
- `--help`
Show this message and exit.
2 changes: 1 addition & 1 deletion docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@

.body {
font-weight: normal;
}
}
4 changes: 2 additions & 2 deletions hardware/light/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Please install first [PlatformIO](http://platformio.org/) open source ecosystem

```bash
cd software/source/clients/esp32/src/client/
```
```

And build and upload the firmware with a simple command:

```bash
pio run --target upload
```
```

## Wifi

Expand Down
2 changes: 1 addition & 1 deletion project_management/hardware/devices/jetson-nano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

![](mac-share-internet-v2.png)

d. Now the Jetson should have connectivity!
d. Now the Jetson should have connectivity!
1 change: 0 additions & 1 deletion software/.cursorignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
_archive
__pycache__
.idea

2 changes: 1 addition & 1 deletion software/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ target-version = ['py311']
[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
include_trailing_comma = true
5 changes: 2 additions & 3 deletions software/source/clients/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ Please install first [PlatformIO](http://platformio.org/) open source ecosystem

```bash
cd client/
```
```

And build and upload the firmware with a simple command:

```bash
pio run --target upload
```

```
44 changes: 22 additions & 22 deletions software/source/clients/esp32/src/client/client.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ const char post_connected_html[] PROGMEM = R"=====(
<head>
<title>01OS Setup</title>
<style>
* {
box-sizing: border-box;
}
body {
background-color: #fff;
margin: 0;
Expand Down Expand Up @@ -122,15 +122,15 @@ const char post_connected_html[] PROGMEM = R"=====(
input[type="submit"]:hover {
background-color: #333;
}
#error_message {
color: red;
font-weight: bold;
text-align: center;
text-align: center;
width: 100%;
margin-top: 20px;
margin-top: 20px;
max-width: 300px;
}
</style>
Expand All @@ -144,7 +144,7 @@ const char post_connected_html[] PROGMEM = R"=====(
<input type="text" id="server_address" name="server_address"><br><br>
</div>
<input type="submit" value="Connect"/>
<p id="error_message"></p>
Expand Down Expand Up @@ -270,7 +270,7 @@ bool connectTo01OS(String server_address)
portStr = server_address.substring(colonIndex + 1);
} else {
domain = server_address;
portStr = "";
portStr = "";
}

WiFiClient c;
Expand All @@ -281,7 +281,7 @@ bool connectTo01OS(String server_address)
port = portStr.toInt();
}

HttpClient http(c, domain.c_str(), port);
HttpClient http(c, domain.c_str(), port);
Serial.println("Connecting to 01OS at " + domain + ":" + port + "/ping");

if (domain.indexOf("ngrok") != -1) {
Expand Down Expand Up @@ -363,7 +363,7 @@ bool connectTo01OS(String server_address)
Serial.print("Connection failed: ");
Serial.println(err);
}

return connectionSuccess;
}

Expand Down Expand Up @@ -436,7 +436,7 @@ void setUpWebserver(AsyncWebServer &server, const IPAddress &localIP)
{
String ssid;
String password;

// Check if SSID parameter exists and assign it
if(request->hasParam("ssid", true)) {
ssid = request->getParam("ssid", true)->value();
Expand All @@ -446,7 +446,7 @@ void setUpWebserver(AsyncWebServer &server, const IPAddress &localIP)
Serial.println("OTHER SSID SELECTED: " + ssid);
}
}

// Check if Password parameter exists and assign it
if(request->hasParam("password", true)) {
password = request->getParam("password", true)->value();
Expand All @@ -458,23 +458,23 @@ void setUpWebserver(AsyncWebServer &server, const IPAddress &localIP)
if(request->hasParam("password", true) && request->hasParam("ssid", true)) {
connectToWifi(ssid, password);
}


// Redirect user or send a response back
if (WiFi.status() == WL_CONNECTED) {
String htmlContent = post_connected_html;
AsyncWebServerResponse *response = request->beginResponse(200, "text/html", htmlContent);
response->addHeader("Cache-Control", "public,max-age=31536000"); // save this file to cache for 1 year (unless you refresh)
request->send(response);
Serial.println("Served Post connection HTML Page");
Serial.println("Served Post connection HTML Page");
} else {
request->send(200, "text/plain", "Failed to connect to " + ssid);
} });

server.on("/submit_01os", HTTP_POST, [](AsyncWebServerRequest *request)
{
String server_address;

// Check if SSID parameter exists and assign it
if(request->hasParam("server_address", true)) {
server_address = request->getParam("server_address", true)->value();
Expand All @@ -490,7 +490,7 @@ void setUpWebserver(AsyncWebServer &server, const IPAddress &localIP)
{
AsyncWebServerResponse *response = request->beginResponse(200, "text/html", successHtml);
response->addHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // Prevent caching of this page
request->send(response);
request->send(response);
Serial.println(" ");
Serial.println("Connected to 01 websocket!");
Serial.println(" ");
Expand All @@ -502,7 +502,7 @@ void setUpWebserver(AsyncWebServer &server, const IPAddress &localIP)
String htmlContent = String(post_connected_html); // Load your HTML template
// Inject the error message
htmlContent.replace("<p id=\"error_message\"></p>", "<p id=\"error_message\" style=\"color: red;\">Error connecting, please try again.</p>");

AsyncWebServerResponse *response = request->beginResponse(200, "text/html", htmlContent);
response->addHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // Prevent caching of this page
request->send(response);
Expand Down Expand Up @@ -622,7 +622,7 @@ void InitI2SSpeakerOrMic(int mode)
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 1, 0)
.communication_format =
I2S_COMM_FORMAT_STAND_I2S, // Set the format of the communication.
#else
#else
.communication_format = I2S_COMM_FORMAT_I2S,
#endif
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
Expand Down Expand Up @@ -779,17 +779,17 @@ void setup() {
Serial.begin(115200); // Initialize serial communication at 115200 baud rate.
// Attempt to reconnect to WiFi using stored credentials.
// Check if WiFi is connected but the server URL isn't stored

Serial.setTxBufferSize(1024); // Set the transmit buffer size for the Serial object.

WiFi.mode(WIFI_AP_STA); // Set WiFi mode to both AP and STA.

// delay(100); // Short delay to ensure mode change takes effect
// WiFi.softAPConfig(localIP, gatewayIP, subnetMask);
// WiFi.softAP(ssid, password);
startSoftAccessPoint(ssid, password, localIP, gatewayIP);
setUpDNSServer(dnsServer, localIP);

setUpWebserver(server, localIP);
tryReconnectWiFi();
// Print a welcome message to the Serial port.
Expand Down Expand Up @@ -823,7 +823,7 @@ void loop()
if ((millis() - last_dns_ms) > DNS_INTERVAL) {
last_dns_ms = millis(); // seems to help with stability, if you are doing other things in the loop this may not be needed
dnsServer.processNextRequest(); // I call this atleast every 10ms in my other projects (can be higher but I haven't tested it for stability)
}
}

// Check WiFi connection status
if (WiFi.status() == WL_CONNECTED && !hasSetupWebsocket)
Expand Down Expand Up @@ -865,4 +865,4 @@ void loop()
M5.update();
webSocket.loop();
}
}
}
Loading

0 comments on commit 79ee710

Please sign in to comment.