Announcement

Collapse
No announcement yet.

Rf100

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

  • Rf100

    Im trying to transmit a UART data to other node in wireless, for that as a starting point. I have tried to test the the working of UART. The code which i used for it is shown below.

    used componets:
    2 RF 200 modules
    1 SN171 board
    1 FTDI chip

    In RF200: Im giving input to UART1's RX(Pin 10 in SN171 board) via an FTDI chip which is basically an USB to UART converter.

    Im using the coolterm terminal to load the data into FTDI chip. But i cant see LED blinking or lighting up.

    NodeA:
    It is used as portal to send the code over the air.

    Node B code:
    IT has the SN171 board, FTDI chip and LED connected

    from synapse.switchboard import *
    from synapse.evalBase import *

    UARTtestPin = GPIO_9
    toggle = 0

    yourPortalAddr = "\x5F\xCE\x81"

    @setHook(HOOK_STARTUP)
    def startupEvent():

    setPinDir(UARTtestPin,True) # configure the pin as output
    writePin(UARTtestPin, False) # Set the pin high to power the device

    initUart(1, 9600)
    flowControl(1, False) # disable CTS/RTS
    stdinMode(1, False)
    #crossConnect(DS_UART1, DS_STDIO)
    uniConnect(DS_STDIO,DS_UART1) # From UART0 to STDIN
    uniConnect(DS_TRANSPARENT, DS_STDIO) #From STDOUT to Datamode/Portal
    ucastSerial(yourPortalAddr) #<= Add your address here

    @setHook(HOOK_STDIN)
    def stdinEvent(data):
    print data
    print "data"
    global toggle
    if(toggle ==1):
    writePin(UARTtestPin, False)
    toggle=0
    else:
    writePin(UARTtestPin, True)
    toggle=1

    @setHook(HOOK_1S)
    def eventlogger():
    print " test: The working of intercepter"

    Doubts:
    1. why the print command under HOOK_STDIN doesnot work.
    2. why "data" is not printed in intercepter( the second print code under HOOK_STDIN)
    3. why the LED did not light up
    4. If the the data is printed properly under HOOK_STDIN, is it possible to pass the same data through RPC call or do we have any other easy way?

    TESTS:
    1. Tried using both the UARTS
    Kindly help me in this regard

  • #2
    In RF200: Im giving input to UART1's RX(Pin 10 in SN171 board) via an FTDI chip which is basically an USB to UART converter.
    On the RF200 UART1 RX pin is GPIO_7 or physical pin 9 or SNAPpy I/O 10 please confirm what pin you are on for proper connection

    Doubts:
    1. why the print command under HOOK_STDIN doesnot work.
    2. why "data" is not printed in intercepter( the second print code under HOOK_STDIN)
    Are you sure HOOK_STDIN is getting called? UART1 RX pin is GPIO_7 or physical pin 9 or SNAPpy I/O 10 please confirm what pin you are on for proper connection

    3. why the LED did not light up? GPIO_9 is your LED control and I assume you have added an LED to the proto board, or are you trying to use the on board LEDs , LED1 and LED2? If you added an LED have you tested it manually for proper orientation?
    4. If the data is printed properly under HOOK_STDIN, is it possible to pass the same data through RPC call or do we have any other easy way?
    yes but you are limited on the amount of data per payload that you can send .....

    /...=rpcSourceAddr

    /...t=passing+data

    Comment


    • #3
      UART data over air

      Thanks for your reply, it started working.

      The only change, which i made was tried to reduce the data rate(not the baud rate) of UART.

      Now it works.

      Comment

      X