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.

Linux/CC2538: Is it possible to port polling based Z-Stack Linux Gateway 3.0 application code on threading architecture.

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK

Tool/software: Linux

Hello E2E Community,

I am using CC2538-CC2592 Development module with BBB, as per my knowledge, Gateway, Network & OTA servers in the Z-stack Linux Gateway 3.0 are driven on polling based architecture.

Also the execution of command (Request & their respective responses) are in blocking state. ( i.e. application code will serve only one request at a moment.)

That's makes the application code litter bit slower. 

 

if I am trying to send multiple request at the same moment. I am getting some delayed responses.

so am thinking..  shall we move it on threading arch to make it more efficient & to achieve parallelism in command execution.

my question's to you are...

1. Is it possible to port polling based Z-Stack Linux Gateway 3.0 application code on threading architecture?.

if   "Yes"   how?     if    "No"    why?

2. Please suggest if there is any other way to make application code run faster or to achieve parallelism in command execution.

Thanks & Regard's

Shiv Patil.

  • Hi,

    Correct, the HA gateway server was designed to be polling. While porting it to use threading instead may be possible, the effort required is likely substantial.

    The simplest way to increase speed is by using higher performance hardware/OS.


    Regards,
    Toby
  • hello Toby Pan,

    i am using beagle-bone green board which working on a AM335x 1GHz ARM® Cortex-A8 processor.

    do you think it's not able to perform faster?

    Actually processor is not the issue,
    problem is our gateway application will take minimum 200-600 m-sec to execute a single request.

    that may slow down my execution.

    if am trying to send commands @ < 200 m-sec.
    some commands will be dropped, because to my gateway server is busy in processing previous request.

    in case where i have to achieve smooth dimming of led's
    will not able give me the better performance.

    is that polling arch. responsible for it?

    what should i do to make it more efficient as well as work faster to execute multiple request's in less time?.


    Regards,
    Shiv
  • For dimming LEDs (an example of general level transitioning), consider using the Level Control for Lighting cluster on the light.

    Exactly which commands do you need to send at a <200 ms period?
    It will likely be easier to find/use a more efficient alternative set of APIs (from among the Z-Stack Linux Gateway APIs).
  • Hello E2E Community,

    I would like to answer my own question, please correct me if anything goes wrong.

    It's possible to port polling based TI's Zigbee Linux gateway code completely on multi-threaded application & that helps to execute concurrent processes.

    Also I wants to correct my statement that polling based architecture makes gateway application littler bit slower,

    Actually the application is quit faster, just the part of the coder is is in blocking state.
    when we are sending packets on the socket's, it sets a waiting for confirmation flag & waits till the confirmation received.
    If we try to write packet on socket in it will return's a busy status.

    now I have some question's that....

    1. When I am trying to send multiple command's on gateway server, each and every command written on socket will be processed,
    even if it is delayed due to responses.

    Is gateway server maintaining some kind of logs for incoming commands???
    OR
    Queuing the incoming command & process them one by one...

    2. The sequence number generated for the command will be a 32 bit integer value & will be incremented gradually.
    but when i verify the packet's sent to the Zigbee Module over the network, it was only a uint8_t integer value.

    If we are sending only 8 bit integer value, Why the sequence number will be set as 32-bit integer on gateway server ???.....
    How we make it possible to increment it up to 255 ( which is the max count for uint8_t integer value ) & reset the counter.
  • 1. The provided gateway application will only accept one command at a time. As stated in the "Z-Stack Linux Gateway Developers Guide.pdf":

    "After sending the packet over the socket interface, the si_send_packet() function sets up some internal state variables to indicate that the application is currently waiting for a confirmation for the command it just sent out. Note: the application will not (and should not) process any other commands till it receives the confirmation for the one just sent out."

    Of course, you can easily modify the gateway application to send multiple commands. In the end, TCP sockets are used, as documented in "Z-Stack Linux Gateway Developers Guide.pdf".

    2. Are you talking about sequence numbers for the gateway commands? If so, this is different from the MAC sequence number that is sent over the air. You do not need to worry about resetting the counter. For more information on the sequence numbers used in the gateway, see Section 7.6 of "Z-Stack Linux Gateway Developers Guide.pdf".