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.

Mark Anderson's Content

There have been 25 items by Mark Anderson (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#55241 Sending data from netduino+ethernet/wifi shield to a sql server (MS) on the web

Posted by Mark Anderson on 07 January 2014 - 09:05 PM in General Discussion

You will need to create a web service to handle the SQL input.

 

I have created something similar using WCF REST. My netduino posts a JSON string to my service and then the service saves the values in the database.

 

Would you mind posting your solution (never done anything with REST or JSON before)




#55188 Ulrimate Netduino Shield

Posted by Mark Anderson on 04 January 2014 - 02:38 PM in Project Showcase

v2 of baord has been in design for the last few months,  will be able to show the new design by Feb.  Many imporvements and innovations

 

Cool. looking forward to it




#55187 Detect Dry Contact Closure

Posted by Mark Anderson on 04 January 2014 - 02:15 PM in General Discussion

Thanks Mario




#55186 Deploy via web

Posted by Mark Anderson on 04 January 2014 - 02:09 PM in General Discussion

Hi mark,

You could write a custom app using MFDeployEngine. Check out this command-line prototype we made for Mac and Linux--which would also work on Windows.

Or you could create a custom app like "Netduino Update" which flashes the board in bootloader mode. Or you could store the assemblies on a MicroSD card and then load them into RAM dynamically.

There are some additional methods which we're exploring for future versions of hardware/software (based in part on some work we're doing with AGENT)...and you could also hack into the Netduino firmware and build your own support.

Chris

 

Thanks Chris

 

This one sounds like the easiest option: "[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Or you could store the assemblies on a MicroSD card and then load them into RAM dynamically"[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]I think it would be a killer feature for the Netduino to have a mechanism to check an update location and be able to do this automagically[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Regards[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Mark[/color]




#55175 Deploy via web

Posted by Mark Anderson on 03 January 2014 - 11:19 PM in General Discussion

Hi Guys

 

I'm considering commercializing a project I'm working on. If I did, is there anyway to install updated via web (using a built-in web client: i.e. the user would have an option to check for updates and if available download and apply). 

 

I don't see any way to do this, but I'm wondering if I missed something. Is there another option other than a user having to know how to use MFdeploy?

 

Regards

 

mark

 




#55174 Detect Dry Contact Closure

Posted by Mark Anderson on 03 January 2014 - 11:13 PM in General Discussion

You may find a lot of examples in the Internet. Here are some pretty well explained (and far better than my English-surrogate):

http://www.all-elect...ic/debounce.htm

http://www.eng.utah..../debouncing.pdf

 

A good hardware debounce circuit (i.e. filter) actually prevents false transitions (both edges) on the input pin. That's important, because you are using the interrupt, and on every edge the handler is called. That is, a lot of useless overhead.

So, if you want to use the interrupt, I'd recommend to implement a good hardware debounce circuit (2nd link, fig. 3 is the best one).

 

Since you probably won't like adding lot of parts (especially whereas you have many buttons), I'd suggest to avoid the interrupt and use a trivial polling. Let a dedicated thread running for all the buttons polling, then filter in a full-software fashion the actual inputs.

I bet on the far lesser overhead than the dozens of interrupt callback calls.

 

Good luck!

 

Thanks mario. i can't really use polling for my application. If I can't figure out how to disable interrupts, I'll go with a hardware option

 

Regards

 

Mark




#55157 Detect Dry Contact Closure

Posted by Mark Anderson on 03 January 2014 - 02:19 PM in General Discussion

A mechanical contact/switch will always produce bounces, which last around the millisecond. The filter glitch is working around the microsecond, thus does not have effect.

You may actually get rid of the bounces in two ways:

  • add an external (hardware) filter;
  • add an internal (software) filter

If you want to use the interrupt you must add the hardware filter. The software filter is based on a periodic sampling, so you can't use the interrupt callback.

 

An external hardware filter is far better other than the software one, because it typically protects the I/O from spurious discharges, noise and whatever. However, it implies *at least* a resistor and a capacitor, and sometime the people don't like adding extra components.

Tell me whether the hardware filter would be fine for you, and I'll explain how to implement it.

 

Thanks Mario, I managed to solve it by recording the time I got the first interrupt and then ignoring others for 100ms. Not sure I understand why I can't use my software filter. when i get the interrupt, I record the time and process it. If I get another and time is less than 100ms from first i just ignore it (don;t run my calcs). That said, I'm interested in how to solve in hardware

 

Regards

 

mark




#55152 Input Debounce

Posted by Mark Anderson on 03 January 2014 - 01:54 AM in Netduino Plus 2 (and Netduino Plus 1)

In case someone is searching for this in the future, this is the very simple software glitch filter i talked about:

    public class Program    {        private static readonly InterruptPort Button1 = new InterruptPort(Pins.GPIO_PIN_D0, false, Port.ResistorMode.PullUp,                                                                Port.InterruptMode.InterruptEdgeLow);        private static DateTime Button1LastPushed;        public static void Main()        {            Button1.OnInterrupt += Button1_OnInterrupt;            // ... main loop        }        private static void Button1_OnInterrupt(uint data1, uint data2, DateTime time)        {            // glitch filter. events within 50 milliseconds of the first event are discarded            if (Button1LastPushed.AddMilliseconds(50) > time)                return; //         Debug.Print("Button 1 Interrupt");            Button1LastPushed = time;            // actions on interrupt here        }    }
Also, Mario, i definitively did read an application note for a microswitch that strongly advised against putting a "naked" capacitor across a switch because of damaging effects. If i can turn it up again (I don't recall where I found it ...) i'll link it here.

Also for the record, if someone wants to do the hardware debouncing "cleanly" it should be probably done like in this article (german text, the schematic should be understandable though) using a RC filter with a schmitt trigger. However, as software debouncing is so easy and doesn't require additional components, i just do that Posted Image Another useful bit of information in that (german) article is that switches usually bounce for up to 10ms, so the time constants for the debouncing (software or hardware) should be chosing according to that (and no human operates a switch 100 times a second anyway)

 

 

Thanks Stefan

 

Helped me out with my project  :D




#55151 Detect Dry Contact Closure

Posted by Mark Anderson on 03 January 2014 - 01:40 AM in General Discussion

Works great, but as expected, I get a lot of bounce.

 

Any idea how to disable interrupts until I've finished processing the first. For example, contact is made, I get an interrupt, I do a very small amount of processing (calculate time since last one), send message over IP or RS232 (not sure which yet) and then wait for more interrupts. Ideally, I'd like to disable interrupts from when I get the first one to about one second after it (without blocking), as any that are more frequent than every 10 seconds are duplicates. My interrupt handler should only take a few milliseconds.

 

I did try it with the glitch filter enabled but it seemed to make no perceivable difference (still got about 4-5 bounces)




#55150 Detect Dry Contact Closure

Posted by Mark Anderson on 03 January 2014 - 01:05 AM in General Discussion

That is the code for one of those "Auto-off" boxes where you flip a switch and a hand comes out and flips the switch back.  The response is pretty darn fast.  if you are doing one cycle every 10 seconds, that will work fine for you.  

 

And that setup follows both rising and falling edge.  So you can trigger from either state change.

Thanks!




#55144 ThingSpeak Twitter - Revisited, Cleaned up.

Posted by Mark Anderson on 02 January 2014 - 07:32 PM in Project Showcase

Here is a post on my blog: http://oz.heliohost....ith-thingspeak/ I plan to make a nice video of it sometime soon, I'll post it here when I do. I like ThingSpeak a lot so I think that I will be making more projects that use this service. If you guys have any requests feel free to ask via reply, and I'll see what I can do. *Updated and cleaned up the code. Please test and let me know if you encounter any bugs.

Can't find on your site. is it still there?




#55143 Ulrimate Netduino Shield

Posted by Mark Anderson on 02 January 2014 - 06:56 PM in Project Showcase

Thanks Noom, i expect the board alone to be about $20 but i am already designing v2 of board which will scalable and include optional wifi, gps etc

 

It will be focused to end users than developers..i would not call it a development board as i expect it to be used in a commercial environment...i will have enclosure for it as well.

 

Yes..i asked for the spelling to be corrected a long time ago but no response!

Any news on v2?




#55142 Using NeoPixels with Netduino Plus 2 - adafruit learning system

Posted by Mark Anderson on 02 January 2014 - 05:48 PM in Project Showcase

Would like to use these, but modifying firmware puts me off. How easy is it and what are the implications (upgrades, etc.)




#55141 Detect Dry Contact Closure

Posted by Mark Anderson on 02 January 2014 - 05:46 PM in General Discussion

Hi Guys

 

What's the easiest way to detect a dry contact state (I can use either NO or NC). it's a float switch and max frequency will be every 10 secs. Would like to use interrupt rather than polling and use on board power supply if possible.

 

Regards

 

Mark




#55137 Help understanding some C# for LED strip

Posted by Mark Anderson on 02 January 2014 - 02:03 PM in General Discussion

Here's the link

 

http://learn.adafrui...-led-strip/code

 

It does have info for the arduino and the libs, but I read this

 

"[color=rgb(82,82,82);font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;]Driving these strips from Netduino (or other .Net Micro Framwork boards like FEZ Panda) is very convenient and doesn't require a code library if SPI ports are used."[/color]

 

and assumed that the way you drove it from Netduino was totally different (i.e. not SPI). Guess I misunderstood

 

Regards

 

Mark




#55120 Help understanding some C# for LED strip

Posted by Mark Anderson on 01 January 2014 - 10:49 PM in General Discussion

Thanks a lot guys.

 

I got sample netduino code from adafruit. All it had was what's in original post.

 

I'd also scrapped the whole = 63 / 64 and used byte[3 * numLEDs] and it worked fine. (Would have made example much clearer in first place.)




#55101 Help understanding some C# for LED strip

Posted by Mark Anderson on 01 January 2014 - 02:29 PM in General Discussion

Hi Guys

 

I bought one of these: http://www.adafruit.com/products/306 and can drive it from netduino using the modified example code on the adafruit site:

using Microsoft.SPOT.Hardware;        public static void LightStripSpi()        {            var spi = new SPI(new SPI.Configuration(Cpu.Pin.GPIO_NONE,                false, 0, 0, false, true, 10000, SPI.SPI_module.SPI1));            var colors = new byte[3 * 32];            var zeros = new byte[3 * ((32 + 63) / 64)];             while (true)            {                // all pixels off                for (int i = 0; i < colors.Length; ++i) colors[i] = (byte)(0x80 | 0);                // a progressive yellow/red blend                for (byte i = 0; i < 32; ++i)                {                    colors[i * 3 + 1] = 0x80 | 32;                    colors[i * 3 + 0] = (byte)(0x80 | (32 - i));                    spi.Write(colors);                    spi.Write(zeros);                    Thread.Sleep(1000 / 32); // march at 32 pixels per second                }            }        }

I can't for the life of me figure out what line 8 is doing:

 

var zeros = new byte[3 * ((32 + 63) / 64)];

 

I know it's creating a byte array. I assume the values of 63 and 64 are related to the no of LED's (32). Pretty poor example really: would be much clearer if no of LED's was defined as a variable or const.

 

Anyway why not just use: 

 

new byte[3 * 32]

 

I've never used byte arrays before, but it looks like byte[3 * 32] creates an array of 96 bytes (which makes sense: 1 byte per color * 3 * 32 LEDs) and it looks like byte[3 * ((32 + 63) / 64) creates a byte array of 4.453125 bytes - clearly this can't be what it's doing. Can anyone enlighten me?

 

It also seems that the zeros array never gets initialized to anything, so I'm surprised spi.Write(zeros) actually does clear the LEDs.

 

Is there a reason why line 13 isn't just:

 

[color=rgb(0,0,0);font-family:monospace;font-size:13px;]spi[/color][color=rgb(102,102,0);font-family:monospace;font-size:13px;].[/color][color=rgb(102,0,102);font-family:monospace;font-size:13px;]Write[/color][color=rgb(102,102,0);font-family:monospace;font-size:13px;]([/color][color=rgb(0,0,0);font-family:monospace;font-size:13px;]zeros[/color][color=rgb(102,102,0);font-family:monospace;font-size:13px;]);[/color]

 

Also, I'm not sure what line 17 does:

 

colors[i * 3 + 1] = 0x80 | 32;

 

I know it's writing a value to the i-th array member, but not sure why the color is OR'd with the color value. I guess it's just setting the MSB to 1, but not sure why.

 

TIA

 

Mark

 

 




#55084 Library for HC_SR04 Ultrasonic Rangefinder

Posted by Mark Anderson on 31 December 2013 - 09:28 PM in Netduino 2 (and Netduino 1)

Anyone got any other calibration numbers? If so, how did you do it?

 

I've no idea where the exact zero point is (presumably the center of the cones behind the mesh. I presume I put a ruler there and placed an object at x-inches, I could determine the error




#55081 Professional's Guide To .NET Micro Framework Application Development Book

Posted by Mark Anderson on 31 December 2013 - 08:39 PM in General Discussion

Has anyone tried EX501? Doesn't matter what I do with thread priorities, doesn't seem to change anything




#54993 Netduino ability / multithreading

Posted by Mark Anderson on 29 December 2013 - 04:32 PM in General Discussion

The only valid point I think he makes is that there's a lot of repetition because he covers 3 platforms. It's not a netduino book it's a .net mf, so if he covered just one platform it would have limited appeal. As for his comments about using the emulator for examples, that's a plus in my book, as it means I can use the examples without having same hardware as author The kindle sample is very long, so download that and read it., if you want to get a feel for it I stand by my review. IMO it's one of the best tech books I've read. I was looking for more info on interrupts and threading and there's a good chunk on that the section on SPI is very detailed too and this uses a physical 2x16 display. Isn't there a way to lend kindle books now? I'd be happy to lend if you can figure out what I need to do. Regarding your question about the speed, I'm not sure I haven't got mine yet. Arrives tomorrow. From my memory of what I read in the book, the scheduler will switch between threads every 20ms. Interrupts are queued in the order they arrive, but you will lose them if they come at a very high rate. You can however get the interrupt details and queue yourself. The book covers this area very well.



#54984 Getting Started with Interrupts

Posted by Mark Anderson on 29 December 2013 - 12:46 AM in General Discussion

Hi All

 

I just read this book and it answered all my questions about threading and interrupts. So if you're in the same boat, I'd highly recommend it. It's excellent.

 

http://www.amazon.co...k/dp/B006UZUCEI

 

Regards

 

mark




#54983 Netduino ability / multithreading

Posted by Mark Anderson on 29 December 2013 - 12:45 AM in General Discussion

Hi Geert

 

I just read this book and it answered all my questions about threading and interrupts.

It's excellent

 

http://www.amazon.co...k/dp/B006UZUCEI

 

Yes you can use the SD card. There are two sections on it in the book.

 

Regards

 

Mark




#54957 Getting Started with Interrupts

Posted by Mark Anderson on 27 December 2013 - 09:48 PM in General Discussion

Hi Guys

 

I'm just getting started with Netduino (done a little arduino stuff). My first project is a sump pit/pump monitor. I have the water level monitoring working on arduino and figure that will be easy to move over when I get my netduino (next week).

 

What I need to add are two things:

 

  • Pump operation stats 
  • RS232 messaging to a home automation server (send current water level, pump stats)

 

For No 1, I need to detect when the pump runs (from an external sensor: currently a float switch, but will change to current sensor later). So this will need to be interrupt driven. I reckon I can figure that out from the examples I've seen. Where I'm "stuck" is what happens when there is an interrupt (new area for me, but I do do know difference between a regular interrupt and NMI).

 

Right now I'm thinking a tread that loops continually and takes a reading of the water level every x-seconds. It will then send a message over RS232 with the value. I may use a network connection to something like thingsalk later. If the pump runs while reading the distance sensor or sending the message, it will generate an interrupt, but I don't know what that does to any executing code. 

 

Can someone give me a brief explanation or point me in right direction?

 

TIA 

 

Mark




#54946 New: Netduino 4.3 SDK and VS2012 support!

Posted by Mark Anderson on 27 December 2013 - 01:41 PM in General Discussion

Thanks Chris

 

Went ahead an re-ordered. Looking forward to getting my 2 plus




#54912 New: Netduino 4.3 SDK and VS2012 support!

Posted by Mark Anderson on 26 December 2013 - 06:55 PM in General Discussion

Blog comment that is not very encouraging:

:unsure:

 

I'm just starting an Arduino project and came across netduino. Ordered a Netduino Plus 2 from Amazon and then saw the above. Cancelled order (fro now).
 
I would much rather use VS and C# than arduino, but don;'t want to get into something that's about to die. What are the implications of MF being moved to maintenance mode in Chinca. Does this mean that netduino is dead in water?
 
Also is Galileo an alternative/competitor
 
Regards
 
Mark




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.