Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M5 Atom Echo not always working #114

Open
asetGem opened this issue Oct 26, 2022 · 6 comments
Open

M5 Atom Echo not always working #114

asetGem opened this issue Oct 26, 2022 · 6 comments

Comments

@asetGem
Copy link

asetGem commented Oct 26, 2022

Hi, I am trying to use a Atom M5 echo as a satellite for rhasspy. However, it does not work properly. Here are the behaviors I have (without changing any parameter):

What it does when it seems to work

  1. the atom echo led is blue
  2. when I pronounce the hot word, or click on the button, it turns red
  3. I say the command
  4. I can hear a little sound, probably signaling the end of recording
  5. in rhasspy web UI, I can see some text in the field "text to recognize", and, when it has recognized something, I have the corresponding intents.

What it does most of the time

Nothing sent

Steps 1 to 4 are as previously, but then, nothing seems to be received on rhasspy side

Nothing happens

The device stays in step 1.
Neither pushing the button or pronouncing the hot word does something.

When this happens, I have to unplug and replug the device.
This usually happens after 2 or 3 times working, so, very often!

What is my configuration

Rhasspy base

{
    "dialogue": {
        "satellite_site_ids": "AtomEcho",
        "system": "rhasspy"
    },
    "handle": {
        "satellite_site_ids": "AtomEcho",
        "system": "hass"
    },
    "home_assistant": {
        "access_token": "XXX",
        "handle_type": "event",
        "url": "http://192.168.XXX"
    },
    "intent": {
        "satellite_site_ids": "AtomEcho",
        "system": "fuzzywuzzy"
    },
    "microphone": {
        "pyaudio": {
            "siteId": "AtomEcho"
        },
        "system": "hermes"
    },
    "mqtt": {
        "enabled": "true",
        "host": "XXX",
        "password": "XXX",
        "site_id": "base",
        "username": "XXX"
    },
    "sounds": {
        "system": "hermes"
    },
    "speech_to_text": {
        "satellite_site_ids": "AtomEcho",
        "system": "kaldi"
    },
    "text_to_speech": {
        "satellite_site_ids": "AtomEcho",
        "system": "nanotts"
    },
    "wake": {
        "raven": {
            "keywords": {
                "custom_wakeword": {
                    "enabled": true
                }
            }
        },
        "satellite_site_ids": "AtomEcho",
        "system": "raven"
    }
}

Flashing Atom Echo

setting.ini :

[General]
hostname="rhasspy base ip"
deployhost="rhasspy base ip"
siteId=AtomEcho
device_type=0
network_type=0

[Wifi]
ssid="XXX"
password="XXX"

[OTA]
method=upload
password=OTApassword
port=3232

[MQTT]
hostname="same as in base config"
port=1883
username = "same as base config"
password=same as base config

Then, I plug it to my computer via USB, and flash it using pio run --target upload. Everything works well, it is transmitted until the end.

Satellite config

Once it has been flashed, the Atom Echo gets its own IP. I open it in my browser, and I have the following config:

image

I put "key press only" to simplify the tests. Testing wake word recognition will be when everything else is working...

Do not hesitate to ask me if you need more details.

@Romkabouter
Copy link
Owner

Hi @asetGem, thanks for the details.
The M5 turning red at point 2 is not OK, that means it crashes and reboots, did you use the latest code?
The sound at 4 is probably the small crackling you hear when booting. I expect you hear the same sound if you pull the plug and insert it again.
Your point 5 will send the TTS to the base, not the M5 so that is expected behaviour.
Your settings seem fine to me.

@asetGem
Copy link
Author

asetGem commented May 8, 2023

Hi again,

I did many tests and bought another Atom echo to check if it was not an issue with the first one...but still the same problem.

I still have the led turning red when I press the button, but this seems to be ok, as when it happens, audio is taken into account (although intent not always recognized but that's another problem).

But sometimes,

  • the led does not turn red (remains blue), and in this case nothing happens.
  • once it turns red, recognizes and sents the intent via mqtt, it remains red, and I can't do anything else than unplug/replug to reboot the system.

When I boot the system (=insert plug), the led is first green and then turns blue. Usually, the first try works as expected.

I used the main branch, cloned yesterday.

@jmorris644
Copy link

This is the exact scenario that I am experiencing. @asetGem Do you get response audio back on the AtomEcho? I do not.

@aperrin
Copy link

aperrin commented Dec 2, 2023

Nop, still nothing :(

@jmorris644
Copy link

I was thinking, if @Romkabouter is correct, and the red indicates a reboot, then maybe the command is getting sent to the server and then it crashes and misses the response because it is rebooting? The erratic behavior might also be explained as when it crashes. Somewhere in between packaging up the audio and sending it.

@jmorris644
Copy link

So, a little more playing around. I have been watching the serial console in VSstudio.

Here is the boot info:

Booting
M5Atom initializing...OK
Loading configuration
{
  "siteid": "AtomEcho",
  "mqtt_host": "192.168.x.x",
  "mqtt_port": 1883,
  "mqtt_user": "",
  "mqtt_pass": "",
  "mute_input": false,
  "mute_output": false,
  "amp_output": 0,
  "brightness": 25,
  "hotword_brightness": 80,
  "hotword_detection": 1,
  "volume": 100,
  "gain": 5,
  "animation": 0
}
Creating I2Stask
Enter WifiDisconnected
Enter WifiConnected
Connected to Wifi with IP: 192.168.x.x, SSID: xxxx, BSSID: FA..., RSSI: -48
Enter MQTTDisconnected
Connecting MQTT: 192.168.x.x, 1883
Enter MQTTConnected
Connected as AtomEcho
Connected to asynch MQTT!
Enter Idle
E (2482) I2S: i2s_driver_uninstall(1999): I2S port 0 has not installed

Which all looks fine.

Then I hit the button and did a command and got this:

Send ListeningEvent from toggleOff (dialogueSession)
Enter Listening
Send ListeningEvent from toggleOff (playAudio)
Samplerate: 44100, Channels: 2, Format: 1, Bits per Sample: 16, Start: 44
Send PlayBytesEvent
Send BeginPlayAudioEvent in PlayBytesEvent
BeginPlayAudioEvent in Listening
Enter ListeningPlay
Done
Send StreamAudioEvent
Send EndPlayAudioEvent in StreamAudioEvent
EndPlayAudioEvent in ListeningPlay
Enter Listening
Send IdleEvent from toggleOn (playAudio)
IdleEvent in Listening
Enter Idle
Send IdleEvent from toggleOn (dialogueSession)

Which as far as I can tell, looks fine as well.

If I let it error out without saying anything I get this:

Enter Listening
Send IdleEvent from toggleOn (playAudio)
IdleEvent in Listening
Enter Idle
Send IdleEvent from toggleOn (dialogueSession)
Send ErrorEvent from errorTopic
Enter Error
Send ListeningEvent from toggleOff (playAudio)
Samplerate: 44100, Channels: 2, Format: 1, Bits per Sample: 16, Start: 44
Send PlayBytesEvent
Send BeginPlayAudioEvent in PlayBytesEvent
BeginPlayAudioEvent in Error
Enter ErrorPlay
Done
Send StreamAudioEvent
Send EndPlayAudioEvent in StreamAudioEvent
EndPlayAudioEvent in ErrorPlay
Enter Error
Send IdleEvent from toggleOn (playAudio)
IdleEvent in Error
Enter Idle
Send IdleEvent from toggleOn (dialogueSession)

And I do hear the error sound.

At one point I was getting buffer underrun errors but I did not capture them and cannot reproduce now.
I still am getting the red led and am not seeing a reboot. So I think the red LED is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants