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.

seascan's Content

There have been 31 items by seascan (Search limited from 19-April 23)


By content type

See this member's


Sort by                Order  

#56841 Sine wave

Posted by seascan on 16 March 2014 - 01:50 PM in Netduino Plus 2 (and Netduino Plus 1)

Oh wow.  It will take me a little bit to digest this but, at first glance this does look like the answer!

 

As for the coils, I am planning on  two separate coils.  One to transmit and one to receive.  Can two SPI channels be opened simultaneously?   I was thinking to use one for the Transmit and One for the Receiver and then compare them to find the phase shift.




#56831 Sine wave

Posted by seascan on 15 March 2014 - 11:39 PM in Netduino Plus 2 (and Netduino Plus 1)

Okay...  let me ask about part 2 of all this:

 

IF a PWM wave of say 25KHz was driving the transmitter coil, is an ND2 fast enough to read say 8 points within the response.  So, the period is 40us.  To read 8 points would be a sample every 5us.  Can the Netduino reliably do this?  Based on this post  it looks doable.  Does anyone have any experience with high speed ADC with the Netduino?




#56816 Sine wave

Posted by seascan on 15 March 2014 - 01:51 PM in Netduino Plus 2 (and Netduino Plus 1)

I agree with the DSP approach.  PIC makes one that is somewhat user friendly but, that means learning WAY more than I intended... oh well, part of the fun I guess.

 

I have read that some detectors do use a square wave instead of a sine wave...  I am not sure if this is accurate information or not.  If it is then I was thinking that if I could use the PWM output coupled to SOMETHING to drive the AC wave then I could use two inputs to measure the phase shift.  One would read the PWM pulse and one the return signal.  Then measure the time delay between them.  Since they are both digital waveforms, I figure this would be a lot easier than trying to do the same with analog waves.




#56801 Sine wave

Posted by seascan on 14 March 2014 - 08:36 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks, Hazibal.  That's definitely an option.   :)

 

But, my goal is to see how much I can do with the ND... I'm not so much about the end result as how to get there!




#56797 Sine wave

Posted by seascan on 14 March 2014 - 06:11 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Mario!  Thank you for the reply.

 

Sorry... I knew I was struggling trying to describe my intentions.

 

My end goal is to try and make a metal detector... I figured this would be a fun project to help me (and anyone else interested) learn some fundamental concepts of Transmitters/Receivers!

 

I would like to see if the ND could be used to generate a signal then read the response amplitude and phase shift from a returned signal.

 

My starting point is the transmitter.  I was thinking of trying to use a PWM output and SOMEHOW converting this to an AC square wave (instead of 0-3.3V, perhaps convert this to +-12V or even +-5V.  Do you know of any devices that can assist in doing this?

 

Thank you!




#56788 Sine wave

Posted by seascan on 14 March 2014 - 12:41 AM in Netduino Plus 2 (and Netduino Plus 1)

After further research, it looks like I am going to use the 50% duty cycle PWM with a 40us period to produce an approximate 25.5kHz square wave instead of a true sine wave.

 

 

I am using the output to drive an antenna.  I additionally need to READ a responding wave at the same frequency and measure the phase shift.

 

Can the Netduino do this?  The specification looks like the ND is 5000 times faster than this frequency...  but, can I access and the analog or digital pins fast enough to measure phase shift somehow?




#56781 Sine wave

Posted by seascan on 13 March 2014 - 05:14 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi.  I was wondering if anyone can enlighten me on how to go about creating a 26khz sine wave with a Netduino?  Also, is the ND's DAC fast enough to sample/measure a responding wave with this frequency?

 

Sorry if my question doesn't make sense.  My strengths are more with coding... I'm not 'tuned in' to the electronics as much.

 

Thanks!

Terry




#55967 ND+1 Connected to Router

Posted by seascan on 09 February 2014 - 04:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Chris, I should have added that I did try multiple power supplies.  Also tried using a phone charger through the USB to power it and had the same issue.  

 

I really like your idea:

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Finally...if all the above doesn't help, I would recommend using some of the free serial pins (D0/D1, D2/D3 on Netduino 1...or those and D7/D8, SDA/SCL on Netduino 2) on your Netduino mainboard and connecting those and GND via a USB TTL adapter to your PC. Then you can Debug.Print out the status of your program operation via a channel which acts consistently in all circumstances--and "see" what your code is doing remotely.[/color]



#55963 ND+1 Connected to Router

Posted by seascan on 09 February 2014 - 03:54 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris.  Yes, it has been quite a journey.  I discovered that the problem occured when I was powering the relay from the +5V on the ND.  I guess that with the Ethernet, writing to the SD and powering a few sensors must have been too much.  I was tired and didn't want to fiddle with it anymore.  It's been weeks of brain-strain.  I was about to give up --  actually, I did.  I put everything away and said to myself that "that's it. Enough is enough".  

 

20 minutes later it hit me:  instead of using a relay or any other crazy ideas, how about waiting  a minute and sending an ethernet request to itself on powerup.  If I don't get a response then cycle the power with powerstate.

 

It worked!  

 

So, now I just need to figure out why I lose ethernet connectivity after 30 minutes or so (while on USB I never had this issue).  

 

So, it continues....




#55948 ND+1 Connected to Router

Posted by seascan on 08 February 2014 - 09:55 PM in Netduino Plus 2 (and Netduino Plus 1)

I am starting to narrow down the issue.

 

Whenever I attach my screw shield (shield that converts the header pins to screw terminals) the SD card needs to be re-formatted.  The file I create can not be deleted -- even with the PC!

 

Curiouser and Curiouser!

 

 




#55947 ND+1 Connected to Router

Posted by seascan on 08 February 2014 - 09:30 PM in Netduino Plus 2 (and Netduino Plus 1)

I will try that... but, first I need a new SD card.  Now, it's hanging in debug mode when I try to delete the file  :blink:

 

(EDIT) -- Never mind, I just had to reformat.




#55945 ND+1 Connected to Router

Posted by seascan on 08 February 2014 - 08:09 PM in Netduino Plus 2 (and Netduino Plus 1)

Excellent ideas!  I may try to implement... but, for now I want/need to get an understanding of this strange behavior with the SD card.  




#55942 SD Card Reading with External Power

Posted by seascan on 08 February 2014 - 07:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi jrlyman3.  Very good advise.  I just checked and the board is getting 9.41V.  Right in the middle of the expected range.

 

 




#55941 ND+1 Connected to Router

Posted by seascan on 08 February 2014 - 07:39 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks again, Paul.

 

When it gets to the end it just quits.  When I rerun it on USB it works great.  On external power it doesn't work.

 

I am thinking it's an SD card issue and just created a new thread with an even more simplified example.

 

Perhaps I need to just throw in the towel and try an ND+2.  But, I am concerned that this will happen on it as well!  




#55938 SD Card Reading with External Power

Posted by seascan on 08 February 2014 - 07:32 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi.  I have a Very simple program that creates a file on an SD card at boot up.  If the File exists, it lights the LED and deletes the file (so the next boot up the LED is off).

 

This works perfectly while plugged into my computer via USB -- every other reboot the LED is on.  When the ND is being powered by an external power supply it does not work -- EVERY reboot the LED is on.

 

I have an ND+1 with 4.2 and a 2GB SD Card formatted to FAT32.

 

Any ideas?

Imports Microsoft.SPOTImports Microsoft.SPOT.HardwareImports SecretLabs.NETMF.HardwareImports SecretLabs.NETMF.Hardware.NetduinoPlusModule Module1    Public _onBoardLED As OutputPort    Sub Main()        _onBoardLED = New OutputPort(Pins.ONBOARD_LED, False)        If System.IO.File.Exists("SDRebootMe.txt") Then            Do Until System.IO.File.Exists("SDRebootMe.txt") = False                System.IO.File.Delete("SDRebootMe.txt")            Loop            _onBoardLED.Write(True)                   Else            Do Until System.IO.File.Exists("SDRebootMe.txt") = True                Dim file As New System.IO.FileStream("SDRebootMe.txt", System.IO.FileMode.Create)                Dim SR As New System.IO.StreamWriter(file)                SR.WriteLine("FooBar")                SR.Flush()                SR.Close()                file.Close()            Loop            _onBoardLED.Write(False)        End If    End SubEnd Module

Thank you!

Terry




#55937 ND+1 Connected to Router

Posted by seascan on 08 February 2014 - 07:05 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Paul.  Thank you for the reply.

 

Yes, I am running 4.2.  I have alternated between 4.2.0.1 and a version of 4.2 that has OneWire and a Watchdog timer.  I've reflashed this ND many times to see if that is the issue.

 

What it comes down to is that it runs perfectly while connected by USB but, bizarrely when off external power.

 

To ensure I am truly cycling power, I rigged up a relay to an output pin.  The hot wire for my AC plug is wired into the normally closed portion of the relay.  When I set the relay high the power to the ND is reset (as well as the relay going back to the NC position). Works great!

 

In the Main portion of my code I read from the SD card.  If there is a file called rebootme then I reboot and delete the file (so that it doesn't reboot on the next go around).  

Take a look at this:

  Sub Main()        _onBoardLED = New OutputPort(Pins.ONBOARD_LED, False)        Dim Flash As Boolean        If System.IO.File.Exists("SDRebootMe.txt") Then            Do Until System.IO.File.Exists("SDRebootMe.txt") = False                System.IO.File.Delete("SDRebootMe.txt")            Loop            For x = 1 To 45                For i = 1 To 10                    _onBoardLED.Write(Flash)                    Thread.Sleep(100)                    Flash = Not Flash                Next            Next            _ResetRelay.Write(ONSTATE)            Exit Sub        Else            Do Until System.IO.File.Exists("SDRebootMe.txt") = True                Dim file As New System.IO.FileStream("SDRebootMe.txt", System.IO.FileMode.Create)                Dim SR As New System.IO.StreamWriter(file)                SR.WriteLine("FooBar")                SR.Flush()                SR.Close()                file.Close()            Loop        End IfEnd Sub

I have do loops to ensure that the file is deleted or written!  Bullet proof, right??  NOPE.  When I run off external power it just constantly reboots and re-runs the same portion.  When I run off of the USB in debug mode it is perfect every time.

 

I put the do loops in for deleting and creating the file just to be doubly sure that it is working.  Since the code gets past this and starts flashing the LED the I KNOW the file was deleted.  Still on the next reboot it "sees" the file and drops into the same portion of the code.

 

I re-formatted the 2GB SD card (tried both FAT and FAT32).  Still no workie.  

 
I am at the end of my rope on this thing and have no clue what to try next.



#55922 Netduino Plus Network Problem

Posted by seascan on 07 February 2014 - 06:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Have any of you figured this one out?  I seem to be running into the same issue.




#55921 ND+1 Connected to Router

Posted by seascan on 07 February 2014 - 06:15 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi.  This one is difficult to explain.  I have been trying to figure it out on my own for days and have failed.    For a few weeks I have been building an application on an ND+1.  It works great.  Reading humidity, multiple temperatures, light levels, controlling relays, etc.  I connected the ND to a Netgear WNCE2001 (Ethernet Adapter) and set my ND to a static IP address.  Again, works great.  With port forwarding on my home router I am able to access all the sensor info from the internet.  Woo Hoo!   So, I went ahead a bought a nice box to house all my components and used external power supplies (not USB) for the ND and Netgear.  I noticed I couldn't 'talk' with the ND when I put in the static IP address.  Weird.  So, I unplugged the ND and plugged the USB cable to my PC for debugging.  Works great -- was able to access it via static IP with no problem!  Weird.  So, without unplugging the netgear I unplugged the ND USB and used the AC Power.  Now it works!  With both the ND and Netgear on external power I was able to access the ND via the IP Address.    So, now I recycle power on both the ND and Netgear and they don't work -- all the lights look happy (just like when plugged into to the USB port but, I can't access the ND via IP address).     For debugging I swapped out power supplies for the ND.  I tried staggering the boot so the netgear loads first, tried watch dog timer, tried cutting out all the code except for the webserver, tried polling the webserver, tried cycling the ethernet pin (CPU 50) -- tried so many things that I can't recall them all. Because I have lots of LED flashing debug points (flashes tell me where I am in the code) I can see that the ND is polling away waiting on the socket.     The only way to access the ND via IP address is if I run the ND in debug mode from the laptop.  Then I can unplug the ND and give it power from the AC power supply and it still works great.   I know I've done a poor job of explaining the issue and all my attempts of debugging....  just hoping someone may recognize this and can say "oh, that's easy just do ------ "   Thank you!




#55888 VB & AGENT

Posted by seascan on 05 February 2014 - 10:52 PM in Visual Basic Support

Is it possible to program an AGENT watch with VB?

 

 




#55887 Galileo

Posted by seascan on 05 February 2014 - 10:20 PM in General Discussion

Thanks for the info, Chris.

 

What is AGENT?

 

(EDIT) Never Mind!  Very cool.




#55884 Galileo

Posted by seascan on 05 February 2014 - 09:25 PM in General Discussion

Hi.  Does anyone know if Galileo is a competitor to Netduino or are the two different enough to not be "against" each other?

 

 




#55491 XML Data

Posted by seascan on 19 January 2014 - 06:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Solved!

 

I added a header:

Send(client, "HTTP/1.0 200 OK" & vbCr & vbLf & "Content-Type: text/xml; charset=utf-8" & vbCr & vbLf & "Content-Length: " & Mystring.Length.ToString() & vbCr & vbLf & vbCr & vbLf)



#55485 XML Data

Posted by seascan on 19 January 2014 - 03:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Are there any .Net experts in the audience?

 

I have a webserver running on a ND+1.  It works great.  I'm sending back a small bit of XML for testing.  When I load up the webpage in IE or chrome it looks perfect.  However, when I try to read this XML from a ASP.Net page I get "Additional information: The underlying connection was closed: The connection was closed unexpectedly."

 

Here's my huge ASP.Net webpage (i trimmed everything down to just the line throwing the error):

Imports System.XmlImports System.Net.SocketsPublic Class GetData    Inherits System.Web.UI.Page    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        Dim xmlDoc = XDocument.Load(MyIpAddress)    End SubEnd Class

Here's my code for returning the XML:

 Private Sub Send(client As Socket, response As String)        client.Send(Encoding.UTF8.GetBytes(response), response.Length, SocketFlags.None)    End Sub    Private Sub SendXML(client As Socket)        Dim Mystring As String = ""        Mystring = "<?xml version=" & Convert.ToChar(34) & "1.0" & Convert.ToChar(34) & " encoding=" & Convert.ToChar(34) & "UTF-8" & Convert.ToChar(34) & "?>"        Mystring += "<DataTable>"        Mystring += "<Data>"        Mystring += "<Temp1_C>28.0</Temp1_C>"        Mystring += "</Data>"        Mystring += "</DataTable>"        Send(client, Mystring)End Sub

I have added this to my asp.net web.config:

  <system.net>    <settings>      <httpWebRequest useUnsafeHeaderParsing="true" />    </settings>  </system.net>

Any thoughts?  Thanks!




#55454 ND Plus 1 & the internet

Posted by seascan on 18 January 2014 - 01:20 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks, Wendo.  That makes sense.

 

I tried changing the port and the ND has been stable for 2 hours.  So far, so good.




#55451 ND Plus 1 & the internet

Posted by seascan on 17 January 2014 - 10:04 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi.  I've got a strange problem and after a few days of struggling and searching I'm throwing it out to the community:

 

I set up a webserver on my Netduino Plus 1.  I connected it to my local network.  Finally, I set port fowarding on my home router to point to it.  Everything worked great for 10 minutes or so.  Then the ND would lock up.  Usually I could not even cycle it with the reset button. Seriously locked up.  It didn't appear to lock up while I was debugging -- just when it was stand-alone.

 

So, I eventually quit doing the port forwarding and only am operating from my local network.  So far things look great.  It's been stable for an hour or so which is a lot more that what I was getting for the past two days.

 

Any ideas why port forwarding and accessing my ND from the internet would cause a lock up??  If this stays stable for a day or two then my next step will be setting the external port to something weird (12345 or something) instead of port 80.

 

Thanks for any insights.

 

Terry





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.