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.

MarkNic's Content

There have been 22 items by MarkNic (Search limited from 26-April 23)


By content type

See this member's

Sort by                Order  

#49342 Adafruit NFC shield

Posted by MarkNic on 10 May 2013 - 04:44 PM in Netduino 2 (and Netduino 1)

Andy, gomore11,

 

Since the direct approach hasn't worked and technically the failures experienced seem to be a N+/N+2 issue I fired up another thread in that forum.  Hopefully more eyes will see it.

 

Mark




#49341 Apparent N+ and N+2 I2C differences

Posted by MarkNic on 10 May 2013 - 04:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Over in the Netduino/N2 forum several of us have been trying to get an Adafruit NFC shield working with Netduino using I2C.  After a lot of iterations it looks like there was success getting it working on a N+ board.  I, however, have a N+2 and cannot get the same source code to work (after changes made to reference the appropriate Netduino base assembly).

 

The other thread is @: http://forums.netdui...uit-nfc-shield/

 

We're hoping someone can provide some insight as to why the I2C code will work on the N+ board but not on the N+2.

 

Any help would be appreciated,

 

Mark




#49296 Adafruit NFC shield

Posted by MarkNic on 09 May 2013 - 01:57 PM in Netduino 2 (and Netduino 1)

Just as an FYI...

 

I sent Chris Walker a direct message a couple days ago around the N+ board working and the N+2 board not working (with the Adafruit NFC board using I2C) but haven't heard anything back.  In fact the UI indicates that he hasn't read it yet.  The message I sent requested that he look more closely at this thread since it looks like we've got some good data for investigating why the N+2 board can't read/write to the NFC board. 

 

Hopefully soon,

 

Mark




#49206 Adafruit NFC shield

Posted by MarkNic on 08 May 2013 - 03:49 AM in Netduino 2 (and Netduino 1)

If you are using a N+2 board and a shield designed for a arduino or Netduino don't you have to jumper the I2C pins from the N+2 dedicated pins to the ones used by the shield (analog pins 4-5: I2C SDA, SCL)?

 

I may be wrong but I've looked at the NFC board and the dedicated SDA/SCL pins have leads that run to the "MOSI" and "SS" connections which in turn go on to the other side of the board to pins A4 & A5. The jumpering seems to be there already.

 

Mark




#49178 Adafruit NFC shield

Posted by MarkNic on 07 May 2013 - 05:12 PM in Netduino 2 (and Netduino 1)

gomore11,

 

If I can get the N+2 board and the NFC card working I may be able to help.  I have a WP8 (Nokia) so I also want the recognition and data transfer to work.

 

Mark




#49086 Adafruit NFC shield

Posted by MarkNic on 06 May 2013 - 02:19 AM in Netduino 2 (and Netduino 1)

[font="arial, helvetica, sans-serif;"]Nice work Andy.[/font]

 

[font="arial, helvetica, sans-serif;"]My board must be bad.  I tried your code as well as mine and get the same result.  OR, there's a difference with Netduino Plus and N+2.  From your code, you must be using the N+ and mine is the +2 and no read or write for me.[/font]

 

[font="arial, helvetica, sans-serif;"]Also, you mentioned that reset/read/write is working.  Is the reset pin on your NFC board actually connected to something.  I looked closely at mine and it doesn't appear to have a lead going anywhere.  The 'RST' connection is right next to pin 3 but no lead to connects them.  Either way I don't think that has anything to do with my boards inability to work.  Just thought it was strange since all sample code I've see has the 'reset' method.[/font]

 

[font="arial, helvetica, sans-serif;"]Anyway, thanks again for all the research and passing on the info,[/font]

 

[font="arial, helvetica, sans-serif;"]Mark[/font]




#49065 Adafruit NFC shield

Posted by MarkNic on 05 May 2013 - 04:08 PM in Netduino 2 (and Netduino 1)

2Elemental,

 

First, nice job getting the card running.  That's awesome and I really appreciate all of your effort.

 

I've tried the change that you suggested and based on no other changes in my code I'm still getting the same no read/no write result.  Did you happen to change any other code?  If not then it may be my card that's failing rather than the code.

 

The bit shift fix suggests that the read and write addresses are the same since a single bit shift right would be a divide by 2 and the low order bit that made the address values different is gone.  Ultimately 0x48 and 0x49 end up in both of the constants as 0x24.  I guess it's possible that the board manages the difference internally but I didn't see anything in the documentation to suggest that.

 

Thanks again,

 

Mark




#47339 Adafruit NFC shield

Posted by MarkNic on 18 March 2013 - 05:41 PM in Netduino 2 (and Netduino 1)

Wanted to add some information to this thread. 

 

I have the Adafruit PN532 NFC card and have been attempting to get the Netduino Plus 2 card to talk to it using I2C since the NFC card comes configured for I2C.  I've tried isolating everything to figure out what is going on and cannot get the two to talk.  I've been able to trigger a reset of the card after installing a jumper on the card to connect pin D3 with reset but that doesn't help the communication.  I've even tried to run the NFC card with jumper wires from pins on the Netduino to the corresponding pins on the NFC card - this was just to make sure that no shorts on other pins were causing issues.

 

Every write transaction fails (returns 0 bytes written).  No interrupts are ever triggered.  I've made sure that the packet being sent is structured correctly although even a poorly constructed packet should write to the card it just wouldn't make the NFC do anything.  The problem here seems to be writing the bytes.  Reads are failing in a similar way.

 

Code I created to test is here: https://github.com/marknic/NetduinoNFC




#45438 Experimental Webserver Problem

Posted by MarkNic on 13 February 2013 - 03:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Good to know.  I did test it against content on my SD card and it did a good job of listing the files, folders and even the content of the file when selected.  That is great functionality for an app directly as well as debugging (seeing into files on the SD card without removing it and putting it into a PC).

 

Mark




#45355 Experimental Webserver Problem

Posted by MarkNic on 12 February 2013 - 03:56 AM in Netduino Plus 2 (and Netduino Plus 1)

Did you try the code I posted?  It had some other changes in it.  Most had to do with disposing of the object correctly.

 

Mark




#45318 Experimental Webserver Problem

Posted by MarkNic on 11 February 2013 - 04:38 PM in Netduino Plus 2 (and Netduino Plus 1)

Martin,

 

It appears to be a timing issue.  The reason it works in the VS debugger is probably because debugging is a cpu/time consuming set of operations and things in threads were getting done.  When you switch to the board alone, the delays aren't there and objects are being torn down before they are done responding.  Specifically, the response stream looks like it is being disposed of prematurely.  I was able to get it to fail on the code that was attempting to write to that stream.

 

I can get it to work fairly consistently by placing Thread.Sleep(20); right after you create your thread and start it up.  With that in place I could get it to respond on the board as well.  There are still times where the browser says no data came back but if you refresh it should show a response.  Also, it isn't throwing an exception so it keeps going.

 

I think you have a place to start that will let you test on the board but there's still a couple things that need to be figured out.  One big suggestion I have is to start using the "using" command on objects with a disposable/close interface such as sockets and streams.  With "using" you won't have to deal with closing/disposing and the GC.

 

BTW, I hardcoded the creation of the DateTime just for debugging purposes.

 

I've attached the app with the code that I updated.  Hope this helps,

 

Mark

 

Attached Files




#45316 TCP Basic Script

Posted by MarkNic on 11 February 2013 - 03:16 PM in Netduino Plus 2 (and Netduino Plus 1)

JoRu1407,
 

The error you're getting is that the http connection is dropping before the response comes back.  I'm just guessing but I expect the response from the Netduino is taking a long time.  Hard to say why with the info here.

I just loaded up the web server code from the site and tested it. The setled command worked as expected
on my machine:


    [*]http://10.0.0.39/setled/on and it responded immediately
    [*]Windows 8/VS 2012 (was using 2010 but loaded MF 4.3 last night so I used 2012 to test here)
    [*]Netduino Plus 2 - created a new NP2 solution/project and copied the code over to quickly make sure I had the right assemblies since the project on the web site was NP1
    [*]IE10/Chrome - both worked and responded with "[color=rgb(0,0,0);]You called SetLed with argument: on[/color]" and the board led lit up
    [*]I don't use firefox so no test there
    [/list]

    Mark




#44880 Getting Started with Netduino error in Chapter 5

Posted by MarkNic on 04 February 2013 - 02:41 PM in Netduino Plus 2 (and Netduino Plus 1)

With the newer frameworks for Netduino I believe they have changed the types for the digital and analog ports that don't match the book anymore.  In this case the AnalogInput parameters are looking for "AnalogChannel" values such as Cpu.AnalogChannel.ANALOG_0.  To see the list of possible values, delete the parameter portion of the call including the parens "(".  The type a open-paren, VS IntelliSense should show you a list of enumerated values that you can use.  Just match up the channel number with what it says in the book.

 

HTH




#44790 Odd behavior when debugging

Posted by MarkNic on 02 February 2013 - 10:54 PM in Netduino Plus 2 (and Netduino Plus 1)

I'm creating a fairly complex application using multiple classes to describe objects that I'm controlling through Netduino.  When you create public/private/static fields or properties that are input or output ports and hit a breakpoint in a debug session, and look at the values within the class, fields show up as "?" question marks with no values.

 

Simple example:

public class PortTest {

  public string AName { get; set; }

  public InputPort MyPort { get; set; }

  public PortTest() {

  MyPort = new InputPort(Pins.GPIO_PIN_D0, false, Port.ResistorMode.Disabled);

  AName = "testing";

  }

}

 

public static void Main() {

  var myport = new PortTest();

}

 

Set a breakpoint on the curly brace at the end of Main, run then look at myport.  You should see the AName property with the value of "testing".  After that, you should see just a "?".

 

Now, if you change the name of the AName property to Name in the class, you should see 2 "?".  You won't see Name because the values are shown alphabetically and anything after the port property isn't shown.

 

If you remove the line of code that actually new's up the input port, you will see MyPort = null and Name = "testing"

 

I've tested with N+ and N+2 on Windows 7 and Windows 8.

 

Is this a known issue or is there something I can do to make values show in debugging?  Now, I could prefix all my port field names with "Z" so they show up after all the other fields and I'll be able to see values while debugging - doable but clearly not that convenient.

 

Thanks,

 

Mark

 

 

 

 

 




#44789 TCP Basic Script

Posted by MarkNic on 02 February 2013 - 10:13 PM in Netduino Plus 2 (and Netduino Plus 1)

Your best bet is to go with a Web Server component. There are many out there. I played with a couple for a while and then created my own. For what you described, This one would probably do: http://www.schuurman...r-netduino-plus

 

Mark




#41319 WCF Rest Service Trouble

Posted by MarkNic on 10 December 2012 - 03:21 PM in Netduino Plus 2 (and Netduino Plus 1)

Cris, Could you narrow down your problem? What is/isn't working? Is it on the service side, is the netduino code throwing an exception or something else? Mark



#41196 N+2 and (not so) TinyCore

Posted by MarkNic on 07 December 2012 - 09:33 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi MarkNic,

Good info; thanks for sharing this.

Have you thought about changing to a System.Threading.Thread-based or System.Threading.Timer-based model?

Chris


That part of the code was originally part of a component that I didn't build and over time I've replaced all almost all of the functionality through different means. The timer was something I hadn't messed with because it was working. Unfortunately, until now I hadn't taken the time to review the impact of that one single "feature".

I had the same thought as you and created a new timer today by extending a Threading.Timer and it works great and Drops the code size by ~60K. Because of that, I think my app may even fit on a N+1. I'll try that later.

I wonder who's bright idea it was to name that assembly "TinyCore"? Whoever it was, I'm sure they're still giggling.

Mark



#41141 N+2 and (not so) TinyCore

Posted by MarkNic on 07 December 2012 - 02:27 PM in Netduino Plus 2 (and Netduino Plus 1)

I did a search and found other topics on TinyCore where the use of it balloons the size of the deployed application by 60+K. Looked like all the other threads were discussing the use on pre-N+2 boards which were smaller and therefore could not handle that much code. I just finished testing an app that I am trying to port from Gadgeteer over to the N+2. It should be able to handle the app because of the increased memory and speed. However, TinyCore is giving it problems. If you create a blank app and add a reference to TinyCore you should see the size jump to around 64K (even with no application code added) and when you try to deploy and run you'll see the error: Resolve: unknown type: Microsoft.SPOT.Touch.TouchGestureEventArgs Error: ff000000 It should also be around 64K - again, without adding any application code. Adding the Touch assembly to try to resolve the type only adds to the deployment size. I can't seem to find a way to get around the type resolution error. BTW, I'm not trying to use any of the touch or wpf features - just DispatcherTimer. I'm going to create a work around since this is a stopping point AND adding that much size to the app just for a timer doesn't make sense. It took me a while to figure out that the unknown type issue was simply the use of TinyCore so thought I would post here just in case someone else runs into a similar situation. Thanks, MarkNic



#40763 N+2 deploys, starts loading debugger then stops

Posted by MarkNic on 02 December 2012 - 06:41 PM in Netduino Plus 2 (and Netduino Plus 1)

For reference you should really be using the Pins enum (Pins.GPIO_PIN_D10) provided by SecretLabs.NETMF.Hardware.Netduino. The Cpu.Pin enum is relative to the pins on the uC not to the lables on the N+2.


Arron,

Yes, I get that. That's why I mentioned it in my post. The point of my last reply was just to point out the possible semi-destructive nature of a simple pin mismatch on the N+2 board that doesn't appear to occur on the N+1. If, for example, the Netduino assemblies threw an exception for pin references "outside of bounds", the board would not have locked up and I would have known immediately what the problem was.

Like I said, just an FYI,

Mark



#40758 N+2 deploys, starts loading debugger then stops

Posted by MarkNic on 02 December 2012 - 06:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Chris, Ok, apparently in my attempt to quickly test the board I pointed at the cpu pin (my stupidity + intellisense != good app). I get that the enumerated values are different so my bad. var myPin = new InputPort(Cpu.Pin.GPIO_Pin12, false, Port.ResistorMode.PullUp); One thing I did test though was running this same code (using the N+1 VS app template) on a N+1 and it stalled in the same way but does recover. That is, if I shut down the app and ping in MFDeploy it replies. If you run the code on the N+2 (using the N+2 VS app template) it locks up. MFDeploy can see the board but it won't reply to a ping and requires a reload of the firmware to get it going again. Like I said, I get that the pin mapping is different but if I had written the test with Cpu.Pin.GPIO_Pin3, the app would have run. Pin2 would really have the pin I activated so the app wouldn't have worked right but also wouldn't have locked to the point of having to reload the firmware. Just an FYI/Observation. Thanks for the support, Mark



#40710 N+2 deploys, starts loading debugger then stops

Posted by MarkNic on 01 December 2012 - 06:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Chris,

Thanks for getting back.

Are you redeploying an existing Netduino Plus 1 project to Netduino Plus 2?


No, a new N+2 specific VS project created (create an input port, try to read it, debug.print the result in a loop) and used in this experience. Although, as part of the testing, I did check and make sure the "non-plus" assembly was referenced and used. Always looks like the code is deployed but then freezes just before it starts to run. Like I mentioned, once the board stops, MFDeploy can't ping. All I can do to fix it is erase/reinstall the firmware.

I haven't gotten to the point where I do want to extend an application that now runs on a Gadgeteer device to also operate on the N+2 - now that it has the extended performance and memory. Kudos for that move BTW. Anyway, once I get passed deploy and debug, then I will worry about the migration. First things first.

Regards,

Mark



#40347 N+2 deploys, starts loading debugger then stops

Posted by MarkNic on 28 November 2012 - 03:03 AM in Netduino Plus 2 (and Netduino Plus 1)

Background: Own 2 N+ boards and have been working with them for quite a while. New N+2 and tried to load a simple app to do nothing more than read a couple digital pins. When I run it, VS starts to deploy and start the debugger but before any breakpoint is hit the app freezes. After that MFDeploy can see the board but when I ping: "Error: No response from device". Power off/on does not change things. Only recourse is to redo the firmware with DFU tools. That part works fine and I've done it over a dozen times trying to get the board to go but no joy. I initially thought the problem to be that I was running from Windows 8 so I moved over to a Win7 (32bit) machine but freezes just the same. ClrInfo.clrVersion: 4.2.0.0 ClrInfo.clrVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion: 4.2.1.0 SolutionReleaseInfo.solutionVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC SoftwareVersion.BuildDate: Nov 7 2012 I tried both USB drivers but MFUSB is currently installed. I can't get any further with it. Anyone with ideas or similar situations? Thanks, Marknic




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.