Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] case study using C# M2Mqtt Client library in scripting tool Winbatch

Last week I joined this mailing list on the subject of MQTT clients and Paho MQTT development.

The previous week I read Paolo Patierno's nice and clear article about the C# dotnet MQTT Client library (M2Mqtt) ( and I like to try using this for my domotica IoT project.

I installed using Nuget the M2Mqtt dotnet library package on my windows10 Pro (64b) development PC in order to publish a MQTT message using a Winbatch script. Winbatch support dotnet assemblies. The M2Mqtt package is installed in the Winbatch script directory using “nuget install M2Mqtt -o D:\Winbatch\Ontw”

After installing the M2Mqtt package I saw 6 subdirectories in the d:\Windows\Ontw\M2Mqtt.\lib\ directory. All containing different DLLs. I’m now confused which DLL I have to take to get the uPLibrary.Networking.M2Mqtt namespace and to define the object new MqttClient. I assume it is the M2Mqtt.WinRT.dll in the ..\lib\win81 subdirectory.

Maybe you can help me out, as I need some suggestions or advice to proceed from here on to get things working.

1) do I have to use regasm.exe to register the DLL using regasm.exe M2Mqtt.WinRT.dll /codebase

2) can I delete all the other libraries because they are meant for other platforms like Linux, WinPhone.. Also the ones in my D:\users\user\... directory.

3) whats is the best practice to save the M2Mqtt.WinRT.dll after I finished the Winbatch development and rolledout the complete script to my target Windows PC. Normally I store my own DLL's in the ..\bin directory of the application(s).

4) is there a complete example script in C# (mono) in order to publish a topic and payload message, which i can use as a starting point.

Beste regards, from the Netherlands,
Jan Willem Teunisse

P.S. I also posted a comment on the blog of the above mentioned article, Dominik of the HiveMQ team adviced me to contact therefore to join this mailing list.

Back to the top