Environment Variables and JSON Parsing

I have a question about how numbers larger than a 32-bit integer are parsed and interpreted when writing to an environment variable.

We write a Unix Epoch timestamp to the _restart env var to reliably start a new session by perform a device reboot.

What is the range of integers that will reliably result in a device reboot and new session? If we write a number greater than 2147483647, the device does not reboot.

Hi @BLehman and welcome to the Blues community!

Good catch! Numeric values are currently parsed as 32-bit signed integers by the Notecard firmware, so the valid range is -2147483648 to 2147483647. Any value larger than 2147483647 overflows and won’t trigger a reboot, which is why you’re seeing this behavior. We plan on addressing this in an updated version of Notecard firmware.

Thanks,
Rob