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

Need help with network settings on N+2


Best Answer tim c, 06 March 2013 - 02:03 PM

I would recommend using completely different IP settings for this mini network. You are basically setting up a second network that is isolated from any other. It is just between the PC and device. Try using these:

 

PC

IP: 10.1.1.10 

SNM: 255.255.255.0

GW: 0.0.0.0

 

N+2

IP: 10.1.1.20 

SNM: 255.255.255.0

GW: 0.0.0.0

 

From what I recall you won't need a gateway since you can't leave the local segment.

 

Tim

I didn't try pinging it, but I did hook the Netduino up directly to the router and both programs worked. (See my last post on this thread.)

 

Now I'm trying to get the PC and the Netduino to talk to each other without the router in the middle. First, is this even possible, or do I need a router to direct the traffic? I would think that, given the correct settings and connection, they should be able to send simple packets back and forth. But as I said earlier, I have little to no experience with TCP. If it's not possible, do you have a recommendation on which protocol I should try instead?

 

I did get a crossover cable and connected the two directly, but haven't been able to make it work. I basically kept all the settings the same, except changed the default gateway from the router's IP to the PC's.

 

Thoughts?

Go to the full post


  • Please log in to reply
9 replies to this topic

#1 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 05 March 2013 - 08:00 PM

I've been trying to get this to work:
 
 
(Not sure if it makes any difference, but the only change I made to the project is to switch from 4.1 framework to 4.2. Also, I'm running an N+2 rather than N+.) Bear with me if any of my questions are idiotic--this is my first time messing with TCP in any way.
 
If I run NetPlusEthernet and step through it line-by-line, it hangs on the line
using (Socket commSocket = socket.Accept())
I thought maybe it was waiting for something from the Simple Socket form, but when I click Toggle LED, it just times out. (Host IP is 192.168.0.100, port 8080).
 
I'm guessing it's probably something simple with my settings, so here they are.
 
My PC's local IP address is 192.168.0.86
 
My N+2's settings from MFDeploy are as follows:
Static IP: 192.168.0.100
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.0.86
MAC address: [address from sticker on N+2]
 
If I hit the Ping button in MFDeploy, it correctly shows Pinging...TinyCLR. But if I ping 192.168.0.100 from a cmd window, I get "Reply from 192.168.0.86: Destination host unreachable."
 
I tried changing the default gateway in MFDeploy to my router's local address rather than my PC's, but no change in results.
 
I'm connected directly to my PC through a standard Ethernet cable. Should I be using a crossover cable instead? Should I be connecting the Netduino directly to my router instead? If so, is TCP communcation possible without the router in the picture if my Netduino is connected directly to my PC? I'm ultimately going to need communicate between the two when there's no router around, so I need to come up with a different solution if TCP isn't it.
 
Any suggestions would be very much appreciated.
 
Justin


#2 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 05 March 2013 - 08:03 PM

I forgot some information. I did try the "Hello World" web server. The first time I ran it, the Debug window showed 192.168.0.100, which was what I expected. My browser timed out when I typed that address in, however. And every subsequent time I ran it, the debug window displayed 0.0.0.0 as the address. I have no idea what that's all about, but just thought it could be pertinent.

 

Justin



#3 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 05 March 2013 - 09:38 PM

OK, I think I discovered my problem. I connected my N+2 directly to my router, then both programs worked. (One odd thing--the static IP got changed from 192.168.0.100 to 192.168.0.91. No idea how or why that happened.) Now that I sit back and think it out, I'm pretty sure I do need a crossover cable to connect the N+2 directly to the PC. I'll try that out and post again if I can't get it to work.



#4 emg

emg

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 05 March 2013 - 09:46 PM

I would use standard Ethernet patch cables and connect both your PC and Netduino to the switch/router. The default gateway on your Netduino needs to be set to the IP address of your router (this should be also set on your PC). I would check your PC IP settings (IPCONFIG /all in a DOS box on the PC) and I assume net mask is correct 255.255.255.0, which will be the same for all devices on your network).

 

Once you have the right IP, mask and gateway set in the Netduino and powered up and connected to the router, you can ping it from your PC to see if it is seen (DOS box, PING 192.168.0.100). Does it reply to pings?



#5 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 06 March 2013 - 01:20 AM

I didn't try pinging it, but I did hook the Netduino up directly to the router and both programs worked. (See my last post on this thread.)

 

Now I'm trying to get the PC and the Netduino to talk to each other without the router in the middle. First, is this even possible, or do I need a router to direct the traffic? I would think that, given the correct settings and connection, they should be able to send simple packets back and forth. But as I said earlier, I have little to no experience with TCP. If it's not possible, do you have a recommendation on which protocol I should try instead?

 

I did get a crossover cable and connected the two directly, but haven't been able to make it work. I basically kept all the settings the same, except changed the default gateway from the router's IP to the PC's.

 

Thoughts?



#6 emg

emg

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 06 March 2013 - 08:36 AM

Yes, you should be able to do it, but why? Both your devices would lose network/internet connectivity (kinda defeats the purpose IMHO). You will need a cross over cable or auto-sensing NIC that crosses over w/o cable. I would not bother as the switch built into your router has some buffering and provides the network backbone, i.e., it just generally works better w/o any funky issues that I've seen arise in other direct cable situations.



#7 tim c

tim c

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 06 March 2013 - 02:03 PM   Best Answer

I would recommend using completely different IP settings for this mini network. You are basically setting up a second network that is isolated from any other. It is just between the PC and device. Try using these:

 

PC

IP: 10.1.1.10 

SNM: 255.255.255.0

GW: 0.0.0.0

 

N+2

IP: 10.1.1.20 

SNM: 255.255.255.0

GW: 0.0.0.0

 

From what I recall you won't need a gateway since you can't leave the local segment.

 

Tim

I didn't try pinging it, but I did hook the Netduino up directly to the router and both programs worked. (See my last post on this thread.)

 

Now I'm trying to get the PC and the Netduino to talk to each other without the router in the middle. First, is this even possible, or do I need a router to direct the traffic? I would think that, given the correct settings and connection, they should be able to send simple packets back and forth. But as I said earlier, I have little to no experience with TCP. If it's not possible, do you have a recommendation on which protocol I should try instead?

 

I did get a crossover cable and connected the two directly, but haven't been able to make it work. I basically kept all the settings the same, except changed the default gateway from the router's IP to the PC's.

 

Thoughts?



#8 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 06 March 2013 - 03:23 PM

Yes, you should be able to do it, but why? Both your devices would lose network/internet connectivity (kinda defeats the purpose IMHO). You will need a cross over cable or auto-sensing NIC that crosses over w/o cable. I would not bother as the switch built into your router has some buffering and provides the network backbone, i.e., it just generally works better w/o any funky issues that I've seen arise in other direct cable situations.

 

Here's a general overview of my project. I'm building a device that will essentially be used to control motors. It's used in the testing of anechoic chambers. It will be taken to various sites around the world, most (if not all) of which will have no available router/switch to which I can connect. The N+2 will be the central piece of this system controller. It will receive commands from the laptop via LabVIEW as well as from a keypad. It will output status messages, etc. to an LCD display as well as back to the laptop. The display and keypad will communicate over an I2C bus. The N+2 will send serial commands to the motors via RS232 by way of a MAX232 chip.

 

The reason I'm wanting to do an Ethernet connection between the N+2 and the laptop is because it was recommended here:

http://forums.netdui...sb-inputoutput/

(The connection TO the laptop must be USB, but it doesn't sound like it's possible to connect via USB on the N+2 end)

 

This laptop will be used to talk to the Netduino during testing, but is used for more typical functions (i.e., it needs to have internet access) elsewhere. Is there some solution where I won't have to change network settings before and after each test? All I can think of off the top of my head is to create a new user under Windows that uses these new network settings, and just switch users when I need to run a test. Do you think that would work? Ideally, it would be nice not to have to do anything but plug it in.

 

I'm going to try Tim's suggestion just to see if that works, but ultimately, I'd like to get back to the 192.168.*.* settings.



#9 justinbobo

justinbobo

    Member

  • Members
  • PipPip
  • 16 posts

Posted 06 March 2013 - 03:53 PM

Tim, your suggested settings worked fine. (Window's wouldn't let me set the default gateway to 0.0.0.0, so I made the N+2's gateway be the PC's static IP, and vice versa.) I think this'll be okay since I didn't have to change the settings to my wireless network--I just changed settings for Local Area Connection and left the wireless alone. I rarely, if ever, use a wired connection on the laptop, so that should work out fine. I also tried unplugging the Ethernet cable, restarting the computer, and plugging the cable back in to see if Windows would remember my new settings or return to default. Thankfully, it remembered the new settings.

 

Thanks for the help, guys!



#10 tim c

tim c

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 06 March 2013 - 05:50 PM

If you want to stay on 192.168.x.x for the netduino subnet you can use these settings:

 

PC

IP: 192.168.1.10

SNM: 255.255.255.0

GW: 192.168.1.1

 

N+2

IP: 192.168.1.20

SNM: 255.255.255.0

GW: 192.168.1.1

 

Notice the third one (octet) is a 1 and not a 0. the Zero subnet is for your pc/internet network.

 

The reason you can not use 192.168.0.x is that your PC already has a network with that Subnet and, while it can be done with static routes, it can be very difficult to set it all up correctly. Try this at a command prompt "Route Print" :)

 

HTH,

Tim

Tim, your suggested settings worked fine. (Window's wouldn't let me set the default gateway to 0.0.0.0, so I made the N+2's gateway be the PC's static IP, and vice versa.) I think this'll be okay since I didn't have to change the settings to my wireless network--I just changed settings for Local Area Connection and left the wireless alone. I rarely, if ever, use a wired connection on the laptop, so that should work out fine. I also tried unplugging the Ethernet cable, restarting the computer, and plugging the cable back in to see if Windows would remember my new settings or return to default. Thankfully, it remembered the new settings.

 

Thanks for the help, guys!






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.