# assetData and GPIO

**URL:** <https://mangoh.discourse.group/t/assetdata-and-gpio/1455>\
**Category:** Cloud & Connectivity\
**Created:** [May 22, 2018, 6:34pm UTC](https://mangoh.discourse.group/t/assetdata-and-gpio/1455 "2018-05-22T18:34:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rzapata](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@rzapata](https://mangoh.discourse.group/u/rzapata)\
**Post date:** [May 22, 2018, 6:34pm UTC](https://mangoh.discourse.group/t/assetdata-and-gpio/1455/1 "2018-05-22T18:34:24Z")

</div>

Hello,

I want to activate the GPIO 21 from wp8548 via command in airvantage.

In order to do that, I want to use the gpioService, juts like this app does: [https://github.com/legatoproject/legato-af/tree/master/apps/sample/gpioCf3Demo](https://github.com/legatoproject/legato-af/tree/master/apps/sample/gpioCf3Demo)

I’m writing my code based on this app: [https://github.com/nhonchu/Legato16.10-AssetData](https://github.com/nhonchu/Legato16.10-AssetData)

I want to use GPIOService in the AssetData sample.

I tried this:

1. changed assetDataTutorial.adef to:  

2. changed the component.cdef to:  

then I wrote this function in the assetDataMain.c:

static void toggleGPIO()  
{  
bool active;  
active = le\_gpioPin21\_Read();

```
if(active)
{
	LE_INFO("Pin is active, its gonna be deactivated");
	le_gpioPin21_Deactivate();
}

else

{
	LE_INFO("Pin is inactive, its gonna be activated");
	le_gpioPin21_Activate();
}

```

}

I couldn’t run the app, the log gives me:

info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c \_componentAssetData\_COMPONENT\_INIT() 212 | Legato AssetData: Start Legato AssetDataApp  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘framework.SigMonitor’ overflowed. Expanded to 1 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘framework.SigHandler’ overflowed. Expanded to 1 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘.le\_avc\_ClientData’ overflowed. Expanded to 1 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avc\_client.c le\_avc\_AddStatusEventHandler() 618 | Sending message to server and waiting for response : 4 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avc\_client.c le\_avc\_StartSession() 942 | Sending message to server and waiting for response : 0 bytes sent  
info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c \_componentAssetData\_COMPONENT\_INIT() 227 | Legato AssetData: Started LWM2M session with AirVantage  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_timer\_Start() 982 | threadRecPtr-\>timerFD=11  
info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c \_componentAssetData\_COMPONENT\_INIT() 245 | Legato AssetData: Create 2 instances AssetData  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_Create() 756 | Sending message to server and waiting for response : 8 bytes sent  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceByName() 3113 | Creating asset instance for assetDataTutorial/Room  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceById() 2982 | Creating asset instance for assetDataTutorial/1000  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceById() 3079 | Finished creating instance 0 for assetDataTutorial/1000  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_Create() 756 | Sending message to server and waiting for response : 8 bytes sent  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceByName() 3113 | Creating asset instance for assetDataTutorial/Room  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceById() 2982 | Creating asset instance for assetDataTutorial/1000  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_CreateInstanceById() 3079 | Finished creating instance 1 for assetDataTutorial/1000  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetString() 1376 | Sending message to server and waiting for response : 23 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetFloat() 1091 | Sending message to server and waiting for response : 27 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetBool() 1231 | Sending message to server and waiting for response : 16 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetInt() 951 | Sending message to server and waiting for response : 29 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘.le\_avdata\_ClientData’ overflowed. Expanded to 1 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 29 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘.le\_avdata\_ClientData’ overflowed. Expanded to 2 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 21 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetString() 1376 | Sending message to server and waiting for response : 27 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetFloat() 1091 | Sending message to server and waiting for response : 27 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetBool() 1231 | Sending message to server and waiting for response : 16 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_SetInt() 951 | Sending message to server and waiting for response : 29 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘.le\_avdata\_ClientData’ overflowed. Expanded to 3 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 29 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘.le\_avdata\_ClientData’ overflowed. Expanded to 4 blocks.  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le\_avdata\_client.c le\_avdata\_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 21 bytes sent  
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE\_FILENAME le\_mem\_ForceAlloc() 841 | Memory pool ‘framework.Default Timer Pool’ overflowed. Expanded to 2 blocks.  
emerg Legato: _EMR_ | assetDataTutorial[16925]/framework T=main | LE\_FILENAME ClientSocketHangUp() 852 | Session closed by server (assetDataTutorial.componentAssetData.le\_gpioPin21:53b428577c18e3558699d57262acfc23).  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | avData.c ClientCloseSessionHandler() 188 | Client 0x694ac closed, remove allocated resources  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_DeleteInstance() 3160 | Deleting instance assetDataTutorial/1000/1  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData\_DeleteInstance() 3160 | Deleting instance assetDataTutorial/1000/0  
info Legato: INFO | supervisor[421]/supervisor T=main | proc.c proc\_SigChildHandler() 1942 | Process ‘assetDataTutorial’ (PID: 16925) has exited with exit code 1.  
info Legato: INFO | supervisor[421]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process ‘assetDataTutorial’. Assuming ‘ignore’.  
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | avcServer.c ClientCloseSessionHandler() 566 | Client 0x692b4 closed, remove allocated resources  
warn Legato: -WRN- | supervisor[421]/supervisor T=main | app.c app\_SigChildHandler() 3221 | Process ‘assetDataTutorial’ in app ‘assetDataTutorial’ faulted: Ignored.  
warn Legato: -WRN- | \_appStopClient[16926]/framework T=main | LE\_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!  
info Legato: INFO | supervisor[421]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘assetDataTutorial’ has stopped.  
info Legato: INFO | updateDaemon[450]/updateDaemon T=main | updateDaemon.c updateDaemon\_MarkGood() 203 | System passed probation. Marking ‘good’.

I don’t know much of communication between apps, I’m sure that’s where I’m getting it wrong.

Can anybody help me?

Regards
