Shop OBEX P1 Docs P2 Docs Learn Events
Wireless connection — Parallax Forums

Wireless connection

Jerry RoachJerry Roach Posts: 13
edited 2009-08-07 20:13 in BASIC Stamp
I'm trying to use Gridconnect's Firefly (RS232 to bluetooth adapters) for a wireless connection that is supposed to replace the serial cable. The adapters seem to be connected to each other (status LEDs indicate a link) and transferring data, but my Stamp Editor is not recognizing a connection. No loopback, no Echo, no device... nothing. With the hardwired serial cable everything is fine. Does anyone have experience with this? Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-06 23:10
    This is a commonly asked question. You cannot program a Stamp via a wireless connection. There are delays inherent to a reliable wireless connection and the timing of the programming protocol is too tight to work with these delays.

    For those Stamps with more than one 2K program "slot", it's possible to compile a Stamp program to a binary file, then transfer the file as data across the wireless connection to a "slot" other than the one running, then execute that other "slot". It's a slow process and you'll need to do your own programming on both the PC and Stamp ends.
  • Jerry RoachJerry Roach Posts: 13
    edited 2009-08-07 00:36
    I don't really need to program this way, but I do need to run the program wirelessly - isn't this possible?· It's not even recognizing the stamps' presence.·
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-08-07 01:15
    ·
    Check this link for· RS232 / DB9 protocol.
    Here is a snippet from wiki.
    RTS/CTS handshaking

    In older versions of the specification, RS-232's use of the RTS and CTS lines is asymmetric: The DTE asserts RTS to indicate a desire to transmit to the DCE, and the DCE asserts CTS in response to grant permission.

    In a nutshell – Stamp editor initialize communication using DSR (pin6).
    The Stamp “respond” asserting RTS/CTS (pin7) via hardwired connection in DB9 plug.
    ·
    I am not sure how the editor uses DTR.
    ·
    In order to use any other means than cable RS232 connection you would have to simulate this somehow to work with Stamp editor. So unless you want to spent time building a front application for the Stamp editor you are stuck.
    ·
    When you use other communication technology with your application running this hardware handshake on port 16 needs to be monitored by your application same way the Stamp editor does it in order for your application to “recognize” the Stamp..
  • dev/nulldev/null Posts: 381
    edited 2009-08-07 01:17
    To communicate between the Stamp and your PC wirelessly, you have to use the SEROUT and SERIN commands on the Stamp (or DEBUG).
    On your PC, you can use a terminal program like HyperTerminal or you can make a program that communicates on the serial port.
    You can't use the Stamp Editor with a wireless connection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-08-07 02:02
    Jerry--

    I have been very successful using Bluetooth in serial cable replacement mode. Although Bluetooth will not provide very much range (30 meters with a Class I dongle and an antenna on the Bluetooth module--anyway, I got 100 feet out of it), it is very robust and will try, try again until it either succeeds or dies.

    Study SERIN/SEROUT on the Stamp side.

    --Bill
    ps Beg Parallax to develop the WiFi module they have already semi-announced. I am.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-07 02:05
    "I don't really need to program this way, but I do need to run the program wirelessly"

    You don't need to have the PC attached in order to run a program on the Stamp. The PC is needed to compile and download a new program and it's needed if you want to look at DEBUG output or if your program expects input from the PC via DEBUGIN. If your program is producing DEBUG output, it doesn't check to make sure there's a PC there. It will output the DEBUG data even if there's nothing listening.

    Whenever your Stamp is reset, either because it is powered on or a reset button is pushed, it will start executing whatever program is stored in its EEPROM from the beginning. It doesn't need a PC present for this to happen. Note that if the DTR line on the programming port is toggled, the Stamp is reset. This is used for downloading. If there's no connection to the programming port, this reset won't happen.
  • Jerry RoachJerry Roach Posts: 13
    edited 2009-08-07 13:12
    Hi Mike, just to clarify the application:

    I am working on a project to wirelessly sense 5 switch positions and report switch status to the host computer at least 6 times a second. There will be 2 systems running simultaneously so each stamp must have a unique identification to the host computer. I was thinking of using 3 of the I/O ports to create an address to ID each stamp with dip switches. And then have 5 I/O lines sense the switch positions in a continuous loop. Effectively sending a byte of data in a loop to the host computer to interpret.

    Bill, what kind of bluetooth product did you use? And how did you deal with the RTS/CTS signals?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-07 14:15
    If you want, you could dispense with the identification information since Bluetooth devices have a unique identification number and you can request that from the remote device.

    Some devices don't provide RTS/CTS like Parallax's Easy Bluetooth. Other devices either ignore them until a mode is set or CTS is hard-wired so it's always enabled. The Stamps don't normally use them, but there is an option in the SERIN and SEROUT statements to add flow control using an extra I/O pin. See the description of the SERIN and SEROUT statements in the Basic Stamp Syntax and Reference Manual (or the Stamp Editor help file).
  • dev/nulldev/null Posts: 381
    edited 2009-08-07 14:34
    BlueSmirf from Sparkfun is class 2 with 100m range.
    Easy Bluetooth from Parallax has 30m range.
    I have used BlueSmirf on my Stamps it works great. You need to step down the baudrate to 9600, as they come with 115k default.
    Make sure you have the right class dongle if you're going to connect to another device (e.g. your PC).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • TRAVIS12TRAVIS12 Posts: 2
    edited 2009-08-07 17:05
    · hi· i am trying to program· my keypad· circuit· using my basic stamp and also need help with findig commands to read my project·
  • dev/nulldev/null Posts: 381
    edited 2009-08-07 17:46
    LOL!

    Sorry but that is truly a funny question in a thread about Bluetooth.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • Jerry RoachJerry Roach Posts: 13
    edited 2009-08-07 20:13
    Just to update everyone. Mike was right on the money - the editor would not recognize the stamp because of the timing. I opened up Windows Hyper Terminal to com1 to connect to the stamp and the program works great!
Sign In or Register to comment.