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.

jrlyman3's Content

There have been 65 items by jrlyman3 (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#59671 Powering the Netduino model 1

Posted by jrlyman3 on 12 August 2014 - 02:29 AM in Netduino 2 (and Netduino 1)

The specifications (http://www.netduino....duino/specs.htm) say 7.5 - 12 volts on the power connector (as opposed to the USB connector).

 

I usually run them at 9 volts.

 

3.7 * 2 = 7.4 which is a little short but it might work.




#59652 Trying to recreate Arduino Code for Netduino, running into issues.

Posted by jrlyman3 on 11 August 2014 - 02:31 AM in Netduino Plus 2 (and Netduino Plus 1)

I took a quick look and I think that you're missing:

        

IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, port);

 

before listener.Bind(localEndPoint);

 

Also, you should use listener.RecieveFrom() which will receive the data and tell you who it came from.  This works best with UDP since you can receive data from multiple hosts on the same socket (no connection).

 

John




#59536 Setting DHCP client ID on Netduino Plus 2

Posted by jrlyman3 on 04 August 2014 - 02:15 AM in Netduino Plus 2 (and Netduino Plus 1)

I believe the the Client ID (DUID) is an option and not part of the main DHCP header.  My guess is that you're right and it's not being send by the .NETMF client.  I couldn't find any documentation that says whether it is supported or not.  Let us know what you find out with WireShark.

 

John




#59426 LiquidCrystal for netduino

Posted by jrlyman3 on 29 July 2014 - 03:07 AM in General Discussion

I haven't wired up my 20x2 display yet, but as near as I can tell your wiring looks good.  When I started with my 20x4 display I didn't get anything because I didn't know that I needed to hook up the contrast, it looks like you've got that covered.

 

Looking at your code it looks good too.  One thing that I do differently is to call Clear() and SetCursorPosition(0, 0) after the Begin() call.  It shouldn't matter since Begin() calls Clear() itself, but I can't see any other issues.

 

Check that all of your connections are good.  Maybe it's a bad display ... it happens.  Try hooking up the back light I'm using a 39 ohm resistor between pin15 and +5, pin16 to ground.

 

John




#59314 NETMF SerialPort and "BreakState"

Posted by jrlyman3 on 20 July 2014 - 03:14 PM in Netduino Plus 2 (and Netduino Plus 1)

I thought that I ported this, but it wasn't me.  This code uses interrupts and seems to be fairly accurate if I remember correctly.   One thing that I changed was the SecretLabs.NETFM.Hardware.Netduino using statement since I'm using a Netduino Plus.  Enjoy.

 

John

 

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace HC_SR04
{
    /// <summary>
    /// Class for controlling the HC-SR04 Ultrasonic Range detector
    /// Written by John E. Wilson
    /// Version 1.1 - 2012/04/03 - Corrected constructor pin documentation
    /// Free to use, please attribute credit
    /// </summary>
    public class HC_SR04
    {
        private OutputPort portOut;
        private InterruptPort interIn;
        private long beginTick;
        private long endTick;
        private long minTicks;  // System latency, subtracted off ticks to find actual sound travel time
        private double inchConversion;
        private double version;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="pinTrig">Netduino pin connected to the HC-SR04 Trig pin</param>
        /// <param name="pinEcho">Netduino pin connected to the HC-SR04 Echo pin</param>
        public HC_SR04(Cpu.Pin pinTrig, Cpu.Pin pinEcho)
        {
            portOut = new OutputPort(pinTrig, false);
            interIn = new InterruptPort(pinEcho, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow);
            interIn.OnInterrupt += new NativeEventHandler(interIn_OnInterrupt);
            minTicks = 6200L;
            inchConversion = 1440.0;
            version = 1.1;
        }

        /// <summary>
        /// Returns the library version number
        /// </summary>
        public double Version
        {
            get
            {
                return version;
            }
        }

        /// <summary>
        /// Trigger a sensor reading
        /// Convert ticks to distance using TicksToInches below
        /// </summary>
        /// <returns>Number of ticks it takes to get back sonic pulse</returns>
        public long Ping()
        {
            // Reset Sensor
            portOut.Write(true);
            Thread.Sleep(1);

            // Start Clock
            endTick = 0L;
            beginTick = System.DateTime.Now.Ticks;
            // Trigger Sonic Pulse
            portOut.Write(false);

            // Wait 1/20 second (this could be set as a variable instead of constant)
            Thread.Sleep(50);

            if (endTick > 0L)
            {
                // Calculate Difference
                long elapsed = endTick - beginTick;

                // Subtract out fixed overhead (interrupt lag, etc.)
                elapsed -= minTicks;
                if (elapsed < 0L)
                {
                    elapsed = 0L;
                }

                // Return elapsed ticks
                return elapsed;
            }

            // Sonic pulse wasn't detected within 1/20 second
            return -1L;
        }

        /// <summary>
        /// This interrupt will trigger when detector receives back reflected sonic pulse      
        /// </summary>
        /// <param name="data1">Not used</param>
        /// <param name="data2">Not used</param>
        /// <param name="time">Transfer to endTick to calculated sound pulse travel time</param>
        void interIn_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            // Save the ticks when pulse was received back
            endTick = time.Ticks;
        }

        /// <summary>
        /// Convert ticks to inches
        /// </summary>
        /// <param name="ticks"></param>
        /// <returns></returns>
        public double TicksToInches(long ticks)
        {
            return (double)ticks / inchConversion;
        }

        /// <summary>
        /// The ticks to inches conversion factor
        /// </summary>
        public double InchCoversionFactor
        {
            get
            {
                return inchConversion;
            }
            set
            {
                inchConversion = value;
            }
        }

        /// <summary>
        /// The system latency (minimum number of ticks)
        /// This number will be subtracted off to find actual sound travel time
        /// </summary>
        public long LatencyTicks
        {
            get
            {
                return minTicks;
            }
            set
            {
                minTicks = value;
            }
        }
    }

    public class Program
    {
        public static void Main()
        {
            HC_SR04 sensor = new HC_SR04(Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7);

            while (true)
            {
                long ticks = sensor.Ping();
                if (ticks > 0L)
                {
                    double inches = sensor.TicksToInches(ticks);
                }
            }
        }
    }
}




#59243 NETMF SerialPort and "BreakState"

Posted by jrlyman3 on 16 July 2014 - 02:54 AM in Netduino Plus 2 (and Netduino Plus 1)

If you're interested I could dig up the software I was testing with.

 

It may be a bit messy,  But it's not too complex.  I think that I ported it from an Arduino library ...




#59242 Server to Client Communication

Posted by jrlyman3 on 16 July 2014 - 02:39 AM in Netduino Plus 2 (and Netduino Plus 1)

I guess that depends on how you define client and server :).

 

In my home automation system (just monitoring so far), the server is written in Java and runs on a Windows PC.  It monitors a collection of 1-wire sensors directly and it talks to a Netduino Plus (NP1) over ethernet that monitors my boiler, water header, and garage door (more to come).  The server configuration includes the IP address of the sensor client.  The server connects to the sensor client and asks for sensor data once per minute.  I plan to implement a locator protocol but haven't had time yet.  I have to admit that in this configuration the sensor client is really acting as a server ... but it all depends on how you look at it.

 

There are also user interface (UI) clients that connect to the server and subscribe to a data feed, which results in the client getting sensor data once per minute which it displays for the user (me).  I use some old laptops (one upstairs and one downstairs) as the UI clients, they make a great graphic display, and they were basically free.

 

I like to implement my own networking code, I've been thinking that I should try to come up with a simple system that could be easily extended for typical network sensors.  Maybe this fall I'll have time to do that.

 

Good luck, with your home automation.

 

John




#59197 NETMF SerialPort and "BreakState"

Posted by jrlyman3 on 13 July 2014 - 07:50 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Nathan,

 

I've played with the HC-SR04 and it seems to work pretty good, no soldering required :).

 

I haven't had time to put my project together yet ...




#59196 Automated Urban Garden

Posted by jrlyman3 on 13 July 2014 - 07:28 PM in Project Showcase

Wow that looks great!  What type of moisture sensor are you using?  How's it been working?

 

My PlantNanny (http://www.lymantech...nanny-part-one/) started giving me noise for the moisture level last week.  I pulled out the moisture sensor (a two prong fork like thing) and when I cleaned it off I found that the metal plating (probably copper) was completely corroded away.

 

Instead of buying a new one I took two pieces of #12 gauge copper electrical wire, secured them to the fork by wrapping some hookup wire around them, and soldered them to the sensor at the top of the fork.  It seems to be working, I guess we'll see how it goes.




#59059 Netduino plus 1 ethernet problem

Posted by jrlyman3 on 07 July 2014 - 01:18 AM in Netduino Plus 2 (and Netduino Plus 1)

So if you print out the [0] result of GetAllNeworkInterfaces() you would see NULL.

 

I find this interesting because I just bought a tplink tl-wr702n and see exactly the same problems with my NP1.  Of course it works just fine with my laptop :-).

 

I found one forum post that said the tplink wotks with the NP2 but not the NP1.  I'm going to do some more research, I'll let you know if I figure out anything.

 

What did you change in the router to get the lights on?

 

John




#59034 Control LCD Display

Posted by jrlyman3 on 06 July 2014 - 05:07 AM in Netduino Plus 2 (and Netduino Plus 1)

I suggest the you skip the .sln file and try to open the .csproj file.  And, as Wendo said make sure the NETMF is installed.  If t's installed then if you open a new project in VS, under Templates --> Visual C# --> Micro Framework you will see some Netduino templates.  Don't loose heart, it's a bit compicated to get everything set up at first ....




#59030 Simple Sensor Interface - SSI protocol?

Posted by jrlyman3 on 06 July 2014 - 02:47 AM in General Discussion

Frode,

 

I found a specification for the SSI protocol at: http://www.janding.f...fication_12.pdf if that helps.

 

I've been working on a protocol to read sensor data over TCP/IP (but I haven't made much progress since it's summer and I have a lot of projects to do on our house).  I think that I'll read through the SSI spec, it's always nice to follow a standard (when one exists).  It's going to be a fair amount of work to create a full implementation, but it's similar to what I was planning anyways ....




#58756 Pushover or Pushbullet Notifications from Netduino Plus 2

Posted by jrlyman3 on 17 June 2014 - 03:40 PM in Netduino Plus 2 (and Netduino Plus 1)

I think that you're stuck with some kind of server because: 1) your phone is not always connected to the internet, and 2) it's IP address will change based on how you're connected.  Even if that were not true the available apps are setup to work that way so you would have to write your own app otherwise.

 

If you're OK with writing your own app then I think you want your phone to poll your Netduino when it's connected to see if there is anything to notify you about.  That would require your Netduino to have a fixed IP address, or you have to use a server to get the IP address ...

 

If you're on your local WiFi then you could use a discovery protocol to find the Netduino.

 

Looks, like you've already got a good solution (except maybe privacy) ...

 

Email was too slow ... Mmmm, I guess I might have to learn more about these new methods :).

 

John




#58746 obstacle detection

Posted by jrlyman3 on 17 June 2014 - 02:32 AM in General Discussion

I like to use "breadboard jumper wires".  They come in M/F, F/F, and even M/M configurations.  You can get them from a bunch of vendors on Amazon for a few dollars.  One way to do a "Y" cable would be to cut a couple M/F cables in half, strip the ends, twist them together, solder it together, and shrink wrap it.  Use one male end (to plug into the Netduino) and 2 or more female ends to receive the wires from your devices.

 

Another way that I've done it is to solder a jumper wire with a male end to a piece of female header with 3 or 4 sockets.  Solder all the pins together and put some shrink wrap on it if you want.

 

Do you have a soldering iron?  I took a quick look on Amazon and I don't see any premade jumpers.

 

John




#58745 Pushover or Pushbullet Notifications from Netduino Plus 2

Posted by jrlyman3 on 17 June 2014 - 02:13 AM in Netduino Plus 2 (and Netduino Plus 1)

Why don't you use SMTP to send an email?  You could use email direct to your cellphone or use it to send the phone a text message.




#58732 obstacle detection

Posted by jrlyman3 on 16 June 2014 - 12:11 AM in General Discussion

If you're saying that you haven't been able to hook up both the LCD and the sensor because there is only one socket on the shield connector for 5V, then I've had the same problem.  My solution was to create a couple "Y" cables.  They allow me to connect multiple devices to the 5V, 3.3V and/or GND pins.

 

If that;s not what you're saying ... then say more ...

 

John




#58583 water quality monitoring system using wireless sensor

Posted by jrlyman3 on 06 June 2014 - 02:27 AM in Netduino 2 (and Netduino 1)

This is a lot of code to try and guess what caused the exception, especially since you didn't give us the entire output.  I would suggest using Debug.Print("Some message"); at different points in the program to pin down where the exception is occurring.  One guess is that maybe you need to add your event handler before you open the serial port.  All of the examples show it that way (and it works for me), but the API doc (http://msdn.microsof...y/hh401405.aspx) doesn't have much to say.




#58243 erase board netduino+2

Posted by jrlyman3 on 19 May 2014 - 02:11 AM in Netduino Plus 2 (and Netduino Plus 1)

Erase your Netduino Plus 2 by applying 3V3 power to the square gold ERASE pad under the digital I/O pin 0 while the Netduino is powered up.




#58207 How do I pause a while loop using the onboard button?

Posted by jrlyman3 on 18 May 2014 - 12:49 AM in Netduino Plus 2 (and Netduino Plus 1)

Of course, there are many (many) conventions ... I prefer the use of m_Button instead of _button.  This was promoted by Microsoft not sure if they still do.  You're never going to make everyone happy.  The important thing to me is to be consistent.

 

And have fun ....

 

John




#58206 water quality monitoring system using wireless sensor

Posted by jrlyman3 on 18 May 2014 - 12:41 AM in Netduino 2 (and Netduino 1)

odich,

 

Try adding the statement "this.turbidity.Refresh();" after you set the Text value.

 

John




#58189 Has anyone used Netduino Plus 2 with the e-Health Sensor Platform?

Posted by jrlyman3 on 17 May 2014 - 02:35 AM in Netduino Plus 2 (and Netduino Plus 1)

It's hard to tell from the web site (nice site) what resources of the Arduino that they're using.  But it looks like a lot of Arduino code to support all of those sensors.  So you would have a lot of C code to convet to C#.  Could be fun  :).  To determine what resources they're using you'll have to go through all of the Arduino C code.

 

I'm not sure why you want to use the Netduino i this case, but if I wanted to get this working quickly I would probably connect the Netduino to an Arduino with a serial port (UART) and create a set of Netduino functions that send a command over to the Arduino which would call the provided function and return the result to the Netduino over the serial link.  Then later I could replace that with a native Netduino implemetation.

 

John




#58188 Scaling Analog Ports

Posted by jrlyman3 on 17 May 2014 - 01:28 AM in Netduino Plus 2 (and Netduino Plus 1)

Fred,

 

I thinik that what you need to know is that the  0.5079 you are getting means 50.79% of your supply voltage.  So you're getting 0.5079 * 3.3 = 1.676v.    This started with NETMF 4.2.  Hope this helps.

 

John




#57701 Netduino plus OneWire

Posted by jrlyman3 on 23 April 2014 - 03:47 AM in Netduino 2 (and Netduino 1)

According to this thread http://forums.netdui...ge-8?hl=onewire OneWire does not work on NP1 with 4.2 (maybe 4.3).  I gave it a try anyways with an example I've run on a NP2 and I get the same exception as you do on the NP1.

 

Sorry,

 

John




#57698 Hang on socket connect

Posted by jrlyman3 on 23 April 2014 - 03:14 AM in Netduino Plus 2 (and Netduino Plus 1)

Chris,

 

I haven't started a list yet, but off the top of my head I miss:

 

  • StringBuilder class
  • Blocking and Connected properties of Socket class
  • List<> class and templates in general

My only other complaint is the lack of coherent documentation.

 

On the plus side the forums are great!

 

Thanks,

 

John




#57697 Hang on socket connect

Posted by jrlyman3 on 23 April 2014 - 03:09 AM in Netduino Plus 2 (and Netduino Plus 1)

Steve,

 

Glad that helped.  It turned out to be much more of a problem than I expected and it didn't fix my random freeze problem :( either.

 

If you are repeatedly creating and closing sockets on a Netduino it could be running out of socket resources, each closed socket hangs around for a while to support the TCP CloseWait time.  I haven't explored this on a Netduino, but it's one theory.  Have you tried keeping the socket to each peer open?  Do they need to be fully connected, or could connect them in a ring?  Or have one as the master?

 

I've read some posts that indicate some issues with the network, especially if there is a lot of traffic.  I'm thinking that a marginal power supply might also cause hang conditions.  If I come up with a solution I'll post it.

 

Good luck.

 

John





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.