Wireless Sensor Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI WSN-3230 Out of memory

Solved!
Go to solution

Hello everyone


I have a problem with my LabView WSN target software.

 

The system has PC with Windows 7 and LabView 2012 SP1 as Host computer, NI-WSN9791 as gateway, NI-WSN3230 as node and sbRIO9636 as device connected to node via Serial Port.

 

Node has WSN 1.4.0f0 firmware.

 

Software on WSN node communicates with sbRIO and gets data from it. Then node sends that data as User Messages to Gateway.

 

Main problem is that WSN node can work for a certain time and then

1) says it run out of memor;

2) reboots;

3) works one minute or two;

4) reboots again;

5) works for few minutes;

6) stops respond. Gateway says that signal lost.

 

Of course it should be something wrong with my program, so I'm asking for advice — where can I find a cause of memory leak or how I can solve it anyway?

 

I attach the program that I deploy to node (NI 3230).

Sample interval is 5 seconds, set by VI.

 

Program's function can be divided into the following sequence:

1) Sends command "!Start" to sbRIO and waits for response; If no response it sends Debug Message "Sbrio not responding";

2) Read and parses response — it consists of command's type, length of command's body and body of command;

3) In case if responce has "msg"-type it splits command's body by 50-bytes blocks to fit User Message;

4) Then send splitted strings to gateway by User Message.

5) If no error occured, it sends "!OK" and "!Stop" to Sbrio;

 

Program try to repeat those operations in 4 second interval, and leaves 1 second to not overlap next sample.

 

"COM Complex Read" subVI helps to read messages that longer than device can read at one time. Also it designed for reading of COMPort without termination string.

"Split Message" splits command's body to equal sizes to fit User Message (Maximum size of 3230's User Message is 64 bytes) and adds index before it.

 

Last time debug messages list was:

Spoiler
13:43:38 SBRio not responding (Heap/Stack): 10256 / 1358
13:43:43 BytesTransferred: 148
13:43:48 BytesTransferred: 2536
13:43:53 BytesTransferred: 3108
13:43:58 BytesTransferred: 2516
13:44:03 BytesTransferred: 3404
13:44:08 BytesTransferred: 2664
13:44:13 BytesTransferred: 2664
13:44:18 BytesTransferred: 3108
13:44:23 BytesTransferred: 1776
13:44:28 BytesTransferred: 2664
13:44:33 BytesTransferred: 2664
13:44:38 BytesTransferred: 2368
13:44:43 BytesTransferred: 2960
13:44:48 BytesTransferred: 2516
13:44:53 BytesTransferred: 2664
13:44:57 BytesTransferred: 2072
13:45:03 BytesTransferred: 2664
13:45:08 BytesTransferred: 2516
13:45:13 BytesTransferred: 2516
13:45:18 BytesTransferred: 3404
13:45:23 BytesTransferred: 2516
13:45:28 BytesTransferred: 2516
13:45:33 BytesTransferred: 2664
13:45:38 BytesTransferred: 2516
13:45:43 BytesTransferred: 2664
13:45:47 BytesTransferred: 2812
13:45:53 BytesTransferred: 2368
13:45:58 BytesTransferred: 2664
13:46:02 BytesTransferred: 2072
13:46:08 BytesTransferred: 3108
13:46:13 BytesTransferred: 2516
13:46:18 BytesTransferred: 2664
13:46:22 BytesTransferred: 2516
13:46:28 BytesTransferred: 2516
13:46:33 BytesTransferred: 2516
13:46:38 BytesTransferred: 1924
13:46:43 BytesTransferred: 1036
13:46:47 BytesTransferred: 1184
13:46:48 :Out of memory, available 10152, requested 24458. Rebooting
13:46:59 Node connected ...
13:47:05 BytesTransferred: 2516
13:47:09 BytesTransferred: 1924
13:47:14 BytesTransferred: 2516
13:47:19 BytesTransferred: 2516
13:47:24 BytesTransferred: 592
13:47:29 BytesTransferred: 1776
13:47:30 :Out of memory, available 10152, requested 25426. Rebooting
13:47:41 Node connected ...
13:47:46 BytesTransferred: 888
13:47:51 BytesTransferred: 2072
13:47:56 BytesTransferred: 2812
13:48:01 BytesTransferred: 2516
13:48:06 BytesTransferred: 2072
13:48:11 BytesTransferred: 1924
13:48:16 BytesTransferred: 2072
13:48:21 BytesTransferred: 3256
13:48:26 BytesTransferred: 2516
13:48:31 BytesTransferred: 2516
13:48:36 BytesTransferred: 2960
13:48:41 BytesTransferred: 2516
13:48:46 BytesTransferred: 3404
13:48:51 BytesTransferred: 2664
13:48:56 BytesTransferred: 2516
13:49:01 BytesTransferred: 3404
13:49:06 BytesTransferred: 2812
13:49:11 BytesTransferred: 2516
13:49:16 BytesTransferred: 3256
13:49:21 BytesTransferred: 2516
13:49:26 BytesTransferred: 3108
13:49:31 BytesTransferred: 3256
13:49:36 BytesTransferred: 2516
13:49:41 BytesTransferred: 2664
13:49:46 BytesTransferred: 2960
13:49:51 BytesTransferred: 2368
13:49:56 BytesTransferred: 2664
Then signal was lost

 

I hope that somebody can say me what I'm doing wrong, or give a few advices about memory optimization on WSN.

 

Thank you

 

 

0 Kudos
Message 1 of 2
(7,158 Views)
Solution
Accepted by topic author ctepa

Problem solved this time — I had added a warning if received length of command's body is more than 4096 bytes. And it happened about after 1 hour of work of sbRIO and WSN, lasted about 4 seconds (I think it happened inside one sample interval) and then returned back again to normal functioning.

 

Sorry that disturbed you

 

0 Kudos
Message 2 of 2
(7,149 Views)