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.

AxelG's Content

There have been 52 items by AxelG (Search limited from 13-July 19)


By content type

See this member's


Sort by                Order  

#47373 Building my own custom Netduino Plus 2 hardware

Posted by AxelG on 19 March 2013 - 07:07 AM in Netduino Plus 2 (and Netduino Plus 1)

lol, doing the same with my 2012 Hemi Charger....




#47355 Building my own custom Netduino Plus 2 hardware

Posted by AxelG on 18 March 2013 - 09:56 PM in Netduino Plus 2 (and Netduino Plus 1)

Dave:

Thanks for the reply.  We did, and actually still are considering that option. Longer term we want to use the larger 100 pin STM chip to take advantage of extra IO.

 

We also wanted the first generation to tap into SPI3 for the onboard SD card: but I can always mount the SD on SPI1 with ND2.

 

One factor is having a real-time CAN bus capturing OBD data.  Still have not decided on the best approach; but it would be nice not having to add a lot of hardware to do that.

 

Cost is not the only factor; total size is also a design factor, which is why we jettisoned the Ethernet.  There are several add-on devices needed to fit into a total footprint < 3" X 3"

 

As always, thanks for the insight!




#47342 Building my own custom Netduino Plus 2 hardware

Posted by AxelG on 18 March 2013 - 07:01 PM in Netduino Plus 2 (and Netduino Plus 1)

I have been asked to help with a project to build a device based on the Netduino framework and the STM32F405 family of processors.

 

We expect to use the same processor as the Plus 2, but leave off the ethernet hardware (we need the flash, not the ethernet)  There is also a possibility of going to a larger package in the future to expose more peripherals; like a CAN bus.

 

I have two questions for anyone with experience building their own device.

 

1) For the first revision I would like to avoid having to recompile the ND firmware and just flash the current build to the new device.  Is there any problem flashing the ND 4.2 build on a chip that has not implemented the ethernet hardware?

 

2) I would like to get a second set of eyes on the schematics before I build a prototype board. Is there someone interested in reading the schematic to catch my mistakes?




#47341 Watchdog: How to do on netduino?

Posted by AxelG on 18 March 2013 - 06:49 PM in General Discussion

I have an extra board;happy to send it along... Just PM me.




#46683 NP2 reboots on deploy; never debugs/runs app

Posted by AxelG on 05 March 2013 - 02:34 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks, I saw your reply in the other thread.  I decided to spin up a separate VM for gen2 development work.  I'll suck it up until WinUSB drivers are available for gen 2  :)   (No pressure....)

 

Honestly, thanks for all you do in support of this platform.  It's really appreciated.




#46682 Running ND+ and ND+2 on the same VM

Posted by AxelG on 05 March 2013 - 02:30 PM in Netduino Plus 2 (and Netduino Plus 1)

All of my ND and ND+ gen 1 and gen 2 are flashed to the latest firmware and everything running under 4.2 NETMF.

 

ND gen 1: 4.2.0.1

ND+ gen 1 4.2.0.1

ND+ gen 2 4.2.2.2

 

All the gen 1s are running WINUSB and gen 2 MFUSB on the latest  VM Player 5.0 Win7 ultimate 64 bit.

 

I can get all my gen 1 running OK together.  I have to reconnect them often in order to deploy and get into debug, but it is workable.

 

For the most part when running the gen 2 alone, deploying and debugging works OK.  If the gen 2 stops responding and needs to be disconnected; I will 100% of the time get a BSOD.  (It's not always fun having the ND+2 act as a hardware reset button in the middle of coding a project :) )




#46645 Watchdog: How to do on netduino?

Posted by AxelG on 05 March 2013 - 01:08 AM in General Discussion

I have designs and plans to build a hardware watchdog you can use on a breadboard.  It is based on the MAX6373 chip.

 

I have posted the designs in another thread, or I can build one for you if you are interested.




#46628 Running ND+ and ND+2 on the same VM

Posted by AxelG on 04 March 2013 - 08:29 PM in Netduino Plus 2 (and Netduino Plus 1)

Doe anyone have experience running a development environment with two Netduinos?  Specifically one ND+ and one ND+2?

 

I was getting BSOD and decided to rebuild my environment and now I can't seem to communicate with two NDs.  It will recognize one or the other but not both.

 

I can use ND and ND+ without a problem, it's only when I plus in the ND2...




#46492 NP2 reboots on deploy; never debugs/runs app

Posted by AxelG on 01 March 2013 - 03:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi AxelG,The gen2 Netduinos use the MFUSB drivers, rather than the WinUSB drivers. There have been reports of issues with the WinUSB drivers and USB 3.0 ports...so while that bug is getting squashed we haven't switched the gen2 hardware to WinUSB. [For gen1 hardware, .NET MF 4.2 necessitated the move to WinUSB--because of the USB hardware architecture.]If Visual Studio has trouble deploying, press the Netduino's onboard board to reset the board. If that doesn't work, disconnect and reconnect and Visual Studio should find it (as you experienced previously). [And if you can find a simple repro where the pushbutton doesn't reset the board...please let us know, as there are things we can do to make the software-based reset even more resilient.] Chris

Thanks for the response Chris, and after re-installing I did notice the gen2 uses the older drivers.  I did notice less frequent hangs when I don't have gen1 and gen2 NDs plugged in at the same time.  However, when it does hang: hitting the reset button does the same as unplugging, my entire VM shuts down or get BSOD.




#46335 Xbee to LCD using Netduino

Posted by AxelG on 27 February 2013 - 01:30 PM in Netduino 2 (and Netduino 1)

These XBee drivers are great.

 

Grommet

 

As well as this one:

 

GBee




#46334 NP2 reboots on deploy; never debugs/runs app

Posted by AxelG on 27 February 2013 - 01:21 PM in Netduino Plus 2 (and Netduino Plus 1)

Same here.  I am running VMWare virtual machine Win7 with 4.2 NETMF and a ND2+ on 4.2.2.2. and VS 2010.   For some reason Windows wants to install and use MFUSB drivers not the WINUSB drivers.

 

When the ND locks up and I unplug it, my VM shuts down.  (nice feature!)

 

If I force WINUSB drivers, I can't see the ND on the USB bus and VS usually hangs up on deploy.

 

I have un-installed and re-installed both NETMF as well as Drivers without any effect.

 

My ND/MD+ will sometimes hang on deploy, but unplugging and plugging back in usually solves the problem.

 

Any additional ideas on troubleshooting would be great.




#46332 Is there a Watchdog breakout out there?

Posted by AxelG on 27 February 2013 - 01:13 PM in Netduino Plus 2 (and Netduino Plus 1)

Yes, but the timer thread can be set up to check for certain conditions being managed by your other thread(s).  Take for example the checking of the LastPing value that the watchdog performs in my basic example.  If that value is not updated regularly by some other process, the watchdog class assumes something is wrong and reboots.  You can get way more creative with inter-thread communications to make sure all the other threads are doing what they are supposed to; and when they are not; force a reboot.

 

There is nothing that says only the timer can update the watchdog either.  You can also just have your main thread (or any thread for that matter) call the StartWatchdog method on a regular basis instead of a timer.  Just make sure you implement proper locking mechanism to ensure thread-safe operations.

 

I have used this in a situation where I need to keep a persistent connection open on the network.  If some condition prevents me from reconnecting, I can change the networking parameters and force a reboot to reconnect to try and resolve.  It is nice to have the ability to reboot your ND on demand!




#46288 Is there a Watchdog breakout out there?

Posted by AxelG on 27 February 2013 - 02:51 AM in Netduino Plus 2 (and Netduino Plus 1)

Well, I had some time tonight and soldered and tested the MAX6373 board I made based on this chip:

 

After wiring up the board, I realized I forgot the pullup resistor on the /RESET line, so I created a version 1.1 board that includes one on the board without having to wire one on the breadboard.  (Eagle files available)

 

Attached is the version 1.1 schematic, R4 is new.

 

I have a few spare version 1.0 boards if anybody is interested.  I can also solder a MAX 6373 if you want.  PM me.

 

 

WatchDogSch.JPG

 

Attached File  MAX6373WatchDog.zip   1.34KB   47 downloads

 

2013-02-26_22-08-57_159.jpg




#46286 4X20 LCD display with I2C Interface

Posted by AxelG on 27 February 2013 - 02:28 AM in Project Showcase

I looked at my code again, and it is not what you are looking to do, but here are the display methods so you can see what I did:

 

        /// <summary>        /// Writes a string array to the device.  Truncates strings to the number of columns allowed,         ///  or wraps if enough room.        /// </summary>        /// <param name="data">string array with each element mapped to a line on the LCD.  Will         ///   truncate if too many are sent</param>        /// <param name="format">C = center each line</param>        private void write(string[] data, char format = ' ')        {            int NumRows = data.Length;            if (NumRows > _rows) NumRows = _rows;            //base.clear();            //truncate the strings, and center if needed            lock (LCDLock)            {                for (int i = 0; i < NumRows; i++)                {                    if (data[i].Length > _cols) data[i] = data[i].Substring(0, _cols);                    if(data[i].Length != 0) write(data[i], 0, (byte)i, format);                }            }        }        /// <summary>        /// Takes in a string, and breaks it up into four strings suitable for the display        /// </summary>        /// <param name="value">String to be converted</param>        /// <returns>string array containing one element for each row on the display</returns>        public string[] MakeTextBlock(string value)        {            int LastSpace = 0;            string[] TextBlock = new string[_rows];            for (int i = 0; i < _rows; i++) TextBlock[i] = "";            for (int pass = 0; pass < _rows; pass++)            {                int SegLen = _cols;                if (value.Length < LastSpace + _cols) SegLen = value.Length - LastSpace;                int ThisSpace = 0;                string part = value.Substring(LastSpace, SegLen);                ThisSpace = part.Length;                if (part.Length >= _cols)                {                    for (int i = 0; i < part.Length; i++) if (part[i] == ' ') ThisSpace = i;                }                TextBlock[pass] = part.Substring(0, ThisSpace);                LastSpace += ThisSpace + 1;                if (LastSpace >= value.Length) break;            }            return TextBlock;        }        /// <summary>        /// Write the string at a specific location, with a specific formatting        /// </summary>        /// <param name="value">Value to display</param>        /// <param name="col">Starting column </param>        /// <param name="row">Row to display</param>        /// <param name="format">C = Centered on the row</param>        private void write(string value, byte col, byte row, char format = 'c')        {            string NewString = "";            if ((format == 'c' || format == 'C') && value.Length < _cols && col == 0)            {                for (int space = 0; space < (_cols - value.Length) / 2; space++) NewString += " ";                NewString = NewString + value;            }            else NewString = value;            lock (LCDLock)            {                base.setCursor(col, row);                write(NewString);                //if (row == TEMPROW && NewString.Trim().Length != 0) LastTempLine = DateTime.Now;            }        }        /// <summary>        /// Send string to the current cursor position        /// If the string is longer than number of columns, the string will be broken        ///   up into parts and written across multiple lines.        /// </summary>        /// <param name="value">string value to display</param>        private void write(string value)        {            if (value.Length > _cols)            {                write(MakeTextBlock(value), 'c');            }            else            {                byte[] Buffer = Tools.Chars2Bytes(value.ToCharArray());                lock (LCDLock)                    base.write(Buffer);            }        }



#46266 Is there a Watchdog breakout out there?

Posted by AxelG on 26 February 2013 - 06:39 PM in Netduino Plus 2 (and Netduino Plus 1)

I have developed a prototype based on the MAX6373 chip.  I wrote a simple software driver (using timers in c#) that uses one GPIO to reset the hardware watchdog periodically.  If it misses a reset, the watchdog will perform a hardware reset on the ND/ND+ (or any other MCU)

 

The board was designed to have the watchdog timeout be selected by jumpers and expose all eight pins on the MAX to your breadboard.  All it needs is power, access to RESET, and one GPIO.

 

I will post the eagle layout and drivers once it is fully tested.  The board just came in from BatchPCB and will solder it this week.




#46201 4X20 LCD display with I2C Interface

Posted by AxelG on 25 February 2013 - 03:54 AM in Project Showcase

Thanks for the great project! I was wondering if you would be able to post you display class so I can see how you implement the LCD sreen? Thanks again!

Sorry it has taken some time to respond, I have been working on another project and just now getting back here.  I moved the MakeTextBlock() method into a display class that is quite specific to my project and may not make much sense posted as a helper-class.

 

Essentially this method uses a four element array of strings, one fore each line of the display.  This way it is easy to handle wrapping text on the screen; pass in a large string and the string gets broken into four smaller strings broken at the space character (and optionally centered on each line)

 

I can look at breaking out a more generic class if you are still interested; but it really isn't anything that special...




#44802 Netduino Plus 2 Firmware v4.2.2 (update 1)

Posted by AxelG on 03 February 2013 - 03:01 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks to Lunddahl and T!!

 

 

i also found that EndOfStream property is not set until AFTER the first access!!!  Before that it always reads "true".  If I use Peak() after opening the stream, and then change my while loop looking at EndOfStream it seems to work.

 

I will try looking at the solution T provided.  Thanks for your help!!




#44747 Netduino Plus 2 Firmware v4.2.2 (update 1)

Posted by AxelG on 02 February 2013 - 04:03 AM in Netduino Plus 2 (and Netduino Plus 1)

Update went well, but now I am seeing a quirky problem reading from the SD card.  The following code hangs on the "while (reader.Peak())" line.  Stepping through the debugger looks like it is stuck in a loop...  Here is the code.  The file on the SD card has 10 lines of ascii data.

 

            ArrayList PortList = new ArrayList();            using (StreamReader reader = new StreamReader(PortFileName))            {                while (reader.Peek() > 0)                {                    HoldPort = new MCUPort(reader.ReadLine());                    HoldPort.State = 1;                    HoldPort.LastState = DateTime.Now;                    PortList.Add(HoldPort);                }            }



#44466 Adafruit LCD MCP23017 IC

Posted by AxelG on 29 January 2013 - 01:44 AM in Netduino Plus 2 (and Netduino Plus 1)

Can you post a schematic?

 

I2C is sensitive to the pullup resistor values used on the SDA SCL wires.




#43999 Multithreading and writing to SD card

Posted by AxelG on 23 January 2013 - 06:40 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for this reply. Could you explain what is meant by a "locking scheme"?

Sure:

In my code I open the Filestream once and keep it open.  It would be a bad thing if multiple threads interacted with the the stream at "the same time".  I therefore create an object to lock it (private object LockMe = new object();) and any time I am reading or writing to the filestream I make sure the code holds a lock on this object (lock(LockMe) { //Code here } )

 

This way, you can ensure only one thread is interacting with the filestream at any given time.  Just make sure the scope of LockMe is shared between all threads.

 

I hope this helps.  You can google "C# lock()"  for more reference.




#43718 Netduino Plus 2 and LCD 20x4

Posted by AxelG on 19 January 2013 - 01:27 AM in Netduino Plus 2 (and Netduino Plus 1)

I used the same exact hardware on the ND and ND+ (version 1) and posed an article with light-weight driver here.




#43717 Multithreading and writing to SD card

Posted by AxelG on 19 January 2013 - 01:16 AM in Netduino Plus 2 (and Netduino Plus 1)

I have written a couple applications that have multiple threads accessing the SD card at the same time; it works but you need to be careful with a couple things.  You hit on the first one; one thread per file (reading and writing).  If you need two threads, simple locking mechanism can ensure read/seek/write transactions remain pure.  Since each thread keeps their own file structures (Assuming you are not sharing them!); mostly you are OK.

 

I have also found that dealing with the SD card is quite resource intensive; especially when mixed with time-sensitive sensor reading.  It is easy to create bottlenecks in the code that create data flow problems. Multi-threading on the netduino is not parallel processing; it just allows you to branch execution into separate places in your code - processor time is shared between the threads so only one instruction is running at a time.  The right locking scheme can make all of the difference.

 

SD cards also use SPI.  This is another area to make sure you code is aware there are multiple SPI devices.




#42927 small door sensor

Posted by AxelG on 07 January 2013 - 06:59 PM in Netduino 2 (and Netduino 1)

Another idea might be to wire a small piezo buzzer to the ND to also get an audio cue.

 

I have a home-built alarm system that will alert me to the opening or closing of a door or window while in standby.  Simple two beeps for open, one for closed.




#42926 4X20 LCD display with I2C Interface

Posted by AxelG on 07 January 2013 - 06:48 PM in Project Showcase

I have these working just fine on a N+2:

 

Here is a video of it working on my BoxCar:

 

http://sdrv.ms/UwMKxE

 

LMK if you want a code sample.

 

I would love to see the code samples!




#42831 4X20 LCD display with I2C Interface

Posted by AxelG on 05 January 2013 - 10:23 PM in Project Showcase

I attached the driver code to the first post.





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.