Code Monkey home page Code Monkey logo

judahpaul16 / gpt-home Goto Github PK

View Code? Open in Web Editor NEW
401.0 401.0 38.0 48.41 MB

ChatGPT at home! Basically a better Google Nest Hub or Amazon Alexa home assistant. Built on the Raspberry Pi using the OpenAI API.

Home Page: https://hub.docker.com/r/judahpaul/gpt-home

License: GNU General Public License v3.0

Python 55.79% HTML 1.60% TypeScript 26.33% CSS 7.31% Shell 5.97% Dockerfile 3.00%
ai async automation chatgpt docker fastapi home-assistant home-automation iot llm nginx nlp nodejs openai python raspberry-pi react speech-recognition spotify typescript

gpt-home's Introduction

Typing SVG

Judah Paul's GitHub Stats Top Languages

  • ๐Ÿ“– BS in Computer Science @ Georgia State University.

  • ๐Ÿš€ Currently building apps and pursuing enlightenment through philosophy.

  • Hiย  Please consider supporting my uncle's stem cell therapy by donating to his GoFundMe campaign.

Open Source Projects & Contributions
Project Name Stars Technologies
COVID Tracking Stars Python Tkinter Matplotlib Pandas Numpy GNUPlot
Hackermans Stars PhaserJS NodeJS Webpack TypeScript
GPT Home Stars RaspberryPi Python FastAPI React NodeJS TypeScript
OpenAI API Spotify API Philips Hue API OpenWeatherMap API
GNU Bash SystemD NGINX Docker
Employee Time Clock Stars React Express NodeJS Javascript TypeScript NeDB
VROOM Stars Python Flask Javascript jQuery Node.JS Webpack
Three.js Blender OpenGL SQLAlchemy
Python-Voipms Python Requests VoIP.ms API
Karnaugh Map Generator Stars React Express NodeJS Python TypeScript
Artfolio Stars Dart Flutter SQLite Disqus
Dirconfig Stars Python YAML UrBackup API
Social Media Analytics Stars Python Tkinter Requests BeautifulSoup Selenium
Python-UrBackup Stars Python Requests UrBackup API
Clear Badge Cache Stars Go cURL GNU Bash Powershell
Clear-Badge-Cache.com Stars Go HTMX HyperScript GNU Bash NGINX Docker
Closed Source Projects
Project Name Technologies
FluidVoIP.com Python Django HTMX HyperScript jQuery Postgres SystemD NGINX
VoIP.ms API Stripe API PayPal API ReCAPTCHA WeasyPrint Jinja Docker
Atlexecpm.com React Express NodeJS TypeScript ReCAPTCHA
JudahPaul.com PhaserJS NodeJS Webpack TypeScript Python Gymnasium
MadPolls.com React NodeJS TypeScript Tailwind CSS PocketBase Vite NGINX Docker
MAV Manager SvelteKit NodeJS TypeScript Tailwind CSS PocketBase Vite NGINX Docker

gpt-home's People

Contributors

judahpaul16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpt-home's Issues

Web interface event log sometimes truncates logs

I was able to build everything without any errors! I had to run an "apt --fix-broken" though as libflac12 had a number of dependencies to correct and install.

Now, I am getting these messages in the log (assuming that the wake word is "computer" - I don't get a response):

INFO:functions:Timed out, waiting for phrase to start...
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):
ERROR:functions:Listening timed out: Traceback (most recent call last):

Originally posted by @brainhig in #12 (comment)

image

ERROR: "docker buildx build" requires exactly 1 argument.

When I run "./setup.sh" I get the following error:

Building Docker image 'gpt-home' for ARMhf...
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
Docker build failed. Exiting...
cosmo@cosmo:~ $ 

Issues using on Google Wifi

System kept reporting "Network not connected. Retrying..." while connected to wifi. Turns out my Google wifi blocks ICMP and there is no way to enable it.

As a workaround I changed the following in common.py from this:

def network_connected():
return os.system("ping -c 1 google.com") == 0

to this:

def network_connected():
return 1

--samd

Troubleshooting `avahi` service failure on AlmaLinux

image

root@almalinux:/app# apt show dbus-daemon
Package: dbus-daemon
Version: 1.14.4-1ubuntu1
Priority: important
Section: admin
Source: dbus
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Utopia Maintenance Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 457 kB
Depends: dbus-bin (= 1.14.4-1ubuntu1), dbus-session-bus-common (>= 1.14.4-1ubuntu1), libapparmor1 (>= 2.8.94), libaudit1 (>= 1:2.2.1), libc6 (>= 2.34), libcap-ng0 (>= 0.7.9), libdbus-1-3 (= 1.14.4-1ubuntu1), libexpat1 (>= 2.1~beta3), libselinux1 (>= 3.1~), libsystemd0
Breaks: dbus (<< 1.13.18-2~)
Replaces: dbus (<< 1.13.18-2~)
Homepage: https://dbus.freedesktop.org/
Task: minimal, server-minimal
Download-Size: 114 kB
APT-Manual-Installed: no
APT-Sources: http://ports.ubuntu.com/ubuntu-ports lunar/main arm64 Packages
Description: simple interprocess messaging system (reference message bus)

System information:

[almalinux@almalinux ~]$ cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.4 (Seafoam Ocelot)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.4 (Seafoam Ocelot)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
SUPPORT_END=2032-06-01
[almalinux@almalinux ~]$ uname -a
Linux almalinux.local 6.1.31-v8.1.el9 #1 SMP PREEMPT Wed Jun 14 12:18:16 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
[almalinux@almalinux ~]$

First time running `setup.sh` fails due to the session not recognizing the user as part of the `docker` group

I thought I'd try a fresh install to see if it made any difference. Before I was using Ubuntu Server LTS - whatever the newest one is on the Raspberry Pi Imager.

So I did a fresh install (using RPi Imager) and selected Ubuntu Server 23.10 64bit. I added settings for Wifi and SSH into RPi Imager so that the install would contain them already.

Then I booted up, SSH'd in, and all I did was:

  • Ran sudo apt get update
  • Installed raspi-config
  • Ran raspi-config, and changed audio output to Phono
  • Tested audio output successfully with speaker-test

Ran:

echo "export OPENAI_API_KEY='my api key'" >> ~/.bashrc
source ~/.bashrc
curl -s https://raw.githubusercontent.com/judahpaul16/gpt-home/main/contrib/setup.sh |
bash -s -- --no-build

At some point this failed with the error: "Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.32/containers/json: dial unix /var/run/docker.sock: connect: permission denied"

  • So I ran the command "sudo usermod -aG docker myusername" then rebooted the Pi

Then I ran this again:

echo "export OPENAI_API_KEY='my api key'" >> ~/.bashrc
source ~/.bashrc
curl -s https://raw.githubusercontent.com/judahpaul16/gpt-home/main/contrib/setup.sh |
bash -s -- --no-build

And this time it finished with no problems.

I connected to http://192.168.0.215 from a web browser on another machine, and the web interface comes up fine and lets me change options etc.

I tested by speaking to it, and all the same issues are still happening - no audio, and I can only give one command each time I restart the service, and I get the response when I click the service restart button.

Originally posted by @buffeh in #38 (reply in thread)

Troubleshooting `gpt-start` failing

Hi, i installed everything as explained but the command gpt-start keeps failing with result 'exit-code'

The web interfacce Is working, except for the settings Tab which Is not loading.

Thanks in Advance, you had a Greta idea!

Name Handle error is not defined

Updates, so after a few reboots I am able to get the mic to work (not sure how).
When I call it (wake word Cosmo), and ask for anything, it always says the same feedback on the speaker and on the OLED:

Heard <the question I asked>. Something went wrong. Name "handle_error" is not defined.

Please help?
Thanks!

Photos of case assembly

I ordered the full set of parts but spent longer than I'd anticipated on assembly and still not quite sure I have it right. Could you possibly post some additional photos from other angles? Possibly an assembly video?

Mic Error

Hi, I'm getting an error in the logs as below. The device says "Listening..." on the OLED but doesn't seem to be responsive otherwise.
I also tested the mic and speaker when putting the hardware together and both were fine. They now fail when I test them online (no mic) and the speaker only plays when issued in sudo mode. Not sure if this is related.

Error from web-interface event logs (it hangs and crashes so I'm unable to copy paste) but something along the line of:

ERROR:common:Listening timed out: Traceback (most recent call last)...

Any ideas please?
Thanks!

Troubleshooting OpenWeatherMap

I've got it working for the basic functionality, Thank you SO much for your help and quick response!

Now I'm having issues with Open Weather API. Sorry, I'm testing one thing at a time. Please let me know if you want me to start new issues for anything new.

SUCCESS:functions:Heard: "whats the weather in santa fe new mexico"
ERROR:functions:Error: Traceback (most recent call last):
File "/home/ubuntu/gpt-home/functions.py", line 323, in open_weather_action
response = await session.get(f"https://api.openweathermap.org/data/3.0/onecall?lat={coords.get('lat')}&lon={coords.get('lon')}&appid={api_key}&units=imperial")
AttributeError: 'NoneType' object has no attribute 'get'

SUCCESS:functions:Something went wrong. 'NoneType' object has no attribute 'get'

Originally posted by @brainhig in #12 (comment)

Can't get microphone to pick up when using USB speakers and USB microphone

I'm using a USB sound device to connect a couple small speakers (https://a.co/d/05CPIVYZ) and a USB microphone, mostly due to the long cord (https://a.co/d/00JrdQhD) and for the life of me I can't get the microphone to pick up.

I'm able to hear sound with aplay on both the host and in the container, and can record using arecord. I've had to modify my /etc/asound.conf to get to this point. This is currently what I have:

# Output device (hw:1)
pcm.!default {
    type plug
    slave.pcm {
        type hw
        card 1
    }
}

ctl.!default {
    type hw
    card 1
}

# Input device (hw:2)
pcm.input {
    type plug
    slave.pcm {
        type hw
        card 2
    }
}

ctl.input {
    type hw
    card 2
}

Here's the output of aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Device [USB PnP Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And the output of arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: Microphone [USB Lavalier Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I've tried modifying common.py line:
engine.setProperty('alsa_device', 'hw:Headphones,0')
to a few different things. I'ved tried hw:Microphone,0 and plughw:2,0. Neither have worked.
The logs repeat over and over

INFO:common:Could not understand audio, waiting for a new phrase...

I'm hitting up against a brick wall at this point. I'm not sure what to try next. Any ideas?

Don't require i2c display

Can you make the i2c display optional? It's a nice to have feature at best, and requiring a specific i2c device is rather limiting.
Great project! Looking forward to using this once I get it set up once I disable the display code.

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.