-
Notifications
You must be signed in to change notification settings - Fork 71
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
Random resets panic crash #13
Comments
I'm afraid the ping to prevent timeouts isn't implemented yet, so thats what happens. AWS closes the connection and the whole thing crashes. |
Ah i see. Will this be implemented anytime soon?
…On 4 January 2018 15:17:27 GMT+01:00, "Michael Böckling" ***@***.***> wrote:
I'm afraid the ping to prevent timeouts isn't implemented yet, so thats
what happens. AWS closes the connection and the whole thing crashes.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#13 (comment)
|
I've been meaning to do that since months, so probably not. :-) |
Ok. Please keep this issue open for now. I will ask a friend to have a look at it. He is much more a programmer than me. I will post back any findings or questions i have here.
…On 4 January 2018 16:51:11 GMT+01:00, "Michael Böckling" ***@***.***> wrote:
I've been meaning to do that since months, so probably not. :-)
I'm quite busy learning other tech stuff atm due to professional
obligations. Something like an asio timer task would have to be
implemented which sends the http2 ping packet, driven by the ESP32
hardware timers.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#13 (comment)
|
It looks like the ping is already implemented, but the timer never gets to 300s
I guess a better way would be to handle the disconnection and then just reconnect |
@flakeydabanana Would you know how to do that? I am not much of a programmer myself. |
@flakeydabanana I suppose you got that from components/nghttp_client/nghttp2_client.c? This is not used anymore, I should clean it up. I changed the programming model from threaded to async, as I needed to reclaim the stack memory. See components/asio/asio_http2.c. |
Is that whole file used for the "ping" function or is it a specific block? I couldn't find anything recognizable in there. |
I have implemented ping functionality fairly easy. Just i have to do some more test to see why code is crashing after about 50 minutes. @MrBuddyCasino If you wish i can post code or prepare PR. |
Nice! I suppose a PR is easiest. |
Based on your code i started this task in alexa.c:
to send GET request to this address: There is some more code involved, but i think you know what i mean. |
@chegewara I downloaded your fork of ESP32-Alexa and now get resets every 10 minutes or so, sometimes a bit longer. |
Hi @mano1979, yes my ping request code to keep connection open is pushed to github. I have one more addition in my code that is reconnecting when amazon server sends GOAWAY frame. I will try to clean my code and push it to github. Im guessing now, but maybe your code is crashing due to difference in sdkconfig. If you could provide info about decoded crash info then we can try to find a reason. I am using this to decode backtrace: Its quick and easy to use. |
@chegewara I tried to install the exception decoder but had trouble using it. however, this is what i got from the serial terminal on crash (and part of boot sequence)
|
There is not much info here. Thats why im using this tool (its arduino tool, but can be used with esp-idf). When you start this tool it will ask for elf file. That file is ESP32_alexa/build/elaxa.elf, then copy/paste this: Each time you recompile app and flash new bin you need to restart this tool. |
yep, got it
|
This is question to @MrBuddyCasino , i dont know this stack enough to say what its the reason. Ive got it too, but in my case its after about 50 minutes (now maybe even later). |
@chegewara Do you also have this issue that your voice is recorded in high speed? Do you have dual microphones or a single one? If dual, how did you wire them? |
@mano1979 I suspect this crash is due to some heap corruption or out of memory condition |
I am using ESP32 simple alexa board (newest version i think) and i dont have any issue with recording my voice, neither with 240MHz or 160 MHz. Its one mic board. To make alexa speak with right pitch i have to change this value to about 0.54: Its due to conversion from 44100 to 24000 (24000/44100). |
This is my latest log after about 5 hours or so (no longer crashing). Now i have to handle GOAWAY frame:
|
Is there something i could do about that? Does your ESP32 has more memory? (mine is 4MB standard esp-wroom module) @chegewara Wich microphone is your board using? I am using a ICS-43434. Are you using the sph0645? |
@chegewara That board is using the same microphone as me. so that is not the problem. I don't get it...... so i removed the entire repo from my harddrive and cloned it again to start with a fresh image. But no change..... How can it work fine before and not now while i didn't change anything? The code runs fine though, it is just the scrambled audio that is not recognized by the alexa servers. |
Can my issues have something to do with me using the internal dac as audio output? |
That could be it. I think the I2S interface is supposed to behave in the same way, but maybe its not. |
@mano1979 You can always try with this repo without changes ive made. Then you can confirm its issue with my code or not. |
@MrBuddyCasino I also saw an option called "PDM" in the audio output menu. What does that do? @chegewara Yes, i wil try that. But your code used to work fine before. So i doubt that the problem is in your code. |
I suppose its something with menuconfig options, or worst case scenario, broken hardware. |
@mano1979 PDM is an analog out option and theoretically a lot better than the 8 bit DAC, but nobody has yet figured out why it sounds so crappy. |
Wich pin is used for this output? |
Same pin I think. |
ok. Flashing now...... |
ok. sound has a lot of noise but overall not bad. But i still am not recognized. only if i talk real slow, alexa understands what i'm saying |
After trying the original code from "this" repo, i conclude that the issues i have with NOT beeing understood by alexa and the high speed audio from he microphone still are there. Also with this repo i used to have no issues with beeing understood. Even with the high speed microphone rec. (allthough it has never been THIS fast). Can my hardware setup , beeing on a breadboard , cause any capacitive issues? |
I have clue why this crash might happen. |
@mano1979 What is your log after alexa speaking? |
This is after me talking:
This is after Alexa talking:
|
@chegewara The above whas with the original code from Buddy. Below is the string with your fork:
|
Thats odd, only line i changed that can affect it is: Could you try with original value? |
I set that value to 1.0 and now i am understood by alexa again. (though int he android app my voice still sounds like a chipmunk at warp-speed) One question though. The playback speed in buddy's repo, is very fast (alexa's voice), but now i flashed your fork, he voice is still so fast, eventhough it was not before... i will check the code to see what hat is set to, just in case |
In this repo original value is 1.25 |
I set the value for speech playback to 0.75 since it was 1.0 in your fork and 1.25 in Buddy's code. It somehow looks like the flash migh not be overwritten correctly? |
changed 44100 to 24000 but the speech is now even faster. now i cannot even make up what she said. though.... It now sounds the same speed as my voice in the alexa android app |
Maybe both parameters need to be adjusted. Ive got lucky and after few minutes(i had to find parameter and see which way it needs to be changed) my board was ready to go. PS my alexa is working for about 2 hours and crashing because lack of RAM during refreshing token 2nd or 3rd time. Its literaly about 2-3kB short |
Ok. I will try to play with the values a bit. Good to see you keeping it alive for 2 hours. Mine still resets after 12 minutes. I'll keep you posted. |
I dont know if i should open new issue for this because its related. Finaly i managed to run over 2 hours. Here is set big stack for created task and i found that 6 * 1024 is enough: This is free ram amount when access token is refreshed after about 2 hours running(not much): |
There is one more part of code that is required to keep alexa alive (i cant make PR myself at the moment, sorry). Access token is valid only 3600 seconds and then amazon server is sending GO_AWAY frame. Again, its most likely not best possible solution, but it works for me:
|
thanks, merged that too |
The issue with GO_AWAY frame is that even if first works (after about one hour) next causes crash because lack of RAM. Ive found that some heap can be released as described here: As for now this seems to be enough to work for longer without crash. And MrBuddy, thanks for this great piece of code. All i am doing is paid project thats why i am trying to share info but i cant make too much PR's. |
I understand, thx. |
I dont want to open new issue just to show how it works (video on YT) and it is related to this issue(crash). Over 8 hours and still working:
The issue is memory leaking on access token refresh:
|
New ping version looks and works way better than last one and which is most important does not cause memory leak. I will try to find time and prepare clean PR with it. Here is how it looks like:
|
Like i promissed there is refactored ping event. PR is ready to merge. |
about every 10 to 15 minutes the code crashes and the esp32 is rebooted. Te histerical laugh almost giving me a heartattack. Crash report is below:
The text was updated successfully, but these errors were encountered: