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.

Nicolas Dorier's Content

There have been 24 items by Nicolas Dorier (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#16632 DHCP not working

Posted by Nicolas Dorier on 11 August 2011 - 02:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok don't bother, it seems my ethernet port... it is down the ethernet's leds are off :(



#16630 DHCP not working

Posted by Nicolas Dorier on 11 August 2011 - 02:07 PM in Netduino Plus 2 (and Netduino Plus 1)

I don't manage to make DHCP work on my netduino :(

public static void Main()
{
	var interf = NetworkInterface.GetAllNetworkInterfaces()[0];
	interf.EnableDhcp();
	interf.RenewDhcpLease();
	while(true)
	{
		Thread.Sleep(10000);
		Debug.Print(interf.IPAddress.ToString());
	}
}

The IPAddress is always 0.0.0.0, I did not forgot to set the mac address and I deployed the good firmware (I had the same problem before the firmware update)

HalSystemInfo.halVersion: 4.2.0.0
HalSystemInfo.halVendorInfo: Netduino Plus (v4.2.0.0 RC1) by Secret Labs LLC
HalSystemInfo.oemCode: 34
HalSystemInfo.modelCode: 177
HalSystemInfo.skuCode: 4097
HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000
HalSystemInfo.systemSerialNumber: 0000000000000000
ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo: Netduino Plus (v4.2.0.0 RC1) by Secret Labs LLC
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.0.0
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.0 RC1) by Secret Labs LLC


Am I doing something wrong ?

I suspect something is wrong with my ethernet port... I don't see DHCP requests with wireshark. Does the netduino plus should have a led blinking when ethernet is plugged ?



#12523 zigbee, zwave, X10 which one for what ?

Posted by Nicolas Dorier on 27 April 2011 - 08:24 AM in General Discussion

If you go with Z-Wave (which is a semi-confidential licensed protocol), you can get products from a lot of different manufacturers. You can do basic control of a number of devices from Netduino using something like Leviton's Vizia RF RS232 Interface.


Thanks, it will be my next toy !

For the remotes, I used XBee stand-alone (which is cool) and also the Arduino Fio, depending on the application


What component are you using to control XBEE ?

I don't use the .NET stuff on Netduino Plus! I put FreeRTOS on and just program in C mostly (out in left field as always).


Can you tell why you do not use .NET stuff ? can you recommend resources on FreeRTOS ? (To learn how to program and install it)

For the remotes, I used XBee stand-alone (which is cool) and also the Arduino Fio, depending on the application


I'm new in electronic, forgive me if my question seems obvious. Why do you use an Ardiuno FIO instead of a Netduino Mini ?
Given the technical specs they have same power consumption to me.



#12504 zigbee, zwave, X10 which one for what ?

Posted by Nicolas Dorier on 26 April 2011 - 05:11 PM in General Discussion

I've seen that there is a lot's of home automation protocol out there. The cool thing about them is that they can easily installed. I used X10 for some projects, but the reliability is really bad. Two others protocol, zigbee and zwave seems to exist, and both seems to be meshed wireless network. Both seems much more reliable than X10, and are low power consumption. My question is, why would someone would choose zigbee over zwave ? Which one is easier to program with the netduino ? What is your experience on these protocols ? Can you recommend some cool component and devices to play with it on netduino ?



#10909 Netduino Plus Sold Out

Posted by Nicolas Dorier on 14 March 2011 - 05:02 PM in Netduino Plus 2 (and Netduino Plus 1)

At least one time in my life I want to say I underestimated the success of my product !



#10853 Article about RAM occupation

Posted by Nicolas Dorier on 12 March 2011 - 07:25 PM in Project Showcase

Having the OutOfMemory exception myself, and coming from the business software industry, I can't thank you enough for your article !! Great !



#10647 Socket programming unreliable

Posted by Nicolas Dorier on 07 March 2011 - 08:57 PM in Netduino Plus 2 (and Netduino Plus 1)

The issue is not solved, can you send me your code please ? I think I did it right... maybe my netduino is buggy



#10632 Can Netduino call a WCF Dataservice 4.0

Posted by Nicolas Dorier on 07 March 2011 - 11:16 AM in Netduino Plus 2 (and Netduino Plus 1)

Valkyrie-MT,
I did not said it was impossible, I just don't think it's a good solution.
Especially since I've seen OutOfMemoryException popping out.

I really think that classic custom reader/interpreter, is not very hard to do and the way to go with the netduino.
Even with that, I had OutOfMemoryException... so I don't recommend to test with XML/JSON over HTTP webservices.



#10606 C# help

Posted by Nicolas Dorier on 06 March 2011 - 10:31 AM in General Discussion

MicroFramework is really small, so the microframework does not support generics. What you need before hacking your netduino is to learn basic OOP principle in C# .NET 4.0 (not the micro framework version). Here is what you need to know, just google every bullet point or buy a certification book. http://www.microsoft...?id=70-536#tab2



#10588 OutOfMemory not expected

Posted by Nicolas Dorier on 05 March 2011 - 03:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Here is the solution, my netduino is v 4.1.1.7a

Attached Files




#10581 Can Netduino call a WCF Dataservice 4.0

Posted by Nicolas Dorier on 05 March 2011 - 10:07 AM in Netduino Plus 2 (and Netduino Plus 1)

From what I have seen, the best and easiest way has been to code an reader/interpreter.

The reader is an interface like ReadInt, ReadCommand, ReadID etc..., it just get bytes from the underlying stream and convert it to an int/command/id.

The interpreter, just call the reader's method in the right order.

var command = reader.ReadCommand();
switch(command)
{
   case Command.DoSomething: .... break;
   case Command.DoSomething2: .... break;
}

The code is really readable, compact, and do not waste any ressources.
(I'm myself a "business developer", I'm very used to WCF, but we don't need all of its flexibility here)



#10558 OutOfMemory not expected

Posted by Nicolas Dorier on 04 March 2011 - 09:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Yes the error comes consistently. I have also tried to create several big byte array and it does not work even if it seems I have enough space. I can create 20 byte array of 512 element, but cannont create 1 byte array of 10 000. My guess is that internally, for the ArrayList and Array, the .NET try to get continuous memory blocks. Depending on the internal implementation of ArrayList, maybe after 473 elements, it tries to expand to a bigger array at twice as big as the source array of 473 elements. (and it seems that each elements takes 24 bytes) I send you all there different use case and the results I get with my netduino tomorrow.



#10544 OutOfMemory not expected

Posted by Nicolas Dorier on 04 March 2011 - 08:37 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi, here is a really simple program :

ArrayList list = new ArrayList();
			for(int i = 0; i < 1000; i++)
			{
				list.Add(i);
				Log(i.ToString() + " " + Debug.GC(true).ToString());
			}


And it seems that an OutOfMemoryException is raised very early... After 473 elements... and 14844 Bytes unused in the RAM

469 14940
470 14916
471 14892
472 14868
473 14844
#### Exception System.OutOfMemoryException - CLR_E_OUT_OF_MEMORY (1) ####


What is going on ?



#10517 How can I see flash and RAM memory left ?

Posted by Nicolas Dorier on 03 March 2011 - 01:31 PM in Netduino 2 (and Netduino 1)

When you compile your project just calculate the size on .pe files



#10481 Socket programming unreliable

Posted by Nicolas Dorier on 02 March 2011 - 12:28 PM in Netduino Plus 2 (and Netduino Plus 1)

The workaround was to use the NetworkChange.NetworkAvailabilityChanged event. I unplug the ethernet cable when the netduino start, when it's started, I plug the ethernet cable and then I start a new thread in the event handler and opens the socket.



#10457 How can I see flash and RAM memory left ?

Posted by Nicolas Dorier on 01 March 2011 - 10:42 PM in Netduino 2 (and Netduino 1)

Simply subtract this from the flash storage space available for your board and you'll know how much room is left for code.



Where can I find the space available for my board ?

In the tech spec of the netduino I see

Code Storage: 128 KB
RAM: 60 KB

After deployment :
(11924 RAM - 100376 ROM - 54323 METADATA)

So I have 50 KB of RAM left during the execution.
And 28 KB of code ?

When you give a new firware you say :

64KB Flash
28KB+ RAM

In this case, I would have only 18 KB of RAM left during execution.



#10447 How can I see flash and RAM memory left ?

Posted by Nicolas Dorier on 01 March 2011 - 06:37 PM in Netduino 2 (and Netduino 1)

You have the Netduino and Netduino Plus confused. They have different amounts of RAM and Flash available.


I posted on Netduino because, it's probably the same answer with the Netduino+.



#10445 How can I see flash and RAM memory left ?

Posted by Nicolas Dorier on 01 March 2011 - 04:49 PM in Netduino 2 (and Netduino 1)

I have seen that in the firmware 4.1.1.a7 :

With this firmware, you will have the following resources available for your code:
64KB Flash
28KB+ RAM


When I deploy my program on the netduino I see

Total: (11924 RAM - 100376 ROM - 54323 METADATA)

And in the website tech spec for the netduino

Code Storage: 128 KB
RAM: 60 KB

And in MFDeploy I see

RAM    0x00000000  0x00020000 (131072 in dec))
FLASH  0x00100000  0x00080000 (524288 in dec)

Does somebody can explain what is all these different value about the netduino ROM/Flash ?
How can we know how much memory is left for our code after the deployment ?

Thanks !



#10401 Socket programming unreliable

Posted by Nicolas Dorier on 28 February 2011 - 04:56 PM in Netduino Plus 2 (and Netduino Plus 1)

When I instanciate the Socket object, the netduino crashs (Even tinybooter does not respond) I have found a workaround : I need to put a breakpoint between the new Socket, and the Bind and plug the ethernet cable at this time. :(



#10302 Socket programming unreliable

Posted by Nicolas Dorier on 27 February 2011 - 08:30 AM in Netduino Plus 2 (and Netduino Plus 1)

I had not reset the MAC address, I just did but same problem here how I do :

-Run in debug the two projects
-Click on "Ping" from the WPF application
(Here I test several pings and it works fine...)
-Click "Renew"...
(Here the "socket.Connect of the wpf application works, whereas the netduino is not blocked on socket.Accept)
-Click" Ping"
(Does not work)
-Stop debug,
-Unplug the netduino
-Replug
-Run in debug the two projects
-Now the netduino is blocked on server.Bind

Every time I unplug/replug the netduino it blocks on server.Bind... and by chance it works again once

I use 4.1.1 a7, thanks for your help !! :)

Update

Same problem when I use UDP.
sometimes it blocks on server.Bind, sometimes it blocks when I create the socket
Socket udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);



#10277 Socket programming unreliable

Posted by Nicolas Dorier on 26 February 2011 - 10:54 PM in Netduino Plus 2 (and Netduino Plus 1)

I have tried to program sockets with the netduino in v4.1.0 (update 5) and v4.1.1 ALPHA 7.
From what I have seen, I had some problems.
Sometimes, call to bind like this
server.Bind(new IPEndPoint(IPAddress.Parse("192.168.5.100"), 5656));
completely blocks the netduino (even MFDeploy can't ping it after that)

Sometimes it does not block but throw an exception which means that no interface have this IP
And sometimes, after several reboot, without doing anything, it works.

Most of the time, when I use sockets, I can't deploy without replugging the USB cable.
And MFDeploy can't ping when the server is on.

Am I doing something wrong ?

Here two project, "Portal.Debug.Client" is a WPF test client which connect and "ping" the netduino.
"Portal.Debug" just listen for a client, and send back the data it recieves.

Sometimes it does not work, sometimes it work, it's very unreliable.

Attached Files




#10059 What are the best practice to create a Netduino Server ?

Posted by Nicolas Dorier on 23 February 2011 - 10:38 PM in Netduino Plus 2 (and Netduino Plus 1)

thanks, my main concern was that the call was blocking, so I thought there would be a better way to save power and CPU resources.



#10045 What are the best practice to create a Netduino Server ?

Posted by Nicolas Dorier on 23 February 2011 - 04:09 PM in Netduino Plus 2 (and Netduino Plus 1)

I'd like my Netduino to be a server. However, it seems that the Socket class do not have asynchronous methods... Does it means that I need to keep a thread alive and Poll the socket ? I'm afraid that the processor will run for nothing... Do you have a better solution to save power and CPU usage ?



#8925 Does GPIOs means "usable with Out/In/InterrruptPort" ?

Posted by Nicolas Dorier on 03 February 2011 - 04:11 AM in General Discussion

I have seen in the description of the netduino that it has 20 GPIOs with SPI, I2C, 2 UARTs (1 RTS/CTS), 4 PWM and 6 ADC channels. My question may seems obvious, but I'm really new to this field. (Electronics in general) Does each of these pin can be used with OutputPort/InputPort/InterruptPort ? Or does each pin have its own job and must be used only for its jobs (pin 0-1 can only handle serial etc...)




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.