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.
Actually, I think you ARE wrong . The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.
Actually, I think you ARE wrong . The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.
Actually that issue #2 should be two issues
I also mention some strange calculations when using a Long in a Double calculation.
Either way, I'm sure Chris will figure the bug(s) out, eventually
Actually, I think you ARE wrong . The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.
OK, I think I figured out some of it. It's a casting issue, a typo, and an overflow. To get the correct value that Stavros indicated, the variable should be 8242800 (needs another 0 on the end -- typo?). Now, if you cast the 3000 as an integer, you can reproduce the answer of -62.072... But why the heck is it -62? It looks like netduino does the multiply of 3000 x 8242800 as integers first, then casts as double, but if you multiply those, that overflows the integer datatype by exceeding 2,147,483,647. If it were cast as a single first, it would not overflow and give you the right answer.
Valkyrie-MT, very interesting! The .NET MF team made some big changes to the floating point support in .NET MF 4.2...perhaps there are a few kinks to work out still.
Dixon, we're setting up .NET MF 4.2 for Simple Storage support. The framework is there; we still need to work out the implementation details.
Chris
I'm having an issue with double.ToString(string format). I have existing code that calculates temperature and then displays the result to the debug window. In 4.1.0.6 I used .ToString("N2") to round up to two places on my Mini and after the upgrade to 4.2 the ToString(*) call no longer works. No matter what value I give "N" I get the full value. I have done a simple test on the emulator and that is working fine. Here is a basic code example to demonstrate:
I had it posted on the netduino issue tracker since I didnt know if the problem was on netmf or netduino. The link to that is http://netduino.code....com/workitem/6
Confirmed with my own code (format string "F5"). Works fine in emulator.
BTW, Where the heck is the help page for these format strings? (Where in "PSDK.chm", I mean.)
Here is where I have been looking for the string format options for an int32 on NetMF 4.1: http://msdn.microsof...y/ee436732.aspx. I'm not sure if anything has changed for 4.2 but I doubt it (except I did her hear a rumor that you can use "X" now to output the hex string).
Public Function bytesToHexString(ByVal arr() As Byte,
Optional ByVal addSpc As Boolean = False) As String
Dim sb As New System.Text.StringBuilder()
Dim separator As String = String.Empty
If (addSpc) Then separator = " "
For i As Integer = 0 To arr.Length - 1
sb.Append(arr(i).ToString("x2") & separator)
Next i
Return sb.ToString.TrimEnd
End Function
about the toString issue. I looked into this, it's not a Netduino specific bug but a .NET Microframework issue, so I created an item about it to their bugtracker:
http://netmf.codeple...m/workitem/1322
If you ping the device in MFDeploy (after flashing the bootloader and before uploading TinyCLR) what message do you get?
Also, if you hold down the pushbutton on your Netduino Plus after plugging it into your PC...and then press Ping in MFDeploy, what message do you get?
Chris
Some update:
I tried other netduino (no plus), here is my steps:
- Run MFDepoly
- Connect netduino with pushed button
- Erase (fw, storage, deployment)
- Reconnect netduino with pusheded button
- Deploy FW 4.2 RC3
- Reconnect netduino
- Ping with response 'tinyclr'
- Run VisualStudio
- Deploy project
- After that netduino flashes with blue led (maybe restart), no debug log output but application running (led on pin flashes)
- Run MFDeploy
- Reconnect netduino
- No response to ping
I tried it with both old and new bootloaders.
I have windows XP. Is there anybody with WinXP and working 4.2 RC3 FW?
Hi Alladdin,
Did you stop the debugger in Visual Studio before reconnecting Netduino and trying to ping it? If not, Visual Studio will automatically reconnect to your Netduino.
Also, if you hold down the pushbutton on your Netduino while plugging it into your PC...it will go into bootloader mode.
Chris
Did you stop the debugger in Visual Studio before reconnecting Netduino and trying to ping it? If not, Visual Studio will automatically reconnect to your Netduino.
Also, if you hold down the pushbutton on your Netduino while plugging it into your PC...it will go into bootloader mode.
Chris
Yes, I stopped debugger before reconnect.
I must hold down the button if I want to deploy new FW. If I try to deploy firmware without entering bootloader (hold down the button) then it's not possible to deploy FW because connect to bootloader fails.
It's look like I have problem with my computer, windows or usb driver.
There appears to be an issue with HttpWebRequest in this new firmware. I've reduced my code to the simplest test case of making the request and trying to get the response, but it seems to freeze on getting the response (pressing pause in Visual Studio shows that the execution never gets past that line.
public static void Main()
{
Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress);
HttpWebRequest request = HttpWebRequest.Create("http://example.com") as HttpWebRequest;
Debug.Print("Request created");
WebResponse response = request.GetResponse();
}
Any ideas? It also used to freeze on the previous RC's but only if unplugging the network cable, and then re-plugging it back in (or dropping the connection some other way). As a note it works fine in the emulator, so assume its an issue with the firmware.
When I updated v4.1.0.6 to v4.2RC1 last week, my code that connects to a time server stoped working. It seems that the following doesn't work:
s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
s.Connect(ep);
Whereas the following does work (for a different endpoint):
s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
s.Connect(ep);
The endpoints are correct in both cases.
Is this a known problem? If so, has it been fixed in RC3?
Also with 4.2RC1 the reset button must be used to get the debugger to run after every deploy.
The USB cable needs to be disconnected about one in 10 times to get deployment.
VS Pro 2010 crashes during deployment about 2-3 times a day, usually after fiddling with the USB cable during a deploy.
Okay, like nothing is working with this RC3 ... even Socket.Connect is now broken ...
Seriously, how many people are working on this, one or what ?
Could you upload the RC1 firmware somewhere ? (why do you replace the post with the RC3 !?)