microsoft / azure-iot-developer-kit

A curated list of awesome Azure IoT Developer Kit projects and resources.
MIT License
94 stars 57 forks source link

DevKitTranslator - Error happened when translating: Azure Function failed #492

Closed michhar closed 4 years ago

michhar commented 4 years ago

Hi DevKit Folks,

Need some help with the Translator tutorial.

Summary: After setting up the AZ3166 for use in VSCode and following the DevKit Translator tutorial (https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-iot-devkit-az3166-translator), the Azure Function is failing according to logs after opening the serial port on device.

Error: After choosing a language, pressing B and speaking into the mic it is hanging at (shown on LCD):

"Recording... Release to send Max duration: 1.5 sec"

In addition, the open serial port, at the same time, shows a small message:

[Starting] Opening the serial port - COM4
[Info] Opened the serial port - COM4
Azure Function return value: -1
Error happened when translating: Azure Function failed

I've ensured I have these set appropriately:

       // Subscription Key of Speech Service
        const string speechSubscriptionKey = "";

        // Region of the speech service, see https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/regions for more details.
        const string speechServiceRegion = "";

        // Device ID
        const string deviceName = "";

I've ensured the Azure Function has the Application Setting of iotHubConnectionString set as well.

Reflashing and starting from scratch has produced the same results so it is repeatable on my end. Has anyone else experienced this issue?

Help great appreciated! Thanks!

zunhu commented 4 years ago

it is known issue. we are in investigating.

michhar commented 4 years ago

@zunhu Are there, by chance, any updates on this sample issue? Thanks.

xinyiz1226 commented 4 years ago

@michhar , this issue in under our radar. We will let you know when the issue is fixed.

DevScienceScope commented 4 years ago

I had this example previosuly working and tried to get it working again and i have encountered the same error.

I am getting the same error. I follwed the error back to HttpTriggerTranslator function and tried to output the status code and status message. to see what was happening as the Azure functions wasnt returning anything. I get the following output

`Azure Function return value: -1

Error happened when translating: Azure Function failed

536900604

1I1915111-1)1%1!11111

1 1�B�B�B�BC!C

`

`static int HttpTriggerTranslator(const char *content, int length)

{

if (content == NULL || length <= 0 || length > MAX_UPLOAD_SIZE)

{

Serial.println("Content not valid");

return -1;

}

sprintf(azureFunctionUri, "%s&&source=%s", (char *)AZURE_FUNCTION_URL, allLocalNames[currentLanguage]);

HTTPClient client = HTTPClient(HTTP_POST, azureFunctionUri);

client.set_header("source", allLocalNames[currentLanguage]);

const Http_Response *response = client.send(content, length);

if (response != NULL && response->status_code == 200)

{

return 0;

}

else

{

Serial.println(response->status_code);

Serial.println(response->status_message);

return -1;

}

}`

inessaid commented 4 years ago

Are there any updates on this issue ?

JerryYangKai commented 4 years ago

Hi, we have released workbench 0.10.15 and fixed the bug. You can create a new sample project and check it.

jara5499550 commented 3 years ago

Hi, I meet the same problem. So does anyone have good suggestions on this issue? Thannnnks!

jara5499550 commented 3 years ago

Hi, we have released workbench 0.10.15 and fixed the bug. You can create a new sample project and check it. Hi, I am new to explore the DevKitTranslator, and I encountered the same problem. I do have the very latest workbench version. But the problem is still, is there any suggestions on this issue? Thannnnnks a lot!