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

0 Members and 1 Guest are viewing this topic.

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #25 on: April 20, 2017, 04:39:32 am »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #26 on: April 26, 2017, 12: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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #27 on: April 26, 2017, 03:30:07 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #28 on: April 28, 2017, 12: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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #29 on: April 28, 2017, 03:40:15 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #30 on: April 29, 2017, 05:40:22 am »
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 ?









 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #31 on: April 29, 2017, 05:43:28 am »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #32 on: April 30, 2017, 08:01:07 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #33 on: April 30, 2017, 05:57:05 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #34 on: April 30, 2017, 06:13:52 pm »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #35 on: April 30, 2017, 06:17:39 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #36 on: April 30, 2017, 07:05:00 pm »
Hi Alex,

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




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #37 on: April 30, 2017, 07:06:42 pm »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #38 on: May 03, 2017, 01: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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #39 on: May 03, 2017, 09:22:15 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #40 on: May 03, 2017, 03:30:16 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #41 on: May 05, 2017, 10:11:24 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #42 on: May 05, 2017, 04:20:59 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #43 on: May 13, 2017, 08:38:05 am »
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



 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #44 on: May 13, 2017, 05:41:33 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #45 on: May 14, 2017, 04:53:56 pm »
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 14, 2017, 05:14:44 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #46 on: May 14, 2017, 06:10:18 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #47 on: May 20, 2017, 02:55:31 pm »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #48 on: May 20, 2017, 09:47:14 pm »
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 muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #49 on: May 21, 2017, 04:46:43 am »
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