# Problem with Reading UART

**URL:** <https://forum.sierrawireless.com/t/problem-with-reading-uart/13322>\
**Category:** WP Series\
**Created:** [July 31, 2018, 4:21am UTC](https://forum.sierrawireless.com/t/problem-with-reading-uart/13322 "2018-07-31T04:21:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![laxminarayan](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@laxminarayan](https://forum.sierrawireless.com/u/laxminarayan)\
**Post date:** [July 31, 2018, 4:21am UTC](https://forum.sierrawireless.com/t/problem-with-reading-uart/13322/1 "2018-07-31T04:21:26Z")

</div>

I’m using UART to communicate with another device, I can write data but problem in reading the data, I’m calling the function read(uart\_fd, read\_buf, size) but after some time it stops receiving data.  
In the terminal I see:

irq 50, desc: cefcd780, depth: 0, count: 0, unhandled: 0  
-\>handle\_irq(): c026f6d4, msm\_gpio\_irq\_handler+0x0/0x150  
-\>irq\_data.chip(): c0f4eb98, gic\_chip+0x0/0x74  
-\>action(): (null)  
IRQ\_NOPROBE set  
IRQ\_NOREQUEST set  
IRQ\_NOTHREAD set

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [July 31, 2018, 4:46am UTC](https://forum.sierrawireless.com/t/problem-with-reading-uart/13322/2 "2018-07-31T04:46:20Z")

</div>

Which module are you using ?  
I remember in WP77 R8, the UART will go to sleep mode after some time.  
Maybe you can have a try on R9 FW.  
Or you can try using a timer to periodically wake up the UART;

#define TIMER\_INTERVAL\_SEC 1  
#define TIMER\_INTERVAL\_uSEC 100000  
int fd1;  
static void tmrHandler(le\_timer\_Ref\_t timerRef) {  
//LE\_INFO(“INSIDE TIMER”);  
tcflow(fd1,TCION );

}  
COMPONENT\_INIT  
{

```
	fd1=OpenPort("/dev/ttyHS0");

	le_clk_Time_t clk = { .sec = TIMER_INTERVAL_SEC, .usec = TIMER_INTERVAL_uSEC };
	    le_timer_Ref_t adxlPollingTimer = le_timer_Create("ADXL_TIMER");
	    le_timer_SetRepeat(adxlPollingTimer, 1000);
	    le_timer_SetInterval(adxlPollingTimer, clk);
	    le_timer_SetHandler(adxlPollingTimer, tmrHandler);
	    le_timer_Start(adxlPollingTimer);
```

---

<div class="post-metadata">

**Author:** ![laxminarayan](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@laxminarayan](https://forum.sierrawireless.com/u/laxminarayan)\
**Post date:** [July 31, 2018, 5:04am UTC](https://forum.sierrawireless.com/t/problem-with-reading-uart/13322/3 "2018-07-31T05:04:25Z")

</div>

Thanks It worked.  
Earlier i tried at+ksleep=2 but did not work.  
I was looking for method like this to keep uart awake.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 3, 2021, 6:19am UTC](https://forum.sierrawireless.com/t/problem-with-reading-uart/13322/4 "2021-02-03T06:19:12Z")

</div>

You can also try the following command to disable the UART auto suspend behavior :

echo -1 \> /sys/devices/78b0000.uart/power/autosuspend\_delay\_ms
