Hi everyone,
i have to connect one button to Mangoh Red, i used GPIO22 of CF3 GPIO. Following you can see the code: .adef
executables:
{
gpioCf3Demo = ( gpioCf3PinComponent )
}
What seems to be the issue here? I’ve been working with the le_gpio API quite a bit and your code looks mostly correct to me. Are you having trouble compiling/building/deploying or are you just not seeing the change?
Hi Nick
Thank you for your replay, anyway my problem is that i don’t see any change when i press the button. I checked also was enable by AT commands and everithing seems good. Regarding bulding/compilation i don’t have any error.
Let’s confirm the app is installed and running. Start by ssh'ing into your target by invoking ssh root@192.168.2.2 (or another IP if you changed it). After logging into the ssh session, invoke app status or app status | grep gpioCf3Demo if you want to only see your new app. It’s also helpful to update versions in your .adef file as you go such that you can run app version <appname> to confirm the latest version is installed (its not uncommon for Legato to reject apps that fault frequently and roll them back).
If all is running as expected, let me know and we can go from there.
Hi Nick, the app is runnig, as you can see in the attached picture. Just to be sure, at the moment i connected the push button to GPIO22, without external pull-up resistance, but i have just enable the internal pull-up. Maybe the is something wrong in the phisical connection.
Definitely double check the physical connections as its always a good thing to try and rule out. The only thing I see in your code that I’ve never tried before is the call to le_gpioPin22_SetEdgeSense(LE_GPIOPIN22_EDGE_BOTH);. I suspect this call is not needed since the edge sense is specified when attaching the change handler, but I would be surprised if this would cause issues.
Maybe try polling it every 30 seconds or so and print the value to the logs. See if these values match what you expect. If they are not what you expect, likely that GPIO pin is not working at all (physical or configuration).
I’ve also found it helpful to inspect things you depend on in situations like this. A few handy commands for this:
sdir list: Shows all services and bindings (and shows if any services are waiting).
dmesg and dmesg | grep i2c: Show the kernel logs. I’ve seen GPIO failure occur due to i2c problems so the grep can be useful.
logread | grep gpioService: Show the logs for gpioService. It should log if it’s having any issues.