Shop OBEX P1 Docs P2 Docs Learn Events
RN-42 connection trouble — Parallax Forums

RN-42 connection trouble

JulJul Posts: 4
edited 2013-10-30 15:06 in Accessories
Hello,

I have bought a RN-42 module (http://www.parallax.com/product/30086) in order to transmit GPS date into a Nikon camera (as described here : http://www.diyphotography.net/build-a-bluetooth-gps-unit-for-nikon).
For now, I have just connected the RN-42 to a USB port for the 5V supply.
I have configured the RN-42 via bluetooth with TeraTerm or RealTerm.

I managed to connect the GPS with the RN-42 using the following settings:
RN-42 is in auto-connect mode with the remote address of the GPS stored. I also enabled the bonding option.
Both, GPS and RN-42, have the same pairing code.

Here is the problem : it seems that the configuration is not saved correctly or disappeared somehow. Just after the configuration, I can connect the 2 devices. But after a while (when I disconnect a module for example), the connection is not working anymore.
I do not really understand where is the mistake (I'm sure there is one ...).
I'm a great beginner in this kind of stuff, so I apologize if the answer seemed obvious.

Thanks for the help.

Jul.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-10-23 08:33
    Jul,

    Welcome to the forums! I had an issue with some test code where I was sure the RN-42 stopped responding but then 60 seconds later data resumed. The test code was just sending a value and incrementing, etc. Once it hit the escape sequence character (Decimal 36 I think) it stopped waiting for the the next character in the escape sequence. There are internal timers that affect all of this. I believe the window by default is 60 seconds to be able to initiate command mode. If you send the escape sequence character I believe it will wait for that amount of time before aborting. You may have to change to connecting and going immediately into fast-data mode.
  • JulJul Posts: 4
    edited 2013-10-24 03:01
    Thanks for the answer Chris, even though I didn't understand everything. I have to tell english is not my everyday language and moreover, I am not very comfortable with programming electronic device.
    With my RN-42, i don't make program. I just want to connect a GPS with my Nikon camera.
    The Rn-42 should be connected to the camera by cable and retrieve GPS position by bluetooth
    To do that, I have just send into the module some basic instruction (as described in this document : http://parallax.com/downloads/rn-42-bluetooth-module-advanced-users-manual).
    Maybe I shouldn't configure the module via Bluetooth ?

    Sorry again, if I didn't understand your answer.

    Jul
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-10-24 09:40
    Perhaps it was I who did not understand your connections. How are you connecting the RN-42 Bluetooth Module to the USB port? It cannot connect directly, so there must be some interface device you did not mention. Nonetheless when the RN-42 connects to a remote device there is a window of 60 seconds I believe where the RN-42 can be remotely configured. I'm not sure this is happening, but what I am wondering is if a character sent by the remote device is causing the RN-42 to think it is being remotely configured. One thing you could try is to wait 60 seconds after the RN-42 connects to send data. Let me know if you still have the issue and I will look more into it. Also, please describe your USB connection in more detail.
  • JulJul Posts: 4
    edited 2013-10-27 01:17
    Thanks for your help,

    I just connect the module to a USB cable in order to bring the power to the RN-42. There are only 2 wires used in the USB cable (power and ground). For now, I just try to connect by bluetooth, the GPS and the RN-42 module, that's all.
    To be remotly configured, you have to send to the module this string of character : $$$ within 60s after connecting the module. But, it is in configuration mode, you can see the LED blink in a special sequence. So, I didn't see that happen when I tried to connect it with my GPS. Moreover, the GPS only send some NMEA sentence of this kind :
    $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47


    I will try with another GPS module to see if there is trouble with the first GPS receiver.

    Anyway, thanks again.

    Jul.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-10-28 17:20
    I should back up a bit...which command are you using to set the RN-42 to auto-connect to the remote device? The reason I ask is that certain commands work immediately, and some require a special command to store the settings and then you must power cycle the device.
  • SRLMSRLM Posts: 5,045
    edited 2013-10-28 17:29
    What firmware version is the module?
  • JulJul Posts: 4
    edited 2013-10-30 03:01
    I sent the "SM, 3"command to set the automaster mode. For the firmware, I don't know, l am currently on the field for work.

    Jul
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-10-30 15:06
    Auto-Master can be set using the Jumper #3 on the RN-42 Bluetooth Module. In using Auto-Master the device tries to connect to the stored address, if no address is found it attempts to connect to the first device that matches the COD (Class Of Device), which, like the address must be set/stored using a different command.
Sign In or Register to comment.