hi all,
Is their any pinging mechanism in zigbee so that devices in the networks can be easily identified..
please help..
regards,
arun...
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hi all,
Is their any pinging mechanism in zigbee so that devices in the networks can be easily identified..
please help..
regards,
arun...
Hi Sherer,
I want to use zigbee network for a critical application. In that network all the zigbee devices should be active always. Suppose any one of the device fails i have to peform some other action which is independent of the wireless network. In my application pinging means any logic which ensures all devices in the network or it should identify failure of any device.
Please help
thanks in advance
You can initiate some periodic message to be sent to a data collector (a PC) through a ZigBee gateway.
The application (on PC) should be able to detect that some device hasn't sent (even once) its periodic
message, thus indicating some sort of failure.
This kind of message can be a simple ZigBee application message with a specific opcode, shouldn't be
a very complicated or complex implementation/solution.
Hi Sherer,
It will be an advantage if i can send a periodic message from cordinator to routers and their response to cordinator when any one of the routers fails then the cordinator can report that to PC. But "serialapp" sample application seems to be complex and i could not implement this logic due to its OSAL tasks.
Thanks
arun
Arun C S said:It will be an advantage if i can send a periodic message from cordinator to routers and their response to cordinator
Broadcasting from a node that can be a potential gateway may create an avalanche. Why instead not using
the routers to send periodic messages directly to the coordinator, sort of "I'm alive" messages. Coordinator
will relay those messages directly to a PC (through USB or Serial) and a PC application will be monitoring
if one of the router haven't sent its message when it should be.
Arun C S said:But "serialapp" sample application seems to be complex and i could not implement this logic due to its OSAL tasks.
The OSAL is a perfect solution in this case, go through OSAL API document, there
you will find several functions for scheduling events, immediately or with a help of
a software timer.
You could call for a timer that cen be reloaded automatically, where this timer will
invoke a very simple event.
You can learn and benefit by learning other sample applications in Z-stack.
I will try to implement this but apart from the ping data i also have to send data packets randomly this will add some complexity of distinguishing ping data and other data packet.
also nothing mentioned about creating a new task in OSAL documentation.
thanks
arun
Hi,
Arun C S said:I will try to implement this but apart from the ping data i also have to send data packets randomly this will add some complexity of distinguishing ping data and other data packet.
Sending periodic and random messages in a different way shouldn't be hard for implementation.
The trick here is to send a periodic messages with OPCODE_1 (as payload sub-header) and a
random messages with OPCODE_2. On the coordinator side some sort of minimal payload
inspection (look for the opcode) should be done and then a decision about what have to do with a
specific message (packet) must be taken.
Arun C S said:also nothing mentioned about creating a new task in OSAL documentation.
Practically, you may not create a new task, by creating two different events in one task,
where first event will handle the periodic messages
Hi Sherer,
you have given a better solution but i have some doubts..Is it possible to define new events? the "serialapp" is bounded for handling messages through UART, i think with it is not possible to send periodic messages without the help of UART. In my application i want to send ping data without the help of UART ie., from the application layer itself. I want to don't know abt packet formation with custimized fields like OPCODE_1,etc, I also want to know more about events.
thank you
arun
Hi,
Arun C S said:I want to don't know abt packet formation with custimized fields like OPCODE_1,etc, I also want to know more about events.
Let's investigate a bit the SerialApp_ProcessEvent, as you can probably observe a very nice
if( SOME_EVENT ) {
//some logic
return ( events ^ SOME_EVENT ); // Actually discard processed event
}
structure, so after the SYSTEM_EVENT there are several application specific events like the
SERIALAPP_SEND_EVT and SERIALAPP_RESP_EVT. These events defined in serialApp.h
You can add your own event by initially defining a name for this event
(i.e. #define MY_PERIODIC_MSG_EVT 0x0004) and then adding an if() structure inside
the SerialApp_ProcessEvent function that will handle (in some way) your periodic msg.
Also you can learn a bit the flow of serial application, this described in Z-Stack Sample Applications.pdf,
section 3.
thanks Mr. Sherer,
i think with the help of a new event and using osal timer, i can send periodic messages..
regards,
arun
hi Sherer,
I tried the method suggested by you but not working..may be because of my coding problem...the problem is when to trigger the MY_PING_EVENT using osal_start_timerEx() function only once i can trigger not repeatedly...next problem is where to put the osal_start_timerEx() in the SerialApp application..
Please help
thank you
arun
Hi,
Arun C S said:osal_start_timerEx() function only once i can trigger not repeatedly
osal_start_timerEx() will trigger an event only once, it is a perfect solution for setting
manual periods (or some other logic on demand).
For periodic triggering you may try the osal_start_reload_timer() which will trigger an
event and then reload a timer again, trigger an event... and so on.
Arun C S said:where to put the osal_start_timerEx() in the SerialApp application
There are no deterministic rules for such things, but in your case a good place might
be when device joins a network and starts itself as router/end device, in other words,
when device's state changed from DEV_INIT to DEV_ROUTER/DEV_END_DEV, or
once device is bound to another device. There is always an option of triggering this
timer execution by an external event, such as detection of push button press.
Hi Sherer,
Some problem in osal_start_reload_timer() function , am getting error message as "osal_start_reload_timer"declared implictly,also i could not find OSAL API about osal_start_reload_timer().Which is the header file corresponding to osal_start_reload_timer()?
Please help
thank you
arun
Hi Sherer,
I changed the SerialApp code as follows
UINT16 SerialApp_ProcessEvent( uint8 task_id, UINT16 events )
{
(void)task_id; // Intentionally unreferenced parameter
if ( events & SYS_EVENT_MSG )
{
.
.
.
case ZDO_STATE_CHANGE:
osal_start_reload_timer (SerialApp_TaskID, PING_EVENT, 50 );
break;
.
.
.
.
.
if (events & PING_EVENT )// for ping
{
ping_send();
return ( events ^ PING_EVENT);
}
************************************************************
static void ping_send(void)
{
if (afStatus_SUCCESS != AF_DataRequest(&SerialApp_TxAddr,
(endPointDesc_t *)&SerialApp_epDesc,
SERIALAPP_CLUSTERID1,
12, ping_sendbuf,
&SerialApp_MsgID, 0, AF_DEFAULT_RADIUS))
{
osal_set_event(SerialApp_TaskID, PING_EVENT);
}
}
But no ping msg is sending...i couldn't find any mistake in this..
please help
Than you
arun
Hi Sherer,
I changed the SerialApp code as follows,
UINT16 SerialApp_ProcessEvent( uint8 task_id, UINT16 events )
{
(void)task_id; // Intentionally unreferenced parameter
if ( events & SYS_EVENT_MSG )
{
.
.
.
case ZDO_STATE_CHANGE:
osal_start_reload_timer (SerialApp_TaskID, PING_EVENT, 50 );
break;
.
.
if (events & PING_EVENT )// for ping
{
ping_send();
return ( events ^ PING_EVENT);
}
*********************************************************************
static void ping_send(void)
{
if (afStatus_SUCCESS != AF_DataRequest(&SerialApp_TxAddr,
(endPointDesc_t *)&SerialApp_epDesc,
SERIALAPP_CLUSTERID1,
12, ping_sendbuf,
&SerialApp_MsgID, 0, AF_DEFAULT_RADIUS))
{
osal_set_event(SerialApp_TaskID, PING_EVENT);
}
}
I couldn't find any mistake in the code...but it is not sending ping messages.
please help
arun
Hi,
The code looks right, I have two comments though:
Several tips for debugging:
Hi sherer,
i set breakpoints at different places....i found that the problem with PING_EVENT, that event is not trigerring......it could be either the problem with event or timer....
thank you
arun
When i did step by step debugging, it reaches start_reload_timer() only once and the timer is not incrementing ie., when it reaches start_reload_timer() ,it doesn't gone to start_reload_timer() portion in OSAL_timers.c
than you
arun
hi Sherer,
now i am concentrating on the receiver side my receiver is a router(actually 3 routers) i have not included any ping processing function in router. My cordinator is sending ping messages from application layer the router receives the packet and issues acknowlledgement(seen from packet sniffer) but it doesn't write the received packet on the UART. But it writes data to UART which was send from cordinator UART.
please help
thank you
arun