8 Replies Latest reply on Jul 1, 2015 9:48 AM by JernejH

    XBee with Edison

    hwNewbie

      Hey folks,

       

      I am a complete newbie to both Arduino and Edison. As a result my question is presumably a very simple (and potentially a dumb) one but I have been struggling this with several hours now, reading documents and forums without much luck. So I wanted to ask.

       

      Here is what I have:

      • Arduino Breakout Kit for Edison, powered by micro USB
      • SparkFun Xbee Shield
      • Series 2 XBee
      • Judging from the leds, XBee shield is working. Power is on, DIO5 is blinking green and RSSI turns on and off (there are ZigBee units around but not another XBee unit to the best of my knowledge, unless one of my neighbors has one)

       

      Here is what I want to do:

      1. Initially, I would like to access the XBee from the Edison itself to interact with XBee with AT commands
      2. Then, I would like to access XBee with XCTU running on my computer running OS X and change the firmware for API mode
      3. Eventually, I would like to write a code on the Edison that will access the XBee in API mode (this is the end goal).

       

      Step 3 is out of the scope of this post. But as a starter, I could not get either step 1 or step 2 to work.

       

      Here is what I tried:

      • If I understand it right, /dev/ttyMFD1 is the serial port that will communicate with the XBee unit on Edison.
        • I tried accessing it with screen /dev/ttyMFD1 9600, nothing seems to be happening. I am at least expecting to see something on the screen and get a response to ATVR command, which should return the firmware version. I don't see anything and there is no interaction. I also tried 115200 bps, same result.
        • I tried this with the switch on XBee shield in DLINE mode, also with UART mode. No change.
      • Then I tried to access the XBee unit from the XCTU software running on my Mac.
        • My Mac can communicate with Edison on /dev/tty.usbserial-Axxxxx, and I tried to scan on that same port with XCTU without any luck.
        • I again tried it with the switch in DLINE mode, also in UART mode. No change.
        • This operation logically puzzled me anyways. I normally access the Edison console from /dev/tty.usbserial-Axxxxx. So it didn't really make sense for XCTU to find it on that very same port which normally returns a login console. But I tried it nonetheless.
        • I guess I am missing something obvious here, but how am I supposed to have the software running on my computer interact with the XBee directly, bypassing the Edison console?

      Here is how the board looks like (black micro usb is a standalone power source, and white micro usb cable connects to OS X)

      IMG_5489.JPG

      Any help will be greatly appreciated.

       

      Thanks,

        • 1. Re: XBee with Edison
          Intel_Peter

          Hello hwNewbie,

           

          I'm not familiar with the XBee shields, but did you make sure to install screen on your Edison?

          Also, have you checked the Shield Testing Report for Intel® Galileo and Intel® Edison Boards it includes the shield that you are trying to use, so I believe you may find some useful information there.

           

          Peter.

          • 2. Re: XBee with Edison
            hwNewbie

            Thanks Peter.

             

            Yes, I do have screen installed on Edison.

             

            I also had looked at Shield Testing Report for Intel® Galileo and Intel® Edison Boards. My very specific shield is not listed there but a similar one (XBee S2 Module w/Arduino Wireless Proto Shield) is listed. I can't say they behave exactly the same but I think they do.

            • 3. Re: XBee with Edison
              Intel_Peter

              Does the sketch included in the document work with your shield?

               

              Peter.

              • 4. Re: XBee with Edison
                CMata_Intel

                Hi hwNewbie

                 

                Do you have updates in this? Did you try with the code in the suggested document? Did you have access to the Xbee from the Edison?

                 

                Regards;

                CMata

                • 5. Re: XBee with Edison
                  hwNewbie

                  Hi Cmata_Intel, thanks for checking. Yes I have some updates. Nothing great though.

                   

                  First of all, I also have bought XBee S2 Module w/Arduino Wireless Proto Shield that is mentioned at Shield Testing Report for Intel® Galileo and Intel® Edison Boards as compatible. I also bought an Arduino Uno R3 just to see how it behaves compared to the Edison Arduino board.

                   

                  I can say several things:

                  • This shield is different than the Sparkfun Xbee shield I had. They behave differently.
                  • Neither of the shields work properly on the Edison Arduino board. Whatever I did, I could not get the XBee communicate with Edison or my host computer. This may be a mistake on my part still, but I don't observe the same behavior on Arduino Uno.
                  • When I put the shield on the Arduino Uno, behavior is significantly different:
                    • Arduino Wireless Proto Shield works flawlessly.
                    • Sparkfun shield is giving me issues. I need to use a code that uses SoftwareSerial Library. With that software, I can initiate connection to the Xbee unit with the shield but connection timeouts fairly often, it is not reliable.
                  • Edison Arduino doesn't support Software Serial library so Sparkfun shield and Edison board together seem to be a no-go in any case.

                   

                  I have to admit I am a little disappointed. As I mentioned I am fairly new to both Arduino and Edison. I was under the assumption that and Edison Arduino board would help me understand and learn both. My assumption was apparently wrong. I can say fairly confidently now that a standalone Arduino Uno and Arduino Intel boards behave pretty differently in this use case and their libraries have significant differences for me that affect usability (at least for Software Serial). I ended up having to buy a separate Uno unit as I mentioned.

                   

                  Maybe this was a given and I should have had this expectation. But the whole experience did not leave me with a great taste. I was expecting more clarity, better documentation and better interoperability.

                   

                  I am putting this down as a note, in case someone searching for similar issues might benefit.

                   

                  Thanks,

                  • 6. Re: XBee with Edison
                    Intel_Peter

                    Thanks for this feedback, we appreciate it. The Edison’s Aduino Expansion Board has been designed to provide footprint compatibility with the Arduino UNO R3; however this doesn’t mean that it is an Arduino UNO itself.

                    The architecture differences between the two boards are quite big. What that means is that there are libraries that will work fine with the regular Arduino UNO but they won’t be compatible with the Edison. In such cases, the best option is to re-write the library on your own in order to make it compatible with Edison. Of course I understand that it would require a bigger effort but you will obtain a library that works as you want in your Edison.

                    The main difference (or advantage) between the Edison and the Arduino UNO, is that the former has an internal Linux OS. This fact brings a lot more flexibility to the Edison since you are not only able to use the Arduino IDE but you can compile in basically every programming language compatible with Linux. And with libraries such as MRAA, I2Ctools, SPIdev, hcitool, etc… you really have a powerful combination.

                    There are some examples of users that have encountered the same issues as you, like How to set XBee Serial?. If you are still interested in using XBee with Edison, I’d suggest you to take a look at it.

                     

                    Peter.

                    • 7. Re: XBee with Edison
                      hwNewbie

                      Thanks Peter, I appreciate it.

                       

                      As I mentioned, this was probably a misaligned expectation on my end. I honestly didn't know what to expect from and Arduino / Edison combo and I made some assumptions on what it would be like.

                       

                      I had reviewed the forums before posting my question and had seen the article that you referred above and some others. The OP pretty much had the same question I now have.

                       

                      Regardless, I think Edison is an amazing platform that has a lot of potential. I think it will benefit from more and better documentation. Given that it is fairly new, I think it is fair this is to be expected. I will be eagerly watching to see it fulfill its true potential.

                      • 8. Re: XBee with Edison
                        JernejH

                        Hi,

                         

                        perhaps there is a workaround you can try. XBee 2.1.0 : Python Package Index this is Xbee library for Python. You can make everything work in Python, first you will need to write a script which set the pins on shield in the right position. I think you only need UART. You can write script in Python.

                         

                        And then you will need to change dev to UART, I don't have Edison Arduino shield to check which interface is UART, but I think this is the only line you will need to change and then examples should work.

                         

                        ser = serial.Serial('/dev/ttyUSB0', 9600)

                         

                        I don't know how experienced you are, but I think it relatively easy to do it. If you want to do it and don't know how to get started, ask. I personally think that Edison and Galileo are good platforms, but Intel's constant promoting Arduino like environment is keeping people blind from real advantage Edison and Galileo have, this is Yocto embedded Linux.

                         

                        Cheers, Jernej