Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

CT1's Content

There have been 17 items by CT1 (Search limited from 11-July 19)


By content type

See this member's

Sort by                Order  

#63612 M2Mqtt Library

Posted by CT1 on 22 July 2015 - 11:21 AM in Netduino Plus 2 (and Netduino Plus 1)

So back to my main problem. Is MQTT suppose to work on a NetduinoPlus v1 or am I just spinning my wheels?


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



#63593 M2Mqtt Library

Posted by CT1 on 21 July 2015 - 12:30 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the tip on the paste, couldn't get it to work for anything yesterday.

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



#63587 M2Mqtt Library

Posted by CT1 on 20 July 2015 - 10:07 PM in Netduino Plus 2 (and Netduino Plus 1)

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

 

 

 

 

 

 

 

 

 




#63571 M2Mqtt Library

Posted by CT1 on 17 July 2015 - 10:57 PM in Netduino Plus 2 (and Netduino Plus 1)



public static void mqttSubscriber()
(   
    // create client instance
    MqttClient client = new MqttClient(IPAddress.Parse(MQTT_BROKER_ADDRESS));

    // register to message received
   client.MqttMsgPublishReceived += client_MqttMsgPublishReceived;
   string clientId = Guid.NewGuid().ToString();
   client.Connect(clientId);

   // subscribe to the topic "/home/temperature" with QoS 2
   client.Subscribe(new string[] { "/home/temperature" }, new byte[] { MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE });
}

   static void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e)
   {
     // handle message received
   }

I am trying to use the M2Mqtt Library written by Paolo which I downloaded from codeplex.

I extracted the library and added M2Mqtt as a Project to Solution Explorer.

 

In my main project I have added the code listed above.

I am getting an error saying MqttClient not found am I missing a directive or a reference?

 

This is the first time I have tried adding a library and I'm guessing I'm not doing it right, can someone point me in the right direction?

Thanks

 

 




#62168 OneWire ALPHA

Posted by CT1 on 17 April 2015 - 11:18 AM in Beta Firmware and Drivers

Thanks for the update I will definitely try this out!  




#62136 OneWire ALPHA

Posted by CT1 on 16 April 2015 - 01:31 PM in Beta Firmware and Drivers

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#?




#62112 1-Wire DS18B20 Does it work on a Netduino Plus 1?

Posted by CT1 on 14 April 2015 - 09:46 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

I've been reading thru tons of threads on the DS18B20 with the Netduino, but am confused as to whether it should or shouldn't work on a plus 1.  The firmware has been updated to 4.2  

 

I have added the Microsoft.SPOT.Hardware.OneWire to references and the sample code that I've found appears to build and deploy ok, but I get a  System.NotSupportedException on the first statement that accesses the OneWire Device   ... if (OneWire.touchReset() > 0)

 

In reading thru CW2's Alpha One Wire post I get the impression that his fix works on 4.1.1 but not 4.2 

 

Does anyone have this working on a Netduino Plus 1 with 4.2?

Thanks




#61535 LM35 & a PhotoCell

Posted by CT1 on 06 February 2015 - 01:09 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Ya

Ok then ... I've tried all kinds of combinations but it always comes back to needing a 3rd analog pin defined and connected to ground.

 

Current configuration is:

static SecretLabs.NETMF.Hardware.AnalogInput AP0_temperature = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO_PINS_A0);

static SecretLabs.NETMF.Hardware.AnalogInput.AP1_dummy = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO.PINS_A1);

static SecretLabs.NETMF.Hardware.AnalogInput.AP2_photo = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO.PINS_A2);

 

I've checked all the readings on the multimeter that I know how and everything seems ok. 

The temp sensor is giving me .23v and the photocell is 1.65v

 

Thank you for offering suggestions

Cyn




#61497 LM35 & a PhotoCell

Posted by CT1 on 03 February 2015 - 11:06 PM in Netduino Plus 2 (and Netduino Plus 1)

Hey Paul

Thanks for taking the time to ask me questions.  I'll answer as many as I can.

 

It's a simple LDR that I bought here www.jayconsystems.com/cds-photocell.light-sensor.html (no data sheet).

I have it connected to 3.3V with a 10K resistor across output & ground.  I followed instructions I found on adafruit.

 

The cell works in the dark & in the light but it does seem to have an affect on the LM35(? or is it the other way around?)

The photocell is only read when it gets a command from ThingSpeak (maybe once a day).  Most of the time it just sits there doing nothing.

 

The LM35 is attached to 5v and works fine when the Photocell is unplugged.

 

Just 10 minutes ago I added a second LM35 to my breadboard and attached it to analog pin4.  When I displayed the readings

A4 was 99F and A5 (the original LM35) was now 68F and holding steady. Aha! Then I plugged the A4 pin to ground and the original sensor is still holding steady and working like it should.  I think I was picking up your typing before you sent it.   ThankYou

 

I was thinking about moving the photocell to the 5v breadboard to see if that made a difference?

Thanks again

Cyn




#61445 LM35 & a PhotoCell

Posted by CT1 on 02 February 2015 - 12:30 PM in Netduino Plus 2 (and Netduino Plus 1)

Hey Bulletprooffool, thanks for the reply.  Not sure what you are asking regarding alternate paths?  I don't have anything configured or wired on the other analog pins.  Both devices work independently but not together.  I've tried several different LM35s getting same results.  Let me see about getting a picture.  Thanks




#61444 LM35 & a PhotoCell

Posted by CT1 on 02 February 2015 - 12:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Anything?  Anybody?




#61424 LM35 & a PhotoCell

Posted by CT1 on 31 January 2015 - 05:11 PM in Netduino Plus 2 (and Netduino Plus 1)

I have a ND+v1 using 4.2 firmware.  I have a LM35 temperature sensor wired to analog pin 5 and a photocell wired to analog pin 0.  The temperature sensor works great until I connect the PhotoCell then the temp immediately jumps anywhere from 10 to 30 degrees. 

 

The temperature sensor logic is throwing away the first reading and then averaging the next 10 readings and it's consistent and  accurate.

 

The photocell logic is triggered maybe once a day so it's not doing a lot of readings, it just has to be connected to bother the LM35.

 

I've read many articles but haven't been able to figure this one out.  Can anyone advise?

Thanks   




#61218 RF Link InterruptPort too slow for Weather Stations?

Posted by CT1 on 11 January 2015 - 05:16 PM in Netduino Plus 2 (and Netduino Plus 1)

I have a Netduino Plus v1 and multiple Acurite Temperature Sensors.  I have found a couple great threads that decode these sensors on an Arduino but not much on decoding these sensors on the Netduino.

 

After about 100 interrupts I see a message regarding allocation failed for 5 blocks messages, this leads me to believe the Netduino is to slow to handle all the interrupts(?) and maybe this is the reason I can't find Netduino examples.   

 

Can the Netduino be used by these sensors or am I just missing something? 

Thanks for your thoughts. 

 

 

 

 




#61040 PIR interrupt fires exact opposite

Posted by CT1 on 21 December 2014 - 10:48 PM in Netduino Plus 2 (and Netduino Plus 1)

I'm no expert but my PIR uses InterruptModes.InterrupEdgeLow and it works the way I expect it to.

Netduino Plus v1

Netmf 4.2

 

Hope that helped




#60585 Email SMTP ToolBox looking in wrong directory

Posted by CT1 on 30 October 2014 - 02:20 PM in Netduino Plus 2 (and Netduino Plus 1)

OK after more searching ......   I have tried other samples from the toolbox and they are working as expected.

Does anyone have the SMTP working?

Care to share what you did?

 

Thanks 




#60571 SMTP with .NET Micro Framework

Posted by CT1 on 29 October 2014 - 04:24 PM in Netduino Plus 2 (and Netduino Plus 1)

From this post reply #10

static IPAddress mailip = IPAddress.Parse("192.168.1.15")

 

Can anyone tell me what this line relates to?  More specifically what is this IP Address pointing to?

gmail?,   the posters PC?,  the posters Netduino?

 

I've tried all three but the netduino never comes back from the connect command.

Thanks




#60559 Email SMTP ToolBox looking in wrong directory

Posted by CT1 on 27 October 2014 - 10:17 PM in Netduino Plus 2 (and Netduino Plus 1)

I know this is gonna be one of those silly gotchas. 

 

I downloaded & installed .NET Micro Framework Toolbox from CodePlex using the installation file approach.

It appears to have installed correctly.  Then I added the sample code to my program and after awhile got the Using and References all set.

 

Deployed my program to the netduino Plus 1 in debug mode, when the code gets to SMTP_Client.Mailcontact... it can't find the source because it's looking in D:\projecten\garrcomm  .... which I'm pretty sure is Stefan's directory

 

How do I change it to look where I installed it?  Anyone know what I did wrong?

 

Thanks

Cyn

 

 

 

 

 





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.