If using 126.96.36.199 version you realize that Connect and Disconnect events are not raised ... it is correct ... they are not handled in the client and you need to update the library or ignore them !
I released an update M2Mqtt library (version 188.8.131.52) that lays out this oversight.
Following the code merge between the M2Mqtt client library and the future GnatMQ broker I made the mistake of including the SUBSCRIBE, UNSUBSCRIBE, CONNECT and DISCONNECT messages handling also in the client (of course without any sense) with the corresponding events.
The update is available as always on Nuget and I proceeded to update the corresponding M2Mqtt4CE component for Windows Embedded Compact 2013.
Also this time an update arrives on time for my M2Mqtt library now reached to version 184.108.40.206 !
The main updates concerning better management of QoS Level 2 , some client properties exposed to the outside but especially the fact that it assessed and added some requests that I received by users that obviously thank you !
Also, in some parts of the source code you will see a compilation directive that is conditional on the definition of the symbol BROKER ... why ? I standardized the library code of M2Mqtt with the code of a MQTT broker that I am developing and which will shortly be released in beta version. Its name is GnatMQ and the project is already published online on CodePlex and then open source. Please note that currently it is still a version in development and not completely stable but the release is imminent !
In addition to updating the project on CodePlex , I updated its package on Nuget ( which has now passed 1000 downloads ! ), the code in the Microsoft Gallery and the project M2Mqtt4CE to in ...
Read the rest of entry »
We are to the last post of this tutorial that guides us through the creation of a proprietary component (using the M2Mqtt library as an example) for Platform Builder and its inclusion in the Windows Embedded Compact 2013. In this final post we will see how you can use this component in a sample managed application using also debugging.
SDK and Application Builder
When we build Windows Embedded Compact 2013 image that we have to provide to the software development team that will implement the high-level application for the target device, we must necessarily also make available its SDK. It contains all the header files and static libraries that developers can use to build applications in native code, avoiding the use of the APIs that we have not included in our image. Typically we would not need the SDK with managed applications based on .Net Compact Framework but unfortunately without any SDK installed, Visual Studio 2012 does not make available any templates for applications based on Windows Embedde ...
In the previous post, using the tool CEComponentWiz, we have created a custom component that is visible in the Platform Builder catalog items.
We used the assembly of M2Mqtt library compiled for .NET Compact Framework 3.9 and created the corresponding component that I made publicly available on CodePlex under the name M2Mqtt4CE !
M2Mqtt4CE : component description
This component can be useful to any OEM that should produce Windows Embedded Compact 2013 operating system image that has a client for MQTT onboard and developed with .Net Compact Framework 3.9. Assuming to be OEM, we can download the M2Mqtt4CE package from CodePlex and extract the contents to the \WINCE800\3rdParty folder (as described in the ReadMe.txt file attached).
The main files of the component are the following :
M2Mqtt.dll (located in the Resources folder) is the signed assembly of M2Mqtt library that is included in the image and registered in the GAC;
M2Mqtt.bib is the BIB file that determines th ...
My M2Mqtt open source library has finally come to version 3.0 with two important news !
In the first place, the operations of publish, subscribe and unsubscribe have become completely asynchronous. Until the previous version , the corresponding methods were synchronous even if the library raised related events on published message and subscription / unsubscription occurred. In particular , in the Publish() method the exchange of messages with the broker was run to ensure the required QoS ( PUBACK for QoS 1 , PUBREC , PUBREL and PUBCOMP for QoS2 ) while in the Subscribe() and Unsubscribe() methods handled the acknowledge ( SUBACK and UNSUBACK ). Now , these methods not bother to put a message in a queue and immediately return the message id itself , which is why there is a "breaking change" on the Subscribe() method that does not return the array with the "granted" QoS level. This array is still provided at the end of the asynchronous operation in the event args object of the corresponding event.
I tal ...
On Saturday 15th of February was staged the second edition of Microsoft Embedded Conference which was held at the Holiday Inn in Naples and organized by the DotNetCampania community (I am a member of it), TinyCLR.it and Embedded101, this community that is a reference on Windows Embedded of which, I’m a "board of directors" member since November 2013.
Also this year there was a good turnout of attendees even though it was Saturday, because the main topic was the Internet of Things and M2M Communication of which we hear persistently in the last period as the business of the future for the big network.
At 8:00, the team was ready for the preparations and organization in order to accommodate very well the attendees and ensure that the event will start on time. As with all events, we started with the keynote of our president Michele Aponte, who presented the community and to whom I have given ...
New release for my M2Mqtt library, MQTT client available for any platform based on .Net Framework (from the desktop to the micro via the compact), now at version 220.127.116.11 and as always is available on CodePlex and Nuget.
Bug Fix : message identifier no longer cross-broker
This time the update contains, among other things, an important bug fixes on the message identifier generation for PUBLISH, SUBSCRIBE and UNSUBSCRIBE messages provided by the MQTT protocol. In previous versions, the generation of this identifier was encapsulated in the base class of the hierarchy of messages, the MqttMsgBase, highlighting the anomaly of a message identifier increasing cross-broker, which was used the same variable (static) for the generation also if the client was instantiated multiple times in our application to connect to multiple different brokers. Obviously, the protocol provides that the identifier is bound to the client-broker pair, namely that it is unique for each connection to the broker.
.Net Compact Framework 3 ...
This time again with great pleasure, my M2Mqtt library (MQTT client for all versions of the. Net Framework) is mentioned in the "fardware friday post" on the blog Coding4Fun on Channel9 at the following link !
The post highlights the main latest features, support for security through SSL / TLS protocol and event management asynchronously. It is also highlighted my demo on the use of the MQTT client with 2lemetry platform.
The satisfaction is double in knowing that my work is attracting a lot of interest and that the library is increasingly being used. Obviously, this leads me to improve it and in fact approaching many surprises and improvements!
Now you can find numerous online platforms that offer the service of "device to the cloud," in order to acquire data from remote devices, save and expose them to other devices: one of these is 2lemetry.
It provides a RESTful interface over HTTP and an MQTT interface that we are going to use with the M2Mqtt client library.
First you need to register online :
At the end of the registration, you can log in to your account page and view some information, including the most important one is the "domain", which will be the root of all topics on which we are going to publish or receive messages via MQTT.
At this point we can move immediately to develop a simple application by choosing between all platforms supported by the M2Mqtt library (.NET Framework, .Net Compact Framework or. Net Micro Framework). In a real case, we use the Netduino Plus board with a temperature sensor (usually the TMP102 already widely used in previous posts and where the driver can be found in uPLibrary) to send the data collected onlin ...
The development of this project began in April of this year with the objective of filling the absence of a good MQTT client for all .Net platforms. After 6 months I did not expect an interest so strong against him, probably due to the wave of the Internet of Things that is coming (or is already among us ? ) .
Many people are using the library for projects of varying complexity , they send me mails ( with reports but also with compliments ) and open the "issue" on the CodePlex site , which I promptly resolve .
This can push me to get better and better the quality of the project , now arrived at version 2.3.0 with some bug fixes but also with an interesting new feature : all the events raised by the MqttClient class ( published message , the received message , ...) are executed in a separate thread , so the user no longer has to worry about launch "long" processing in his event handler through a new thread.
With this update, I hope to have made further improvements of great interest for those who ...
View this page in another language: