quangtrister@gmail.com
02-17-2010, 04:39 PM
Hello,
I have been struggling with this code and could not find out what exactly went wrong. I am using Synapse RF engine RFET with the evalboards from development kit EK2500.
At the moment, I have all three modules in the kit set up with
1. NV_GROUP_INTEREST_MASK_ID (NV variables) set to respond to 3 (modules in group 1 and 2)
2. NV_GROUP_FORWARDING_MASK_ID (NV variables) set to respond to 3 also
3. TX_GROUP_ADDR_ID (defined in the code) set to 3 as well
The problem is when I send any data straight from UART1 to the module, the data always loop back and is printed through the same terminal (The data is supposed be sent through the terminals of the different modules within the Tx_Group_Addr instead)
However, when I use one of the module as a bridge through Portal (that module now is erased with no image), I can call processDataIn(databuff), enter some data and all the modules responded as they are supposed to.
Could you please give me some insight what is actually happening?
from synapse.switchboard import *
EXT_BAUD_RATE = 9600 # External baud rate
EXT_UART_SEL = 1 # Default uart 1 talk to the outside
TX_GROUP_ADDR_ID = 150
def setTxGroup(address): """ to set up which groups the node can transmit message to """ global Tx_Group_Addr
Tx_Group_Addr = address
saveNvParam(TX_GROUP_ADDR_ID, Tx_Group_Addr)
@setHook(HOOK_STARTUP)
def startupEvent(): """ This is hooked into the HOOK_STARTUP event """ global Tx_Group_Addr
global Com_Option
# Set up Uart communication
initUart(EXT_UART_SEL, EXT_BAUD_RATE)
flowControl(EXT_UART_SEL, False)
crossConnect(DS_STDIO, DS_UART1)
@setHook(HOOK_STDIN)
def processDataIn(databuff): """ handle received data from UART1 """
mcastRpc(Tx_Group_Addr, 10, 'OTACommunicate', databuff)
databuff = ''
def OTACommunicate(databuff): """ handles processing data received over the air """
print databuff, # dont care just dump all data
Thank you
I have been struggling with this code and could not find out what exactly went wrong. I am using Synapse RF engine RFET with the evalboards from development kit EK2500.
At the moment, I have all three modules in the kit set up with
1. NV_GROUP_INTEREST_MASK_ID (NV variables) set to respond to 3 (modules in group 1 and 2)
2. NV_GROUP_FORWARDING_MASK_ID (NV variables) set to respond to 3 also
3. TX_GROUP_ADDR_ID (defined in the code) set to 3 as well
The problem is when I send any data straight from UART1 to the module, the data always loop back and is printed through the same terminal (The data is supposed be sent through the terminals of the different modules within the Tx_Group_Addr instead)
However, when I use one of the module as a bridge through Portal (that module now is erased with no image), I can call processDataIn(databuff), enter some data and all the modules responded as they are supposed to.
Could you please give me some insight what is actually happening?
from synapse.switchboard import *
EXT_BAUD_RATE = 9600 # External baud rate
EXT_UART_SEL = 1 # Default uart 1 talk to the outside
TX_GROUP_ADDR_ID = 150
def setTxGroup(address): """ to set up which groups the node can transmit message to """ global Tx_Group_Addr
Tx_Group_Addr = address
saveNvParam(TX_GROUP_ADDR_ID, Tx_Group_Addr)
@setHook(HOOK_STARTUP)
def startupEvent(): """ This is hooked into the HOOK_STARTUP event """ global Tx_Group_Addr
global Com_Option
# Set up Uart communication
initUart(EXT_UART_SEL, EXT_BAUD_RATE)
flowControl(EXT_UART_SEL, False)
crossConnect(DS_STDIO, DS_UART1)
@setHook(HOOK_STDIN)
def processDataIn(databuff): """ handle received data from UART1 """
mcastRpc(Tx_Group_Addr, 10, 'OTACommunicate', databuff)
databuff = ''
def OTACommunicate(databuff): """ handles processing data received over the air """
print databuff, # dont care just dump all data
Thank you