Giter VIP home page Giter VIP logo

Comments (8)

JerryYangKai avatar JerryYangKai commented on May 24, 2024 1

Since this issue has no reply during a week. I close this issue.

from devkit-sdk.

JerryYangKai avatar JerryYangKai commented on May 24, 2024

Hi @lokijota , I need more information to resolve this issue, you can check if this connection string is correct frist. I suggest use workbench command in vscode to config this connection string for work around.

from devkit-sdk.

lokijota avatar lokijota commented on May 24, 2024

Hey Jerry,

here's how I got the device connection string:

1- Opened portal.azure.com
2- Accessed my IoT Hub
3- Clicked "IoT Devices" in menu section "Explorers"
4- Clicked the device I created (I call it "mx1") in the list of devices. The status is Enabled, Authentication Type = SAS, and columns "Last status update" and "Cloud do Device Message Count" are empty
5- In the detail page of the device, "Enable connection to IoT Hub" = Enabled.
6- Clicked the "Copy" icon to the right of the "Primary Connection String" field: HostName=myiothub.azure-devices.net;DeviceId=mx1;SharedAccessKey=mykey

Regarding using the Workbench, I struggled with understanding how it works. I have it installed in VS Code but when I launched the command to "Configure device settings", I ended up having to create a project which generated an .ino file. Where do I test the connection string?

I then followed the instructions here: https://docs.microsoft.com/en-us/azure/iot-hub/tutorial-connectivity and managed to succesfully test connectivity:

node SimulatedDevice-1.js "<the key I got from above>"
IoT Hub troubleshooting tutorial
Simulated device #1

Client connected

What other information can I provide?

PS: While trying to understand how to use the Workbench I noticed:

Where can one find documentation on how to use the IoT Workbench in VS Code?

from devkit-sdk.

JerryYangKai avatar JerryYangKai commented on May 24, 2024

@lokijota Hi, thanks for your suggestions. Let us come to the beginning. Have you tried this format?

# set_az_iothub HostName=xxxxx.azure-devices.net;DeviceId=mx1;SharedAccessKey=xxxx

I mean remove these quotes and check if it works.

For the second questions. You can follow this tutorials to try our workbench
https://docs.microsoft.com/en-us/samples/azure-samples/mxchip-iot-devkit-get-started/sample/

from devkit-sdk.

lokijota avatar lokijota commented on May 24, 2024

Hi Jerry. As per my initial message: "I tried running set_az_iothub passing the connection string without the commas and had the same result".

Issue is NOT closed, and there's people in other threads mentioning the same issue. Please re-open.

from devkit-sdk.

JerryYangKai avatar JerryYangKai commented on May 24, 2024

@lokijota Sorry about that, I have reopened this issue.
Fristly, I ran set_az_iothub over the serial interface in my mxchip (sdk version 1.6.5). This is my output log

************************************************
** MXChip - Microsoft IoT Developer Kit **
************************************************
Configuration console:
 - help: Help document.
 - version: System version.
 - exit: Exit and reboot.
 - scan: Scan Wi-Fi AP.
 - set_wifissid: Set Wi-Fi SSID.
 - set_wifipwd: Set Wi-Fi password.
 - set_az_iothub: Set IoT Hub device connection string.
 - set_dps_uds: Set DPS Unique Device Secret (UDS) for X.509 certificates..
 - set_az_iotdps: Set DPS Symmetric Key. Format: "DPSEndpoint=global.azure-devices-provisioning.net;IdScope=XXX;DeviceId=XXX;SymmetricKey=XXX".
 - enable_secure: Enable secure channel between AZ3166 and secure chip.

# set_az_iothub HostName=xxx.azure-devices.net;DeviceId=xxx;SharedAccessKey=xxx
INFO: Set Azure Iot hub connection string successfully.

#
************************************************
** MXChip - Microsoft IoT Developer Kit **
************************************************
You can 1. press Button A and reset to enter configuration mode.
        2. press Button B and reset to enter AP mode.

Wi-Fi xxx connected.
Now is (UTC): Mon Feb 24 03:02:21 2020

2020-02-24 03:02:23 INFO:  IoThub Version: 1.3.6

2020-02-24 03:02:30 INFO:  >>>Connection status: connected
2020-02-24 03:02:35 INFO:  >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
2020-02-24 03:02:36 INFO:  >>>Confirmation[0] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_OK
2020-02-24 03:02:41 INFO:  >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
2020-02-24 03:02:42 INFO:  >>>Confirmation[1] received for message tracking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK

This command do not need these quotes with connection string.

Secondly, you can use command in vscode to configure it, the link is here https://docs.microsoft.com/en-us/samples/azure-samples/mxchip-iot-devkit-get-started/sample/

And if someone have the same issue, we can talk together in this gitter https://gitter.im/Microsoft/azure-iot-developer-kit

from devkit-sdk.

JerryYangKai avatar JerryYangKai commented on May 24, 2024

Close issue without reply for seven days

from devkit-sdk.

andrewwhitten avatar andrewwhitten commented on May 24, 2024

I am getting exactly the same issue 9 months later. "Failed to send telemetry data: 400" - my connection string is correct, and I have tried with both 1.6.5 and 2.0.0 firmware

from devkit-sdk.

Related Issues (20)

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.