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.
Photo

DHCP Server


  • Please log in to reply
4 replies to this topic

#1 crawf

crawf

    Member

  • Members
  • PipPip
  • 13 posts

Posted 10 July 2012 - 01:12 PM

This may seem like a dumb question, but was pondering whether it's possible to setup the Netduino Plus as a DHCP server for clients to get IP's from? Here's what I'm trying to achieve. I have a web server setup on the Netduino, which allows you to set configuration options for the data logger (what the project is). This includes Netbios, ip, gateway, etc, and basically allows you to join a users network (wired or wifi). However, in order for users to get to this screen, they first need to change their computers IP configuration (from DHCP, which I'm assuming at this stage most will have set) to even be able to talk to the device. Setting up a Netbios name helps, but the client computer and the Netduino need to be on the same subnet. I thought that setting the Netduino as a DHCP server itself could help, but I'm quite sure that's not possible, and if so, would be far too large to fit into the Netduino. So, any other suggestions on connecting to a Netduino web server? Another thought is to just ask them to plug the Netduino into their home router, which will be allocated an IP on their networks (hopefully the router will have DHCP enabled!!) I should mention that I intend to give out these devices to users that may not be tech-savvy, so trying to make the process as easy as possible. Cheers!

#2 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 11 July 2012 - 09:27 AM

Hi In my experience 99% of all home routers are DHCP enabled. So i wouldn't worry to much about the users who are on static as they generally know enough to be able change IP addresses etc.! As for using the ND as a DHCP device I wouldn't run the risk of having a second DHCP server on a home network especially as ALL SOHO routers are DHCP enabled by default. For your scenario i would just enable the DHCP client via mfdeploy and hope for the best, another thing you could do would be to store the desired IP in a config file on the SD card and set the device to that IP during an init sequence. Then the end user could manually edit the sd card config file to specify an IP for there device to use. Nak.

#3 crawf

crawf

    Member

  • Members
  • PipPip
  • 13 posts

Posted 11 July 2012 - 09:48 AM

Hi

In my experience 99% of all home routers are DHCP enabled. So i wouldn't worry to much about the users who are on static as they generally know enough to be able change IP addresses etc.!

As for using the ND as a DHCP device I wouldn't run the risk of having a second DHCP server on a home network especially as ALL SOHO routers are DHCP enabled by default. For your scenario i would just enable the DHCP client via mfdeploy and hope for the best, another thing you could do would be to store the desired IP in a config file on the SD card and set the device to that IP during an init sequence. Then the end user could manually edit the sd card config file to specify an IP for there device to use.

Nak.



Hi nakchak,

Thanks for your suggestions! Yep, I'm counting on the 'special cases' of static IP's, etc that the user is smart enough to figure their own stuff out.

I should point out that the final goal is to connect the device to a WiFi network and provide data logging available on the users home network. As such, the user will somehow need to configure the WiFi settings for the Netduino. This will be a simple configuration screen the user will browse to.

This is how I picture the setup process:
  • User plugs Netduino to PC via ethernet.
  • User navigates to http://netduino/index.html to configure WiFi settings.
  • Hits save, and device is now on WiFi network. User unplugs the device and relocates (to where-ever they want).

Obviously, there is an inherent issue with IP addresses with the above solution (user needs to be on the same subnet as the IP address configured in the config file on the SD card. Eg, if the IP address of the Netduino was 192.168.0.100, the user would need to be on the 192.168.0.XXX range to communicate). Is there any way to somehow automate to allocation?

Any further thoughts on a user-friendly way to achieve this without having the end user muck around with IP settings?

#4 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 11 July 2012 - 10:26 AM

Hmmmm I suppose you could write a small winforms app to do a udp broadcast on the home network, you would need a listener on the netduino to respond to the broadcast, but essentially that is a very similar method to the one used by Lantronix and Digi for their embedded ethernet controllers configuration. Once you have the connection you could use the local subnet mask (on the client pc running the winforms app) to set everything up, then you could have a simple wizard to set SSID and passphrase etc. for WiFi as well as a static ip if needed, that would probably be the nicest configuration experience for your end users... Hope that helps Nak.

#5 crawf

crawf

    Member

  • Members
  • PipPip
  • 13 posts

Posted 11 July 2012 - 10:29 AM

Hmmmm

I suppose you could write a small winforms app to do a udp broadcast on the home network, you would need a listener on the netduino to respond to the broadcast, but essentially that is a very similar method to the one used by cand Digi for their embedded ethernet controllers configuration. Once you have the connection you could use the local subnet mask (on the client pc running the winforms app) to set everything up, then you could have a simple wizard to set SSID and passphrase etc. for WiFi as well as a static ip if needed, that would probably be the nicest configuration experience for your end users...

Hope that helps

Nak.


Yep, I tend to agree with you there. I don't think there is any way to getting away from implementing a WinForms-type 'Wizard' for clients to use. And it's probably the most elegant (and user-friendly) solution.

Thanks so much for your thoughts and insight!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.