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.

Scott Green's Content

There have been 34 items by Scott Green (Search limited from 18-May 23)


By content type

See this member's


Sort by                Order  

#17142 Netduino+ WeatherStation / Environment Monitor / Webserver

Posted by Scott Green on 27 August 2011 - 01:58 AM in Project Showcase

I've been working on a standalone NetDuino+ solution that utilizes the following hardware.... Wind Speed / Wind Direction / Rain Fall - http://www.sparkfun.com/products/8942 Barometric Pressure - http://www.sparkfun.com/products/9694 OneWire temp sensor - http://www.sparkfun.com/products/245 Light Meter - Jameco part Serial LCD - http://www.sparkfun.com/products/9068 Door Switches - Jameco part Humidity - http://www.sparkfun.com/products/9569 I originaly built this so that I could check wind speed, and direction for flying RC Airplanes, but now I've decided to add some other things like monitoring Door Openings on my workshop, a WebServer so you can see instant weather stats and trends, etc. Is anyone remotely interested in this? If so, I'll start posting build log notes, pictures and code. I'm using a lot of stuff that others on the forums have contributed. Post a reply to this thread if you are interested in progress / code. Scott...



#17131 Error Deploying Solution

Posted by Scott Green on 26 August 2011 - 09:34 PM in Netduino Plus 2 (and Netduino Plus 1)

Nevermind! Fixed my own problem. Deleted everything in the bin/debug and release dir, rebuilt and it deployed fine. Must have been old dlls causing the problem. Sorry for the churn. Scott...



#17129 Error Deploying Solution

Posted by Scott Green on 26 August 2011 - 09:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Bought a 2nd Netduino plus to use as a development environment so I didnt have to reboot my other one all of the time and loose all of the stats it has kept to that point. It was working great until about an hour ago. Now I get the following error when I try to deploy to the netduino+ The sequence of events was as follows: 1) I was writing a program that polled a variety of sensors (Barometric Pressure, wind speed, dir, temp) 2) I was adding support for Onewire from the Onewire ALPHA firmware to the code. I hadn't upgraded the firmware and it was getting an error during deploy. 3) I remembered that I hadn't deployed the Onewire ALPHA firmware, so I downloaded and deployed the firmware with MFDEPLOY. 4) After deploying the onewire firmware I still constantly get the following error. I have commented out all references to the onewire classes. ------ Build started: Project: Netdueather, Configuration: Debug Any CPU ------ Netdueather -> C:\Users\scott\Documents\Visual Studio 2010\Projects\Netdueather\Netdueather\bin\Debug\Netdueather.exe ------ Deploy started: Project: Netdueather, Configuration: Debug Any CPU ------ An error has occurred: please check your hardware. Object reference not set to an instance of an object. Source: Microsoft.SPOT.Debugger.CorDebug Stack : at Microsoft.SPOT.Debugger.VsProjectFlavorCfg.Deploy() in c:\depot\current\CLIENT_V4_1\Framework\CorDebug\VsProjectFlavorCfg.cs:line 893 at Microsoft.SPOT.Debugger.VsProjectFlavorCfg.<Microsoft.VisualStudio.Shell.Interop.IVsDeployableProjectCfg.StartDeploy>b__0() in c:\depot\current\CLIENT_V4_1\Framework\CorDebug\VsProjectFlavorCfg.cs:line 634 ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========



#16723 OneWire ALPHA

Posted by Scott Green on 14 August 2011 - 11:57 PM in Beta Firmware and Drivers

Not entirely sure I understand your question, so I'll try to answer with some observations/facts.

  • You must have this native driver to directly communicate with 1-wire devices (parasitic or not) with the Netduino (alternatively, you can use components like those from Peter Anderson)
  • With this firmware, I can read from a mix of DS18B20, DS18S20, DS18B20PAR sensors some connected in parasitic mode (only 2 wires - ground and 1-wire signal) and others connected with the 5VDC (non-parasitic). I currently have 5 sensors connected - 3 are not parasitic and 2 are parasitic. That works fine.
  • On occassion, I will get a bad read (think 1 in 50 reads) for whatever reason (possibly because I don't have a MOSFET as recommended), but with the CRC check, you always know, so I handle them easily. And usually, it won't happen twice on the same sensor.

-Valkyrie-MT



Valkyrie,

Can you elaborate on the CRC fix you are using to deal with the bad reads? I am getting some bogus temp readings as well..

Scott...



#16702 OneWire ALPHA

Posted by Scott Green on 14 August 2011 - 06:04 AM in Beta Firmware and Drivers

FANTASTIC! The One-Wire code in the firmware appears solid to me. I haven't seen any issues with it. Although, I really wanted to see a much simpler and object oriented way of working with 1 wire, so I wrote a wrapper class (called OneWireNetwork) out of CW2's sample. I only tested it with my DS18B20 sensors, but I have more coming soon and hopefully will add classes for them. So, what I did was create a collection class of devices that has a "Discover" method to scan the One-Wire network for devices. I hope this can be the start of a One-Wire framework that will make this the easiest One-Wire platform available. I have attached the code to this post. It is a complete replacement for CW2's OneWireTestApp project from the first post. Also, this example works with 1, 2, 3, or more devices, using parasite power or not.

By using the library, the code gets very simple:

public static void Main()
    {
      // TODO: Change pin according to the actual wiring
      var deviceNetwork = new OneWireNetwork(Pins.GPIO_PIN_D0);
          
      // Interrogate the devices on the network (adding them to the collection)
      deviceNetwork.Discover();

      while (true)
      {
          // Loop through all the discovered devices
          foreach (var aDevice in deviceNetwork)
          {
              Debug.Print("Address: " + aDevice.Address);
              
              if (aDevice is DS18B20) 
                  Debug.Print("Temp: " + (aDevice as DS18B20).Temperature);
          }

          Thread.Sleep(20000);
      }
    }

Output:
1-Wire device present
Multiple devices present
72000002DC320128
B2000002DC405128
54000002DC577D28
Address: 000002DC3201
Temp: 23.375
Address: 000002DC4051
Temp: 23.4375
Address: 000002DC577D
Temp: 23.5
The program '[16] Micro Framework application: Managed' has exited with code 0 (0x0).

Things still to add:
Support for reading and writing to the device memory
Throw Events for device alerts
Robust exception handling
Throw Events for devices being added or removed
Support for a variety of One-Wire devices
Automatic instantiation of classes based on detected device family (should probably use some Reflection here)

I think CW2's firmware should get included into the next Beta. Let's get more people trying to use it...

*** Thanks again to CW2 ***

-Valkyrie-MT



Valkyrie,

I noticed that ever time you call Discover() it causes "foreach (var aDevice in gdeviceNetwork)" to add a new device to gDeviceNetwork...

May be intended, but if you put the discover in a loop, it adds a new device for every 1wire device you have on the network each time you call it. Seems like you should put a CRC check to make sure that the same device is not being added for each call...

FYI: I moved the Discover() call outside the loop, once at the top of Main() and it solved my problem..

Scott...



#16695 OneWire ALPHA

Posted by Scott Green on 13 August 2011 - 07:38 PM in Beta Firmware and Drivers

IMHO the problem is that your oneWire object uses pin D0 that also has alternative function of being RxD of COM1 and it tries to reserve it during its initialization, which results in exception. To resolve the issue, you can use different pin for OneWire, e.g. D2, or switch to COM2 (D2, D3) for serial communication.


CW2, That did it! Thanks!

Scott...



#16689 OneWire ALPHA

Posted by Scott Green on 13 August 2011 - 05:49 PM in Beta Firmware and Drivers

I'm trying to use the serial port to control a SparkFun serial LCD, and use the OneWire support of this firmware at the same time. I started out using both the DLL included with this release as well as the SerLCD class elsewhere in the forums. When I build either one by themselves, I can either write to the LCD or read 1wire temp sensors, but not both at the same time. I always get an InvalidOperation exception on the serial port open. So, to simplify the equation, I've added the following code to the OneWireTestApp. This just opens the serial port, writes a few lines to it, then starts waiting for button presses to read the temp sensor. I'm getting the same exception on the line lcd.Open(); Anyone else having this problem? public static byte[] getBytes(String message) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); return encoding.GetBytes(message); } public static void Main() { sw1 = new InterruptPort(Pins.ONBOARD_SW1, true, ResistorModes.Disabled, InterruptModes.InterruptEdgeLow); sw1.OnInterrupt += new NativeEventHandler(sw1_OnInterrupt); // TODO: Change pin according to the actual wiring oneWire = new OneWire(Pins.GPIO_PIN_D0); SerialPort lcd; lcd = new SerialPort(SerialPorts.COM1, 9600, Parity.None, 8, StopBits.One); lcd.ReadTimeout = 10; lcd.Open(); byte[] byteme = getBytes("Welcome to Netduino"); lcd.Write(byteme, 0, byteme.Length); byte[] bytes = new byte[1] { 12 }; lcd.Write(bytes, 0, bytes.Length); Thread.Sleep(Timeout.Infinite); }



#16603 OneWire ALPHA

Posted by Scott Green on 11 August 2011 - 03:35 AM in Beta Firmware and Drivers

Sorry for the newb question, but can you tell me where I unzip the files for the example program prior to build and deploy? Firmware installed, just need to know where to put the unziped contents, and the DLL when built. Thanks, Scott...



#16599 Netduino Plus Firmware v4.2.0 RC1

Posted by Scott Green on 11 August 2011 - 02:24 AM in Beta Firmware and Drivers

Sorry if this has been asked elsewhere, but is OneWire support included in 4.2.0 RC1 Scott...




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.