- Paul Newton likes this
- Netduino Forums
- → Viewing Profile: Likes: Ellen
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.
Community Stats
- Group Members
- Active Posts 65
- Profile Views 9011
- Member Title Advanced Member
- Age 49 years old
- Birthday May 25, 1974
-
Gender
Female
-
Location
Rotterdam, Netherlands
#38434 P1 & S0 Port monitoring with Netduino Plus
Posted by Ellen on 03 November 2012 - 04:06 PM
Hello to All,
As a member of the Tweaker forum club (I do the coffee for my father and my friend who do.....nothing) i want to inform you that there is quality software available on Codeplex for monitoring PV power and home boards. It is all in Beta status but I think (as student VB) from a high quality.
Here is the link:
http://p1netduinoplus.codeplex.com/
Thank you and enjoy.
#33577 N+ hangs sometimes when try to receive Time
Posted by Ellen on 14 August 2012 - 09:03 AM
Hello,
How can i resolve hanging my N+ when i want to sync my Netduino with a time server.
Function call:
Utility.SetLocalTime(NTPTime("time-a.nist.gov"))
"time-a.nist.gov" : ntp ok, time,daytime busy, not recommended
He will sometimes hang when receive :
s.Receive(ntpData)
I can choose out of many servers but that is for now not the point.
http://tf.nist.gov/tf-cgi/servers.cgi
How to resolve?
Thanks in advance, Ellen
How can i resolve hanging my N+ when i want to sync my Netduino with a time server.
Function call:
Utility.SetLocalTime(NTPTime("time-a.nist.gov"))
"time-a.nist.gov" : ntp ok, time,daytime busy, not recommended
He will sometimes hang when receive :
s.Receive(ntpData)
I can choose out of many servers but that is for now not the point.
http://tf.nist.gov/tf-cgi/servers.cgi
How to resolve?
Thanks in advance, Ellen
Private Shared Function NTPTime(ByVal TimeServer As [String]) As DateTime Dim ep As New IPEndPoint(Dns.GetHostEntry(TimeServer).AddressList(0), 123) Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) Dim ntpData As Byte() = New Byte(47) {} Array.Clear(ntpData, 0, 48) ntpData(0) = &H1B s.SendTimeout = 5000 s.SendTo(ntpData, ep) s.Receive(ntpData) 'with debugging, HERE he will stop.' Dim offsetTransmitTime As Byte = 40 Dim intpart As Long = 0 Dim fractpart As Long = 0 For i As Integer = 0 To 3 intpart = (intpart << 8) Or ntpData(offsetTransmitTime + i) Next For i As Integer = 4 To 7 fractpart = (fractpart << 8) Or ntpData(offsetTransmitTime + i) Next Dim milliseconds As Long = CLng(intpart * 1000 + (fractpart * 1000) / &H100000000L) s.Close() Dim timeSpan__1 As TimeSpan = TimeSpan.FromTicks(CLng(milliseconds) * TimeSpan.TicksPerMillisecond) Dim dT As New DateTime(1900, 1, 1) dT += timeSpan__1 'daylight saving' If dT.Month < 3 OrElse dT.Month > 10 Then Return dT.AddHours(1) End If If dT.Month > 3 AndAlso dT.Month < 10 Then Return dT.AddHours(2) End If If dT.Month = 3 Then ' in march' If (dT.Day - CInt(dT.DayOfWeek)) < 25 Then Return dT.AddHours(1) End If If (CInt(dT.DayOfWeek) = 0) AndAlso (dT.Hour < 2) Then Return dT.AddHours(1) End If Return dT.AddHours(2) End If ' in october' If (dT.Day - CInt(dT.DayOfWeek)) < 25 Then Return dT.AddHours(2) End If If (CInt(dT.DayOfWeek) = 0) AndAlso (dT.Hour < 2) Then Return dT.AddHours(2) End If Return dT.AddHours(1) End Function
- Giuliano likes this
- Netduino Forums
- → Viewing Profile: Likes: Ellen
- Privacy Policy