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.

nhale's Content

There have been 29 items by nhale (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#57341 Microsoft Build 2014 (and Netduino SDK for Azure)

Posted by nhale on 04 April 2014 - 09:59 AM in General Discussion

Hi,

 

great to hear that Microsoft will spend more work in enhancing the .NET MF.

I also like that you guys are working on further improvements for the Netduino-plattform and I could imagine that you get some sponsorship by adding Azure support (you don't need to confirm or deny ;-))

 

Azure itself is an interesting platform, the reason why I still run my own server is that it's cheaper when you don't just need a plain webserver. For me I need also some more database space, which makes Azure quite expensive very fast - are you maybe also in discussion with Microsoft to provide some IoT/Netduino-pricing which also fits more to the pricing segment of low-cost devices?

 

Thanks




#57331 my Netduino 2 is stuck in BootLoader mode and its driver will not respond

Posted by nhale on 03 April 2014 - 07:41 PM in Netduino 2 (and Netduino 1)

I opened an issue for the problem.

https://netmf.codepl...m/workitem/2226




#57328 Netduino 2 Firmware v4.3.1 with GCC support

Posted by nhale on 03 April 2014 - 05:54 PM in Beta Firmware and Drivers

 

otherwise, you have to pay several thousand dollars for commercial ARM toolchains (such as Keil MDK).

thanks, that was the missing information ;-)




#57322 Read data from CAN-Bus using ELM327

Posted by nhale on 03 April 2014 - 09:24 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

thanks for the hint, I will take a look once my Buffer overflow problems are solved ;-(




#57321 Netduino 2 Firmware v4.3.1 with GCC support

Posted by nhale on 03 April 2014 - 09:20 AM in Beta Firmware and Drivers

Don't get me wrong but can maybe also explain the advantages, why I should use that? What's the benefits or what problem is solved? Just have no clue and ask myself if I should take a look at it ;-)




#57320 my Netduino 2 is stuck in BootLoader mode and its driver will not respond

Posted by nhale on 03 April 2014 - 09:05 AM in Netduino 2 (and Netduino 1)

Hi Chris,

sorry for the late reply.

Installed:
- Windows 7 with NETMF 4.3 (QFE1) and Netduino SDK 4.3, I deinstalled the older versions before
- VS2012 Premium (VS2013 Premium installed but not used for Netduino development - if this info is relevant)

When I make a simple program without any Threads and just reading the data from the Serial Port even then I get errors.

I attached a small solution which does nothing else then configuring the Hertz and Baudrate for the GPS receiver and then starts waiting for data.

In the "Main" there are two options when calling the Start-method. One works using a while loop and one using the DataReceived Event.

The while loop works better but even there I get the following (can be seen when doing a Ping with MFDeploy)
Both occur multiple times
- Failed allocation for 5 blocks, 60 bytes
- Buffer OVFLW

When running with the DataReceived event MFDeploy shows only
- Buffer OVFLW

The Thread.Sleep at the beginning of the main is used to be able to redeploy stuff, because as soon as the Buffer OVFLW happens
it's a problem.

The implementation for the N1(+) does a lot more than just reading the data from the serial port, is using threads and works fine.
My question is the following, how can I prevent these errors? Is there anything I can do in the coding to detect that it might happen sooner or later or to clear something to get rid of it?

Thanks

 

 

 

Attached Files




#57235 Compatible Shields and Accessories

Posted by nhale on 31 March 2014 - 03:38 PM in Netduino 2 (and Netduino 1)

Does the Adafruit Ultimate GPS Logger Shield work with netduino? Not the older one, this one:

http://www.adafruit.com/products/1272

 

I would also be interested in that




#57221 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by nhale on 30 March 2014 - 10:06 AM in Netduino Plus 2 (and Netduino Plus 1)

 

Its not just about moving it! Could you please try this:

- remove(!) the backup battery from the GPS module

- power the GPS module using the Netduino board (5V, GND). Do not power the GPS using batteries !!!

- try to get a sat fix with the GPS powered by the Netduino

 

Normally I'm running a N1+ or N2+ (but I also tested it with the non-plus variants). Both with the same configuration.

+ Arduino Protoshield with a

-->Soldered Adafruit Ultimate GPS v3 connected to COM2

-->Soldered IC 74HC595 driving 3 bi-color LEDS (5mm)

+ Seeedstudio GPRS Shield v2 (per default because of the PCB design to COM1)

 

While debugging/development it's connected to the USB Port only and productive testing to 12V.

In both scenarios I attach an external GPS antenna, as the results are much better. And getting a valid fix is faster.

 

I tried it yesterday with and without a backup battery, after removing the battery i was waiting for about 30 minutes.

With backup battery it takes about 10-20 seconds to get a fix and a few seconds later a valid position

Without backup battery it took about 2 minutes to get a fix and shortly after i got a valid position

 

I know that you want to drive it without an external antenna, but I think the setup above should show that there is something strange going on.

Have you had the possibility to try another Netduino, just to eliminate the possibility of a problem with exactly this board.




#57142 Commercial-grade duinoCases ...

Posted by nhale on 26 March 2014 - 11:51 AM in Netduino 2 (and Netduino 1)

What are the maximum dimension in height and depth? E.g. I have Netduino, arduino protoshield and Seeedstudio GPRS shield v2 will it fit?
Do you ship to Germany?



#57141 my Netduino 2 is stuck in BootLoader mode and its driver will not respond

Posted by nhale on 26 March 2014 - 11:37 AM in Netduino 2 (and Netduino 1)

Hi Chris,

 

sure the N2 is faster but from my point of view there must be another problem. Imagine the following:

- GPS sensor sends data with 115200 baud and 10Hz updates (Adafruit Ultimate GPS v3), so the amount of data is always the same regardeless of N1 or N2.

- N1 which is slower, so cannot read the data so fast --> I would expect the buffer overflow, but works fine.

- N2 which is faster, so can read the data faster, to make memory free for new incoming data throws a buffer overflow...

=> Again the source of the data behaves the same. The code is the same, just the Netduino is different.

 

 

If you want that I file a bug, I can do this - but is discarding really the solution?

What I'm missing is some kind of advice how things should be done - I tried several implementations of reading data from the serial port here from the forum and none of them is by default stable, all of them ran into the same problem after seconds or less than 5 minutes ;-( (and buffer or allocation problems only occured on N2)

 

If really discarding the data is the only way, than I think it would be somehow helpful to throw an exception which can be caught via code once a buffer overflow was detected, that you at least know what happened. Because currently it's just a lot of effort to find out what happened and get a fixed version again on the device (see my last post)




#57134 my Netduino 2 is stuck in BootLoader mode and its driver will not respond

Posted by nhale on 26 March 2014 - 09:21 AM in Netduino 2 (and Netduino 1)

Hi,

 

i have the same problem more often than I would like to.

I'm currently trying to get my N2(+) devices running, and found out, that the N2-series is much more fragile when it comes to handling data (currently only evaluated the serialport).

When the driver does not respond, in 99% it's a "Buffer overflow" message.

 

How to identify?

  • You try to deploy new assemblies via Visual Studio and the debugger does not attach
  • After deploying new assemblies, the device restarts on it's own every few seconds
  • Messages like "Device not found" or similar shown when trying to deploy new assemblies
  • Detach any debugger and open the "MFDeploy" tool from the Micro Framework SDK. Select "USB" and after connecting the USB cable press the "Ping" button a few times. The "buffer overflow" messages or any Debug.Print output can be seen there.

 

How to solve?

  1. If VS shows message that it's waiting for the device to reboot, after deployment was successfull. Just unplug and replugin the USB cable, in most cases the debugger automatically attaches.
  2. If even deployment is not possible with messages like "Device not found" or similar. Following sequence works for me in most cases. Unplug USB cable. Rebuild in VS (F6). Clean Solution. Start deployment with debugging (F5), without the device attached. Now the console in VS should show something like "Iteration 1, Iteration 2...", now plugin the USB cable again. This should at least make it successfull to deploy the new assemblies. If the debugger then does not attach, try step 1.)
  3. If step 1.) and 2.) do not work try to erase the app via the "Netduino Update Tool", in 50% of the cases this helps, if not for me the only solution was redeploy the firmware.

 

Altogether I'm not really happy with the new N2(+) series, by only introducing a Thread.Sleep(100) after reading the buffer on a SerialPort I got the buffer overflow problem again, while on the N1(+) series it works without any problem for month. Also working with the DataReceived event on the SerialPort causes a "buffer overflow" working with the same code in a simple while() did not make any problem.




#57063 SerialPort buffer overflow on Netduino 2

Posted by nhale on 24 March 2014 - 10:34 PM in Netduino 2 (and Netduino 1)

Ok, got it running.

What did I do?

- Introduce check to see if more than 1 byte is there to read (read in the forum, that check for >0 can be a problem)

- Then I had several messages "Failed to allocate 5 blocks 60 bytes". I tried to set the buffer array as instance variable instead newly created on every DataReceived event. But the problem still existed. (the step with the instance variable was also posted as possible solution in the forum)

- Then I tried to switch between the different Baudrates the GPS receiver support, and boom that's it, now it's running. It seems that the receiver was reset in the meantime, with the full app I set it to 115200 baud but removed this to eliminate every unnecessary. So I think the points above fixed it.

 

Now I try to enhance the code skeleton to finally provide the full functionality in parsing the NMEA strings.

 

If someone is interested, here is the code which is running fine now.

public static void Main()
        {
            //Required, otherwise redeploy not possible due to Buffer overflow
            Thread.Sleep(8000);

            GpsConnector _gpsConnector = new GpsConnector();

            Thread.Sleep(Timeout.Infinite);
            Debug.Print("EXIT - should not happen");
        }

    public class GpsConnector
    {
        SerialPort _serialPort;
        private byte[] _buffer;

        		
        public GpsConnector()
        {		
            _serialPort = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);
            _serialPort.ReadTimeout = 500;		
            _serialPort.Open();
            if (_serialPort.IsOpen)
            {                               
                _serialPort.DataReceived += _serialPort_DataReceived;
                _serialPort.ErrorReceived += _serialPort_ErrorReceived;
            }
        }

        void _serialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
        {
            Debug.Print("Exception event raised: " + e.EventType.ToString());
        }

        void _serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            Debug.Print("Data received");
            try
            {
                int bytesToRead = _serialPort.BytesToRead;
                if (bytesToRead > 1)
                {
                    // get the waiting data
                    _buffer = new byte[bytesToRead];
                    _serialPort.Read(_buffer, 0, _buffer.Length);

                    //copy the byte array to a readable string
                    String str = new String(System.Text.Encoding.UTF8.GetChars(_buffer));
                    if (str != null)
                    {
                        Debug.Print("Value "+str);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.Print("Exception raised on data received: "+ex.ToString());
            }
        }
    }



#57061 Multiple Serials Ports in Threads - Best Practices

Posted by nhale on 24 March 2014 - 09:38 PM in Netduino Plus 2 (and Netduino Plus 1)

I think we are talking about a similar problem here.

I also have issues with reading from the serial port on N2(+) devices

http://forums.netdui...e-v431/?p=57040




#57056 SerialPort buffer overflow on Netduino 2

Posted by nhale on 24 March 2014 - 10:38 AM in Netduino 2 (and Netduino 1)

I will try that and hope it helps



#57053 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by nhale on 24 March 2014 - 08:18 AM in Netduino Plus 2 (and Netduino Plus 1)

 

a mobile network connection is definitely not required to get a sat fix.

 

I know, I just wanted to say that you should not compare the mobile phone with a standalone GPS receiver, as the mobile phone has additional "support" through the network. I really think that you should try the backup battery and wait until you got a fix, then disconnect and reconnect with the Netduino (backup battery always attached).




#57040 SerialPort buffer overflow on Netduino 2

Posted by nhale on 23 March 2014 - 10:21 PM in Netduino 2 (and Netduino 1)

So I nailed it down why my N2 does not work since I got it last year. Now I upgraded again and still did not work.

The problem is that the same code below runs on the N1 and N1+ without any problem, but on N2 and N2+ nothing works.

When starting MFDeploy after deploying the code to the N2(+), the console shows an endless list of "Buffer overflw" messages. Again on N1(+) it's running for hours without any problem.

 

Please advice what's wrong here...because it's still an issue in 4.3.1

There is just an Adafruit Ultimate GPS sensor v3 connected to the N2 nothing else

public class Program
    {
        public static void Main()
        {
            //Required, otherwise redeploy not possible due to Buffer overflow
            Thread.Sleep(8000);

            GpsConnector _gpsConnector = new GpsConnector();

            Thread.Sleep(Timeout.Infinite);
        }
    }

    public class GpsConnector
    {
        SerialPort _serialPort;
        private char[] splitBy = new Char[] {'\r', '\n'};
        private bool _isStarted;
        
        //'objectified' main		
        public GpsConnector()
        {		
            _serialPort = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One);
            _serialPort.Handshake = Handshake.None;
            		
            _serialPort.Open();
            if (_serialPort.IsOpen)
            {
                _isStarted = true;
                DoProcessing();
            }
        }

        private void DoProcessing()
        {           
            if (!_serialPort.IsOpen)
            {
                _serialPort.Open();
            }

            while (_isStarted)
            {
                int bytesToRead = _serialPort.BytesToRead;
                // get the waiting data
                byte[] buffer = new byte[bytesToRead];
                _serialPort.Read(buffer, 0, buffer.Length);
                _serialPort.Flush();
                //only accept a statement starting with $
                if (buffer[0] != 36)
                    continue;

                //copy the byte array to a readable string
                String str = new String(System.Text.Encoding.UTF8.GetChars(buffer));

                //break up string into statements
                string[] statements = null;
                statements = str.Split(splitBy);

                for (int i = 0; i < statements.Length; i++)
                {
                    //only accept statements with a checksum
                    String currStatement = statements[i];
                    if (currStatement.Length > 0 && currStatement.IndexOf("*") >= 0)
                    {
                        Debug.Print(currStatement);
                    }
                }
            }
        }
    }



#57036 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by nhale on 23 March 2014 - 08:48 PM in Netduino Plus 2 (and Netduino Plus 1)

I'm not familiar with these portable GPS devices but mobile phones also use the mobile network to get the GPS location. I remeber situations where there was no network signal and also the GPS could not get a fix.

For both I think they have some kind of RTC, so try it with the backup battery. I have still the first one since about a year.

 

The problem with the connection to the Netduino is indeed somehow strange.




#57031 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by nhale on 23 March 2014 - 07:05 PM in Netduino Plus 2 (and Netduino Plus 1)

Do you have the small battery at the bottom at all times?

Because this helped me, as the internal RTC is kept running and this helps the system to get the fix faster.

 

I've once had another GPS shield, which was a lot bigger and so on and I only got a fix only once and never again.

With the Adafruit Ultimate board it's running without any problems.

 

Why is an external antenna no option?




#57022 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by nhale on 23 March 2014 - 03:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I'm running two of them without any problems on a N1 and N1+ device. Using N2(+) devices the same code does not run probably (even with the new 4.3.1)

 

Antenna:

I always run the GPS board with an external antenna, as I noticed that the position is only accurate with an external antenna.

When using the built-in antenna, the positions are about 20-50 meters off the original track. With antenna it's less than 1-2 meters.

 

Wiring:

I have the board connected to the Rx/Tx and the 5V and GND nothing else.

 

Battery:

As I also had some issues with getting a fix after disconnecting from the power source, I added the battery and since then it gets a fix after about 30 secs (even when I travelled about 350km without switching the device on).

I think the combination of battery + antenna do the trick.

 

I don't know where you live, but in Germany I bought the antenna and the adapter cable from Exp-Tech as they deliver very fast (within 2 days).

http://www.exp-tech....-Mount-SMA.html

http://www.exp-tech....pter-Cable.html

 

Maybe some additional comment, you can switch between a 1Hz, 5Hz and 10Hz update rate.

I still have problem with that and it sometimes works and sometimes not, but once the rate is set with the battery the setting is kept.

To switch I have to change to 9600 baud and then restart the serial connection with the working-baudrate.

With the following combinations I made good experience

- 1Hz, 9600 Baud, Full data

- 5Hz, 115200 Baud, RMC+GGA

- 10Hz, 115200 Baud, RMC only (RMC+GGA currently under evaluation if results are good)

 

Hope this helps.

using System;
using System.IO.Ports;
using System.Threading;
using LL.Core;

namespace LL.Gps
{ 
   public class GpsConfig
   { 
   #region Hertz
      // Set the update rate to 1 Hz
      public const string GPSUpdateRate1HZ = "$PMTK220,1000*1F";
 
      // 5 Hz update rate- for 9600 baud you'll have to set the output to RMC or RMCGGA only 
      public const string GPSUpdateRate5HZ = "$PMTK220,200*2C"; //5Hz
 
      // 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only
      public const string GPSUpdateRate10HZ = "$PMTK220,100*2F"; //10Hz
   #endregion
 
   #region Data
      //turns on RMC (recommended minimum) and GGA (fix data) including altitude 
      public const string GPSDataRecommendedMin = "PMTK_SET_NMEA_OUTPUT_RMCGGA";
      //turns on only the "minimum recommended" data for high update rates!
      public const string GPSDataMinimum = "PMTK_SET_NMEA_OUTPUT_RMCONLY";
 
      //turns on all the available data - for 9600 baud you'll want 1 Hz rate
      public const string GPSDataFull = "PMTK_SET_NMEA_OUTPUT_ALLDATA";
   #endregion
 
   #region Baudrate
      public const string GPSBaudrate9600 = "$PMTK251,9600*17"; //9600
      public const string GPSBaudrate57600 = "$PMTK251,57600*2C"; //57600
      public const string GPSBaudrate115200 = "$PMTK251,115200*1F"; //115200
   #endregion

        public void Set1Hz()
        {
            Logger.Log(LoggerSource.GPS, "Receiver set to 1Hz");
            Thread.Sleep(1000);
            SendCommand(GPSBaudrate115200);            
            Thread.Sleep(1000);
            SendCommand(GPSDataFull);
            Thread.Sleep(1000);
            SendCommand(GPSUpdateRate1HZ);            
        }

        public void Set5Hz()
        {
            Logger.Log(LoggerSource.GPS, "Receiver set to 5Hz");
            Thread.Sleep(1000);
            SendCommand(GPSBaudrate115200);            
            Thread.Sleep(1000);
            SendCommand(GPSDataRecommendedMin);
            Thread.Sleep(1000);
            SendCommand(GPSUpdateRate5HZ);
            
        }

        public void Set10Hz()
        {
            Logger.Log(LoggerSource.GPS, "Receiver set to 10Hz");
            Thread.Sleep(1000);
            SendCommand(GPSBaudrate115200);            
            Thread.Sleep(1000);
            SendCommand(GPSDataRecommendedMin);
            Thread.Sleep(1000);
            SendCommand(GPSUpdateRate10HZ);         
        }       
        private void SendCommand(string line)
        {
            Send(line + "\r\n");
        }

        private void Send(string line)
        {
            if (line != null && line != String.Empty)
            {
                while (!_serialPort.CanWrite)
                {
                    Thread.Sleep(100);
                }
                System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
                byte[] bytesToSend = encoder.GetBytes(line);
                _serialPort.Write(bytesToSend, 0, bytesToSend.Length);
            }
        }
    }
}



#57016 Read data from CAN-Bus using ELM327

Posted by nhale on 23 March 2014 - 10:20 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I bought a Sparkfun OBD-UART II board and I'm able to read data from the OBD interface.

Now I need some additional data from the CAN-Bus which is not accessible via an OBD code.

 

Regarding to the spec of the ELM327 there are some commands related to CAN, but I don't really get the idea of how to read a value for a specific CAN-Id...

 

Maybe someone already did something in this direction and may help me out how to do this.

For example I found this site with a CAN-Id and the description how the value is formatted:

http://www.loopybunn...PC/can/0CE.html

 

I found some topics regarding some "MCPC2515" but I think that's different to the ELM327, or is the procedure the same (when leaving out that one works with SPI and the other UART)

 

Thanks in advance




#53205 Netduino 2 Firmware v4.3.0 (beta 1)

Posted by nhale on 15 October 2013 - 07:34 AM in Beta Firmware and Drivers

Then what is. The N2+ has been out of stock in uk amazon.co.uk for a while. Has there been news of a new product on the way? I'm having issues with 4.3 that having the source code for may help. Moving 4.3 to final andor releasing the source would be fantastic. Cheers

 

So sounds for me N2(+) is dead - according to the availability and the missing statement from Chris.

This means to me, that I will invest work in "Raspberry Pi" - goodbye




#52804 Netduino 2 Firmware v4.3.0 (beta 1)

Posted by nhale on 18 September 2013 - 10:48 AM in Beta Firmware and Drivers

Hello???

Any official statements?




#52687 Connect Push-Button to Analog-Pins

Posted by nhale on 10 September 2013 - 03:52 PM in Netduino 2 (and Netduino 1)

Ok, thanks, when they are also just Digital IO's then there is already some example on the Wiki here.

Many thanks!!!




#52682 Connect Push-Button to Analog-Pins

Posted by nhale on 10 September 2013 - 10:01 AM in Netduino 2 (and Netduino 1)

Hi,

 

as my digital pins are nearly all in use, I asked myself if there is a possibility to connect a pushbutton like this one (http://www.conrad.co...product/706140/) [font="arial, helvetica, sans-serif;"]to the Analog pins?[/font]

 

Is this possible via the analog pins and if yes, is there some kind of tutorial how to do it with the analog pins?

Is there some restriction in the cable length between button and pin? Do I need additional resistors or something like that? (sorry I'm no electronics guy ;-))

 

Thanks in advance.




#52681 netduino plus 2 compatible gps/gsm module

Posted by nhale on 10 September 2013 - 09:52 AM in Netduino Plus 2 (and Netduino Plus 1)

Take a look at these ones.

 

The Seeedstudio GPRS Shield v2.0 has GSM and GPRS support and you can replace the internal antenna

http://www.seeedstud...tml?cPath=19_20

http://www.seeedstud...PRS_Shield_V2.0

 

and the Adafruit Ultimate GPS Breakout v3 gives you selectable rates of 1/5/10Hz, the possibility to connect an external antenna and everything on a quite small PCB.

http://www.adafruit.com/products/746

 

Both work fine with my Netduino and both have the same type of u.FL connector for their antennas.

 

Have fun

 

 





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.