Author Topic: LW mesh stack in atmega256rfr2 data missing  (Read 4922 times)

0 Members and 1 Guest are viewing this topic.

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
LW mesh stack in atmega256rfr2 data missing
« on: March 01, 2017, 06:17:21 am »
HI ,

I have configured lwmesh for atmega256rfr2 MCU.I tried out with peer to peer application and it works fine.Now I modified the peer to peer code  to read data from 4 devices and sends it to a central device(lets call it as a coordinator).The 4 devices gets its data from uart and sends it to coordinator in 1sec delay.The coordinator also reads uart and send some commands to any of these four devices(address specified in the destination address field).I could implement the basic scenario.But I am missing data from any of the devices mean while its running and after 1 or 2 sec it will start sending itself.The baud rate am using is 9600

please help to solve  it...............
 
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #1 on: March 01, 2017, 06:49:01 am »
You really need to give more details. What changes have you made to support this 4 device configuration? What does this "But I am missing data from any of the devices mean while its running and after 1 or 2 sec it will start sending itself." mean?
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #2 on: March 01, 2017, 07:00:36 am »
I am attaching the code for coordinator(Peer2Peer_C) and other devices(Peer2Peer_R) also config file
« Last Edit: March 01, 2017, 07:05:56 am by vishal »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #3 on: March 01, 2017, 07:09:19 am »
This is a textbook example of unreadable code. I'm not going to waste my time trying to parse this.
Code: [Select]
         int flag=0;
j=0;
for(i=0;i<appUartBufferPtr;i++)
{
if(appUartBuffer[i]==0x40||appUartBuffer[i]==0x4e)
flag=1;
  if(appUartBuffer[i]==0x4d)
  a=5;
  else if(appUartBuffer[i]==0x50)
  a=6;
  else if(appUartBuffer[i]==0x4e)
  a=0xffff;
  if(flag==1)
{
appDataReqBuffer[j]=appUartBuffer[i];

j++;
}
if(appUartBuffer[i]==0x23||appUartBuffer[i]==0x44)
break;
//flag=0;
}
//}
int k=j;    
    appUartBufferPtr=k;

Also, your addition of appSendDiscoverData() completely broke appDataReqBusy logic, so your appDataReq is not protected agains double use.

And you have not answered my other question.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #4 on: March 01, 2017, 07:17:45 am »
 
Each device sends data from sensors  in regular interval. At coordinator level  some time stamp data is not received . Let say devices are numbered as 1,2 ,3,4 . At coordinator  may get 1 or 2 at a time or 3 or 4 and sometimes 1,2,3 .
that y i mentioned data missing ..
                            The appSendDiscoverData () not used now..Also what changes i need to make in configuration to accommodate 4 devices.
« Last Edit: March 01, 2017, 07:21:10 am by vishal »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #5 on: March 01, 2017, 07:25:59 am »
What are those regular intervals? You need to start giving information.

You may want to increase APP_FLUSH_TIMER_INTERVAL , since you are essentially relying on it for data integrity. Then you need to check if your updates even get into the device. May be you have some UART problem. Then check what status code is returned in the appDataConf().

Are you sure that your hardware is working properly?

You really need to design application logic properly. Your logic is substantially different from P2P application.

Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #6 on: March 01, 2017, 07:30:11 am »

Time interval is every one second  . Means every one second the devices get data from sensor.  Hardware part is working properly . we checked with Xbee modules
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #7 on: March 01, 2017, 07:32:27 am »
Time interval is every one second  . Means every one second the devices get data from sensor.  Hardware part is working properly . we checked with Xbee modules

Again, you have not answered any of my questions ans raised new ones.

What was the method of checking? I don't see what Xbee has to do with ATmega256RFR2.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #8 on: March 01, 2017, 07:35:28 am »
sorry .....we think hardware is  working because it misses data occasionally.   
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #9 on: March 01, 2017, 07:37:50 am »
I've seen plenty of hardware that misses data occasionally. Radio is not a binary thing, signal level can be marginal.

You have not said what your hardware is anyway. Is this some standard module or something you designed yourself.

And again, do all that debugging I asked you. You won't hear anything new until you do that.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #10 on: March 01, 2017, 07:38:17 am »
What are those regular intervals? You need to start giving information.


the  devices get data in 1 sec delay from sensor..then it sends to coordinator...
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #11 on: March 01, 2017, 07:49:47 am »


You have not said what your hardware is anyway. Is this some standard module or something you designed yourself.



we did the hardware with reference to atmega256rfr2 altium design provided by atmel. we only doing communication with Tx and Rx pin. We did 4 layer board according to the standard  design and also provided 50 ohm matching in rf line. We didn't put 32.786 crystal to TIMER2 pins.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #12 on: March 01, 2017, 07:57:28 am »
we did the hardware with reference to atmega256rfr2 altium design provided by atmel.
Ok, so it is custom hardware.

When you say that stock P2P works fine - what was the method of verification? Have you tried to send a few mgabytes of data and verify it on the other end, or just typed a few characters into a terminal?

On a new hardware, even if you don't want to go into proper hardware verification, you need to do some basic stuff. Like check ind->lqi and ind->rssi values in the appDataInd() on the Coordinator, and req->status in the appDataConf() on the devices.

Also, change addresses from 0x8zzz to something without highest bit set.

If you are expecting some magical solution, there is none, you'll have to debug stuff.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #13 on: March 01, 2017, 08:03:50 am »

When you say that stock P2P works fine - what was the method of verification? Have you tried to send a few mgabytes of data and verify it on the other end, or just typed a few characters into a terminal?
 

we sent  a few megabytes of data and verify it on the other end.


Also, change addresses from 0x8zzz to something without highest bit set.
can you give an example for the address
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #14 on: March 01, 2017, 08:05:06 am »
can you give an example for the address
I don't understand the question. 1, 2, 3, 4, 5 will work.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #15 on: March 01, 2017, 08:08:38 am »
sorry I got it . I will do necessary changes  you have mentioned and try to debug. May I change APP_FLUSH_TIMER_INTERVAL  from 20 to 10 ?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #16 on: March 01, 2017, 08:10:52 am »
You need to understand the logic of this interval. You need to increase it, if anything.

There is no way you will make anything work without actually trying to methodically understand and purposefully design things.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #17 on: March 01, 2017, 08:16:35 am »
sorry for my misunderstanding
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #18 on: March 01, 2017, 10:59:22 am »
Hi...I Started from the begining..I dowloaded Lwmesh code once again and starts from peer2peer app.Now I just modified APP_FLUSH_INTERVAL_TIME to 50 and has assigned 1,2,3,4 for each of the 4 devices and 0 for the coordinator.Nothing has changed in the peer2peer.c file.The devices now just read uart and send it to coordinator.The devices get data from uart in 1sec delay .Now also it misses data at coordinator side.I contacted hardware team they are confident with hardware.

Can I use peer2peer app for reading data from multiple devices??
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #19 on: March 01, 2017, 05:19:01 pm »
I will ask you one more time to provide me this information:

Quote
On a new hardware, even if you don't want to go into proper hardware verification, you need to do some basic stuff. Like check ind->lqi and ind->rssi values in the appDataInd() on the Coordinator, and req->status in the appDataConf() on the devices.

You can't just guess, you need to debug.
Alex
 

Offline Anu

  • Newbie
  • Posts: 5
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #20 on: November 30, 2021, 09:45:03 am »
Hi,
I am using tags which push data to the router and router ushes it to the wifi backbone.There is no coordinator at this setup.The ON time now getting is 70 milli seconds and because of which the battery is only lasting for 6 months.I need to optimize the the process during ON state and reduce it to micro seconds. How can I reduce the time?
Thanks
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #21 on: November 30, 2021, 07:30:36 pm »
All of this is so application-dependent that it is impossible to say anything useful. Have you tried to debug and see what it is doing for those 70 ms?
Alex
 

Offline Anu

  • Newbie
  • Posts: 5
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #22 on: December 21, 2021, 09:39:22 am »
Hi,
I would like to know how we send packets to xbee module from this stack?
Thanks
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11752
  • Country: us
    • Personal site
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #23 on: December 21, 2021, 05:26:13 pm »
It is impossible to use LwMesh to communicate with XBee modules. They use completely different protocols.
Alex
 

Offline Anu

  • Newbie
  • Posts: 5
  • Country: in
Re: LW mesh stack in atmega256rfr2 data missing
« Reply #24 on: December 29, 2021, 12:31:44 pm »
when device wake up only calls for route discovery,route update and appsend data functions are executed.I toggle PD6 pin in APP_STATE from wake up to sleep,then captures the pin in oscilloscope and getting 10ms long.Please correct, Iam on the right way to reduce ON time?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf