-
Notifications
You must be signed in to change notification settings - Fork 59
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
Getting error while sending C2D message via Service Client. (Error: failed to send message: protocol error: received flow without next-incoming-id after session established) #88
Comments
We are using below modules package:
|
It might be the Transport you are using, your device might be blocking it, try to change it |
What do you mean by transport? |
Try setting your client like this |
does not it support 'amqps' protocol instead of http? |
Above code throws same previously mentioned error, even we tried with other 2 (WithLogger , WithTLSConfig) do you have any working examples? |
Show the error |
|
I think your issue is because you are using iotservice to send a message. This should be turned flow |
|
If IoTHub Device wants to send message (D2C), then it must use Device Client. |
Could you please provide working sample code of Service Client sender, if you have any? |
You're right. I read wrong |
yes, true. |
From Azure portal we can directly send a C2D message for specific device. And the device receives the data without any issue. But it works from Java Service Client |
is there any thing wrong with the amqp protcol version? |
Hey , if you have any sample code for that specific library for the C2D communication , then please provide , or any pseudo code ? |
Hi please give some updates about the above thread?? |
@amenzhinsky please have a look into the above issue in thread. |
Hi @pedrolemos4 please do some comment on the above thread , it's getting blocker for me |
Hi Folks ! |
is there any issue with AMQP getting this error only : received flow without next-incoming-id after session established |
Or is there some setting that needs to be configured in the IoT Hub to prevent this from happening? : protocol error: received flow without next-incoming-id after session established I would really appreciate if someone is able to jump on this one. |
|
in Azure/go-amqp/session.go file
above condition expects some uint32 type NextIncomingID I just made it to a hardcoded value '12345'. Now we got rid of this error. |
Do not know though, how to pass body.NextIncomingI value as non-nil while sending the message (C2D) |
Below is the code used to C2D (Service client Sender)
`package iothub
import (
"context"
"fmt"
"log"
)
// SendMessage sends a message to the specified IoT Hub device.
func SendMessage(iotHubConnectionString, deviceID, messageContent string) {
// Create a new IoT Hub service client using the connection string
client, err := iotservice.NewFromConnectionString(iotHubConnectionString)
if err != nil {
log.Fatalf("failed to create IoT Hub service client: %v", err)
}
}
`
The text was updated successfully, but these errors were encountered: