Announcement

Collapse
No announcement yet.

Outputting RSSI Information RF266

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Outputting RSSI Information RF266

    Hi,
    I was wondering if anyone knows how to output RSSI to a specific pin on the RF266. I set up a serial link between my two RF266 antennas and I used getLq() but when I physically check the output from the "RSSI" pin listed on my breakout board (https://www.sparkfun.com/products/11812) the output is a constant value even at far distances.
    I would appreciate any help with this.

  • #2
    I have not personally used the sparkfun device in this manner. RSSI is not a standard output on the Synapse module. I would assume that you would have to write a script that would "getLq" then based on a baseline you set in the script then turn the LED on are off.

    Have you contacted Sparkfun for more information on their hardware and to see if they have an example script?

    Here is an example script that I have used:

    Code:
    def LQstatus():
        maxDbm = 18
        minDbm = 95
        percent = 100 - ((getLq() - maxDbm) * 100) / (minDbm - maxDbm)
        print 'LQ= ', percent

    Comment


    • #3
      Where do I see this information printed out and how can I see it?

      I put the following code on both of my antenna chips:

      from synapse.switchboard import *


      otherNodeAddr = "\x5D\x26\x4F" # <= MAC address of Breceiver

      @setHook(HOOK_100MS)
      def startupEvent():
      global lqSum
      initUart(1, 9600) # <= put your desired baudrate here!
      flowControl(1, False) # <= set flow control to True or False as needed
      crossConnect(DS_UART1, DS_TRANSPARENT)
      ucastSerial(otherNodeAddr)


      def LQstatus():
      maxDbm = 18
      minDbm = 95
      percent = 100 - ((getLq() - maxDbm) * 100) / (minDbm - maxDbm)
      print 'LQ= ', percent

      I have contacted SparkFun and I am waiting for their reply.
      Thank you so much for all of your help so far.

      Comment


      • #4
        Just FYI using UART1 in your script will lock you out of Portal because that is the port Portal uses for connectivity. And you really should put the initUART stuff in startup not a 100ms timer routine. For example ....

        Code:
        @setHook(HOOK_STARTUP)
        def startupEvent():
            """Event called at system startup"""
            crossConnect(DS_UART1, DS_STDIO)
            initUart(1, 19200, 8, 'N', 1)

        If you have the device connected to portal through a serial connection then click on "Intercept node output" and then the "print" statement will be displayed in the event log.

        Comment


        • #5
          I spoke to a Synapse representative and they suggested that I use the linkqualityranger.py example code. I don't understand why they do not establish a serial link between two antenna chips. I want to output the signal strength between the two antennas to a node on the chip which I will then feed to an arduino which will display the information on an android device.
          Also for the code I posted previously, what UART would you recommend using instead of UART1?
          Also, how would I output the LQ value to the DOUT pin of the RF266?

          Thank you so much for all of your help. I really appreciate it.

          '''
          Link Quality Ranger example code
          Sample SNAPpy script for evaluation boards. Demonstrates receive link quality from peer unit.
          Instructions: Load script into two evaluation boards and watch the 2 digit display.
          '''

          from synapse.evalBase import *

          lqTimeout = 0
          lqSum = 0
          lqCount = 0

          @setHook(HOOK_STARTUP)
          def startupEvent():
          display2digits(0)

          # Comment the following out if you have your own HOOK_10MS handler
          # (and be sure to call updateSevenSegmentDisplay() from your own handler)
          @setHook(HOOK_10MS)
          def defaultTimerHandler():
          updateSevenSegmentDisplay()

          def getPercentLq():
          maxDbm = 18
          minDbm = 95
          percent = 100 - ((getLq() - maxDbm) * 100) / (minDbm - maxDbm)
          return percent

          def displayLq(value):
          display2digits(value)

          def remoteLQ():
          """Called from remote end. Display LQ averaged over previous second."""
          global lqSum, lqCount, lqTimeout
          lqCount += 1
          lqSum += getPercentLq()
          if lqCount == 10:
          displayLq(lqSum / lqCount)
          lqSum = 0
          lqCount = 0

          # Reset the "not receiving" timeout
          lqTimeout = 10

          @setHook(HOOK_100MS)
          def time100MsHook(time):
          """Broadcast ONE HOP remoteLQ() call every 100ms"""
          mcastRpc(1, 1, "remoteLQ")

          # If we haven't received a remoteLQ() call in the last second, zero the display
          global lqTimeout
          if lqTimeout > 0:
          lqTimeout -= 1
          if lqTimeout == 0:
          display2digits(0)

          Comment

          X