Shop OBEX P1 Docs P2 Docs Learn Events
XBee WiFi info — Parallax Forums

XBee WiFi info

RsadeikaRsadeika Posts: 3,837
edited 2014-12-23 04:21 in Accessories
Yesterday I received my XBee WiFi module from Parallax, this morning I plugged it into my Activity Board XBee socket, now what do I do? I downloaded XCTU, ran the program, since my AB is on COM11 I chose that for the XCTU, and ran the find module, nothing showed up. I also read in the docs that you can go to 192.168.1.10 and that should bring up some kind of built in program that is on the WiFi, but since my WiFi hotspots are password protected, nothing came of that.

It seems like I need some handholding on this one, any help will be greatly appreciated.

Thanks
Ray

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-20 09:36
    You need to make a connection between your PC (USB serial port) and the XBee's serial port so XCTU can do its stuff. Your Activity Board has the Propeller sitting in the way (not necessarily a bad thing). You have three choices ... 1) Buy an XBee to USB serial adapter (like this one: http://www.parallax.com/product/32400). 2) Write a program for your Propeller that copies any characters received from the PC on pin 31 to whatever I/O pin you're using for the XBee receive line and copies any characters received from the XBee transmit line to the PC on pin 30. You'll need jumpers between the XBee header sockets for Rx and Tx near the crystal to the Propeller I/O pins you want to use. 3) If you have a spare USB to serial adapter like a PropPlug, you can attach that to the XBee header sockets (and ground) and use that for #1.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 10:58
    Thanks Mike, I thought it would a simpler method of initializing the XBee Wifi. I attached my module to the PC and made a connection with the XCTU program. I put in the obvious information, SSID, Encryption Enable(using WEP security[3]), and the Passphrase. I left the Module IP Address at 192.168.1.10 as the default, but still no joy when I try to access via Putty. I must be missing some other obvious piece of information, not sure what it is at the moment.

    It is to bad that Digi does not have a simplified version of getting the XBee WiFi module up and running, unless of course what they have now is the simplified version. Once you do make a connection, does anybody know what is supposed to appear on the Putty screen?

    Ray
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-20 11:16
    Make sure RTS/CTS is disabled and the Baud is set to what you want. There are a lot of messages that appear on the serial port when the XBee is reset as it connects to the WiFi network. You can suppress those via a configuration option or throw them away in your Propeller program once you get to that point. If your XBee is configured to get its IP address from the WiFi Router, the IP address may be different each time it's reset. It seemed to work for me.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 11:41
    I guess I am making some headway, I decided to use the "Active Scan" method which found my hotspots, I picked the strongest signal and it came back with a, connected. I guess at this point the XBee WiFi module is configured? And now I can plug it back into the Activity Board, write a quick IO program that should display something once an external WiFi connection is made?

    When I am in the XCTU program mode and I tried using Putty with the 192.168.1.10 address, I do not get a connection. Since the setting in Putty is SSH, I wonder if that could be a problem. I just scanned over the info in XCTU, and it looks like the XBee WiFi module IP address got changed, will have to try the new address. Just tried the new address, while still in XCTU, and it did not make a connection, Hmm.

    Ray
  • ElectrodudeElectrodude Posts: 1,657
    edited 2014-12-20 12:28
    Rsadeika wrote: »
    I guess I am making some headway, I decided to use the "Active Scan" method which found my hotspots, I picked the strongest signal and it came back with a, connected. I guess at this point the XBee WiFi module is configured? And now I can plug it back into the Activity Board, write a quick IO program that should display something once an external WiFi connection is made?

    When I am in the XCTU program mode and I tried using Putty with the 192.168.1.10 address, I do not get a connection. Since the setting in Putty is SSH, I wonder if that could be a problem. I just scanned over the info in XCTU, and it looks like the XBee WiFi module IP address got changed, will have to try the new address. Just tried the new address, while still in XCTU, and it did not make a connection, Hmm.

    Ray
    SSH mode will definitely not work. Try raw mode instead.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 12:53
    I went through all the Putty modes, the last one was "raw mode", did not connect, it timed out. I also tried IE, that did not make a connection either. I also plugged the module into the Activity Board, hoping it would do something, nothing, no connection from Putty or IE.

    When I have the module connected to the PC and I am running XCTU, it seems to be talking to the module, so the module is not broken, it just will not let any program make a connection to the WiFi module. Once I got past the "Active Scan" setup I thought everything from that point would be easy, not going my way.

    Ray
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-20 13:03
    I can't help you with the PUTTY stuff. I use a Mac program called MacWise which has a Telnet option for the serial connection and that works fine. On my iPad, I also have a Telnet emulator called "Telnet" which works fine. There's a free version called "Telnet Lite" that also works.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 13:16
    I just got some advice from my brother, and he made the same suggestion. Now I have to figure out how to get Telnet for Windows 7, you would think that IE would be able to do something like that. I also checked my router to see if it was finding the new IP address, it shows up, so I guess the router is aware of the address, now how do I talk to the XBee WiFi module.

    Wait a minute, I just checked Putty, it has a Telnet option which I just tried, no luck it just timed out. I also just did a ping to the new IP via the command prompt, it sent and received some data, so ping gets to it without any problem. What would be the most obvious thing that I would be overlooking at this point?

    Ray
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 13:39
    I had my brother check out the IP address for the module using Look@Lan, that program says that the only thing that it will respond too is a ping. So I must be missing another setting for the WiFi module. In XCTU it is not very apparent as to what is missing, This is a mystery.

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-20 13:55
    The XBee WiFi is basically an ethernet/serial adapter. Other than that, XBee has some kind of cloud support for it (which I never used).

    David Betz wrote a Propeller Loader for the S6B device last year that sends programs to EEPROM over the serial port. I also created a project for controlling the ActivityBot+S6B with an early version of David's code which is described here.

    Jeff Martin completed his Delphi based propeller loader for the S6B afterwards. Someone is translating that to Objective C ... (still?).
  • ElectrodudeElectrodude Posts: 1,657
    edited 2014-12-20 14:28
    Mike Green wrote: »
    I can't help you with the PUTTY stuff. I use a Mac program called MacWise which has a Telnet option for the serial connection and that works fine. On my iPad, I also have a Telnet emulator called "Telnet" which works fine. There's a free version called "Telnet Lite" that also works.

    There's also the command-line telnet program that comes with OSX.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-20 14:43
    Thanks jazzed. I was trying to have a thread where somebody who just purchased an XBee WiFi could go to, and get a good feel for a simple start up of the module. I did search the forum and it seems the information is scattered all over the place, but nobody describes what the initial steps are for getting the thing to work, again maybe I am missing something very obvious. Hopefully this could be the thread.

    I think maybe tomorrow I will have to dig into this some more, and get this thing to work for me.

    Ray
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-21 06:32
    @jazzed, I downloaded 6b0d18bd4330, which took about a half hour, and then when I tried to unzip it, it comes up as an empty or damaged file. Did not try it again because it was taking such a long time to download. Not sure if it is on my end, the problem that is.

    Today I will try making some headway with XBee WiFi module, from the Digi docs it says that you are supposed to be able to connect without having an HTML setup, that is what I am aiming for, the simplest form of connection to the module.

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-21 09:21
    Rsadeika wrote: »
    @jazzed, I downloaded 6b0d18bd4330, which took about a half hour, and then when I tried to unzip it, it comes up as an empty or damaged file. Did not try it again because it was taking such a long time to download. Not sure if it is on my end, the problem that is.

    No surprise there.

    The links are part of a huge repository not intended to be zipped. It is intended to be used with the mercurial source control program. Maybe I'll post a zip of the demo program pieces later.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-21 10:49
    I guess I have to start somewhere, below is a base program. It is actually checking the voltage on the battery pack that is powering the AB, and sending a string out the XBee WiFi Rx/Tx line, I think. The problem that I have to overcome is, why isn't the XBee WiFi acknowledging when you try to connect to the its IP address? In the docs it talks about working with frames, but I am not sure what that has to do with anything unless you have to set up some code, in the program, to check to see if there is any action on the incoming line, I am assuming that that is a built in function of the module. In the docs there is no mention of that, unless it is a given.

    At this point, according to the XCTU, the module has been set up correctly for accessing my closest hotspot, it just does not seem to want to go to work.

    Ray

    /*
      ABmobile.c
    
    */
    #include "simpletools.h"
    #include "adcDCpropab.h"
    #include "simpletext.h"
    #include "fdserial.h"
    
    serial *xbwifi;
    
    void Bat_Log();
    
    int XBwifi_remote();
    
    float v3;
    
    int main()
    {
      // Add startup code here.
      adc_init(21, 20, 19, 18);
    /*                       Rx  Tx  Mode  BAUD */
      xbwifi = fdserial_open(12, 13,  0,   9600);
      pause(50);  
    
      int xwcmd = -1;
     
      while(1)
      {
        // Add main loop code here.
        Bat_Log();
        writeLine(xbwifi,"Is anybody there?"); // Till I get a response
        //xwcmd = XBwifi_remote();
      }  
    }
    
    int XBwifi_remote()
    {
      char inBuff[40];
      int retval = 0;
      
      if(fdserial_rxReady(xbwifi))
      {
        readStr(xbwifi, inBuff, 40);
        if(!strcmp(inBuff,"help"))
        {
          writeLine(xbwifi,"Finally got here!");    
        }    
      }
      else
      {
        writeLine(xbwifi,"??");
        retval = -1;
      }    
      return retval;    
    }
    
    void Bat_Log()
    {
        v3 = adc_volts(3);
        v3 = (v3*1.99);
        
        putChar(HOME);
        print("Battery %f V%c\n", v3, CLREOL);
        pause(250);  
    }
    
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-21 13:01
    Now I am starting to wonder if I got a bum XBee WiFi module. The XCTU program seems to be able to update it, gave it an IP address, which shows up on my router, but none of my devices can connect to it. I have tried Putty, IE, Nook HD+, and my laptop. Since the XBee WiFi module has only a numerical IP address, which is what shows up on router, the other devices that I tried are searching for named IP address, so probably that is why they cannot see it. Is anybody familiar enough with XCTU to point me to a function that can verify an external connection to the WiFi module?

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-21 13:06
    Hi Ray,

    One of the XBee S6B configurations is as a simple HTTP server. Then any web browser can be used as a client to talk to the server. The examples I suggested were based on this concept. It is similar to the idea of having an XBee serial on a PC XBee USB to a separate XBee acting as a serial port connection for a microcontroller.

    I'll come up with a procedure and some binaries for you to use later today for the xbee-abs example linked above. It will take a while to reproduce it.

    Gotta go shopping first.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-21 13:21
    Thanks jazzed, but I am still thinking that I have a broken XBee WiFi module.

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-21 18:59
    Just to follow through ....

    Ray, your device has probably never been configured correctly. The S6B will respond to pings without having a propeller program driving the server.

    Attached are some propeller binaries loadable using propeller-load that will allow configuring the XBee S6B on the Wifi network and provide a quick test for interoperability. The web page code can be used on any PC or server (using the right address path for the file index.html of course).

    xbee-config.elf
    xabs-server.elf
    index.html
    cssAbsDemo.css
    shine.js
    events.js
    images (...)

    How to use this:
    1. Download files to your PC from the .zip
    2. Extract the .zip file keeping the file structure in tact
    3. Connect ActivityBoard XBee DO to Propeller P9
    4. Connect ActivityBoard XBee DI to Propeller P8
    5. Connect ActivityBoard XBee RTS* to Propeller P7
    6. Enter: propeller-load -r -t xbee-config.elf
    7. Enter security type. Example: wpa
    8. Enter Wifi SSID. Example: MyNetwork
    9. Enter Wifi passcode. Example: 12345678
    10. If config fails, repeat last 4 steps; else Control+C to quit.
    11. Enter propeller-load -r -e -t xabs-server.elf
    12. Note the IP address. Example 192.168.1.95
    13. Open the downloaded, unzipped index.html in your web browser
    14. Enter IP address (example 192.168.1.95) in the top left side text box
    15. Click the HELLO button. Hello! should be echoed in the bottom text box area
    16. Click the LED26 button, and LED on P26 should light; click again to toggle off
    17. Click the LED27 button, and LED on P27 should light; click again to toggle off
    A simpleide demo is not available. You must use propeller-load for loading the program.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-22 04:24
    Thank You jazzed for taking the time to get me going. Your setup worked, I got the P26 and P27 to go on and off, plus the "hello" appeared when requested. So, I guess my module is not broke. Now I have to try to figure out where the magic is. Did the EEPROM get a C program loaded that responds to "PIN 26 LOW", and some of the other commands? Is that what xabs-server.elf does? I did not try to open the file, but it seems to me that it might be binary.

    I noticed that when the WiFi module got setup, it still came up with the same IP address that XCTU provided, so some things did not change. I checked my router and it shows the IP address of the XBee WiFi module, but their is no name that should be showing. Because I have a couple of hotspots to get coverage, I guess I will have to go through install procedure to program it with a new SSID and passcode.

    This all shows potential, if you can keep xabs-server.elf to <= 32K ??, you can have a lot of the other stuff done with the PC side of things. Now I am wondering how you could actually program the Activity Board or any other board that has access to the XBee WiFi module, from your desktop. Have to do some more digging...

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-22 07:51
    Great.

    Yes, one can load a propeller using the xbee-server.elf that David wrote. It overwrites EEPROM, but is a good general solution.

    The xabs-server.elf code is actually much smaller than the .elf file. The .elf files contain lots of information not really needed for a binary.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-22 08:20
    The xabs-server.elf code is actually much smaller than the .elf file.
    So, where can I look at xabs-server.c code? Would this C file be in a form that would be suitable for SimpleIDE or is it strictly a command line operation? I still cannot figure out why Putty is not able to cooperate with XBee WiFi IP address. I am also still trying to see if I can open up in a terminal type mode (command line) and just type in some commands like "PIN 26 HIGH". I think baby steps are needed for this, not ready to jump into producing an HTML session, just yet. It seems that at this point the only way I can get access to the XBee WiFi/AB is via an HTML.

    Ray
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-22 11:53
    Well I dug around the google propgcc site until I found where the code is for xabs-server.c, or an earlier rendition of what jazzed made in the previous post. This is not an easy task to accomplish, the code is pretty much over my head, especially when there are two segments to contend with, the xbee-server and the xbee-abs-server. This is not putting together a fancy hello.c program, that's for sure. I will keep looking at the abs-server.c and support code to see if I can do anything with it, and still have it run as expected. This definitely will be a tough nut to crack.

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2014-12-22 16:51
    Hi Ray,

    The functional xabs-server code is in the xbee-loader folder.

    Regarding using putty, I don't believe a telnet server is built-in to the S6B Wifi module.
  • RsadeikaRsadeika Posts: 3,837
    edited 2014-12-23 04:21
    Hmm, my impression of the XBee WiFi/Activity Board, you pretty much have to be an expert programmer to get what you would be expecting, in this combination. This combination in the hands of an expert can be an awesome experience as the little demo program that Steve Denson and David Betz have provided. Now, it is not really clear as to what or how Parallax will be supporting this, as it stands now; after all the thread that Parallax was involved in is dormant as of Feb of this year.

    What got me to this point, I have an experiment going on where I am using the Activity Board/RPi WiFi combination. In order to minimize some power issues, I thought maybe removing the RPi WiFi, and replacing it with the XBee WiFi, might do the trick. Well, if I were an expert programmer, or there was some canned software, that might be a possibility. As it stands now this is going to the very back burner, but I will occasionally keep looking to see if I can do any more with it.

    Ray
Sign In or Register to comment.