Code Monkey home page Code Monkey logo

Comments (11)

PantherTheCat avatar PantherTheCat commented on June 15, 2024

I am experincing the same issue as @rileycrane @nextthingco commentor advised moving to python 3 instead may help, however when attempting to run main.py with python 3 i get an error that alsaaudio module is not found. I installed pip3 to run the install with pip3 which failed out stating that multiple items were not found.

"chip@chip:~/AlexaCHIP$ sudo pip3 install -r requirements.txt
Downloading/unpacking Wave>=0.0.2 (from -r requirements.txt (line 1))
Downloading Wave-0.0.2.tar.gz
Running setup.py (path:/tmp/pip-build-dol7oi7b/Wave/setup.py) egg_info for package Wave

package init file 'wave/__init__.py' not found (or not a regular file)
warning: no files found matching '*.gif' under directory 'doc'

Downloading/unpacking python-memcached>=1.50 (from -r requirements.txt (line 2))
Downloading python_memcached-1.57-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4.3 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3))
Downloading/unpacking wsgiref>=0.1.2 (from -r requirements.txt (line 4))
Downloading wsgiref-0.1.2.zip
Running setup.py (path:/tmp/pip-build-dol7oi7b/wsgiref/setup.py) egg_info for package wsgiref
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-dol7oi7b/wsgiref/setup.py", line 5, in
import ez_setup
File "/tmp/pip-build-dol7oi7b/wsgiref/ez_setup/init.py", line 170
print "Setuptools version",version,"or greater has been installed."
^
SyntaxError: Missing parentheses in call to 'print'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip-build-dol7oi7b/wsgiref/setup.py", line 5, in

import ez_setup

File "/tmp/pip-build-dol7oi7b/wsgiref/ez_setup/init.py", line 170

print "Setuptools version",version,"or greater has been installed."

                         ^

SyntaxError: Missing parentheses in call to 'print'


Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-dol7oi7b/wsgiref
Storing debug log for failure in /root/.pip/pip.log"

from alexachipdeprecated.

tobiasboyd avatar tobiasboyd commented on June 15, 2024

I have been working on getting a cheap BT speaker/headset to act as the audio out/in, but if you haven't already, you might try switching from the jack to pins 10 and 12 on U14: http://docs.getchip.com/#pin-headers (to see if it's related to the cutting / soldering).

from alexachipdeprecated.

PantherTheCat avatar PantherTheCat commented on June 15, 2024

@tobiasboyd I am using 10 12, I also used the mic in/ hpcom as an attempt.
I have run this on 2 different CHIPS now - one that was using the TRRS mod, which i reversed and then seutp the jack through the header pins.
The second, I never did the mod, and used only the pins. (The second, gave me the same error once I ran the main.py and pressed the button/shorted GND - XPIO1)

I tried again using python 3, reinstalling everything Alsa & memcache specific for python 3 installation, while I no longer get the wave error, I get a new error stating

chip@chip:~/echo$ sudo python3 main.py
Traceback (most recent call last):
File "main.py", line 131, in
audio += data
TypeError: Can't convert 'bytes' object to str implicitly

from alexachipdeprecated.

tobiasboyd avatar tobiasboyd commented on June 15, 2024

@PantherTheCat : that error seems less mysterious, audio is implicitly cast to a str in line 126. Do you get the same error if that's audio = None ?

from alexachipdeprecated.

PantherTheCat avatar PantherTheCat commented on June 15, 2024

@tobiasboyd - I will see what happens when I try that modification. I have been working with another user who has made several code modifications that I was also going to attempt.

from alexachipdeprecated.

PantherTheCat avatar PantherTheCat commented on June 15, 2024

@tobiasboyd yes same error.

@jitto created a python 3 version that gets further. Although I still end with an error - Although the error is after the button is released, instead of on press - so that is progress 😸
https://github.com/jitto/AlexaCHIP

Traceback (most recent call last):
File "main.py", line 119, in
alexa()
File "main.py", line 99, in alexa
data = r.content.split(boundary.encode('utf-8'))
UnboundLocalError: local variable 'boundary' referenced before assignment

https://bbs.nextthing.co/t/turning-the-chip-into-an-amazon-echo/1630/33?u=panther

from alexachipdeprecated.

PantherTheCat avatar PantherTheCat commented on June 15, 2024

Figured it out, the TRRS jack mod was not scored deep enough, so it was not recording. Everything working now.

from alexachipdeprecated.

al-jimenez avatar al-jimenez commented on June 15, 2024

@PantherTheCat I am getting the same error. I am using a USB microphone numb and the TRRS jack for audio output. I would prefer not to modify and score the CHIP board. Is there a way of not getting this error if you DON'T modify the board? Python3, etc installed...

NOTE: I have audio capture working and audio output working with arecord/aplay, just get the same error when I run python main.py:

Traceback (most recent call last):
File "main.py", line 119, in
alexa()
File "main.py", line 99, in alexa
data = r.content.split(boundary.encode('utf-8'))
UnboundLocalError: local variable 'boundary' referenced before assignment

I don't want to modify the board unless I have to.

Thanks

from alexachipdeprecated.

bugduino avatar bugduino commented on June 15, 2024

I'm getting the same error with a bluetooth speaker/microphone, are there any progress?

from alexachipdeprecated.

zampy24 avatar zampy24 commented on June 15, 2024

I was having the same UnboundLocalError, and for me, it didn't seem to be related to the bit rate or other of some of the solutions out there. So, in main.py, I just put it in a Try block to handle the error and prevent it from crashing. Seems to be working so far... (note: having trouble with the indents....try: and except are at the same indent, everything else is the same, but pushed forward one indent)

try:
            data = r.content.split(boundary.encode('utf-8'))
            for d in data:
                    if (len(d) >= 1024):
                            audio = d.split(b'\r\n\r\n')[1]
            with open("response.mp3", 'wb') as f:
                    f.write(audio)
            os.system('mpg321 -q 1sec.mp3 response.mp3')
   except(UnboundLocalError):
            print('had an error')
            pass

from alexachipdeprecated.

renekliment avatar renekliment commented on June 15, 2024

This project is now deprecated in favor of the new AlexaPi (https://github.com/alexa-pi/AlexaPi) which has all the features of this project and much more, such as:

  • support for a wide range of devices and platforms (Raspberry Pi, CHIP, Orange Pi, desktops, Magic Mirror and others)
  • voice activation (great PocketSphinx support and snowboy support soon to be released)
  • much more robust installation and configuration
  • better security
  • Arch Linux support
  • awesome documentation
  • and much, much more! You get it - it's just awesome.

Please switch over to the new project and if your issue persists there, file an issue in the new repo's issue tracker. Thank you.

from alexachipdeprecated.

Related Issues (15)

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.