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.

Fred007's Content

There have been 22 items by Fred007 (Search limited from 20-April 23)


By content type

See this member's

Sort by                Order  

#59543 Opinions needed on CAN interface project

Posted by Fred007 on 04 August 2014 - 11:55 AM in General Discussion

Thanks. It is for an automotive project, and I was already thinking of some kind of onboard computer, so will probably go with a regular windows application for this. Thanks.




#59506 Opinions needed on CAN interface project

Posted by Fred007 on 01 August 2014 - 03:11 PM in General Discussion

I have netduino experience on 1,Plus1 and Plus2 and have some questions on a future project. I'd like to stay with the whole netduino / VS platform, (makes it very easy for me) but am looking to develop two projects. One will consume data from two CAN bus systems in my car. The other would be a CAN device simulator that could be used during development/testing.

 

I have a CAN shield but have not assembled it or worked with it on netduino yet.

 

My question is what you think would be a good way to proceed? Should I take the existing stuff I have and get it working? (i don't need a plus in the car, but a bluetooth would be nice)

 

Or, would something like the GO be a better platform for this? And, is there a module for the GO that already does the CAN protocol?

 

Any ideas would be appreciated. Thanks!




#58670 Scaling Analog Ports

Posted by Fred007 on 11 June 2014 - 02:59 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks so much for the help, sorry to go dark on this thread. Got distracted with some cloud services stuff. Yes, I realized that i needed to factor the 3.3v supply. The device is a HM1500LF humidity sensor. The code I have for reading the actual humidity is:

 

        private float _referenceVoltage = 3.3f;
 
            double voltage = analogInput.Read() * _referenceVoltage;
            humidity = 0.03892 * (voltage * 1000) - 42.017;    
 
Close enough for what I am doing.



#58598 Watchdog implemented on plus 2 4.3.1?

Posted by Fred007 on 06 June 2014 - 05:17 PM in Netduino Plus 2 (and Netduino Plus 1)

Is this implemented in 4.3.1 on a plus 2? I have the following simple code but it does not appear to be working.

 

            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            led.Write(true);                                                    // Start with led on, off after initialization
            Debug.Print("Sleeping for 5");
            Thread.Sleep(5000);         // sleep five seconds
 
            led.Write(false);
            Debug.Print("Enabling Watchdog at 100");
 
            Watchdog.Timeout = new TimeSpan(100);
            Watchdog.Behavior = WatchdogBehavior.SoftReboot;
            Watchdog.Enabled = true;
 
            Debug.Print("Sleeping for 1");
            Thread.Sleep(1000);         // Should reboot before here
            Debug.Print("Waking Up, not rebooted");
            Thread.Sleep(5000);         // Should reboot before here
            Debug.Print("Terminating program");
 
I thought I would see the board reboot before the "Waking Up..." output, but it does not reboot. Thanks.



#58474 Plus 2 serial issue with HA7S

Posted by Fred007 on 29 May 2014 - 05:42 PM in Netduino Plus 2 (and Netduino Plus 1)

using System;
using System.Collections;
using System.IO;
using System.IO.Ports;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace ndSerialTestHA7S
{
    public class Program
    {
        private const byte R = 82;
        private const byte S = 83;
        private const byte W = 87;
        private const byte s = 115;
        private const byte CR = 13;
        private static SerialPort _serialPort = null;
        private static Queue _serialQueue = new Queue();
        private static Object _lockQueue = new Object();
        public static AutoResetEvent unblockRead = new AutoResetEvent(false);
        public const int _readTimeout = 3000;
        public static void Main()
        {
            _serialPort = new SerialPort(SerialPorts.COM1);
            _serialPort.BaudRate = 9600;
            _serialPort.DataBits = 8;
            _serialPort.StopBits = StopBits.One;
            _serialPort.Parity = Parity.None;
            _serialPort.Handshake = Handshake.None;
            _serialPort.DataReceived += new SerialDataReceivedEventHandler(inboundSerial);

            byte[] devAddress = new byte[45];
            try
            {
                _serialPort.Open();
                writeSerial(R);
                readSerial(devAddress);
                log(devAddress);
                writeSerial(S);
                readSerial(devAddress);
                log(devAddress);
                writeSerial(s);
                readSerial(devAddress);
                log(devAddress);
                writeSerial(s);
                readSerial(devAddress);
                log(devAddress);
                int i = 1;
            }
            catch (SystemException se)
            {
                Debug.Print("Ha7s: " + se.Message);
            }
        }
        private static void inboundSerial(object sender, SerialDataReceivedEventArgs data)
        {
            while (_serialPort.BytesToRead > 0)                     // While there is data on the serial bus
            {
                lock (_lockQueue)
                {
                    _serialQueue.Enqueue((byte)_serialPort.ReadByte());
                }
            }
            unblockRead.Set();
        }
        private static void writeSerial( byte[] data, int len )
        {
            for (int i = 0; i < len; i++)
                _serialPort.WriteByte(data[i]);
        }
        private static void writeSerial(byte data)
        {
            _serialPort.WriteByte(data);
        }
        private static void log( byte[] buffer )
        {
            string message = "Log: ";
            message += new String(Encoding.UTF8.GetChars(buffer));
            Debug.Print(message);
        }
        private static void zero( byte[] buffer, int l)
        {
            for (int i = 0; i < l; i++)
                buffer[i] = 0;
        }
        private static int readSerial(byte[] data, byte termChar = CR)
        {
            zero(data, 20);
            int bytesRead = 0;
            bool keepChecking = true;
            while (keepChecking && (_serialQueue.Count > 0))                   // Have something in the queue
            {
                lock (_lockQueue)                                              // grab lock while dequeing
                {
                    data[bytesRead] = (byte)_serialQueue.Dequeue();            // grab a byte from the queue
                }
                if (data[bytesRead] == termChar)                               // Hit terminating character, stop grabbing bits
                    keepChecking = false;
                bytesRead++;
            }
            while (keepChecking)
            {
                bool signaled = unblockRead.WaitOne(_readTimeout, false);
                if (!signaled)                                              // Timed out, exit loop
                    keepChecking = false;
                else
                {
                    while (keepChecking && (_serialQueue.Count > 0))        // Have something in the queue
                    {
                        lock (_lockQueue)                                   // grab lock while dequeing
                        {
                            data[bytesRead] = (byte)_serialQueue.Dequeue(); // grab a byte from the queue
                        }
                        if (data[bytesRead] == termChar)                    // Hit terminating character, stop grabbing bits
                            keepChecking = false;
                        bytesRead++;
                    }
                }
            }
            return bytesRead;
        }
    }
}

I think it must be something in my setup, do I need to have a ground wire added somewhere for the plus2? (as opposed to a plus?) I have tried two plus 2 devices, two different HA7S devices, multiple temp sensors, and always get indeterminate results from the serial queries. Its like something is stepping on the UART queue, or inbound characters. Not at all like the behavior on the plus, very timing dependent. Started off with a  fairly simple program to just test the serial commands and can't get any good, or consistent results. Even flashed one unit back to 4.2.2 and have the same issues. Entire test program in message.

 

Would really appreciate any pointers. Thanks.




#58457 Plus 2 serial issue with HA7S

Posted by Fred007 on 28 May 2014 - 06:33 PM in Netduino Plus 2 (and Netduino Plus 1)

I also swapped out the HA7S and still have the same behavior. Will investigate the code a bit, doing some very simple interrupt handling, but will try a smaller example.




#58455 Plus 2 serial issue with HA7S

Posted by Fred007 on 28 May 2014 - 05:24 PM in Netduino Plus 2 (and Netduino Plus 1)

I have an app running on a plus, and working to bring another instance up on a plus2. It talks to the HA7S and to the temp sensors on the one-wire bus. On the new plus 2 setup, it looks like the serial buffer is getting over written. when I issue the 'S' get all devices command, I get a return that is different lengths but never the 16 characters I am looking for. It feels like a timing issue, but can't confirm/deny that. I am using the following serial settings.

 

Com1:9600,8,1,None

 

I swapped out the plus 2 for another one, no difference. Have used different temp sensors too, no joy. Am thinking now it may be the HA7S chip.

 

Thoughts?




#58179 Scaling Analog Ports

Posted by Fred007 on 16 May 2014 - 04:32 PM in Netduino Plus 2 (and Netduino Plus 1)

I think I am missing a step. Trying to read a voltage on Analog0 and measured with a meter its 1.77v but when I read in program I get .5079 (float from .Read()) or 2074 from .ReadRaw(). Is there a calibration setting I am missing? I read about having to pull up the AREF but thought on the Plus 2's that is not necessary. Thanks for any pointers.

 

(wont be reading anything beyond 3.3v, had a voltage dividing in the circuit but don't really need it)




#57966 Digital IO interrupt causing USB reset?

Posted by Fred007 on 06 May 2014 - 03:21 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok, a hard post to write, but please ignore this. I failed to create a NativeEventHandler and was just assigning the method address. Whoops. Caused all kinds of nasty problems, but not right away. As I saw in another post, please ignore, nothing to see here...




#57953 Digital IO interrupt causing USB reset?

Posted by Fred007 on 05 May 2014 - 04:50 PM in Netduino Plus 2 (and Netduino Plus 1)

I have a program that communicates over the net via sockets, and uses COM1 to talk to a OneWire bus. I also monitor the digital IO ports for simple circuit monitoring. Using a Netduino Plus 2 with 4.3 firmware, when I open a closed circuit, it will cause the PC to rediscover the Netduino over USB. (i get the unplug and plug in sounds). This causes the network connection to be reset. I have catches all over the code and can't see anywhere in my code where the socket would be closed, but that is what is being reported on the other end.

 

I also posted a note about very slow debug performance (when you step lines of code) and when I attach the debugger I get the USB reset sounds a couple of times. Things appear to be working, but I wonder about the Netduino driver. This is on a Windows 8.1 Update x64 machine.

 

Any ideas on why just opening/closing a digital port circuit would cause the connection with the PC to reset?

 

Thanks.




#57889 Netduino Plus 2 slow response (debugging)

Posted by Fred007 on 02 May 2014 - 04:08 AM in Netduino Plus 2 (and Netduino Plus 1)

I just replaced my Plus with a Plus 2. Updated the firmware to 4.3.1.0 and changed the projects to target 4.3MF. I am having some issues with debugging, generally while stepping through the code, it is very slow to respond. And when I start the debugger, the device seems to drop off the USB bus, then back on, then off, then on, sometimes one more time.

 

I can connect to it with MFDeploy, but that sometimes says "not supported" when I ask for device capabilities. Then again, sometimes it works just fine.

 

I thought I followed the instructions for updating the firmware completely, but am now wondering if I may have missed a step somewhere. I am using VS 2013 in case that matters.

 

I did not have these kind of performance issues with the plus, just some networking issues I hoped were cleaned up in 4.3.

 

Any ideas on how to examine this problem would be appreciated. Thanks!




#57852 Netduino Plus and Socket.Receive hang

Posted by Fred007 on 30 April 2014 - 02:36 PM in Netduino Plus 2 (and Netduino Plus 1)

I have a Netduino plus with the 4.2.0 firmware, and am using VS 2013 targeting the 4.2 MF. The Netduino is a client posting network updates to a "server" elsewhere on the net. For the most part, things appear to be working fine. However, once in a while, notice it when the server app is on a machine that goes to sleep, the socket.receive call just hangs forever. I do have a receive timeout specified and when the hang happens, it looks like the whole board has gone south. Have a timer routine sampling my sensors that toggles the LED, when it hangs, all activity on the board stops.

 

I was wondering if this might be a known issue and if there are any workarounds to this? In the event of the server going away (sleeping,problems,etc.) I am expecting the receive to eventually timeout which triggers a send (keep alive) packet which should throw an exception because the socket is now invalid. I have all this recovery code in there and working, problem is that the receive never comes back.

 

I have a Plus 2 and am going to try that with the 4.3 MF but was curious if the problem I am experiencing may be a know issue.

 

Thanks.




#57759 Reading 1-Wire devices with the HA7S interface SIP

Posted by Fred007 on 25 April 2014 - 02:01 PM in Netduino Plus 2 (and Netduino Plus 1)

Can you supply the pinouts you used for the HA7S? Assuming pin 3 to the Netduino digital pin 1 and pin 4 to Netduino digital pin 0, just want to make sure I have that correct. Thanks.




#57610 Need a bit of help, Netduino Plus

Posted by Fred007 on 17 April 2014 - 04:45 PM in Netduino 2 (and Netduino 1)

Thanks. Tried again this morning, and voila, it is working. I think its something in the project properties as you suggested. I did reset the device, start VS, made a change there, and it just started downloading the code. Hoping that once it works, it will keep working but have been able to get the code moving again which is key. "Feels" like an issue with VS, but only have the sense its related to the project properties.




#57594 Need a bit of help, Netduino Plus

Posted by Fred007 on 16 April 2014 - 04:56 PM in Netduino 2 (and Netduino 1)

Was not able to change anything in TinyCLR, had to go to TinyBooter to make any changes. It was during this that I think I screwed everything up and had to reflash the firmware. It is now booting in TinyCLR mode, at least that is what it says when I use MFDeploy and ping it.

 

Right now, I can use MFDeploy and ping it, get device capabilities, etc.

 

Problem is that with some, not all, projects, I can't load the assembly.

 

Do you know what VS is trying to do when you see the Iteration messages? When it works, this happens really fast and then you can see the pieces loading on the Netduino.

 

Thanks again, really appreciate the help.




#57591 Need a bit of help, Netduino Plus

Posted by Fred007 on 16 April 2014 - 03:45 PM in Netduino 2 (and Netduino 1)

Here is a new project, just touching the LED, that will not load. Other projects will load. I just can't seem to find out why some and not others. Can ping from MFDeploy just fine, get device capabilities, etc.

 

The one thing that changed, after I reloaded the firmware, I set the device name and the MAC address. Previously, I had not done this. The device name changed was automatically updated in Visual Studio. Did not think this could cause a problem, but is really the only thing I've done since flashing the firmware.

Really appreciate the help. Expecting a Plus2 shortly, but would like to get this one working so I can use it.

Thanks.




#57588 Need a bit of help, Netduino Plus

Posted by Fred007 on 15 April 2014 - 03:04 PM in Netduino 2 (and Netduino 1)

Does not appear to be that simple. I don't have a clue why some assemblies won't load. Created a new project, just added two lines to flash the LEDs, and it won't load. Very strange, some projects work sometimes, others not at all.




#57586 Need a bit of help, Netduino Plus

Posted by Fred007 on 15 April 2014 - 01:18 PM in Netduino 2 (and Netduino 1)

It must be a setting in the project file, new programs I create seem to work fine. When I try and compile/run old programs, I can't seem to deploy them. Will try this with the web server one and see what happens.

 

Thanks.




#57585 Need a bit of help, Netduino Plus

Posted by Fred007 on 15 April 2014 - 01:05 PM in Netduino 2 (and Netduino 1)

Sorry, should have mentioned that yesterday. Target framework is 4.2 Strange thing, just tried it again, and the simple little LED flasher program works. When I try and load the little web server program I have, using the network interface, it can't seem to deploy the program. I get the following messages in the output window.

Looking for a device on transport 'USB'

Starting device deployment

Iteration 0

...

Iteration 59

So it looks like it try's it 60 times then gives up. I don't see any of this when I try the LED flasher program.

 

Thoughts?




#57573 Need a bit of help, Netduino Plus

Posted by Fred007 on 14 April 2014 - 11:43 PM in Netduino 2 (and Netduino 1)

Getting back into this after being away from it for a while. Have a Plus2 on order, but in the meantime, want to get the Plus going. Had some issues, decided to flash the firmware and reset everything. Got that going (I think) and now can connect to the device (via the MFDeploy tool). But, can't seem to load any assemblies to the device from VS 2013. This was working yesterday but today, after all the resets and flash, can't seem to make it happen.

 

when I power up the Plus, I can connect and ping comes back with "Pinging... TinyCLR"

I can get device capabilities

HalSystemInfo.halVersion:   4.2.0.0

...

ClrInfo.clrVersion:       4.2.0.0

...

SoftwareVersion.BuildDate:   Sep 19 2012

 

 

What am I missing in order to get the assemblies to load in VS? Thanks.




#57562 Beta: Visual Studio 2013 support

Posted by Fred007 on 14 April 2014 - 10:55 AM in Visual Studio

Yes, targeting the 4.2 framework does get me up and running. Strange thing, code that used to work fine, now gives me an exception. It's the first call in my listener that is now causing the trouble. I have this call:

using( Socket clientSocket = listeningSocket.Accept() )

and that is what is triggering the exception.

 

Couple of things. If I want to get current on Netduino hardware, what would you suggest? And, are there any examples of simple web servers working on the experimental framework?

 

Thanks for the help, very much fun getting back into this after a few years!




#57548 Beta: Visual Studio 2013 support

Posted by Fred007 on 14 April 2014 - 03:23 AM in Visual Studio

Getting back into this after some time away. Have VS 2013, installed the MicroframeworkSDK and Netduinosdk VS 2013 experimental versions. Things look good, can build and run the standard blinky apps.(Netduino Plus) When I try the project I was working on last, web server, I can't deploy it to the device when I target the .Net MF 4.3, but it will deploy when targeting 4.2. I suspect I need to load new firmware on the Plus, but have seemed to have purged this memory from my brain.

 

Ran the MFDeploy tool, have target framework 4.2.0.0. Could not seem to find an updated firmware for the Plus.

 

Hoping someone can point me in the right direction. Thanks.





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.