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.

ErikN's Content

There have been 89 items by ErikN (Search limited from 18-June 23)


By content type

See this member's


Sort by                Order  

#27025 Netduino Go Firmware v4.2.0

Posted by ErikN on 12 April 2012 - 06:15 AM in Netduino Go

Here is the Netduino Go firmware.

Version: 4.2.0 (version 4.2.0.0)


Is this what is already flashed on the boards or did they ship with a beta of somesort?



#24350 .NET Micro Framework 4.2 QFE1

Posted by ErikN on 17 February 2012 - 05:37 PM in General Discussion

Can't wait!



#32750 Family Photo

Posted by ErikN on 27 July 2012 - 04:21 AM in Netduino Go

I'm constantly surprised how small and elegant these modules are!



#26991 Mutitasking help needed

Posted by ErikN on 11 April 2012 - 11:19 PM in Netduino 2 (and Netduino 1)

I'm so sorry for not responding sooner! My watch on this thread seems to have gotten lost! I guess this explains why perkunas emailed me directly!

This is the code I provided (the helper function is the main bit) and perkunas was able to integrate it and get it to work but he's seeing some strange behavior on some pins when the board is first turned on that he's still trying to diagnose. I thought it might be normal board behavior but it sounds not quite right. He says it stabilizes after 5 seconds or so. Hopefully someone more knowledgeable of the board can help here.

Before I paste the code - the other approaches are pretty much the same and probably lighter weight than this but since perkunas is actually using this at the moment I include it so everyone can be on the same page (so the hardware guys don't blame the software too soon or unjustly!) Again, the AwaitCompletionOf is an adaptation of a function that was heavily inspired by forum member Corey Kosak.

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



namespace Example
{
  public class Program
  {
      public const int SecondMs = 1000;
      public const int MinuteMs = 60 * SecondMs;
      public const int HourMs = 60 * MinuteMs;
      public const int DayMs = 24 * HourMs;
      public const int WeekMs = 7 * DayMs;

      static OutputPort ph = new OutputPort(Pins.GPIO_PIN_D2, true);
      static OutputPort b = new OutputPort(Pins.GPIO_PIN_D3, true);
      static OutputPort a = new OutputPort(Pins.GPIO_PIN_D4, true);
      static OutputPort drain = new OutputPort(Pins.GPIO_PIN_D5, true);
      static OutputPort solenoid = new OutputPort(Pins.GPIO_PIN_D6, true);
      static OutputPort heater = new OutputPort(Pins.GPIO_PIN_D7, true);
      static OutputPort controller = new OutputPort(Pins.GPIO_PIN_D8, true);


      public delegate void VoidAction();

      public static void Main()
      {
          try
          {
              while (true)
              {
                  Method_1();
                  AwaitCompletionOf(new VoidAction[] { Method_2, Method_3, Method_4, Method_5 });
                  AwaitCompletionOf(new VoidAction[] { Method_6, Method_7 });
                  Method_8();
                  Thread.Sleep(10000);
              }
          }
          catch
          {
              //Something has gone wrong; reset to a safe condition
          }
      }

      void RunTheStuff()
      {
      }

      public static void Method_1()
      {
          drain.Write(false);
          Thread.Sleep(16 * MinuteMs);
          drain.Write(true);
      }
      public static void Method_2()
      {
          solenoid.Write(false);
          Thread.Sleep(16 * MinuteMs);
          solenoid.Write(true);
      }
      public static void Method_3()
      {
          a.Write(false);
          Thread.Sleep(11 * MinuteMs + 7 * SecondMs);
          a.Write(true);
      }
      public static void Method_4()
      {
          b.Write(false);
          Thread.Sleep(6 * MinuteMs + 3 * SecondMs);
          b.Write(true);
      }
      public static void Method_5()
      {
          ph.Write(false);
          Thread.Sleep(3 * SecondMs);
          ph.Write(true);
      }
      public static void Method_6()
      {
          while (true)
          {
              controller.Write(false);
              Thread.Sleep(1 * SecondMs);
              controller.Write(true);
              Thread.Sleep(10 * MinuteMs);
          }
      }
      public static void Method_7()
      {
          heater.Write(false);
          for (int i = 0; i < 14; i++)
          {
              solenoid.Write(false);
              Thread.Sleep(20 * SecondMs);
              solenoid.Write(true);
              Thread.Sleep(1 * DayMs);

          }
          heater.Write(false); // added this
      }
      public static void Method_8()
      {
          drain.Write(false);
          Thread.Sleep(16 * MinuteMs);
          solenoid.Write(false);
          Thread.Sleep(16 * MinuteMs);
          Thread.Sleep(30 * MinuteMs);


      }

      public static void AwaitCompletionOf(VoidAction[] actions, int millsecondsTimeout = -1)
      {
          ManualResetEvent mre = new ManualResetEvent(false);
          Thread t = null;
          int total = 0;
          int target = actions.Length;

          for (int i = 0; i < target; i++)
          {
              if (null != t)
                  t.Start();

              int captured = i;

              t = new Thread(() =>
              {
                  try
                  {
                      actions[captured]();
                  }
                  finally
                  {
                      if (Interlocked.Increment(ref total) == target)
                          mre.Set();
                  }
              });
          }

          if (null != t)
          {
              t.Start();
              mre.WaitOne(millsecondsTimeout, false);
          }
      }
  }
}



#26649 Mutitasking help needed

Posted by ErikN on 06 April 2012 - 07:29 PM in Netduino 2 (and Netduino 1)

Some good approaches and advice in that very long thread. As soon as my eyes uncross I could try giving it another pass. Posted Image



#26640 Mutitasking help needed

Posted by ErikN on 06 April 2012 - 03:19 PM in Netduino 2 (and Netduino 1)

I'm a little confused on what you're trying to accomplish (I don't know the other thread to which CW2 referred).
Looking at your post, this is what I understand you're asking for - please correct me if this is wrong.


[==T1==>]
        [==T2==>]
        [==T3=>]|
        [==T4=>]|
        [=T5=>] V
                [==T6=>]
                [========T7=======>]
                                   [====T8====>]

Or is this more accurate?


[==================T1==================>]
 [==T2==>]                              |
 [==T3=>]|                              |
 [==T4=>]|                              |
 [=T5=>] V                              | 
         [==T6=>]                       |
         [========T7=======>]           V
                            [====T8====>]




#26641 Mutitasking help needed

Posted by ErikN on 06 April 2012 - 03:49 PM in Netduino 2 (and Netduino 1)

If your methods are timed correctly and you don't want to adjust your logic, I'd just create a helper function that takes an array of delegates (VoidAction delegate?)
and runs them each in a new thread using a ManualResetEvent and a counter to track when each finish and only mre.Set when they've all completed. This would
make your helper function become a blocking call which starts and tracks the completion of multiple threads at once.

public delegate void VoidAction();
void AwaitCompletionOf(VoidAction[] actions);


For the first timing diagram, your code would be as simple as the pseudo-code below:

loop:
Thread_1(); // This is call to method directly so it blocks
AwaitCompletionOf(new VoidAction[] {Thread_2, Thread_3, Thread_4, Thread_5}); //Executing parallel; group blocks
AwaitCompletionOf(new VoidAction[] {Thread_6, Thread_7}); //Same as previous
Thread_8();

The second timing diagram would require a bit more work to synchronize the 1st and 8th methods while running the middle threads in waiting parallel groups.

For inspiration, you can look at the beta (but works!) version of a ParallelForEach extension I'd written for NETMF awhile back. It was refined with feedback from Corey Kosak here on the Netduino boards.



#36107 We interrupt this program

Posted by ErikN on 28 September 2012 - 02:53 AM in Netduino Go

This is not a helpful teaser! I've threatened to chain up Stefan unless he tells me but he hasn't cracked yet.



#36380 So how was Maker Faire NY

Posted by ErikN on 01 October 2012 - 06:43 PM in General Discussion

I didn't get to go for as long as I did last year and even last year I missed a great deal of the exhibits! The trains from Manhattan were all screwed up and that ate into our day there. If you've never been, the event space is very big and split into zones. There's a lot to see but I find a great deal of the value is from listening to people ask questions - it really gives you insight into the way other people are looking at particular bits of technology and what they value. There are a lot of talks and presentations covering a wide variety of topics. It's all very family friendly (though they did add a Beer Garden this year). On top of the Maker events, the entire New York Hall of Science is open and you can browse their exhibits. This was the 3rd annual Maker Faire in NYC and compared to last year it seems to be maturing quite well which is amazing since it's already pretty awesome. Except the food lines. Those are emphatically not awesome. I brought some friends this year who previously had no experience with Maker culture. They both found things they were interested in and seemed to have a good time even if it was a short day for us. My dancer friend was really taken in by the acrobatic show and the arts and jewelry. My engineer friend wanted to check out wearables since he works on Augmented Reality in his day job but was disappointed that it was all just conductive thread and LEDs and Floras. He seemed to enjoy looking at things but we didn't have time to listen to any of the talks specifically. I had a ball. Normally I'm not very comfortable in crowded places but there's something about the crowded place being populated by people who all have similar interests that makes it easier. I struck up a few conversations and helped people navigate the nightmare subway system and was still buzzing with energy when I got home despite being completely exhausted. Long story short - it's a great thing to visit. The event is maturing, there is a wide variety of booths, demonstrations and talks to fill up your entire weekend and the people are just about the friendliest and most inquisitive you can find. It's really amazing the type of people you meet in completely random encounters. When I had people coming up to visit me, I let them know it was Maker Faire weekend and attending was not optional. I compromised though and only went one day. I regret it. I missed so much! Oh well, there's always next year! -Erik



#28721 DIY Go Cables

Posted by ErikN on 09 May 2012 - 03:39 PM in Netduino Go

I found the connectors but even in volume they were over $1 each, and you obviously need 2 of them, making them more pricey than buying assembled cables for the most part.


But the pre-assembled are in specific lengths. The OP isn't suggesting this would be cheaper but rather would lead to more custom lengths and would make use of the currently wasted ribbon cables.



#23538 over run?

Posted by ErikN on 30 January 2012 - 10:59 PM in Netduino Plus 2 (and Netduino Plus 1)

night time here in denmark




I'm going to have to start a list of Scandinavian users! Of which I'll only be an honorary member.


-Erik



#27749 BlueSMiRF Silver (Bluetooth)

Posted by ErikN on 20 April 2012 - 09:03 PM in Netduino Plus 2 (and Netduino Plus 1)

I see from the datasheet a couple things. First, it looks like the default software mode speed is indeed 115,200,8,N,1 but there appears to be a dip switch as well that will set the speed to a fixed 9600.


"Baud Rate select - used to configure 9600 or software selected (default=115K ) baudrate. If the switch is
OFF, the stored baudrate setting will be used. When the switch is in the ON position, the baudrate will be set
to 9600 regardless of the software setting."



Can you check this and verify you're using the proper settings? I'd recommend turning this switch on and communicating via 9600 to ensure your code is working and then try again at 115,200 and ensure everything is still working. It might be that 115,200 is just too fast (seems unlikely).



#27399 .NET Micro Framework 4.3 Roadmap

Posted by ErikN on 16 April 2012 - 07:44 PM in General Discussion

Sweet! And we tentatively had this for 7 months. I can't wait for then to have already happened!



#26568 Learn from my fail...

Posted by ErikN on 05 April 2012 - 06:46 PM in General Discussion

Heh been there done that


You failed to mention whether you acquired the t-shirt.



#37096 Problem TCP Recieve Shows in a Textbox

Posted by ErikN on 12 October 2012 - 07:39 PM in Visual Basic Support

If the string has the full message but the textbox doesn't show it, the problem must be there. What data are you sending? Does it contain carriage returns and/or newline characters? If so, make sure the textbox is configured to show multiple lines. Just because the size is large enough to hold the text doesn't mean it's smart enough to show more than the first line. Next try to write out the characters to a file and open it with a hex editor or Word or Wordpad (but not Notepad) to see if there are "special" characters you don't expect in the string. Visual Studio will strip most of these out when you hover over to preview the string value so it will display correctly. But these characters could still exist and the textbox might be confused by them and not interpreting contents beyond them. This is less likely to me as the answer but it's the only other thing I can think of without seeing the actual text you're receiving and trying to assign to the textbox to display.



#37130 Problem TCP Recieve Shows in a Textbox

Posted by ErikN on 13 October 2012 - 05:51 PM in Visual Basic Support

So a Label control displays it fine, but Textbox still has a problem with the space? That's really strange but not completely unexpected. The Textbox control is not ... great. You might try converting to ASCII instead of UTF8 and see what the output becomes.



#37193 Problem TCP Recieve Shows in a Textbox

Posted by ErikN on 14 October 2012 - 10:49 PM in Visual Basic Support

Glad it's worked out!



#26784 First Project Idea - Rotating Plant Stand

Posted by ErikN on 09 April 2012 - 03:36 PM in General Discussion

Hi Jackie,

I think this sounds like an amazing first project!

Guido's advice about breaking down the tasks is essential. Without it you might start to feel overwhelmed at what you've taken on and I really don't want that to happen - I'd love to see what you design!

First I'd identify what are the 'must have' features. These will be your baseline for accomplishment. The remaining features can then become additional upgrades you can make or can be brought in if you're already nearing completion of your core features before you've reached any limit on time, budget, patience, etc.

In your case, you already have a motor but that would have been one of the first things I would have suggested researching. Since others might follow your journey, the way I'd approach it is to:
1. Identify the power capability of the environment. How will this be powered?
> In your case, you've chosen a 120V motor so I'll assume from here on out you're using standard US AC power socket. Have you checked to ensure the motor is AC rather than DC input?

2. Identify the components that are critical to the function of your project. What do you need to make it work?
> In your case, you've identified (and sourced) a motor and presumably the plant stand. In your 'nice to have' features, you will need a moisture sensor and possibly a water drip source.

3. Refine your static design. Where do all the parts go?
> In your case, the only thing that stands out is that the plant appears to have multiple independent soil containers. Soil not exposed to direct light will not dry as fast - and won't need as much water - as soil that is in the light. If you water all the plants equally when a single sensor detects dryness, you could be over or under watering plants. Is this a problem? Should you use multiple sensors?

4. Identify your intended location of the project. Where will it go?
> In your case, will the plant have enough room to rotate? Will the plant brush against any objects that could tip over? What other environmental factors (curious cat) could impact the rotation?

5. Figure out which environmental factors pose a risk you need to account for in your design.
> Your project could involve electricity and unattended watering. What safety mechanism(s) do you have to prevent water from overflowing the stand?

If you take a look at these questions, your initial scope (create a rotating stand) is much less difficult than when you factor in your additional features of being able to detect soil dryness and water the plants. This is why it's good to separate out the features that aren't critical to completing your project and getting satisfaction! Besides, you can always go back and tinker, tweak, add, edit, etc.

So, now that we know at a minimum we will be working with:

Powered Motor capable of spinning a 10lbs load.
Linkage to a platform which will hold the stand that needs to be rotated.
Light sensor to power down in the evening to save power; not rotate unnecessarily.
Microcontroller with the logic.
Interfacing components.

The interfacing components get a bit tricky. While there are parts to do pretty much anything you want available quite readily, it can be a bit daunting trying to find the /right/ components for what you're trying to accomplish. 'Should I use relays? What about a transistor? MOSFET? Why is isolation of power so important?'

For powering the motor from AC (if this was a correct assumption) you have a couple options and your initial thought of a relay is what I would have thought as well. There are a couple options in this arena though. You could use some screw terminals and strip an extension cable to plug into the outlet and run through the relay. I tend not to like this approach only because I'm skittish around mains. I've been looking at the Powerswitch Tail (Adafruit) which is the same thing as using a relay but it's already wired and sealed. As long as your motor doesn't require more than 15A (also check the 'stall current' spec on the motor in case it gets stuck. This is the amount of current the motor will draw while attempting to force the rotation). The only exposure points are where you'd plug in the signal leads. Bonus: the work to prevent feedback on the signal lines when he coil is discharging is done for you and you don't need to worry about this at all! Since the board does act as an LED, I believe you should put a small resistor on the line. Some of the other people here who are stronger in hardware could weigh in on this. Using the Powerswitch Tail contrasts what you'd do if you use your own relay as you'll have put in your own protection to prevent your microcontroller from getting fried. This has been discussed previously and isn't anything new that you'd have to solve on your own should you chose to go that route. In fact there are probably more than a few compatible Relay Shield modules which have done this work for you as well.

How will you power the microcontroller? Since the board can be fully powered from either USB or a barrel jack and you'll already need access to your mains for the motor, you can easily use either a plug-in USB charger or a wall wart adapter providing the right power. These requirements are documented.


So now what do we have?

Given my preferences for non-cut/spliced mains wires, the design looks like it'd be a Powerswitch Tail and a DC adapter plugged into a power strip. The microcontroller would send signal to the tail and run the timer to kick off spinning based on light readings and possibly other factors. Since the cord and micro will be connected and both are powered from the wall mains, the micro can't live on the spinning platter in order to keep the wires from tangling unless you used a servo or stepper that could be reversed. That's no problem here, unless you want the moisture sensor... (See what I mean about pre-defining your musts?)

What's left?

Figuring out how to pair the motor to a drive on the plant stand, timing the rotation to ensure you get the right turn radius per cycle and figuring out how to keep the lighting evenly distributed in order to keep soil moisture levels fairly consistent. Figure out how to connect a moisture sensor without tangling wires!

Alternatives?

While looking up the spec for the Powerswitch Tail, I noticed a new product - the Smart Cord! It's essentially the same as the Powerswitch Tail but with a 10A capacity and Bluetooth control! This means no wires from the micro to the power tail (but requires the addition of a Bluetooth module, figuring out the protocol, etc.) Using this, your micro is no longer required to be directly connected to control the motor. Now the micro /could/ be mounted on the spinning tray and be attached to moisture sensor(s) and whatever else you would like to have. But - there's a new issue of how to power the board since plugging into the power strip would bring us back to twisted cords. If you're okay with changing a battery from time to time, there are some very powerful LiPoly rechargeable batteries available from various sources which I think would fit the bill though you might need a boost circuit to get the required voltage for the board. Going down this road, you can have an LED on your micro light up to warn you when the moisture level is too low. Getting two batteries would be great as you can have one charging (there are simple USB chargers for them) while the other is running the micro. If you wanted to get super fancy, you could probably find a battery gauge circuit for your batteries which would trigger when the power was getting too low and then light up another LED.


I'd say, just to get started and get that rush of accomplishment, look at just doing the motor and interfacing to spin the plant. Get it revolving and marvel in figuring it out and getting the linkage of the motor to the platter working correctly. Then think about possible ways of adding sensors for feedback. I don't think I'd go down the road of automatic watering of a spinning plant source - it just seems to easy to make a mistake and end up with flowing water and dirt out of the stand. I reserve water pumping for static projects that don't move and have sufficient drainage (usually a closed-loop using the same water unless the drainage is, say, a whole yard which won't flood from an outside water source getting stuck open).


I know this is a super long post but that's because I think this is an awesome project and I'd love to see how it comes out! Just know the community will be here to help you along the way if you need it.


Happy making!



#35019 Flashed firmware, now device have a ! mark in Device manager

Posted by ErikN on 11 September 2012 - 11:37 PM in Netduino Plus 2 (and Netduino Plus 1)

You could try re-installing the .NET Micro Framework SDK 4.2 and the Netduino SDK 4.2.0.1. Links are on the Downloads page under

netduino go (and all 4.2 upgrades)

.



#34989 Flashed firmware, now device have a ! mark in Device manager

Posted by ErikN on 11 September 2012 - 04:12 AM in Netduino Plus 2 (and Netduino Plus 1)

Following the Wiki instructions exactly worked for me.

I also had to install the driver mentioned in a small snippet in those instructions.

Now (re)connect the Netduino to the PC. A driver for an emulated COM port will be installed. Start the SAM-BA tool. If a driver for an emulated COM port is not installed on a Windows 7 x64-machine, try this wiki page.



I'm running Server 2008 on a VM so it wasn't as straight-forward. I had to use IE to go to the Update site, download the file and install it manually. A little bit more of a pain but it worked. The link to the file is in the second Wiki link.



#27946 TRIAC's for switching 24VAC?

Posted by ErikN on 23 April 2012 - 02:31 PM in General Discussion

SparkFun has a couple EL Wire controller boards which use Triacs to switch high frequency AC from an inverter to the wire. One model has a microcontroller on board and the other is meant to be used as a shield.

I've never looked at the schematics to see how this differs from what I know about SSRs so this is presented as informational and entertainment purposes only. If you learn something it's your own fault.

Enjoy!



#26936 Arduino body movement sensor does not work

Posted by ErikN on 11 April 2012 - 02:05 PM in General Discussion

Looking at the third picture on a site that sells them, it looks to me like maybe the connector is set up as |- DET +| when the jumper pins are to the left and the connector is on the bottom of the board facing you.
http://www.geeetech....odule-p-70.html

But otherwise I too can't find any documentation about the module in my, admittedly short, search. At least this suggests there IS a silkscreen on the board. Unless my eyes are really that bad!



#26792 First Project Idea - Rotating Plant Stand

Posted by ErikN on 09 April 2012 - 05:40 PM in General Discussion


You could put a strain gauge under one corner of the base so that as it rotates you can tell which side of the plant is heaviest. As long as the plant was balanced on the base to start with, you could use the heaviest side to tell which side is growing the most and give that side less time in the sun.


That IS a crazy (awesome) idea! Do the herbs grow at different rates/weight though? Maybe the same idea would work as a relative wetness indicator though. You could spin the platter and store the readings as a benchmark (with all the soils appropriately watered first) and then as it rotates, it could indicate when one side has less water than the rest. Maybe spend less time with this section in the direct light until it gets watered again. It's less accurate than a (set of) moisture sensors but it could help keep a neglected plant from becoming too dry (an unexpectedly warm/bright day in the window while away). Otherwise it will spin on schedule. It could also warn if the weight seems to be getting too light in general (all the soils are getting too dry).



#33313 Netduino does not work when powered by Mac Mini USB

Posted by ErikN on 09 August 2012 - 12:34 AM in General Discussion

I have been developing my Netduino application on a Windows desktop machine - but my deployment scenario is going to involve powering the board from a Mac Mini USB port (currently a Mac Mini 2012 model).
What I have discovered, is that if I plug my netduino into a Mac Mini USB port, the on-board LED lights up, but stays on - and my program never loads.
If, I plug it into my PC, or a wall-wart USB power supply, the on-board LED lights up for a few seconds, then goes out as my program loads into memory, and everything works.

Why does my Netduino not run correctly when powered by Mac Mini??

Thanks


I noticed a similar issue. All I had to do was tap the reset button and it'd come up just fine. I noticed as soon as my VM running on the Mac Mini was set up to automatically attach the Netduino to the Windows instance, this stopped happening. Before that it was reliable to just reset the board and it'd come straight up.



#26937 Arduino body movement sensor does not work

Posted by ErikN on 11 April 2012 - 02:08 PM in General Discussion

Looking further at the board, the output goes high when it detects. Your InterruptPort looks like it might be configured for the opposite...




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.