RAK4631 and magnetic switch remote hardware

Hi,

I’m new here.

I have a RAK19007 which I have equipped with a RAK13011 (magnetic switch connected to GPIO1).

First, I’m a bit unsure how to map pins. The RAK13011 datasheet seems to indicate that the switch is connected to GPIO1 as well as GPIO1_1 (whatever that is???). So, my guess is that given the RAK translation table at the meshtastic web site, that corresponds to Arduino GPIO 17, right? So, in Meshtastic, you would use the mask 0x20000. Have I understood things correctly?

However, when I configure the remote hardware module ot use both pin 1 and pin 17 as digital inputs, I always get a ‘1’ on both inputs when reading from a local node.

So, I went about measuring the voltage on “IO1” and found that it is 3.2 V when the magnetic switch is open and 2.9 V when it is closed. So, in both cases logically “1”.

To me, this seems to indicate that the software has configured a pull-up resistor on that pin which shouldn’t be there, or that the pin is configured as an output.

What should I do about this?

I run fw 2.2.1.fb5f2e4.

Best guess is a collision with another software module, like GPS. Do you have other modules connected to the Rak?

Thanks for your suggestion, but I have now verified my suspicion and, yes, the remote hardware module indeed unconditionally configures INPUT_PULLUP and I can see from the schematics of the RAK magnetic switch that a pull-up is incompatible with it.

I also saw that the detection sensor module has an option for pull-up and I tested it without. And, yes, now the voltage on GPIO17 (RAK IO1) goes down to 0V, and detection works.

It would be nice if the remote hardware module also had an option wrt pull-up/pull-down. Of course, those would have to be masks to make individual pin control possible.