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.

Chris Walker's Content

There have been 606 items by Chris Walker (Search limited from 28-April 23)


By content type

See this member's


Sort by                Order  

#63792 Why do I have to reboot my device to change the IP address?

Posted by Chris Walker on 06 August 2015 - 04:47 AM in Netduino Plus 2 (and Netduino Plus 1)

Hey cSharper,

There are some limitations in NETMF and/or the lwIP integration regarding change of IP.

With Netduino.IP, we'll be able to get overcome some of those. We're currently working on a way to change IP settings on the fly. It's not ready to go today--but we should be able to include it in a firmware update later this year. Then you'll get the benefit of a managed code network stack and the ability to change IP settings on the fly :)

Chris



#63790 VBA Questions About Events and Analogs

Posted by Chris Walker on 06 August 2015 - 04:33 AM in Visual Basic Support

Hi STGMavrick,

I was just looking through older posts and noticed that you hadn't received any responses to this. Let me see if I can help get you pointed in the right direction.

So, What I'm seeing is that If I declare buttonstate as true initially I can turn it off.  However, I cannot turn it on again. I'm assuming I am not doing it correctly. Ideally though I would prefer a single pushbutton to toggle the system on and off.

For debouncing: I recommend just checking the current time. Go ahead and react to the pushbutton--but keep a timer value which stores the "last pushed" time in ms...and if it has been less than 10ms since the last push...ignore the new event. No need for two buttons.

[Also...you may want to use EdgeBoth instead of EdgeLow for your interrupt trigger, so that you can see when the button is released.]

Secondly, My Analog input declaration would not work with my code I have written unless I used CPU.AnalogChannel.AnalogChannel_0. Pins.GPIO_PIN_A0 would complain about implicit conversion.

Ah, good observation. The Pins enumeration only works for digital inputs/outputs. Do you have access to the AnalogChannels.ANALOG_PIN_A0, etc. enumeration?

Thirdly, do these have RTC abilities? I originally wanted to have two modes. Manual on/off and time controlled. Start at X hour, stop at y hour.


No RTC, but you can do this pretty easily in code. Just subtract the current DateTime from the target DateTime and then set a timer to wake up your logic. There's no battery backup and you do need to set the time after boot--but this should work well.

BTW, welcome to the Netduino community!

Chris



#63789 Difference Btwn Netduino SDK 4.2 and 4.3 ?

Posted by Chris Walker on 06 August 2015 - 04:27 AM in General Discussion

Hi Adarsh,

Generally speaking, newer is better. 4.3 will give you the latest bugfixes, most importantly.

BTW, you can target NETMF 4.2 with the NETMF 4.3 SDK as well. Just be sure to change the target framework in your project's properties.

Chris



#63788 Netduino 3 and Electronic Brick of Relay

Posted by Chris Walker on 06 August 2015 - 04:24 AM in Netduino 3

Hey Dave,

I'm still confuse between the two and don't understand their specific purpose.

Cpu.Pins is a NETMF enumeration which specifies the physical pin # on the microcontroller itself.

Netduino's Pins.GPIO_PIN_## enumeration specifies the header pins on the Netduino (i.e. Digital 0-13 and Analog 0-5).

I wish that Cpu.Pin didn't have an enumeration at all... That would make this simpler :) In any case, glad you solved the issue. [And thanks as always, Nevyn for helping out!]

Chris



#63787 SPLIT: UDP packet size

Posted by Chris Walker on 06 August 2015 - 03:35 AM in Netduino.IP Technical Preview

Hey Tim,

Generally speaking it's best to keep UDP packets down in the <=~500 byte range, but it's possible to make them up to ~1500 bytes in size. Each packet contains the _entire_ message you're sending.

Regarding buffer size (from the original thread): that's for TCP RX buffers. TCP streams data across multiple packets and buffers the stream in memory. UDP doesn't know if one packet is related to another packet.

What is the size of data you're trying to send via UDP? [Perhaps we need to add an extra exception instead of failing gracefully somewhere here.]

Chris

P.S. I've repurposed UDP before for streaming data. If you add a sequence # to the front of your UDP packets, you can reassemble them on the other side. But unless there's a really good reason to do this manually, use TCP: it does this for you.



#63786 SPLIT: DHCP MaxDHCPMessageSize

Posted by Chris Walker on 06 August 2015 - 03:30 AM in Netduino.IP Technical Preview

Thanks Tim. There are some rules around IPv4 vs IPv6 packet sizes, min buffers, etc. The stack will always take minimum-sized TCP packets (and defaults to larger, regular size IPv4 frames).

Could you post this as an Issue on the Netduino.IP GitHub repo, and then we'll double-check the broadcast minimum DHCP message size?

Unless you're not getting an IP address via DHCP, this setting is unlikely to cause any issues--but in any case we want to make sure the stack is nice and standards-compliant throughout :)

Thanks Tim,

Chris



#63785 Network stops working on the hour or one minute after

Posted by Chris Walker on 06 August 2015 - 03:27 AM in Netduino.IP Technical Preview

Hey Tim,

After I've spent what amounts to several days digging into this issue, it would be nice to know that someone is at least reading these threads...

We're definitely here, following along. Just trying to get a handle on what is going on behind the scenes. This post was really helpful. See below. And thanks for all your test time!

Digging a bit deeper, when the network stack is frozen, I have several threads all stuck in WaitHandle.WaitOne(), backtracking up the call stack shows that the calls originated as follows:

  • Main thread - TcpSocket.Accept
  • ILinkLayer.SendFrame
  • ArpResolver.SendArpGenericThread
  • IpV4Layer.LoopbackInBackgroundThread
  • ICMPv4Handler.SendIcmpMessagesThread
  • DHCPv4Client.DhcpStateMachine
  • EthernetInterface.Send
  • TcpSocket.TcpStateMachine
Okay, now this is interesting. This is your _stack trace_??? Can you grab a screen capture of this? DHCP and ICMP shouldn't really be involved at all with a TCP packet send...

This scenario really feels like a "NETMF event queue is being blocked" kind of issue... Let's drill into your code sample and figure out what's up.

Thanks Tim,

Chris



#63784 Network stops working on the hour or one minute after

Posted by Chris Walker on 06 August 2015 - 03:23 AM in Netduino.IP Technical Preview

Hey Tim,

If the timer overflows at the point marked, then the overflow (carry) has been missed but the timer has wrapped back to 0, so that would result in time _going backwards_ at which point HAL_COMPLETION::DequeueAndExec() will not be able to schedule any further events until the timer overflows again.

Sleuthing :) Awesome.

NETMF uses MachineTicks for all timer/thread scheduling (which is based off of the overflow bits added to the core timer bits. There's always a possibility of a bug in the timing code--but other bug scenarios are a lot more likely. We beat up on timer code quite a bit.

Chris



#63783 Network stops working on the hour or one minute after

Posted by Chris Walker on 06 August 2015 - 03:21 AM in Netduino.IP Technical Preview

Hey Tim,

attachicon.gifAccept-deadlock.PNG

So the good news here is that it appears that the stack is not locking up the board (unlike issues we had with lwIP). The bad news is that there is some weird blocking issue going on.

My first two guesses:
1. NETMF tends to execute one managed hardware event handler at a time, queued, in series. If a project has code in a managed event handler which is not exiting and which is blocking the network stack from getting interrupts...you can see this kind of behavior. This is one of the tradeoffs of the NETMF threading model. [Side note: we are working on some concepts that would actually improve NETMF in this area without breaking backwards code compatibility. But nothing shipping today.]
2. A core runtime bug. If we can reproduce the bug in managed code, and we can whittle down the sample code to a manageable size, we can debug the native issue and work with Microsoft to remedy it in the NETMF core.

Can you send me a copy of the source, along with repro instructions on how to repro the issue consistently? And also your board type, firmware version, etc.? We'll repro the issue here and work with you to resolve the issue (either through guidance on how to modify the sample or through a core bugfix).

Thanks so much for all your effort testing out the new bits!

Chris



#63770 Running a VB program -- it remembers the old serial port

Posted by Chris Walker on 04 August 2015 - 11:55 PM in Netduino Mini

Hi Dr. Who,

Regarding remembering the last used serial port--you're referring to Visual Studio, correct? The NETMF SDK plug-in for will remember the last-used deployment port unless it is manually changed.

[Unfortunately if you're using USB devices or virtual COM ports, it can also appear to have changed the port because it can't show your previously-selected port. I know...confusing. If it ever gives you trouble, just change the port selection quickly and then change it to the port you want to use.]

On the larger post: what are you building? :) I assume it's not a Dalek.

Chris



#63714 VS2013 is history, can't get VS2015 working

Posted by Chris Walker on 30 July 2015 - 03:17 AM in Visual Studio

Hi D.Brown,

I've been away from Netduino as well. I've got a regular netduino no plus or anything. What software do I need to get and in what order. C# express 2010 is no longer an option. I'm pretty new and need pretty clear instructions or I'm sure I'll mess something up.

Visual Studio 2013 Express and the NETMF 4.3 SDK should work for you; just be sure to change the target framework to the earlier version of .NETMF running on your device.

Head over to the Downloads page. Install VS2013 Express, the NETMF SDK, the NETMF plug-in for VS2013, and then the Netduino SDK. And then...install the legacy templates (for Netduino 1). [Yes, I know that's a lot of installs...sorry about that.]

Chris



#63713 VS2013 is history, can't get VS2015 working

Posted by Chris Walker on 30 July 2015 - 03:15 AM in Visual Studio

Hey Joshk,

I'm getting concerned.  Does the release version of VS2015 Express not support the Netduinos?

VS2015 is currently "beta" for NETMF. It should be officially supported soon...but there are a few glitches still (notably with custom EventHandlers, where you have to add in a few lines of extra code to make the linking happy).

We're using VS2015 exclusively over here.

Chris



#63712 Time In Netduino 3

Posted by Chris Walker on 29 July 2015 - 11:55 PM in Netduino 3

Hi bgreer5050,

With NETMF on Netduino, the clock resets when the board is rebooted.

We typically ping an NTP time server as part of startup in applications.

Would a "time" module (with a coin cell battery holder) that remembers time between reboots and when the board is unpowered?

Chris



#63711 SerialPort Receive Data Corruption

Posted by Chris Walker on 29 July 2015 - 11:46 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Tim,

If, instead of using DataAvailable, you put a blocking SerialPort.Read(...) call on another thread, do you see the same issue?

Also--are there any other events which stop firing?

I know that there used to be a bug in NETMF's SerialPort.DataAvailable event where it wouldn't always fire when data was received. We might need to revisit that (once we have a simple repro to test against).

Chris



#63710 Can't create custom events

Posted by Chris Walker on 29 July 2015 - 08:15 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi brian,

I'll report it. Note that this isn't a compiler error... it's displayed in the 'resolving' phase when launching the app on the device.

Thank you. Yeah, I think that the VS2015 compiler/linker is leaving out or garbling the reference. Based on user reports, recompiling and deploying from VS2013 (using the same NETMF SDK release) works as expected.

There have been a lot of changes to the build process with VS2015--but hopefully this is something simple to track down.

Thanks so much for helping improve the VS2015 + NETMF experience!

Chris



#63705 Can't create custom events

Posted by Chris Walker on 29 July 2015 - 04:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi brian,

I tried adding it in 2 ways - one, pasting at the top of an existing code file in the main app project (keeping the namespace, of course), and also creating a new file in a secondary project.

With VS2015 support (experimental), the compiler will need the class in a separate file in the project which is giving you the compiler error.

Can you please add the code as a separate file in the main app project? [If it's in a secondary project, it won't fix the situation).

This appears to be a bug in the compiler/metadataprocessor portion of the VS2015 toolchain, and as of now it appears to only affect this specific enumeration (or enums in its classification).

Would you mind filing an issue on the NETMF repo as well, so we can coordinate to get this fixed and we can get VS2015 support to official status?

NETMF vNext bug filing:
https://github.com/n...erpreter/issues

NETMF 4.3 bug filing:
http://netmf.codeple...item/list/basic

Chris



#63703 RAM storage ?

Posted by Chris Walker on 29 July 2015 - 09:41 AM in Netduino 3

Hi JoopC,

You have networking running on Netduino 3 Wi-Fi, a potentially larger managed stack, etc.

We're still tuning things and we expect to be able to free up even more RAM. Enabling some of the more advanced power/memory management scenarios in the future (like turning off networking at boot) could potentially free up more RAM still.

BTW, we'll be publishing firmware next week which you can manually flash to your Netduino 3 Wi-Fi that will turn off networking and free up more memory, for applications where that is interesting.

Chris



#63694 Can't create custom events

Posted by Chris Walker on 28 July 2015 - 10:58 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi brian,

What error are you getting, exactly? Also--do you have multiple projects in your solution, and did you add the source file to the project giving you the error?

Chris



#63688 SerialPort Receive Data Corruption

Posted by Chris Walker on 28 July 2015 - 04:33 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Hawkez,

Interesting. How simple is your loopback code? Please post a link back to this discussion when you are able to...loopback should always "just work" unless the serialport buffers are overflowing (i.e. more data sent faster than the UART can keep up).

Chris



#63687 Maximum Sockets

Posted by Chris Walker on 28 July 2015 - 04:30 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Brandon,

You can download Netduino.IP 1.0 for Netduino Plus 2 at:
http://forums.netdui...etduino-plus-2/

:)

Does that get you up and running with enough sockets?

Chris



#63686 Dead ND3?

Posted by Chris Walker on 28 July 2015 - 04:29 PM in Netduino 3

Hi Simbraska,

Hi Chris,
I'm having similar issue with my new netduino 3. Rebooting doesn't seem to help. And STDFU tools can't select the device neither. 
Suspecting it's still a driver issue. Is there a .zip file just for the driver, so to manually install?

Which version of STDFU Tools are you using? v3.0.4 (the latest public version) is available here:
http://www.st.com/we...SS1533/PF257916

I believe that the DFU drivers come down over Windows Update, as well as being installed by STDFU Tools in the following folder:
C:\Program Files (x86)\STMicroelectronics\Software\DfuSe v3.0.4\Bin\Driver

Does that get you what you need?

Chris



#63685 Dead ND3?

Posted by Chris Walker on 28 July 2015 - 04:27 PM in Netduino 3

Hi blindahl,

Can you please try uninstalling the driver for the Netduino in Device Manager? And then repairing the Netduino SDK (so the drivers re-install) and re-plug the device?

Also, any chance you can plug the Netduino into a second PC and see if the drivers load (to isolate any issue that's PC-specific)?

We're beyond the 30 day return/warranty period...but I'd like to get to the bottom of this. If none of the above works, let's get that board back so we can take a look at it and get you a replacement unit.

Thank you,

Chris



#63675 Invalid address messages when deploying

Posted by Chris Walker on 27 July 2015 - 10:55 PM in Netduino 3

Hi Sean,

I'm getting some messages that look odd during deployment.  The program still runs correctly, but it doesn't look good.
Sean

Those messages indicate that the debugger is trying to access memory that is not allowed by the CLR.

Try upgrading to the latest firmware, and you should be good to go.

Chris



#63672 Interrupt stops working after a while?

Posted by Chris Walker on 27 July 2015 - 06:27 PM in Netduino Plus 2 (and Netduino Plus 1)

Terrence--also, if you have an extra older PC sitting around...

You can install the Netduino drivers on it, run MFDeploy and connect to your board (F5).

And then you'll get the Debug.Print output.

If you can whittle your code down to a dozen lines or so (while still reproducing the error), we can help dig in and diagnose further. I know that this is an "after a long time" error so that might not be feasible--but we'd like to find a way to keep you running and running... :)

Chris

P.S. Thanks Nevyn for all your help here!



#63671 Dead ND3?

Posted by Chris Walker on 27 July 2015 - 06:21 PM in Netduino 3

Hi brian,

A few diagnostics steps:
1. Can you try rebooting your PC really quickly--and then using another USB port on your computer (if on a laptop, preferably on the other side)--and then reflashing via Netduino Update?
2. Do you have a copy of the STDFU tools? Can you erase the board using STDFU Tester?

Chris




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.