Jetson GPIO pin read/write don't add up

I’m having issues where i’m getting a gpio.LOW when it should be gpio.HIGH and vise-versa.

I have a magnet sensor connected from pin 22 to pin 24 and is set pin 22 as output and pin 24 as input. I write a gpio.HIGH on pin 24 and if the magnet sensor is connected I then later can read a gpio.HIGH on pin 22. This works for a while but then something goes wrong i’m getting gpio.HIGH even if the magnet sensor is not connected. Any ideas? I tried doing it with a pull up-resistor but couldn’t get it to work so that’s why i chose this route.

Here is the sensor: Magnetic contact switch (door sensor) : ID 375 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits

hello felleman,

is there any kernel failure logs for reference?

Hello Jerry,

I’m not seeing any failures in kern.log, but i’m not sure what i’m looking for. I attached the logs for March 16 where we saw the issue. Thanks

mar_16_kern.log (623.7 KB)

hello felleman,

please refer to NVIDIA Jetson AGX Xavier GPIO Header Pinout, are you using pin-22/gpio-417 and pin-24/gpio-494 for hardware connections?

are you able to enter the location of the GPIOs, /sys/class/gpio and control the GPIO via sysnode?
for example,
enter the path as using # echo 417 > export to generate gpio417 name, then you’ll be able to enter /sys/class/gpio/gpio417/ for controlling the pin.
please have a try, thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.