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.

Basiclife's Content

There have been 18 items by Basiclife (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#40705 Any ETAs for Netduino Plus 2 Fixes?

Posted by Basiclife on 01 December 2012 - 04:21 PM in Netduino Plus 2 (and Netduino Plus 1)

I'm a complete newbie to Netduino. I just purchased a Netduino2 plus from Amazon and just wanted to test with the "blinky" project to make sure all was well with the hardware and software.

...



Hi Oliver, although I've personally had issues with the nd+2, I absolutely love my netduino and SL have usually been pretty damned good about getting things resolved. I was a little disappointed it shipped with the issues mentioned above (as you can probably tell) but I'm pretty confident they'll be resolved ASAP. Other (more experienced) members may be able to help with your current problem (which doesn't sound like the same thing we're discussing here). I'd suggest you start a new thread to with full details and see what happens.



#40469 Any ETAs for Netduino Plus 2 Fixes?

Posted by Basiclife on 30 November 2012 - 08:29 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Dave, egeorgiou, Basiclife,

First of all, let's make sure your I2C is up and running. I just posted the 4.2.1.1 update here:
...
Chris


Well, I'm not sure about the others but that certainly shut me up. Thank you.



#40451 Any ETAs for Netduino Plus 2 Fixes?

Posted by Basiclife on 30 November 2012 - 12:44 AM in Netduino Plus 2 (and Netduino Plus 1)

Well, i'm keeping mine, i think Chris Walker has done a tremendous amount of work to make the netduinos a reality.

...

Sometimes people just need a recharge, and no one have promised you anything other than a prototype development platform with community support.


While I don't think I'm quite as annoyed as others, I'm definitely not happy. I know an awful lot of work has gone into the netduinos and it's appreciated but the number of buggy/incomplete features is surprisingly large. Personally, I can live with the little ones but big ones like this need to be addressed in a timely fashion. If the original ETA had been 3 weeks, I don't think anyone would've minded waiting 3 weeks. Even if it was expected to take a week and will now take 3, a simple post from Chris to that effect would probably have made me comfortable to wait. What I personally find to be an issue is an ETA that passes with no updates/news. It makes it seem like the issue isn't being taken seriously.

In any case, I'll wait a little while but I do object to having forked out for a bit of kit that's not usable.



#40396 Any ETAs for Netduino Plus 2 Fixes?

Posted by Basiclife on 29 November 2012 - 02:10 AM in Netduino Plus 2 (and Netduino Plus 1)

I'm disappointed... Mine arrived this morning and isn't usable. I don't think it's unreasonable to expect a product to be fit for purpose before it's shipped. We all know things can (and do) go wrong but since these issues seem to be fairly fundamental. Why was it deemed ready to be shipped in such an unusable state?



#39095 Driverless PC<->Netduino communication using USB

Posted by Basiclife on 12 November 2012 - 01:57 AM in Beta Firmware and Drivers

That said...I wouldn't buy a Netduino Plus 2 for this feature. I'd buy one because it's awesome, and if we can deliver this as an update in the future it's a really nice bonus :)

Chris


Thanks again for the rapid reply. Unfortunately, for me this is the "killer" feature. I love my netduino but the ability to deploy/debug/communicate entirely over USB will make things so much simpler, it would be _the_ reason to purchase an upgrade.

I look forward to further updates and will likely buy a new netduino when this becomes available.

Many thanks



#39078 Driverless PC<->Netduino communication using USB

Posted by Basiclife on 11 November 2012 - 11:53 PM in Beta Firmware and Drivers

Hi Basiclife,

...
To enhance this, we have added extra hardware to Netduino Plus 2 to enable the device to re-enumerate on the fly. This will allow applications to use the UsbClient feature more easily, leading to things like bi-directional data streams. There is quite a bit of work to do to the USB peripheral feature to make this happen...

...

Chris


Hi Chris, thanks for the clarification and quick response. Would it be fair to say that if I were to grab a ND2+, then this will be possible at some point in the future? Or would that be premature and I should wait until it's implemented in case it needs a v3/4/??? In short, are you confident the 2+ has all the required hardware and just needs the appropriate firmware?



#39068 Driverless PC<->Netduino communication using USB

Posted by Basiclife on 11 November 2012 - 11:18 PM in Beta Firmware and Drivers

Hi, I've been away from my Netduino for a while and wondered if someone could clarify... Is it now possible, using only a USB connection, to deploy an app, debug it and communicate with an app running on Windows? Does this still require a power supply too or just updated firmware? If this is now possible, please let thank you for your effort getting this up and running - it's been a major drawback compared to the Arduino and is very welcome.



#30417 VS2010 Crash on debug

Posted by Basiclife on 08 June 2012 - 08:47 AM in Visual Basic Support

Unfortunately crashes in VB are on the Visual Studio/.NET MF SDK side. There's a NETMF 4.2 QFE2 in the works that's gearing up for release...so let's try to see if we can get this bug reported to the right place and see if we can get a fix in the upcoming SDK release.

Can you please post a bug report at the following link?
http://netmf.codeple...item/list/basic

Then please provide us a link, and we can vote for the issue.

Chris


Whilst I don't expect you to be able to fix it instantly (or at all if it's an MS-side issue), it would be nice for you to confirm if you can even reproduce the issue.

As things stand, you've said try the new firmware (after rhamer had said he'd already tried it) and asked if it happened in Blinky (when the first post in this thread says it does not). Frankly, it feels like you're being very dismissive and haven't bothered to read the thread properly.

I didn't mind so much when I was the only one experiencing the issue as I assumed it was a config issue / somethign specific to my machine. Now that other users have confirmed (and considering how few VB developers you seem to have) there's a good chance it would happen to most if not all of them if they chose to code in this style.

If rhamer hasn't posted a bug report by this evening, I'll raise one and add a link.



#29596 VS2010 Crash on debug

Posted by Basiclife on 23 May 2012 - 06:46 PM in Visual Basic Support

I don't know about c# as I don't use it.


FWIW I seem to recall trying it in C# and it working but it was a while back and I don't have mine to hand to test.



#29554 VS2010 Crash on debug

Posted by Basiclife on 22 May 2012 - 10:52 PM in Visual Basic Support

Hi Rohan,

Does this same crash happen when you debug a simple "blinky" type of application in VB?

Does it happen if you try to debug a C# app?

If we can narrow down the combination of factors which causes the issue, we can forward the issue to the right team to help debug...

Chris


Have you downloaded my sample project attached to my first post?

I've demonstrated that the blinky app is fine but that if you move the declaration of the ports into another file/object, pausing execution crashes VS. Can you confirm if the same is happening when you run the project?



#29542 VS2010 Crash on debug

Posted by Basiclife on 22 May 2012 - 07:28 PM in Visual Basic Support

Does anybody official have anything to say about this problem?

Has it been recognised and is a fix being worked on?

It seem like everytime I post here about a problem, it falls on deaf ears.

Once again I would have thought a bug this big would have generated some sort of response.....

I really want to be a Netduino evangalist, but stuff like this just makes it hard to keep the faith.

Regards

Rohan


Hi Rohan,

Sorry for a slow response, I've been moving house and internet takes sooo long to get installed...

I haven't heard anything official about a resolution for this - As you can see, I assumed it was a Beta issue but haven't chased further.

Like you, I want to like the netduino - but it seems to come out of the cupboard for a month until it annoys me and gets shelved again.

That said, I've had good responses from the devs on here before - perhaps you should have a go in the chat room and see if you can get a response.

I'm going to have another go with the netduino in a couple of weeks - if you haven't had any luck by then, I'll try and chase it up.

Good luck and please let me know if you find a solution/workaround



#27646 VS2010 Crash on debug

Posted by Basiclife on 19 April 2012 - 02:31 PM in Visual Basic Support

Out of curiosity, instead of creating the module variables as new instances, if you instantiate them before your main sub runs does the issue still occur?

Hi James,

Most likely this was an issue with the Beta VB.Net support. As such, I've re-flashed it with non-Beta drivers and switched back to C# (VB.Net without OO support is a waste of everyone's time)

I'm curious what you mean by instantiating the module before Sub Main() - I don't have control before Main() executes and by that point the module has been loaded (and presumably the ports instantiated).

If you can provide a code example/explanation, I'll reflash and give it a go.

Thanks



#22707 CSng function

Posted by Basiclife on 11 January 2012 - 09:49 PM in Visual Basic Support

Have you tried Sng.Parse("123.456") ? Also, note that conversion int to double conversion seems to be broken in 4.2 RC3 (http://forums.netdui...ble-to-integer/) so there's a chance Sng.Parse may be broken too.



#22706 Convert double to integer?

Posted by Basiclife on 11 January 2012 - 07:23 PM in Visual Basic Support

Hi Basiclife,

This is very strange. After reading your comment, I re-ran the code that I submitted and got the same answer; and yes, I deployed to Netduno not the emulator (Project Properties, transport:USB, Device:NetduinoPlus_NetduinoPlus). Also, I did not run your code initially. So I ran your original code to get:

93: Temp: 237.14999999999998, R:237
94: Temp: 239.69999999999999, R:240
95: Temp: 242.24999999999997, R:242
96: Temp: 244.79999999999998, R:245
97: Temp: 247.34999999999999, R:247
98: Temp: 249.89999999999998, R:250
99: Temp: 252.44999999999999, R:252
100: Temp: 254.99999999999997, R:255
I am running MF 4.2 RC1 with Netduino Plus. I never ugraded to RC3 because of all of the problems noted in the forum. I seem to recall that there were other issues with doubles in RC3. I guess this is just another bug in RC3 (e.g. Dim R = CUInt(Temp)). You have a good point about scope.

Baxter


Hi Baxter,

Thanks for the info - I think you must be right re: being a bug in RC3 (which is what I'm running). I'll wait until the next release and see how it goes.

Thanks also for the confirmation that my code works on your hardware - good to know I'm not being a complete idiot :)



#22701 Convert double to integer?

Posted by Basiclife on 11 January 2012 - 03:09 PM in Visual Basic Support

If I was working in C/C++ there would not be any rounding or conversion; this is because all of the variables are of type integer. The whole thing gets done in integer arithmetic; any fractional part generated by the divide is just lost.

Does VB convert to floating point to do the calculation when you use the multiply and divide operators - thus requiring a conversion?

Paul

Exactly so

Dim I as Integer
I = 3/2

or 

Dim I, J as Integer
J = 4
I = J/2

or even

Dim I as Integer
I = 1.5


Would all produce a warning (Implicit conversion from Double to Integer)

You can, of course, disable the warning but I tend to like it as it's enforcing strong typing rules. If I intended to force it into an int, I'd do:

Dim I as Integer
I = CInt(3/2)

CInt takes a double (amongst other things) and returns an integer thus complying with strong typing, performing the truncation for me and also providing a level of confidence that I'm not treating double as integers and losing precision unless I explicitly intend to do so.


EDIT: You've just reminded me of the integer divison operator which I rarely ever use...
7 / 2     produces 3.5
7 \ 2     produces 3

With your rearranged formula, this might do the trick. Let me have a play...

Ok, Using:

Dim R = ([End] - Start) * x \ Steps + Start

Seems to work as I'd expect - Thank You!

(Incidentally, it technically results into a long but Long-UInt works without issue and I shouldn't ever overflow)

This does solve the immediate problem but I still think the fundamental question of converting a double to an int is an important one - perhaps it's just been too long since I played with PICs and I've got set in my comfy desktop cpu ways.



#22699 Convert double to integer?

Posted by Basiclife on 11 January 2012 - 02:08 PM in Visual Basic Support

Thanks all for your answers, I'll respond individually...

The trick is to multiply first then divide so that you don't lose any precision.
...

Might be of some help.

Paul

Thanks, that's a reasonable approach to take - especially since I'm not concerned with precision. The problem is that I like to code with Option Strict on which means the conversion you perform which rounds to the nearest integer (result=) is a narrowing conversion, resulting in an Error/Warning. This is same of vanilla .Net but in vanilla, I'd use CInt() to explicitly inform the compiler that I'm expecting the narrowing conversion to take place, removing the error/warning and also reducing coding errors by preventing inadvertent conversion from double to int.

Just declare and type your variables. This is always good practice.Baxter


Thanks for the suggestion. I suspect you ran your test using the emulator not an actual netduino? I get the correct output using the emulator too. Running your code against the netduino shows exactly the same problem as my example:

1: Temp: 2.5500, R:196608
2: Temp: 5.1000, R:327680
3: Temp: 7.6500, R:524288

(If you ran it against your netduino, which one and what firmware?)

I have to say I disagree with you re: typing variables. Implicit typing is perfectly acceptable as it's done at design time and is simply a shorthand notation (as opposed to say PHP with mixed variable types). You can verify this by hovering over the variable in the editor - it will tell you what the type is and won't allow you to treat it as anything else. Using a variable before it's initialised is bad practice but that's why VS gives you a warning.

One other reason I prefer my approach is that variables declared inside the loop are out-of-scope once you leave the loop so are eligible for GC. It also means I won't refer to them by mistake as the designer knows they're no longer valid.

Although I haven't been able to achieve it yet with the MF, all my normal .Net apps have 0 warnings (I treat warnings as errors and TFS won't allow a code checkin unless it compiles and passes unit tests). This tends to enforce good coding habits and has served me well so far - If anyone has reasons they believe I'm wrong, let me know as I'd love to discuss coding style improvements.

Could you convert your code to c#?



Hi Magpie - I could indeed write this in C# (and I use C# at work more often than not) but I personally prefer VB and this is my first noddy project to test VB support - needless to say, I was amazed that you can't do the conversion. Incidentally, Math.Round seems to be available in VB too but it still returns a double (even though it doesn't have a param to indicate precision). As such, I just get an integer stored as a double and the same problems happen again.



I've found a workaround but it's such an ugly hack and I don't recommend anyone use it for any purpose...

Dim Test = 123.45
Debug.Print(UInteger.Parse(Test.ToString.Split("."c)(0)).ToString)

*shudder*

NB:
UInteger.Parse("123") works fine
UInteger.Parse("123.0") throws an exception



#22659 Convert double to integer?

Posted by Basiclife on 10 January 2012 - 03:56 PM in Visual Basic Support

I've got an RGB LED plugged into 3 of the PWM outputs. I want to cross-fade between colours.

I thought this would be trivial but apparently not. I've simplified this to just be a single output for now.

    Dim Start As UInteger = 0
    Dim [End] As UInteger = 255
    Dim Steps = 100

    For x = 1 To Steps
        Dim Temp = ([End] - Start) / Steps * x + Start
        Dim R = CUInt(Temp)

        Debug.Print(x.ToString & ": Temp: " & Temp.ToString & ", R:" & R.ToString)
        LedR.SetPulse(255, R)
        Threading.Thread.Sleep(20)
    Next

This outputs:
1: Temp: 2.5500, R:196608
2: Temp: 5.1000, R:327680
3: Temp: 7.6500, R:524288
4: Temp: 10.2000, R:655360
5: Temp: 12.7499, R:851968
...
95: Temp: 242.2488, R:15859712
96: Temp: 244.7988, R:16056320
97: Temp: 247.3488, R:16187392
98: Temp: 249.8988, R:16384000
99: Temp: 252.4488, R:16515072
100: Temp: 254.9988, R:16711680

As you can see the actual calculation works perfectly but I can't find ANY way to shoe-horn the resulting double into a UInt.

NB: In this scenario, I don't care at all about precision so Ceil/Floor/Truncate are all perfectly acceptable.

I've tried:
        Dim R = CUInt(Temp) 'Odd output - maybe reading memory and just treating it as a UInt
        Dim R = CType(Temp, UInteger) 'Throws: An unhandled exception of type 'System.Exception' occurred in Netduino_VBTest.exe
        Dim R = Convert.ToUInteger(Temp) 'Doesn't have an overload for Double (or anything except string!)
        Dim R = Convert.ToUInteger(Temp.ToString) 'Throws an exception

Any suggestions appreciated.



#22568 VS2010 Crash on debug

Posted by Basiclife on 07 January 2012 - 05:01 PM in Visual Basic Support

I've recently rebuilt my system and dusted off my netduino to have another go. (Standard netduino, not plus, mini, etc.)

As I prefer VB, I've installed:

Microsoft .Net Micro Framework SDK 4.2 (RTM)
Netduino SDK v4.2.0 (June 2011 Beta)

The OS is Windows 7 x64, Dev Env: Visual Studio 2010 Ultimate

I've created a new Micro Framework netduino application which contains the following 2 files:

Main.vb
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino

Module Main
    Sub Main()
        Thread.Sleep(1000)
        Led0.Write(True) ''<<< Breakpoint Here
        Dim Value = 0.0
    End Sub
End Module

HardwareMappings.vb
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino

Module HardwareMapping

    Public Led0 As OutputPort = New OutputPort(Pins.GPIO_PIN_D11, False)
    Public Led1 As OutputPort = New OutputPort(Pins.GPIO_PIN_D4, False)
    Public Led2 As OutputPort = New OutputPort(Pins.GPIO_PIN_D13, False)
    Public Led3 As OutputPort = New OutputPort(Pins.GPIO_PIN_D3, False)

    Public LedR As OutputPort = New OutputPort(Pins.GPIO_PIN_D5, False)
    Public LedG As OutputPort = New OutputPort(Pins.GPIO_PIN_D6, False)
    Public LedB As OutputPort = New OutputPort(Pins.GPIO_PIN_D10, False)

End Module

I can run the app and it will turn on/off the LEDs as desired (I'm using this shield: http://ruggedcircuit...AS010/as010.pdf which provides a number of LEDs and Pots as well as some other things to test).

If I add a breakpoint or pause execution at any point, Visual Studio throws a fatal exception:

The problem signature in the "VS has crashed" Dialog is as follows:
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	devenv.exe
  Application Version:	10.0.40219.1
  Application Timestamp:	4d5f2a73
  Fault Module Name:	vbdebug.dll
  Fault Module Version:	10.0.40219.1
  Fault Module Timestamp:	4d5f2fc9
  Exception Code:	c0000005
  Exception Offset:	000a0ceb
  OS Version:	6.1.7601.2.1.0.256.1
  Locale ID:	2057

Additional information about the problem:
  LCID:	1033

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

If I debug VS itself, I get (in the "choose debugger dialog"):
An unhandled win32 exception occured in devenv.exe [121988].

After opening a new instance of VS as a debugger, I'm told:
Unhandled exception at 0x77d515ee in devenv.exe: 0xC0000005: Access violation reading location 0x00000000

Disassembly is as follows:
ntdll.dll!77d515ee()

77D515AD  mov         ecx,0Ah  
77D515B2  lea         edx,[esp+4]  
77D515B6  call        dword ptr fs:[0C0h]  
77D515BD  add         esp,4  
77D515C0  ret         0Ch  
77D515C3  nop  
77D515C4  mov         eax,12Eh  
77D515C9  xor         ecx,ecx  
77D515CB  lea         edx,[esp+4]  
77D515CF  call        dword ptr fs:[0C0h]  
77D515D6  add         esp,4  
77D515D9  ret         18h  
77D515DC  mov         eax,12Fh  
77D515E1  xor         ecx,ecx  
77D515E3  lea         edx,[esp+4]  
77D515E7  call        dword ptr fs:[0C0h]  
77D515EE  add         esp,4  <<<<<<<< EXCEPTION HERE <<<<<<<<
77D515F1  ret         0Ch  
77D515F4  mov         eax,130h  
77D515F9  xor         ecx,ecx  
77D515FB  lea         edx,[esp+4]  
77D515FF  call        dword ptr fs:[0C0h]  
77D51606  add         esp,4  
77D51609  ret         18h  
77D5160C  mov         eax,131h  
77D51611  xor         ecx,ecx  
77D51613  lea         edx,[esp+4]  
77D51617  call        dword ptr fs:[0C0h]  
77D5161E  add         esp,4  
77D51621  ret         8  
77D51624  mov         eax,132h  
77D51629  xor         ecx,ecx  
77D5162B  lea         edx,[esp+4]  
77D5162F  call        dword ptr fs:[0C0h]  


As it's been a while since I used the netduino and haven't ever used it on this PC, I'm not sure how to go about tracking down the problem especially using Beta drivers. Can someone please suggest a workaround / further places for investigation?

Many thanks

Edit: I've attached the project in question. I've also tried running the simple "Blinky" example which DOES allow debugging so it must be an issue with my very short code

Another Edit: It seems that the problem is caused if the variable for the LED is defined in a different file. To test, take the Blinky example, move the led definition to a different module with a Public scope and run it again. The app will still run but debugging fails.

Attached Files





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.