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 12-May 23)


By content type

See this member's


Sort by                Order  

#57225 Need some help with jagged array (2d array)

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

OK, so here's the problem.  You load the data into XBuffer, then you store a pointer to that bffer into InBuff, you load the next set of data into XBuffer and store the same pointer into the next element of inBuff, and so on.  One way to fix it would be to move the new of XBuffer into the loop.  As in:

    for (Y = 0; Y < Ymax; Y++)
    {
        Xbuffer = new byte[Xmax];  
        for (X = 0; X < Xmax; X++)
        {
          XBuffer[X] = buffer[X + Y * 4];
        }
        InBuff[Y] = XBuffer;
    }

The down side of this is that this will use up twice the amount of memory.  If you use the data from the initial buffer it would save the memory.




#57216 Need some help with jagged array (2d array)

Posted by jrlyman3 on 30 March 2014 - 02:28 AM in Netduino 2 (and Netduino 1)

I copied the example code and ran it (you obviously didn't since it has compile errors :) ) and it works fine.  I ran it both on the PC and the Netduino.  Here's the code I ran ... you must be doing something else.  Note that if you reuse the numbers1..3 arrays that will also change the values in the numbersArr.

        int[] numbers1 = { 101, 102, 103, 104, 105 };
        int[] numbers2 = { 201, 202, 203, 204, 205 };
        int[] numbers3 = { 301, 302, 303, 304, 305 };
        int[] temporary = { 401, 402, 403, 404, 405 };
        int [][] numbersArr = new int[3][];

        temporary = numbers1;
        numbersArr[0] = temporary;
        temporary = numbers2;
        numbersArr[1] = temporary;
        temporary = numbers3;
        numbersArr[2] = temporary;

        for (int i=0; i < 3; i++) {
            for (int j=0; j < 5; j++) {
                Debug.Print(numbersArr[i][j] + " ");
            }
            Debug.Print("\n");
        }



#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




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




#56637 How to convert hex value stored in string to binary in string?

Posted by jrlyman3 on 05 March 2014 - 03:27 AM in Visual Studio

I'm curious to see how you did that ... I'm always looking for a better way to do things ... could you post the code?




#56633 How to convert hex value stored in string to binary in string?

Posted by jrlyman3 on 04 March 2014 - 11:13 PM in Visual Studio

There are a number of useful string functions that are missing ... not to mention the StringBuilder class ... I would use some code like:

        String smsData = "31584C1E8bC160";
        String data = "";
        int bytePos;
        int charPos;
        int nibble0, nibble1, byteVal;
        int carryBits = 0;

        smsData = smsData.ToUpper();   // Not needed if digits will always be uppercase.

        for (bytePos = 0; bytePos < 7; bytePos++) {
            charPos = bytePos * 2;
            nibble0 = smsData[charPos] - '0' - ((smsData[charPos] >> 6) * 7);
            nibble1 = smsData[charPos + 1] - '0' - ((smsData[charPos + 1] >> 6) * 7);
            byteVal = (((nibble0 << 4) + nibble1) << bytePos) | carryBits;
            carryBits = (byteVal & 0x7F80) >> 7;
            data += ((char)(byteVal & 0x7F));
        }
        data += ((char)carryBits);
        Debug.Print("SMS Data = " + data + "\n");

--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 ....




#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




#57666 Send data from netduino 2 plus to a Service with xml serialization

Posted by jrlyman3 on 21 April 2014 - 01:46 AM in Netduino Plus 2 (and Netduino Plus 1)

XML is easy to generate ... I'd probably just create the XML string in the same way I

would generate an output string.  You could create a method for each XML tag to clean

it up a bit.  Of course, XML is so verbose it will reduce your performance quite a bit.

Are you sure you don't want to use JSON?  :) I don't know of any libraries to do that

either.

 

Note that if you try to connect to the server and it doesn't respond, your thread will hang,

and if its the main thread, you're done ...




#55795 Netduino Plus 2 and SerLCD LCD-09067

Posted by jrlyman3 on 01 February 2014 - 10:07 PM in Netduino Plus 2 (and Netduino Plus 1)

I don't think that power is an issue I run a 20x4 parallel display on my NP2 with no problem.  I did some experiments with a logic analyzer and your configuration works to send data out on D3.  The baud rate looks good too.  Note: I used a NP1 for the test but it should be the same :-).

 

According to the Sparkfun web site it should show a banner for half a second on power-up.  Do you see that?  Maybe the display is bad?  Maybe it's a 5V display, you're using the 3.3V pin for Vdd right?  May try 5V and see if you get the banner.




#55768 Netduino Plus 2 and SerLCD LCD-09067

Posted by jrlyman3 on 31 January 2014 - 07:52 PM in Netduino Plus 2 (and Netduino Plus 1)

I assume this is the LCD that Sparkfun is selling which uses 3.3V?  It sounds like a baud rate problem to me.

What code are you using to setup the SerialPort?  Are you setting the baudrate to 9600?  Are you hooked up 

to the right I/O pins?




#55811 AnalogInput - options when I need more than six?

Posted by jrlyman3 on 02 February 2014 - 05:27 PM in Netduino Plus 2 (and Netduino Plus 1)

You could try a multichannel (16) ADC chip that you can access over I2C like the LTC2498.  It's a 38 pin QFN so that might be a problem for prototyping and hobbyist use, but Digikey does have a $50 eval board.




#55822 Netduino Plus 2 and SerLCD LCD-09067

Posted by jrlyman3 on 03 February 2014 - 02:43 AM in Netduino Plus 2 (and Netduino Plus 1)

I'm glad to hear that the display is not dead. It still sounds like the baudrate to me.

 

Sparkfun says that you can send a control-R ('x12') in the first half second after the display powers up to reset the baudrate to 9600.  I think that the easiest way to do this is to use a continuous loop sending the 0x12 (serialLCD.WriteByte(0x12)).  Cycle power on the display a couple times and hope you get lucky.




#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




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




#56125 Socket

Posted by jrlyman3 on 16 February 2014 - 03:54 PM in Visual Basic Support

It seems like this should be easier ...

 

In C# I would set Socket.Blocking = false (which causes the Connect to throw an exception that I ignore), then call Socket.Poll to wait for the connect to finish, and then check if the socket is connected.

 

The following link shows a VB example that's not quite what you're looking for, but might get you headed in the right direction :).

 

  http://msdn.microsof...#code-snippet-2

 

Hope that this helps - 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




#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




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




#55940 SD Card Reading with External Power

Posted by jrlyman3 on 08 February 2014 - 07:39 PM in Netduino Plus 2 (and Netduino Plus 1)

I suggest that you get out your voltmeter and see what voltage the Netduino is seeing from the external supply.




#54996 USB input from barcode scanner to N2+

Posted by jrlyman3 on 30 December 2013 - 04:35 AM in Netduino Plus 2 (and Netduino Plus 1)

I got the Host USB shield from Sparkfun.  I hooked it up to an Arduino UNO (after installing the appropriate libraries, and adding a wire to the shield as described in the documentation) and it worked great with my generic barcode reader.  I then started to look at the Arduino code in preparation for porting it to the Netduino.  I decided that it was going to be quite a bit of work to port, and I put it on the back burner.

 

If you just want to support the scanner you don't have as much to port ... but, you have to figure out how it all works to know what you need and what you don't.

 

I suggest that you buy an Arduino and hook it up to the Netduino with a serial port.  It's a way to start, and who knows maybe someone will get around to porting the USB host library to C# in 2014 :-).

 

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




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




#57620 13.56Mhz RFID module - IOS/IEC 14443 type a

Posted by jrlyman3 on 18 April 2014 - 02:10 AM in Netduino Plus 2 (and Netduino Plus 1)

The link you supplied doesn't seem to work.  If your device is: http://www.seeedstud...KHz_RFID_Reader then it looks pretty simple, ground, +5, transmit, and receive.  You would use some code like:

 

       using System.IO.Ports;

    m_SerialPort = new SerialPort(port, 9600, Parity.None, 8, StopBits.One);

 

You can find information on SerialPort here: http://netmf.codeplex.com/ or just search on the web.

 

Have fun.

 

--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.