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

Netduino Go with Xbee module not supported yet?


  • Please log in to reply
15 replies to this topic

#1 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 August 2012 - 02:07 AM

I am trying to communicate with the serial port of my netduino Go shield base. However I've read that the serial ports are not released or working with the Netduino Go. Aside from programming directly the shield base, is there any other work around that I am missing? Disclaimer: I am fairly new to the hardware side of things, so please keep it simple. Thanks

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 02 August 2012 - 02:42 AM

Hi hoquet, The other easy currently-available option is to use an XBee Gadgeteer module (such as the one from Sytech). Please note that S/U/X/Y Gadgeteer modules may require use of pins from multiple sockets...so we recommend keeping the other sockets on that GoBus channel empty. [Sockets 1-4 make up the first GoBus channel, sockets 5-8 make up the second GoBus channel.] Chris

#3 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 August 2012 - 04:56 PM

Thank you Chris, this is a gadeteer module for XBEE that I am looking at: http://www.ghielectr...log/product/314 Are you saying that if I connect this module to one of the GO bus sockets, for example socket 1, then I must leave 1-4 empty? Using this gadgeteer I will not require the XBee Shield? Also, will I be able to just start working with the socket or do I need to initialize the outport for a gadgeteer xbee module? So far I have used the outport for the RGBLed, Potentiometer, button, and shield base. There are corresponding reference libraries NetduinoGo.RGBLed, etc... that I can use to communicate with those on the GoSocket. Is there a library for communicating with Gadgeteers that I need to use? Thanks hoquet

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 August 2012 - 12:07 AM

Hi hoquet,

Are you saying that if I connect this module to one of the GO bus sockets, for example socket 1, then I must leave 1-4 empty? Using this gadgeteer I will not require the XBee Shield?

Also, will I be able to just start working with the socket or do I need to initialize the outport for a gadgeteer xbee module? So far I have used the outport for the RGBLed, Potentiometer, button, and shield base. There are corresponding reference libraries NetduinoGo.RGBLed, etc... that I can use to communicate with those on the GoSocket. Is there a library for communicating with Gadgeteers that I need to use?

Yes, if you plug that Gadgeteer module into socket 1 then it will use pins 4 and 5 of each of sockets 1-4. You could potentially use other Gadgeteer modules on those other sockets, but GoBus modules generally won't work alongside a Gadgeteer module on the same GoBus channel. In other words, we added a special "Gadgeteer S, U, X" compatibility mode to Netduino Go...but it requires switching over a GoBus channel for exclusive use by Gadgeteer.

Once you plug in the module, you should be able to access it as "COM1" on the Netduino Go mainboard and then speak to the XBee module via normal SerialPort commands. There are several NETMF wrappers for XBee on the Internet which should work.

Community member Stefan has also created a library called Gadgeteer Light for his Netduino Gadgeteer adapter shield...and that might work for you here to use the manufacturer's XBee Gadgeteer library.

NOTE: Gadgeteer 'U' modules on sockets 1-4 use COM1; Gadgeteer 'U' modules on sockets 5-8 use COM2.

Chris

#5 ByteMaster

ByteMaster

    Advanced Member

  • Members
  • PipPipPip
  • 76 posts

Posted 03 August 2012 - 12:09 AM

Hello Hoquet -

I am trying to communicate with the serial port of my netduino Go shield base. However I've read that the serial ports are not released or working with the Netduino Go. Aside from programming directly the shield base, is there any other work around that I am missing?


Funny you should mention Xbee, I just ordered a few boards to act as an XBee host w/ an STM8S207 processor. These don't use the serial port but are a native GO! module.

I'm not really in a position ot manufacture these, but if you want to have a little fun and assemble your own module, I can get you the .BRD file and you can order some of your own boards. You can get three of them for about $15 and not including the XBee module it's about $10 for parts per board. Nothing too small on this one and is pretty easy to hand solder.

-twb

Attached Files


Kevin D. Wolf
Windows Phone Development MVP
President Software Logistics, LLC
Tampa, FL

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 August 2012 - 12:12 AM

Funny you should mention Xbee, I just ordered a few boards to act as an XBee host w/ an STM8S207 processor. These don't use the serial port but are a native GO! module.

Very nice, ByteMaster!

Chris

#7 ByteMaster

ByteMaster

    Advanced Member

  • Members
  • PipPipPip
  • 76 posts

Posted 03 August 2012 - 01:22 AM

Thanks Chris -

Very nice, ByteMaster!


Here's a pix of a similar module with a RN-171 WiFi module soldered in place. This is the same module on the underside of the RN-VX WiFi module with the same foot print and pin-compatible with XBee modules.

The firmware is starting to become pretty solid, hope to have all the 'stuff' (H/W & S/W) I'm working on published by the end of August.

-twb

Attached Files


Kevin D. Wolf
Windows Phone Development MVP
President Software Logistics, LLC
Tampa, FL

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 August 2012 - 02:29 AM

Here's a pix of a similar module with a RN-171 WiFi module soldered in place. This is the same module on the underside of the RN-VX WiFi module with the same foot print and pin-compatible with XBee modules.

It's just cruel to tease us like this, ByteMaster ;)

Seriously, though, thanks for sharing all of this with us!

Chris

#9 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 August 2012 - 08:45 PM

Chris, thanks for the reply. I have a good wrapper that I found for the XBEE, I am going to tweak it and I'll attach my code once I am finished. So I have the XBee Module on Socket 1 which is going to use up 1-4. I have the XBee Shield Base on Socket 5 which will take up 5-8. So now I can communicate and use motors. I still need to add a distance sensor and potentially my accelerometer. At some point the shield base will not take up the full sockets 5-8? I could just wait... Otherwise, can I put the adafruit motorshield on the Go shield base, then stack the accelerator on top of that? Bytemaster, I am going to order the wiFly module. I am looking forward to your publishing your firmware. "Nothing too hard to hand solder?" You have not yet seen my noob soldering job ;) Thanks

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 August 2012 - 09:50 PM

Hi hoquet,

Otherwise, can I put the adafruit motorshield on the Go shield base, then stack the accelerator on top of that?

That should work! As long as they don't use the same pins you'll be good to go.

Chris

#11 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 10 August 2012 - 04:19 AM

I am having a very strange problem. I have the XBee using the gadgeteer on Socket 1 on my NDG. I am using the sparkfun xbee wireless kit. That comes with the 1mw xbee chips. I wrote a program that will initialize the Serial on COM1 then added an event handler to handle the data received. I wrote another windows form to send data via serialport and Xbee. Works great! On the windows form I write something in a textbox, it shows up on my NDG. Now, I added a button on my NDG so that when I push the button, it will write to the serialport a message. On the windows form, I added an event handler for DataReceived that should pick up the message. But it did not work. I then tried another program already written http://forums.netdui...beeusercontrol/ And I got the same results. I could not send data from the NDG to my PC. For some odd reason, I finally decided to switch the xbees from the xbee explorer on the pc and my gadgeteer. Wow, now I press the button on my NDG and it shows up on my windows form. Now when I write something in a textbox on the windows form, the NDG does't read the message. I know my code is working fine both ways. It seems that one of the Xbees is not able to transmit. Could this be a hardware issue or is there something that I forgot to do with one of the xbees or is there a mode/setting, something that I am missing? Any clues?? Thanks

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 August 2012 - 05:57 AM

Hi hoquet, Which socket are you using for your XBee module? Is anything plugged into sockets 2-4? Also, could you please share a brief code sample? I can't quite tell what you're doing. If we can get more details, we can help figure this out with you. Chris

#13 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 August 2012 - 02:05 AM

Greetings Chris,

The XBee Gadgeteer is plugged into Socket 1. I Have the Go Button plugged into Socket 5. Nothing else is plugged into any other socket.

Here is the code on the NDG side:

                serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
                serialPort.ReadTimeout = 500;
                serialPort.WriteTimeout = 500;
                serialPort.Handshake = Handshake.None;
                serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_Datareceived);
                serialPort.Open();

        private static void serialPort_Datareceived(object sender, SerialDataReceivedEventArgs e)
        {
            SerialPort spL = (SerialPort)sender;
            Debug.Print("Data Received");
        }
        static void button_ButtonReleased(object sender, bool buttonState)
        {
            Debug.Print("Button Pressed");
            string output = " Hello from your Netduino: ";
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes(output);
            serialPort.Write(bytes, 0, bytes.Length);
        }

On the windows form side I am able to receive the data from the NDG, but when I send data, I see the Gadgeteer light go on, however the event is not fired.

Here is the code on the windows form side.
            serialPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
            serialPort.ReadTimeout = 500;
            serialPort.Handshake = Handshake.None;
            serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_Datareceived);
            serialPort.Open();

        private void button1_Click(object sender, EventArgs e)
        {
            // then we will prepare sending the message
            byte[] buffer = new byte[MOVEMESSAGE.Length];
            // convert the string to bytes
            buffer = System.Text.Encoding.UTF8.GetBytes(MOVEMESSAGE);
            // write it to Xbee through serial
            if (!serialPort.IsOpen) { serialPort.Open(); }
            serialPort.Write(buffer, 0, buffer.Length);
        }
        private void  serialPort_Datareceived(object sender, SerialDataReceivedEventArgs e)
        {
            SerialPort spL = (SerialPort)sender;
            txtBox1.Text += "Data Received";
        }

The confusing part is that I can send from the NDG and receive on the windows form, but I cannot send from the windows form and receive on the NDG. However when I switch the XBee's, I can send from the windows form and receive on the NDG. But I cannot send from the NDG anymore and receive on the windows form.

Thanks

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 August 2012 - 09:35 AM

That is really bizarre. Is it possible that the XBee modules require hardware or software flow control? That one of them is set up in some sort of single-direction mode? I am certain the the serialports work bi-directional on Netduino Go because we use them to reflash modules and the Shield Base currently uses them for its comm channel. See if you can enable software flow control on both sides (and as a setting on the XBee modules). If that doesn't fix the scenario, we can try to get the same hardware as you and reproduce the issue here. Chris

#15 hoquet

hoquet

    Member

  • Members
  • PipPip
  • 12 posts

Posted 12 August 2012 - 04:53 PM

I switched the flowcontrol to hardware by setting the handshake to RTS or RequestToSend, still no go. I switched the xbee's around again, still no go. I checked the settings on both xbees on windows by using the digi x-ctu, they both appeared to be set correctly and working fine. After switching things back and fourth, I was then always able to send from the NDG, but not receive. I switched the xbee's and still I could send from the NDG, but not receive. The problem must be on the NDG side. The code looked fine and I could find any other settings. Other users code was relatively the same as mine in working with the serialport. I then set the windows form app to continuously transmit, I then picked up the xbee and gadgeteer and moved pressed the xbee onto the gadgeteer, I received data! I had to press down very hard to receive data. I switched the xbees, they both worked as long as I pressed down hard on the xbee. Conclusion The gadgeteer is faulty. One or more of the pin receivers on the gadgeteer is not making connection to the xbee. I will need to send this back and order another one. I hope these are not the type of issues that I am going to run into. I seemed to have run into so many issues already. But managing to work my way through most of them. I guess sometimes you can't always assume that every hardware connection is working. I guess if I was going to production with an application I would have some diagnostic routines that kicked off first. It would check the connectivity of the NDG to the gadgeteer. Then diagnose the connection of the gadgeteer to the XBEE pin by pin. Thanks

#16 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 August 2012 - 08:20 PM

Hoquet, I had similar issue with my buffer setup on the receiver, I could only get it to work at a high baud rate, at 9600 baud only 1 or 2 characters. Will the program work without the xbees? Just connect with jumpers. If you can get a config file for the xbees that is known to work and load that onto the xbees it may narrow down the problem. I had a lot of problems with the xbee configuration. Chuck




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.