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

Ethernet interfering with Xbee


  • Please log in to reply
5 replies to this topic

#1 wowbagger

wowbagger

    New Member

  • Members
  • Pip
  • 4 posts

Posted 23 October 2012 - 12:57 PM

Hello, I am setting up an Xbee network with the Xbee coordinator attached Netduino. I am having some problems and hoped someone might be able to assist. I have setup the XBee connection and its working semi reliably sending data from the Netduino to PC. However when connect Network cable to the Netduino the signal received on the PC becomes corrupted.
I would like to use the netduino as a http server that can request data from sensors connected to Xbee's.

Set up details:
Netduino sending data connected to XBee via XBee Shield. This required that I connect the ICSP header to the Netduino.

The receiving Xbee is connected to a PC via an Xbee USB adapter.

The code on the Netduino for send the data looks like:
SerialPort port = new SerialPort("COM1", 9600);
port.ReadTimeout = 0;
port.Open();
while(true){ //Write H, sleep, write L, sleep }

Is the noise I see because the Ethernet connection is sharing serial connection with the Xbee?

Any assistance would be greatly appreciated.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 October 2012 - 04:54 PM

Hi wowbagger,

Is the noise I see because the Ethernet connection is sharing serial connection with the Xbee?

What are you using for an Ethernet connection? If you're using a Netduino Plus, the network feature should be completely separate.

The XBee interface that you're using...does it implement flow control? Are you losing data bytes--or are the data bytes being corrupted?

Chris

#3 wowbagger

wowbagger

    New Member

  • Members
  • Pip
  • 4 posts

Posted 23 October 2012 - 11:39 PM

Hi Chris, thanks for the reply

What are you using for an Ethernet connection? If you're using a Netduino Plus, the network feature should be completely separate.

I am using an Netduino Plus and its onboard Ethernet connection.

The XBee interface that you're using...does it implement flow control? Are you losing data bytes--or are the data bytes being corrupted?

Currently I have the Xbee's connected in AT mode. When I watch the normal data come through I see a value a pause (where dots are shown) and then the next value. Even when the Ethernet is not connects values are dropped, but at least 4 in 5 come through . When the Ethernet is connected I see much more data some gaps but mostly its random noise
I'm not sure about the flow control question, could you please give more detail?

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 October 2012 - 01:26 AM

I'm not sure about the flow control question, could you please give more detail?

If you're using XBee, you'll generally want to use flow control to make sure that wireless data is not lost as the available bandwidth fluctuates. With wireless, bandwidth changes as RF noise comes and goes.

If you're communicating via the ICSP header, that means you're using SPI. Which is interfacing to another chip. I'd take a look at the SPI data (either debugging via Visual Studio or via a logic analyzer) to see what the data looks like. This will help you isolate whether the data loss is in NETMF, in the XBee shield, or at the target device...which information you can then use to resolve the issue.

Chris

#5 wowbagger

wowbagger

    New Member

  • Members
  • Pip
  • 4 posts

Posted 24 October 2012 - 01:56 AM

If you're using XBee, you'll generally want to use flow control to make sure that wireless data is not lost as the available bandwidth fluctuates. With wireless, bandwidth changes as RF noise comes and goes.

As yet I have not considered this in my project. Is this something you would normally do to the serial data. Like numbering the packets to ensure the all arrive?

If you're communicating via the ICSP header, that means you're using SPI. Which is interfacing to another chip. I'd take a look at the SPI data (either debugging via Visual Studio or via a logic analyzer) to see what the data looks like.

Is there some documentation that describes how to debug the SPI data via visual studio?

When using a Netduino does writing debug.print message interfere with any of the other serial ports?

#6 wowbagger

wowbagger

    New Member

  • Members
  • Pip
  • 4 posts

Posted 24 October 2012 - 01:07 PM

Correction the Xbee is directly connected URT COM1 pins not SPI. The connection to the ICSP header is for power.

I plan to hook a logic analyzer over the weekend. For now I have simplified the code to this:
SerialPort port = new SerialPort("COM1", 9600);
byte[] bytes = Encoding.UTF8.GetBytes("Simple Test");            
port.Open();
while (true)
{
     port.Write(bytes, 0, bytes.Length);
     port.Flush();
     Thread.Sleep(1000);
}

Now normally in the receiving Xbee I see this, As you can see there is a bit of noise:
............Simple Test........................................
............................................................Simple Test.....
............................................................................
....................Simphe st...............................................
.......................................................Sim`la Test..........
............................................................................
..............Simple Test...................................................
................................................Simple

When I plugin the network cable in to the Netduino Plus it changes to this:
......p.....................8..........8......8...x...................
..8....................x.................0......Ad.........8................
...p>.p....................8....................................S.........08
.............`................x..x.x...........8.x...p.......8..8...........
...............................8......0.......X.......8.p...............h@..
..................x.......................................x..........





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.