Questions tagged [mqttnet]

78 questions
1
vote
1 answer

Access to the database from MQTT receive message event in .net 6

I use MQTT (https://github.com/dotnet/MQTTnet) in my WebAPI project (.net 6) and need to check in the database when get message from MQTT, but can't and occur error Cannot access a disposed context instance. A common cause of this error is…
SajjadZare
  • 2,487
  • 4
  • 38
  • 68
1
vote
0 answers

Why does NuGet package reference incorrect .NET framework/standard?

tl;dr: I have a .NET Framework 4.7.2 project consuming a NuGet package which supports .NET Standard 2.0. That package, in turn, requires another package which supports .NET Standard 2.0. However, when run, the latter package uses net461 binaries…
Joe Schrag
  • 855
  • 8
  • 23
1
vote
0 answers

Solved: Cannot connect to MQTT Broker over TLS/SSL using MQTTnet library

I used MQTTnet library to connect to my server via TLS/SSL protocol but there was one issue related to configuration for MqttClientOptionsBuilderTlsParameters Class like this: "Cannot implicitly convert type…
Trang Phan
  • 11
  • 2
1
vote
0 answers

Is it possible to partition a MQTT topic with wildcard?

Is it possible to partition a MQTT topic defined with a wildcard? In short, I am trying to figure out if I can implement a subscriber that will scale without the need to redistribute messages. Here is what I mean. Let's say that I have a MQTT…
1
vote
1 answer

MQTTnet Connect Server to Non-Local Endpoints

I'm very new to MQTTnet, and I part of my program needs a MQTT broker to interact with a third-party MQTT client that may or may not listen on a local port. In case of a local port, all I need to do is to create a local MQTT broker based on examples…
sfeng
  • 93
  • 1
  • 7
1
vote
0 answers

How to correctly trigger an Async process when receiving a message via MqttNet?

We currently developing a set of .netCore console apps which reside on a remote server fed by mqtt message via MqttNet. Upon receipt of messages in the mqttClient we pass these along to various registered Actions. The actions being key'd on the…
Ross Halliday
  • 785
  • 6
  • 19
1
vote
1 answer

How to publish and subscribe files using MQTTnet C#

I'm working on sending files instead of strings to another client via MQTTnet by using C#. I want to send the files that contain delimited data. Here is an example of the file: Time Stamp Time Zone Fuel Category Gen MW 05/09/2018 …
chelsea
  • 21
  • 3
1
vote
0 answers

Creating MQTT SSL Broker C#

I want to create an MQTT Broker with certificate implementation. I used C# MQTTnet library using WithEncryptionSslProtocol and WithEncryptionCertificate Issue is I'm not able to connect to the broker once running. Here is my code : using…
Ronan65
  • 11
  • 1
1
vote
1 answer

MqttNet - MQTT Client cannot receive all the messages that were published by MQTT Server

I publish 1000 messages from an MQTT Server when a client subscribes to a topic. Some of the messages are not received by the MQTT Client. Is this a bug or am I implementing something wrong? Here are the server and client configuration…
karachai
  • 13
  • 1
  • 6
1
vote
0 answers

How to set up MQTTNET Broker in Asp.net Core

I started to getting to know on MQTT and found there is .Net library MQTTNET present. I could not find a documentation on setting up a broker with websocket enabled so I request to know if anyone can share a doc or a sample to start on this will be…
Raghu Hg
  • 21
  • 2
1
vote
0 answers

Client can't connet to mqtt broker with error : The remote certificate was rejected by the provided

In my MQTT broker when active TLS 1.2 client cant connect to broker and get this exception The remote certificate was rejected by the provided RemoteCertificateValidationCallback Note: I use self-signed certificate generated by openssl. Broker…
behroozbc
  • 1,992
  • 2
  • 12
  • 25
1
vote
1 answer

Config and Serilog sink with parameterised factory method

The package Serilog.Settings.Configuration supports use of Microsoft ILogger configuration settings with Serilog. "Console": { "LogLevel": { "Default": "Debug" } }, maps to this (if I understand…
Peter Wone
  • 17,965
  • 12
  • 82
  • 134
1
vote
2 answers

Trying to connect MQTT broker and try to receive messages from broker and display it into console

I am using a MQTT broker credentials to connect with the MQTT broker but my code always goes to the disconnected block of code. After that it shows me a error message like un-handling exception. I was done lots of research on this topic but i can't…
kamlesh jha
  • 361
  • 2
  • 8
1
vote
1 answer

Not able to connect with broker using MQTTNet library .net core

I need an help, I can't connect with the broker. I'm using MQTTNet library into my api project .net core this is my code: // GET: api/ [HttpGet] public void Get() { var options = new MqttClientOptionsBuilder() …
Mr. Developer
  • 3,295
  • 7
  • 43
  • 110
1
vote
3 answers

MQTTnet : Unable to connect With TLS : Interop+AppleCrypto+SslException: bad protocol version

I am a new .NET core user trying to learn how to connect a managed client with TLS on MacOS Catalina, using MQTTnet. I am trying to connect from ASP.NET Core 3 Background Service to a Mosquitto broker. Using MqttExplorer I am able to connect…
anon_dcs3spp
  • 2,342
  • 2
  • 28
  • 62