Azure / azure-iot-explorer

Cross-platform UI for interacting with devices attached to Azure IoT Hub. This tool is meant for learning and testing, not for production environment.
MIT License
224 stars 71 forks source link

[BUG] Unexpected end of JSON - CD Message #598

Closed djaus2 closed 1 year ago

djaus2 commented 1 year ago

Describe the bug When sending CD message get "Unexpected end of JSON input"

To Reproduce Steps to reproduce the behavior:

  1. Go to 'The Explorer
  2. Configure for IoT Hub.
  3. Select the Device
  4. Click on "Cloud-to-device-message"'
  5. See error

Expected behavior Get an OK message.
FYI an OK Method message:

Successfully invoked method 'stop' on device 'Pico2Dev2' with response {"status":200,"payload":{"request_id":2,"mothod":"stop","parameter":"\"\""}}

but with CD Message got:

Failed to send message to device Pico2Dev2: Error: invalid json response body at https://pico2hub.azure-devices.net/devices%2FPico2Dev2%2Fmessages%2FdeviceBound?api-version=2020-06-30-preview reason: Unexpected end of JSON input

NB: Message is received OK on the device, Also no such error displayed when sendt form VS Code.

Screenshots

Bug

Desktop (please complete the following information):

djaus2 commented 1 year ago

Created a c# Console app as per https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-c2d#get-the-iot-hub-connection-string. It works OK with no errors. Have added some ack code to device upon reception of a CD Message and when Console app is set to DeliveryAcknowledgement.Full or PostiveOnly console app comes back with Success!

GKMesh commented 1 year ago

I am also having this issue

EgonRasmussen commented 1 year ago

I have the exact same problem! It works in VSCode, but not in Azure IoT Explorer. Please fix it. It's a wonderful tool - except the bug.

YingXue commented 1 year ago

Sorry for the delay of the release. The fix is now out: https://github.com/Azure/azure-iot-explorer/releases/tag/v0.15.5

djaus2 commented 1 year ago

Thanks, Yes all OK now. I was looking at building it myself an hour ago but this saves me. Yes is does work ,

David Jones Microsoft WinHEC/IoT/Embedded/App Development MVP Sportronics Australia @.**@.> https://davidjones.sportronics.com.au GitHub: djaus2https://github.com/djaus2 https://mvp.microsoft.com/en-us/PublicProfile/5000301?fullName=David%20%20Jones http://embedded101.com/Blogs/David-Jones @IoTMaestrohttps://twitter.com/IOTMaestro

From: YingXue @.> Sent: Tuesday, 24 January 2023 11:10 AM To: Azure/azure-iot-explorer @.> Cc: David Jones (MVP) @.>; Author @.> Subject: Re: [Azure/azure-iot-explorer] [BUG] Unexpected end of JSON - CD Message (Issue #598)

Sorry for the delay of the release. The fix is now out: https://github.com/Azure/azure-iot-explorer/releases/tag/v0.15.5

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-iot-explorer/issues/598#issuecomment-1401183206, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7U2EOERP23UP2YBUAHGD3WT4MUXANCNFSM6AAAAAATUMZBEM. You are receiving this because you authored the thread.Message ID: @.**@.>>

djaus2 commented 1 year ago

Updated package was posted just now and it does work!

From: Egon C. Rasmussen @.> Sent: Sunday, 22 January 2023 2:41 AM To: Azure/azure-iot-explorer @.> Cc: David Jones (MVP) @.>; Author @.> Subject: Re: [Azure/azure-iot-explorer] [BUG] Unexpected end of JSON - CD Message (Issue #598)

I have the exact same problem! It works in VSCode, but not in Azure IoT Explorer. Please fix it. It's a wonderful tool - except the bug.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-iot-explorer/issues/598#issuecomment-1399275073, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7U2EIO5GWYT3XQ6DWQSE3WTP7RDANCNFSM6AAAAAATUMZBEM. You are receiving this because you authored the thread.Message ID: @.**@.>>