Shop OBEX P1 Docs P2 Docs Learn Events
XBee Wifi S6B with Basic Stamp 2 Homework Board... — Parallax Forums

XBee Wifi S6B with Basic Stamp 2 Homework Board...

ppillardppillard Posts: 22
edited 2014-10-12 02:30 in Accessories
Hi! Relative Noob, here, so please bear with me.

I just received a Digi Xbee S6B Wifi module (32412). I also purchased an Xbee USB adapter (32400) to power it properly and configure it. I'm hoping to get it to work with a BS2 Homework board to learn and prototype with it.

When plugged into the USB cable (after installing the latest USB drivers from Parallax), the Xbee powers up as it should and it's LED's seem happy, but I see no Xbee wifi network to connect to with my computer (per Digi documentation), and I can therefore not configure the Xbee to access my network. I have verified this with multiple wireless devices.

I was hoping to find a good tutorial for this, but all I find is propeller/Xbee, not basic stamp, tho the Xbee is advertised to work with the basic stamp. Please advise, or point to a good tutorial. Thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-26 09:00
    Whether you're using a BASIC Stamp or a Propeller makes no difference for connecting to your network. You can use X-CTU to set up the few items you need to connect to the network and then from there your Propeller or BASIC Stamp module just deals with serial data coming in or going out, just like it would on any other XBee Series. I noticed you mentioned powering up the XBee and not seeing any network. You didn't mention X-CTU and your PC won't see the XBee until it is on the same subnet and IP range.

    Oh, and before I forget...the only way to connect the XBee module to the BASIC Stamp Module is via the XBee 5V/3.3V Adapter, but you didn't mention having one of those. Since the XBee modules are 3.3V connecting the BASIC Stamp to them without a buffer would damage the XBee module.

    Please see the following post for what I did to connect to my network.

    http://forums.parallax.com/showthread.php/153072-XBee-Wifi-amp-Propeller-Activity-Board-how-to-connect?p=1233532&viewfull=1#post1233532
  • ppillardppillard Posts: 22
    edited 2014-06-26 09:15
    Chris, thanks for the reply. I failed to mention it, but I do have the latest version of XCTU (Version: 6.1.1). It fails to detect my wifi module with default settings, and it is requesting I hit the reset button, but it has no button that I can detect.

    Also, I was under the impression that the Xbee USB adapter (32400), was also a voltage regulator. Did I err and just fry my nice new wifi module?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-26 09:52
    The XBee USB Adapter does have a regulator on it which takes the USB 5V and converts it to 3.3V to power the XBee Module. However, if you're connecting BASIC Stamp I/O pins to the XBee Adapter, those signals are not buffered and can damage the XBee Module. This is why we have a separate adapter for each use. USB for connecting to PC, standard adapter for Propeller and other 3.3V devices and the 5V/3.3V for 5V microcontrollers like the BASIC Stamps.

    The "Reset" button they refer to is on their evaluation board and many other board have the reset pin brought out (as does ours) so you can connect a reset button if you like. On the XBee USB Adapter you can connect the button between the RESET line and ground (VSS).

    When you try to detect the module the first thing you need to do is select the COM port that the XBee Adapter was assigned. It should show up as USB Serial Port (COMxx) where xx is the assigned port. Are you selecting this port? You should be asked as soon as you click the + button to add a module.
  • ppillardppillard Posts: 22
    edited 2014-06-26 17:46
    Yes, I did select the appropriate port.

    Sadly, the only connections I have made between the basic stamp to the USB adapter are VDD and VSS to the USB adapter with the Wifi module stacked on top of it. You make it sound like I have fried my module. Please confirm.

    I was under the impression that the different adapters were simply offering more options: Good, better, best. DAMN! I hate learning the hard way.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-27 11:01
    I think what is happening is you may be confusing the regulator and power supply with the I/O pin voltages (signal levels). Let me elaborate more...

    USB power is 5 VDC. The XBee USB Adapter has a regulator that drops that down to the 3.3 VDC that the XBee Module operates on. So at this point all connections to any pin on the XBee Module need to be at 3.3 V. THe FTDI chip has it's own internal voltage selection for 3.3 V and therefore has a safe connection to the XBee Module. The BASIC Stamp 2 module is 5V and therefore cannot be connected to the I/O pins of the XBee Module without using a buffered or level-translating adapter such as the XBee 5V/3.3V Adapter. If you were to connect an I/O pin from the BASIC Stamp module to the I/O pins on the XBee Module without such protection you could damage the XBee Module.

    In addition to that I am also stating that the XBee USB Adapter is not intended to connect a microcontroller to the XBee Module. The on-board FTDI chip is connected to the DIN, DOUT and a few other pins, so they're not available to an external microcontroller. On top of that, even if they were you would still have the signal level issue with a BASIC Stamp module. I only stated what would cause damage, not that you did cause damage. I also didn't know you only connected power. Intuitively you would have connected more than power as just the power connections would not accomplish anything.
  • ppillardppillard Posts: 22
    edited 2014-06-28 06:54
    If the unit is still good, I should be able to connect it to the USB adapter, plug that into the computer, and detect it's presence with the X-CTU software, correct? Also, note: when the wifi module is plugged into the USB adapter for any length of time, it gets hot.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-28 21:52
    It does sound like the XBee Module has been damaged somehow. It should not be getting hot.
  • blessedoneblessedone Posts: 7
    edited 2014-10-07 02:05
    I also am working with the xbee wifi S6B and using xctu and a basic stamp 2
    I have it connecting to my router and able to send data to a URL and receive data (set up port forwarding)
    and all is well using XCTU however im just not understanding how to do the same with my basic stamp 2 in pbasic

    im trying to send this get request
    GET /index.php?test=XBeeTest HTTP/1.1\r\n\r\nHost: hush.securehosters.com
    

    how can i do the same with the basic stamp?

    in xctu the frame i use for a get request is as follows (sent as tx ipv4 0x20)
    7E 00 55 20 01 CE BE 82 A4 00 50 00 00 01 00 47 45 54 20 2F 69 6E 64 65 78 2E 70 68 70 3F 74 65 73 74 3D 58 42 65 65 54 65 73 74 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 75 73 68 2E 73 65 63 75 72 65 68 6F 73 74 65 72 73 2E 63 6F 6D 0D 0A 0D 0A 0D 0A 89
    


    this is some of the things I've been trying
    ' {$STAMP BS2}' {$PBASIC 2.5}
    
    
    TX    PIN   12                             ' XBee DIN pin
    RX    PIN   13                             ' XBee DOUT pin
    temp  VAR     Byte                      ' Temporary variable
    Baud  CON     84                        ' 9600 baud non-inverted
    
    
    
    
    
    
    DO
    '7E 00 55 20 01 CE BE 82 A4 00 50 00 00 01 00 47 45 54 20 2F 69 6E 64 65 78 2E 70 68 70 3F 74 65 73 74 3D 58 42 65 65 54 65 73 74 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 75 73 68 2E 73 65 63 75 72 65 68 6F 73 74 65 72 73 2E 63 6F 6D 0D 0A 0D 0A 0D 0A 89
    'SEROUT TX, Baud, ["0x207E00552001CEBE82A4005000000100474554202F696E6465782E7068703F746573743D584265655465737420485454502F312E310D0A486F73743A20687573682E736563757265686F73746572732E636F6D0D0A0D0A0D0A89", CR]
     SEROUT TX, Baud, ["GET /index.php?test=XBeeTest HTTP/1.1\r\n\r\nHost: hush.securehosters.com", CR]
     'SEROUT TX, Baud, ["7E 00 55 20 01 CE BE 82 A4 00 50 00 00 01 00 47 45 54 20 2F 69 6E 64 65 78 2E 70 68 70 3F 74 65 73 74 3D 58 42 65 65 54 65 73 74 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 75 73 68 2E 73 65 63 75 72 65 68 6F 73 74 65 72 73 2E 63 6F 6D 0D 0A 0D 0A 0D 0A 89", CR]
      SERIN RX, Baud, [temp]                ' Get echo from receiving XBee
     DEBUGIN temp                          ' Catch user response
      PAUSE 250                                ' Short pause
    LOOP
    
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-07 10:01
    Which firmware version do you have? As of 2021 the GET (and I think PUT) commands have some known issues we learned about while developing the code to program a Propeller chip over Wi-Fi. Not sure if the fix has been released yet.
  • blessedoneblessedone Posts: 7
    edited 2014-10-07 12:47
    Which firmware version do you have? As of 2021 the GET (and I think PUT) commands have some known issues we learned about while developing the code to program a Propeller chip over Wi-Fi. Not sure if the fix has been released yet.

    yes i have the latest firmware which is 2012.
    i want to clarify before i go off the deep end...

    so you are saying that with firmware version 2012 i cant communicate with my server with the xbee wifi ?
    im a little confused why you would say that since i can communicate with the server and vice versa using xctu instead of the basic stamp.
    so clearly it is capable of sending and receiving get command because im using it already .. did you read my previous post?
    im just tryjng to figure out how to do the same thing i do with xctu with the basic stamp.

    i included some of the code i have tried .. pretty sure none of those were the correct method
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-07 14:17
    I went back to look for the original message I saw and at the moment I can't find it, but I did find this related thread about the issue with the 2021 (not 2012) firmware.

    http://www.digiboard.com/support/forum/37564/getting-xbee-wifi-module-work-correctly-tcp-mode-with-browser
  • blessedoneblessedone Posts: 7
    edited 2014-10-07 17:40
    I went back to look for the original message I saw and at the moment I can't find it, but I did find this related thread about the issue with the 2021 (not 2012) firmware.

    http://www.digiboard.com/support/forum/37564/getting-xbee-wifi-module-work-correctly-tcp-mode-with-browser

    im sorry i think there has been some confusion as my xbee wifi s6b is working as expected
    and am not having issues with post or get or tcp
    everything works


    i was just asking for a example code for the basic stamp which is Pbasic
    i want to do what i am already doing fine but want to use the basic stamp to send my data to the xbee wifi s6b 2021

    sorry for the confusion
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-08 08:20
    In the message I read the GET was working within X-CTU but not from the microcontroller. Since you posted several lines of code to do this that don't seem to be working I assumed you had the same issue. I will conduct my own test on the GET and PUT functions this weekend to see if this is still an issue. A quick search for the S6B and 2021 reveals it is for others. In any event sending the command from the BASIC Stamp 2 may be possible, however you're set up to only receive a single byte back as a response. Is that what you intended? Also your code receives the byte into temp via the SERIN, but you follow that with a DEBUGIN using temp which will erase whatever was received serially. You'll probably want to change DEBUGIN to just DEBUG to display the character on the DEBUG screen.
  • blessedoneblessedone Posts: 7
    edited 2014-10-08 12:00
    In the message I read the GET was working within X-CTU but not from the microcontroller. Since you posted several lines of code to do this that don't seem to be working I assumed you had the same issue. I will conduct my own test on the GET and PUT functions this weekend to see if this is still an issue. A quick search for the S6B and 2021 reveals it is for others. In any event sending the command from the BASIC Stamp 2 may be possible, however you're set up to only receive a single byte back as a response. Is that what you intended? Also your code receives the byte into temp via the SERIN, but you follow that with a DEBUGIN using temp which will erase whatever was received serially. You'll probably want to change DEBUGIN to just DEBUG to display the character on the DEBUG screen.

    well if you are saying that via xctu it can work but not via the micro controller then what is the difference besides the way it is connected
    when i use via xctu im using the xbee development board with usb breakout (serial)

    when i connect to the micro controller i connect to the i/o pins (parallel)

    so correct me if im wrong but in theory the i can accomplish the same thing xctu does by converting parallel to serial and breakout to usb and plug it into my xbee dev board just like i do for my computer.

    can you see anything wrong with that theory?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-08 16:35
    blessedone wrote: »
    can you see anything wrong with that theory?

    Not at all. I am simply referring to what I read and the symptoms described by others. I won't be able to validate it until I try it myself which I won't get a chance to do until Friday or this weekend.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2014-10-08 17:43
    Hi I took a piece from your example code and trimmed the lines you had commented out
    DO
    
     SEROUT TX, Baud, ["GET /index.php?test=XBeeTest HTTP/1.1\r\n\r\nHost: hush.securehosters.com", CR]
     
     SERIN RX, Baud, [temp]                ' Get echo from receiving XBee
    
     DEBUGIN temp                          ' Catch user response
    
     PAUSE 250                                ' Short pause
    
    LOOP
    

    I don't know what should be happening in this case but I can tell you what I would expect to be happening looking at the example.

    SEROUT transmits the GET string
    SERIN assigns the byte variable temp with a single byte response from the XBee
    DEBUGIN temp is a repeat of the line above

    which makes me think DEBUGIN was coded to display the returned value when in actual fact the instruction should be DEBUG. If temp is not an ASCII character value then the debug output will need formatting.

    I may be wrong in my assumptions but looking for a one byte response as a means of testing your system makes perfect sense to me, it just appears your existing needs a little tweeking.
  • blessedoneblessedone Posts: 7
    edited 2014-10-12 02:30
    Hi I took a piece from your example code and trimmed the lines you had commented out
    DO
    
     SEROUT TX, Baud, ["GET /index.php?test=XBeeTest HTTP/1.1\r\n\r\nHost: hush.securehosters.com", CR]
     
     SERIN RX, Baud, [temp]                ' Get echo from receiving XBee
    
     DEBUGIN temp                          ' Catch user response
    
     PAUSE 250                                ' Short pause
    
    LOOP
    

    I don't know what should be happening in this case but I can tell you what I would expect to be happening looking at the example.

    SEROUT transmits the GET string
    SERIN assigns the byte variable temp with a single byte response from the XBee
    DEBUGIN temp is a repeat of the line above

    which makes me think DEBUGIN was coded to display the returned value when in actual fact the instruction should be DEBUG. If temp is not an ASCII character value then the debug output will need formatting.

    I may be wrong in my assumptions but looking for a one byte response as a means of testing your system makes perfect sense to me, it just appears your existing needs a little tweeking.


    thank you for pointing this out however as my server access log didnt show any hits its clearly not a debug issue


    i rewrote the code using a parallax PINK example still to no avail

    any help would be appreciated
    ' ========================================================================='
    '   File...... XbeeWifi.bs2
    '   Purpose... Test Serial Communication Between XbeeWifi & BS2 Module
    '
    '   {$STAMP BS2}
    '   {$PBASIC 2.5}
    '
    ' =========================================================================
    
    
    
    
    ' -----[ Program Description ]---------------------------------------------
    
    
    ' This program tests serial communication between the BASIC Stamp 2 and
    ' the XbeeWifi
    
    
    
    
    ' -----[ I/O Definitions ]-------------------------------------------------
    
    
    RX              PIN      13              ' Serial Receieve Pin --> XbeeWifi.TX
    TX              PIN      12              ' Serial Transmit Pin --> XbeeWifi.RX
    
    
    
    
    ' -----[ Constants ]-------------------------------------------------------
    
    Baud            CON     84             ' 9600 baud non-inverted 
    
    
    
    
    ' -----[ Variables ]-------------------------------------------------------
     NBVAR VAR Byte(16)
    tick VAR Word
    
    
    ' -----[ Program Code ]----------------------------------------------------
    
    
    top:
    DO
    tick=tick+1
    SEROUT TX,Baud,["GET /index.php?test=ehternetshield HTTP/1.1\r\n\r\nHost: hush.securehosters.com"] ' send get command
    SERIN RX,Baud,4000,timeout,[STR NBVAR\16\CLS] ' up to 16 char or CLS, with timeout
    
    
    DEBUG STR NBVAR,CR
    PAUSE 2000
    tick=tick+1
    LOOP
    
    
    timeout:
    DEBUG "timeout error", CR
    GOTO top
    
    
    END
    
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Sorry I never followed up on this from the Savage///Circuits account. Oddly, because of the three '/' in the name I can no longer access the account. If you click on the name you will get an error. I wonder though if you ever got this working?
Sign In or Register to comment.