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

0 Members and 1 Guest are viewing this topic.

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #25 on: April 20, 2017, 02:39:32 pm »
I didn't work with any time synchronization. Can you tell me that how to implement time synchronization between senders?
It is sort of advanced topic. There is no way for me to describe that in details. In general, you need to have gateway assign a time slot to each node. Then gateway will send broadcast synchronization frame periodically. In many cases (Wi-Fi, Bluetooth, and even IEEE 802.15.4) they are called "beacons". After node receives this frame, it should start a more or less precise timer. 10 ms application timers will not work, you will need to use a hardware Timer/Counter for that. After interval is expired, device is free to send its data.

This way you get no collisions, since each device knows exactly when it can send data and the air will be free.

This is not an easy task, and the description above is very general. And obviously, be prepared to do a lot of debugging.

Otherwise you will have to either lower your sending rate, or just deal with collisions.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #26 on: April 26, 2017, 10:18:14 pm »
Hi Alex,
Will WSN demo project from ATMEL help for My application?

I just want to try it before going to time slot based transmission.


Please suggest a solution
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #27 on: April 27, 2017, 01:30:07 am »
Will WSN demo project from ATMEL help for My application?
Help in what sense? Sending a lot of data at a very fast rate? Then no, it won't. WSNDemo uses the same stack, and it generally expects devices to be spread in time.

To do what you want to do, you need to basically implement completely different stack, specifically optimized for streaming continuous data.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #28 on: April 28, 2017, 10:31:43 pm »
Hi Alex,

'' it generally expects devices to be spread in time.

So, here(WSN project), each transmitter exactly knows when it can transmit ?

WSN project itself has time slot based transmission and time sync ?

Please refer the attached time slot image which I want to do.

Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #29 on: April 29, 2017, 01:40:15 am »
So, here(WSN project), each transmitter exactly knows when it can transmit ?
WSN project itself has time slot based transmission and time sync ?
If you are asking about WSNDemo application, then no, it does not implement any of this. It is a feature that will require modifications to the stack itself, not just the application.

The general idea is correct, but you will also have to implement periodic synchronization between the devices, because their time keeping will drift over time.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #30 on: April 29, 2017, 03:40:22 pm »
Hi Alex,
Thanks. Periodic Time sync between devices all are quietly new to me. Can I get ready made code from anywhere? and    Do u have any idea about implementing Periodic sync between the devices ?









 
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #31 on: April 29, 2017, 03:43:28 pm »
Can I get ready made code from anywhere?
I don't think so, it is pretty specific to your application.

Do u have any idea about implementing Periodic sync between the devices ?
I described it earlier in this thread. You may want to read some general information on Wi-Fi or Bluetooth. Both protocols use periodic beacons fro synchronization.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #32 on: April 30, 2017, 06:01:07 pm »
Hi Alex,
In the field, Our application may run continuously for 5 hours to send engine temperature. In between , using periodic sync will affect our application by increasing response time at Receiver. Response time means that Changes of temperature value at transmitter nodes takes how long to reflect at GUI. Is there any way other than Periodic Beacon for Sync.



Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #33 on: May 01, 2017, 03:57:05 am »
In between , using periodic sync will affect our application by increasing response time at Receiver. Response time means that Changes of temperature value at transmitter nodes takes how long to reflect at GUI.
I don't understand why you think that sync pulses will affect anything. They are the only way to get close to 100% of the bandwidth utilization.

I don't know off the top of my head how long the frames are in OQPSK-1000, but in a standard OQPSK-250, a maximum length frame takes 4.5 ms to transmit. And it may actually get a bit shorter for time-synchronized mode, since you can eliminate CSMA/CA procedure.

So lets say you select 4.5 ms intervals. This means that 10 devices aligned back to back will be able to send their data in 45 ms. And transmitter will have to send a sync frame, which can be very short, but even if we assume 5 ms, this means that every device will get a chance to transmit full payload every 50 ms.

You can also skip some sync frames, if you feel like time keeping is good enough on the nodes.

All those calculations are theoretical, a lot will depend on the receiver design as well. You will probably have to switch to the real interrupt-driven radio driver, since it will have to receive a lot of data.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #34 on: May 01, 2017, 04:13:52 am »
Hi Alex,
Basically Sync frame is broadcast frame. In the Mesh network, it will be passed between nodes presented in the network to sync time. So, reach time of Sync frame will differ between nodes right?. If Star network, Sync frame will be reached all nodes at same time right?

And please let me know that why I need to disable routing for testing and how to disable.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #35 on: May 01, 2017, 04:17:39 am »
In the Mesh network, it will be passed between nodes presented in the network to sync time.
No, forget about mesh, There will be no mesh. Time-synchronized mesh networks is something people write PhD disserations about, but in real life they don't work. And most certainly not with this kind of approach to the design.

If Star network, Sync frame will be reached all nodes at same time right?
Yes, and you need to keep it to the star topology. Or invest A LOT of time in money into R&D.

And please let me know that why I need to disable routing for testing and how to disable.
Exactly for that reason. It is disabled in the stack configuration file.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #36 on: May 01, 2017, 05:05:00 am »
Hi Alex,

Only disabling #define NWK_ENABLE_ROUTING Macro will change the stack to Star topology.




Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #37 on: May 01, 2017, 05:06:42 am »
Only disabling #define NWK_ENABLE_ROUTING Macro will change the stack to Star topology.
It will disable routing, all devices within the range will still be able send data directly. In your scenario, it is equivalent to star topology,
Alex
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #38 on: May 03, 2017, 11:29:59 am »
Here is a simple example of a pretty basic time-synchronized network https://github.com/ataradov/netsim/tree/master/embedded/time_sync

This example is written for the network simulator PHY, and will not work on the real hardware. But NetSim radio was modeled after Atmel radios, so porting would not be too hard.

You can try it in the simulator, or just look at the code to get an idea. The code is fully interrupt-driven. Your main loop is free fro ADC and whatever else you want there.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #39 on: May 03, 2017, 07:22:15 pm »
Hi Alex,
I can understand code.

But, I don't see any simulator tool to simulate and any document to work around it in the link which you gave.Please suggest a solution.




Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #40 on: May 04, 2017, 01:30:16 am »
But, I don't see any simulator tool to simulate and any document to work around it in the link which you gave.Please suggest a solution.

That link is quite literally a part of the NetSim project. Here is the link to the root - https://github.com/ataradov/netsim/
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #41 on: May 05, 2017, 08:11:24 pm »
Hi Alex,
Though I read README.md  text in the netSim, I have some doubt on Simulator working. 
Following is the My questions:

1. I don't see simulator.exe in the link that you gave. How to generate it?

2.If I would use Atmel studio and compiling the netSim code in this, what should I do with makefile?

3.Without using real boards, How to simulate multiple nodes using netSim?

Please make me clear in the above.


Thanks,
Muthu





Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #42 on: May 06, 2017, 02:20:59 am »
1. I don't see simulator.exe in the link that you gave. How to generate it?
You have to build it yourself. I don't distribute binary files. Just do what is described in the Installation section. You will need to have MinGW installed to the the GCC for windows and all the necessary utilities.

2.If I would use Atmel studio and compiling the netSim code in this, what should I do with makefile?
It goes with GNU Make utility. You will get it as part of the MinGW installation.

This is not an Atmel product, so it would be against EULA to use Atmel Studio for this. Not that it would make any sense, even if it was not illegal.

You will have to learn how to use make, it is an industry standard tool.

3.Without using real boards, How to simulate multiple nodes using netSim?

NetSim reads a configuration file, that specifies parameters of the simulated environment. In case of TimeSync application this file is located here https://github.com/ataradov/netsim/blob/master/embedded/time_sync/TimeSync_4x4.cfg It specifies a network of 16 nodes located on a grid.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #43 on: May 13, 2017, 06:38:05 pm »
Hi Alex,
I just tried WSN demo project by sending dummy packets from 4 boards. I see below 0.5% packet loss consistently for 4 times-30 minutes capture. I tested at 200ms interval packet send.  But, I wonder how to integrate ADC and maintain synchronicity between ADC task and LWMESH timer which is used to send data in WSN. Because, When I test with dummy data, after 200ms expired, it goes TimerHandler fuction to fill buffer to a prepare packet and change the STATE to APPSEND_DATA to send the prepared packet.This is completely independent task so it was working as expected. But when ADC comes , there are two tasks, Sample accumulation and Timer task. I see difficulty in achieving sync between tasks.Please suggest a solution.

I am also trying with PHY layer.


Thanks,
Muthu



 
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #44 on: May 14, 2017, 03:41:33 am »
I see difficulty in achieving sync between tasks.
I don't see a problem here, and without knowing specifics of your code it is impossible to say wot to do.  Just make sure that none of your task handlers are longer than 10 ms. If they need to be - split processing into multiple stages.

The code I provided runs 100% from interrupts, so main application is free to do whatever it wants to do.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #45 on: May 15, 2017, 02:53:56 am »
Hi Alex,
I have attached the main file and WSN source file. Here, I just tired what I want to do. With this code, I am facing the Problem which I already described. Please let me know if there

I have some questions on the provided code:
The provided code  is compatible for AT86RF212B PHY layer right?. And I can port and check with real hardware?


Thanks,
Muthu
« Last Edit: May 15, 2017, 03:14:44 am by muthukural001 »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #46 on: May 15, 2017, 04:10:18 am »
I have attached the main file and WSN source file. Here, I just tired what I want to do. With this code, I am facing the Problem which I already described. Please let me know if there
I'm not reading 14 pages of code. Why not debug? Toggle a pin at time-critical moments and see where your expected timings don't hold on the oscilloscope. You have to start debugging  your code, not just write and guess why it does not work.


The provided code  is compatible for AT86RF212B PHY layer right?. And I can port and check with real hardware?
Depends on how you define compatible. After porting, it will be working with the real radio. Right now it is designed to work vit a virtual radio, that is similar to all Atmel radios.

It is not really porting. You need to understand what this code does and change 212B PHY code accordingly.
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #47 on: May 21, 2017, 12:55:31 am »
Hi Alex,


[/quote]

This is probably the source of your problems. How long do tcp_write() and tcp_output() take? If they take more than 5-10 ms, then you will have dropped frames.

When appDataInd() is blocked, only one other frame can be buffered in the radio for further processing, the rest of them will be rejected.

At this data rate, you need to accumulate data from many devices and send it in one chunk. And this sending must be fast, or it must be split into smaller section using state machines.
[/quote]

As soon as I come out of appDataInd, I can avoid dropping packets. I come up with FIFO buffer idea which is used to store frame in appDataInd function. So, I am not going to use tcp functions in appDataInd. In while (1), tcp transmission will be performed if FIFO HEAD and TAIL not matched.

It will work?


Thanks,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #48 on: May 21, 2017, 07:47:14 am »
It will work?
If your TCP/IP functions remain big and blocking, then no, it will not. It does not matter where you call them, what matters is how often you release control to the stack (call SYS_TaskHandler). Everything in the stack happens from within that task handler, so if you block outside of the appDataInd(), there will be no new appDataInd() until you unblock and call SYS_TaskHandler().
Alex
 

Offline muthukural001

  • Regular Contributor
  • *
  • Posts: 143
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #49 on: May 21, 2017, 02:46:43 pm »
Hi Alex,
There are two taskHandler in while(1), SYSTaskHandler and Etherenet_TaskHandler. Yes, I understood that how much important to call SYS_TaskHandler frequently to avoid frame missing. Is there any efficient way to do this?



Thanks,
Muthu
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf