Author Topic: LWMESH-OQPSK 1000kbps  (Read 32663 times)

0 Members and 1 Guest are viewing this topic.

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #50 on: May 21, 2017, 04:49:17 am »
Is there any efficient way to do this?
"Efficient" is a relative term. You need to make sure that your Etherenet_TaskHandler does not take a lot of time to execute. It should not contain any busy-wait loops, or transfers of large volumes of data. Do everything though state machines, doing a little bit of work at a time.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #51 on: June 01, 2017, 12:03:02 pm »
Hi Alex,

I have One question.

When I test with three boards and parallely capture packet in sniffer, I see Packet transmission from second and third boards before first device get acknowledgement for its transmitted packet. In the receiver side, I don't use any blocking function in appDataInd function.capture packets only in sniffer, no ethernet nothing. Seeing same thing in OQPSK-250kbps also.

Please refer the attached sniffer log so that you have clear view on the problem.


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #52 on: June 01, 2017, 04:23:47 pm »
You are sending them just a few ms apart, that's not enough time.

Also, as I mentioned many times, you need to disable routing and ACKs, or allow enough time between the requests to receive the ACK.

This is all valid, if you are still working on time-synchronized network.Otherwise  - it is normal, there is no requirement for frames to be received in a any particular order.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #53 on: June 02, 2017, 05:12:57 am »
Hi,

Disabling ACK will change unicast mode to Broadcast mode right?

I heard that Broadcast mode is not recommended as it sends packet all the nodes in the network instead one specific node.



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #54 on: June 02, 2017, 05:26:58 am »
Disabling ACK will change unicast mode to Broadcast mode right?
No, disabling ACKs will disable ACKs. Nothing more.

I heard that Broadcast mode is not recommended as it sends packet all the nodes in the network instead one specific node.
But again, in case we are still discussing time-synchronized network, you want to enable link-local communication only, and disable routing, so broadcasts are not a problem anyway.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #55 on: June 02, 2017, 02:50:54 pm »
Hi,

Can you tell me that how to disable acknowldgement ?




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #56 on: June 02, 2017, 03:42:51 pm »
Can you tell me that how to disable acknowldgement ?
Are you for real? Don't include NWK_OPT_ACK_REQUEST option in the request. You also need to disable routing to disable automatic ACK sent for route discovery.


But remember, that this will disable a major way to device to know that it is not getting through. That's why my simple time-synchronized network has nwkSyncAck variable, which includes all ACKs from the previous cycle, which all devices receive at the same time at the begging of the next cycle. You will have to implement similar thing.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #57 on: June 02, 2017, 03:52:59 pm »
Hi,

I know that not including NWK_OPT_ACK_REQUEST will disable Ack. Doing this change unicast mode to broadcast mode in My side. That's why I asked to know, is there  anything other than this to disable ack.

Yes, I am starting to work on time-sync code provided by you. Hopefully, it will solve My problem.



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #58 on: June 02, 2017, 03:54:25 pm »
Doing this change unicast mode to broadcast mode in My side.
I seriously doubt it. How do you know it?
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #59 on: June 03, 2017, 10:47:54 am »
Hi,

Previously, I disabled ack in Peer2Peer project and captured frame in sniffer. That time it was showing that frames are transmitted in broadcast mode.Just now, I checked with ack disabled, it is working for me.And sniffer shows that it is transmitting in unicast mode only.  May be  I did some mistake earlier in Peer2Peer code.


Thanks,
Muthu
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #60 on: June 07, 2017, 09:44:47 am »
Hi ataradov,


To work on time Sync code given by you, Can I use register setup given by ASF for AT86RF212B.Because, in the shared code, simulator.h includes register which is not for  AT86RF212B.

What I want to do is that take LWMESH stack from ASF and modifiy it as per time sync code that is provided by you.  And one more question is , Both Transmitter and Receiver will have same program?

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #61 on: June 07, 2017, 04:44:11 pm »
To work on time Sync code given by you, Can I use register setup given by ASF for AT86RF212B.Because, in the shared code, simulator.h includes register which is not for  AT86RF212B.
Yes, that's the whole idea - to replace phy.c with code to support the actual PHY you have.

And one more question is , Both Transmitter and Receiver will have same program?
Have you actually read the code? It is like 150 lines long and contains all the answers.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #62 on: June 08, 2017, 09:53:10 am »
Hi,

I am having doubt in implementing network timer . shared time-sync code has the following code for timer

static void nwkStartTimer(int interval, void (*callback)(void))
{
   nwkTimerCallback = callback;

   SYS_TIMER3_COUNTER = 0;
   SYS_TIMER3_PERIOD = interval;
   SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
   SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
   SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
}

void irq_handler_timer3(void)
{
   SYS_TIMER3_PERIOD = 0;
   SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
   nwkTimerCallback();
}


Can you tell me how to make it in MY side?

Moreover, I read the code, but can you explain the concept so that I make sure myself?

As far as I know, GATEWAY with address 0 sends SYNC command for the specified interval which depends NWK_MAX_SLOTS and NWK_SLOT_TIME. For example, NWK_MAX_SLOTS  = 5 and NWK_SLOT_TIME = 10ms, SYNC command will be send for every 60 ms. Router (Or) End device at the other end will send data to GATEWAY upon receiving SYNC command .



Thanks,
Muthu

« Last Edit: June 08, 2017, 11:51:58 am by muthukural001 »
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #63 on: June 08, 2017, 02:42:24 pm »
Hi,


In the share time-sync  code, How irq_handler_trx() get called . I don't see that any function calling irq_handler_trx(). Or It will be used in while(1) main loop.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #64 on: June 08, 2017, 04:27:04 pm »
Can you tell me how to make it in MY side?
This is just a standard hardware timer. LwMesh uses one of those in halTimer.c.


As far as I know, GATEWAY with address 0 sends SYNC command for the specified interval which depends NWK_MAX_SLOTS and NWK_SLOT_TIME. For example, NWK_MAX_SLOTS  = 5 and NWK_SLOT_TIME = 10ms, SYNC command will be send for every 60 ms. Router (Or) End device at the other end will send data to GATEWAY upon receiving SYNC command .
That's correct. So the same code applies to both sides, you just need to assign address 0 to the gateway, and addresses 1-N to the devices.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #65 on: June 08, 2017, 04:28:40 pm »
In the share time-sync  code, How irq_handler_trx() get called . I don't see that any function calling irq_handler_trx(). Or It will be used in while(1) main loop.
That's an interrupt handler, it is called by the MCU when interrupt happens.

Since you are using external radio, in your case this will be external interrupt handler. You will have to setup the pin that is connected to the IRQ pin of the radio accordingly.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #66 on: June 09, 2017, 03:35:01 am »
Hi,

Speaking of External interrupt:

Already ADC sample reading working on External interrupt method. Should I set priority in My case if RF module also using external interrupt?




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #67 on: June 09, 2017, 03:52:31 am »
Already ADC sample reading working on External interrupt method. Should I set priority in My case if RF module also using external interrupt?
I don't understand the question. There are no problems using multiple external interrupts, and you don't get control over the priority. Just follow good practices, and keep interrupts short, and you will be fine.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #68 on: June 09, 2017, 08:19:01 am »
Hi,

So for timer , I can use LWMESH sys timer right?. I have set two timer one is SYNC and Slot timer. Below is the code for that.

                 /*- Code----------------------------------*/
                #define NWK_SLOT_TIME         10   //10000 //
                #define SYNC_INTERVAL   ((NWK_MAX_SLOTS + 1) * NWK_SLOT_TIME)
                #define SLOT_INTERVAL   (SRC_ADDR * NWK_SLOT_TIME )
                 /*- Sync timer--------------------------- */
                 Sync_timer.interval=SYNC_INTERVAL;(  SYNC_INTERVAL=  ((NWK_MAX_SLOTS + 1) * NWK_SLOT_TIME))
                 Sync_timer.mode=SYS_TIMER_INTERVAL_MODE;
                 Sync_timer.handler=nwkSyncTimerHandler;

                 /*- Slot timer----------------------------*/
                 Slot_timer.interval=SLOT_INTERVAL;
            Slot_timer.mode=SYS_TIMER_INTERVAL_MODE;
            Slot_timer.handler=nwkSlotTimerHandler;


 In the shared code,nwkDataReq() function uses ATOMIC_SECTION_ENTER and ATOMIC_SECTION_LEAVE. Can you tell me what does it mean?.
I think it is ENTER_TRX_CRITICAL_REGION() and LEAVE_TRX_CRITICAL_REGION() respectivley.
     //-----------------------------------------------------------------------------
         static void nwkDataReq(uint8_t *data, int size)
        {
                      nwkDataBuf = data;
 
                     ATOMIC_SECTION_ENTER
                    nwkDataSize = size;
                    ATOMIC_SECTION_LEAVE

                   if (NWK_GATEWAY_ID == nwkDeviceId)
                   PHY_DataReq(nwkDataBuf, nwkDataSize);
         }

Should  I use trx_access.h and trx_access.c in lWMESH stack to set up interrupt for RF MODULE. Suggest a solution.



Thanks,
Muthu
 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #69 on: June 09, 2017, 08:27:32 am »
Please use [ code ] tags for formatiing the code.

So for timer , I can use LWMESH sys timer right?
No, you can't. You can look at how that timer is implemented on a low level, pick a different hardware timer, and implement a slotting timer based on that.

In the shared code,nwkDataReq() function uses ATOMIC_SECTION_ENTER and ATOMIC_SECTION_LEAVE. Can you tell me what does it mean?.
They mean exactly what it says in the name. They ensure that code between them executes atomically (win no interruptions).

This is necessary because assignment operation is not guaranteed to be atomic, and if used sends a request just on the edge of the slot, the data size may be corrupted.

Should  I use trx_access.h and trx_access.c in lWMESH stack to set up interrupt for RF MODULE. Suggest a solution.
Use whatever you want. You need to read the datasheet, understand how interrupts are configured in the radio, and configure them accordingly.

I'm not going to do your work for you.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #70 on: June 09, 2017, 02:21:56 pm »
Hi ataradov,

Sorry. This is the first time working on Wireless field.  Yes, I am only to do all work. But, I will need some guidance from your side to complete.



Thanks,
Muthu



 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #71 on: June 09, 2017, 02:52:10 pm »
Hi ataradov,

When implement hardware timer, I can set Sync timer interval (Or) Slot timer interval to Timer period register?

Because Shared code shows that  SYS_TIMER3_PERIOD = interval; in nwkStartTimer(parameters) function.

    //function//
static void nwkStartTimer(int interval, void (*callback)(void))
{
   nwkTimerCallback = callback;

   SYS_TIMER3_COUNTER = 0;
   SYS_TIMER3_PERIOD = interval;
   SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
   SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
   SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
}
  //function//
void irq_handler_timer3(void)
{
   //SYS_TIMER3_PERIOD = 0;
   //SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
   nwkTimerCallback();
}
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #72 on: June 09, 2017, 09:23:36 pm »
Sorry. This is the first time working on Wireless field.
But MCU timers are a very generic topic, they are not specific to wireless.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #73 on: June 09, 2017, 09:24:52 pm »
When implement hardware timer, I can set Sync timer interval (Or) Slot timer interval to Timer period register?
I don't understand the question. You need to replicate functionality of this function, it accepts time interval, and callback function to call when time interval expires.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #74 on: June 10, 2017, 02:04:47 am »
Hi,
Thanks. My question is
Can we directly assign interval (like 60ms) to Timer period register? Or should we set corresponding count value to acheive 60ms inetrrupt.

Shared code shows that inerval assigned to PERIOD register of Timer.

          /* CODE-----------------------------------------*/
             SYS_TIMER3_COUNTER = 0;
             SYS_TIMER3_PERIOD = interval;   //60ms
             SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
             SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
             SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf