Pulse to AUX1 example

Hi all,

I’ve been experimenting with switching the AUX1 pin and it works fine by sending JSON via the USB e.g. the JSON below switches AUX1 high

{“req”:“card.aux”,“mode”:“gpio”,“usage”:[“high”,“”,“”,“”]}

It also works fine using the Environment

_aux_gpio_set=high,

However, I’ve had no success pulsing AUX1 using the example in the Docs “[Pulsing GPIO Outputs High or Low with Environment Variables]”.(Working with the Notecard AUX Pins - Blues Developers)

I have tried JSON with no success

{“req”:“card.aux”,“mode”:“gpio”,“usage”:[“high,1300,1713311000,60”,“”,“”,“”]}

or the Environment

_aux_gpio_set=high,1300,1713311000,60,

I’m using

DeviceUID dev:867730051231110 (NOTE-NBGL-500) running firmware 7.2.2.16518

When I apply changes to the Environment variable and use send the JSON {“req”: “hub.sync”} via the USB, then the Notecard connects to the server, then immediately AUX1 goes HIGH. It does not pulse & AUX1 did not go high at the correct time.

I’m stumped. Can anyone suggest what I’m doing wrong.

Thanks,

Paul H

Hi @hussat,

I think you’re just missing some commas in that string. The first set of args specifies which of the 4 AUX GPIO pins you want to work with (including empty spots for those that you aren’t using, which is the confusing part):

_aux_gpio_set=high,,,,1300,1713311000,60

…will pulse AUX1 high for 1300 ms for 60 seconds starting at 1713311000.

1 Like

Thanks Rob. Got it.

I’m using AUX1 to switch power to my sensor, which is probably a common application. As measurements are taken on a regular interval, it would be great to also be able to specify an interval.

For example, _aux_gpio_set with a value of ,,,high,1300,1713322315,31536000, 86400 means pulse AUX4 HIGH for 1300ms, valid for 3153600 seconds (1 year) from 1713322315 until 1744858315, repeating every 86400 seconds (1 day).

2 Likes

Hi @hussat,

This is an interesting idea. In the meantime, I would suggest looking at implementing this with a paired host as the “timer” to manage the interval.

Rob