- Netduino Forums
- → Viewing Profile: Posts: CT1
Community Stats
- Group Members
- Active Posts 36
- Profile Views 11454
- Member Title Advanced Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
Posts I've Made
In Topic: M2Mqtt Library
22 July 2015 - 11:21 AM
I found an old example in the forum yesterday by Dan Anderson & I got it to work! So the answer is YES MQTT does work on the NetduinoPlus V1. Will need to figure out what I'm doing wrong on Paolo's version but for now I'm moving on to the other side of this project...the Android Phone
Thanks
In Topic: M2Mqtt Library
21 July 2015 - 12:30 PM
So back to my main problem. Is MQTT suppose to work on a NetduinoPlus v1 or am I just spinning my wheels?
Here's the error messages I'm currently getting
A first chance exception of type 'System.ArgumentException' occurred in System.dll
A first chance exception of type 'System.NotSupportedException' occurred in M2Mqtt.NetMf.dll
A first chance exception of type 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' occurred in M2Mqtt.NetMf.dll
An unhandled exception of type 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' occurred in M2Mqtt.NetMf.dll
In Topic: M2Mqtt Library
20 July 2015 - 10:07 PM
using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt.Messages; using System.Text; namespace netduinoplus.app { public class Program { public static void Main() { // create client instance //MqttClient client = new MqttClient(IPAddress.Parse("iot.eclipse.org")); //MqttClient client = new MqttClient("85.119.83.194"); //MqttClient client = new MqttClient("dev.rabbitmq.com", 1883, false, null); MqttClient client = new MqttClient("iot.eclipse.org", 1883, false, null); // register to message received client.MqttMsgPublishReceived += client_MqttMsgPublishReceived; client.MqttMsgSubscribed += client_MqttMsgSubscribed; client.MqttMsgUnsubscribed += client_MqttMsgUnsubscribed; client.MqttMsgPublished += client_MqttMsgPublished; client.Subscribe(new string[] { "sensor/temp" }, new byte[] { MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE }); client.Publish("sensor/temp", Encoding.UTF8.GetBytes("10.1")); var state = client.Connect("netduino_Client", null, null, false, 0, false, null, null, true, 60); /* float temp = 80; while (true) { // get temperature value... temp = temp + 1; // ...publish it to the broker client.Publish("sensor/temp", Encoding.UTF8.GetBytes("10.1")); mqttClient.Publish(MQTT_TEMP_TOPIC, Encoding.UTF8.GetBytes(temp.ToString())); Thread.Sleep(10000); } */ Thread.Sleep(Timeout.Infinite); } public static void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) { // access data bytes throug e.Message Debug.Print("Message: " + e.Message); } public static void client_MqttMsgUnsubscribed(object sender, MqttMsgUnsubscribedEventArgs e) { // write your code Debug.Print("Unsubscribed "); } public static void client_MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e) { // write your code Debug.Print("Subscribed "); } public static void client_MqttMsgPublished(object sender, MqttMsgPublishedEventArgs e) { // write your code Debug.Print("Published "); } } }
Ok, I'm making progress. I learned how to include M2Mqtt in the project using NuGet.
I've recoded the netduino piece following Paolo's examples but am having a problem connecting
A number of First Chance exceptions are coming up....
Can someone tell me the secret to getting Paste to work in this box?
Does MQTT work on the NetDuino Plus version 1?
thanks
In Topic: OneWire ALPHA
17 April 2015 - 11:18 AM
Thanks for the update I will definitely try this out!
In Topic: OneWire ALPHA
16 April 2015 - 01:31 PM
Michael, I just read thru this 9 page thread only to realize one wire probably doesn't work with NetduinoPlus v1 4.2
I am also thinking about moving over to the Raspberry Pi and was wondering if you would us Mono C#?
- Netduino Forums
- → Viewing Profile: Posts: CT1
- Privacy Policy