Invalid JSON

I'm trying to create a template for PMP APs using variables and getting a JSON error.

Going back to basics, I tried the existing PMP AP template. Using the exact code in the Cambium-provided template, I get an error as well. I'm not able to create a template in cnMaestro using the template in cnMaestro.

If I remove the variables, the template works fine.

The cause of this is replacement variables not surrounded by quotation marks do not pass the validation check.  This is an issue for number-based values.  Text-based and Boolean values do not appear to have this issue.

We are aware of this problem and are working towards a fix.  Sorry for any inconvenience.

Works:

{
    "userParameters": {
        "example": "${VARIABLE_NAME=555}"
    }
}

Does not work:

{
    "userParameters": {
        "example": ${VARIABLE_NAME=555}
    }
}
1 Like

OK great, thanks. So by that, the code below should work?

"apRadioConfig": {
"radioColorCode": "${COLOR_CODE=0}",
"radioControlSlots": 3,
"ofdmSMRcvTargetLvl": -52,
"radioFreqCarrier": "${FREQ_CARRIER=0}",
"radioMaxRange": 20,
"radioDownlinkPercent": 65,
}

It should save to cnMaestro correctly if it is surrounded by curly brackets.  The device itself may reject the configuration if it only allows numbers for radioColorCode or radioFreqCarrier.  This validation is on a per-parameter basis.

I recommend using something like http://jsonlint.com/ to validate JSON while you're creating the template to validate and also to auto-format the text into something more readable.  Once we fix validation in cnMaestro to allow replacement variables for numbers that tool will reject the JSON text for the same reason (just to keep in mind later on).

{
	"apRadioConfig": {
		"radioColorCode": "${COLOR_CODE=0}",
		"radioControlSlots": 3,
		"ofdmSMRcvTargetLvl": -52,
		"radioFreqCarrier": "${FREQ_CARRIER=0}",
		"radioMaxRange": 20,
		"radioDownlinkPercent": 65,
	}
}

Apologies, I should have explained. I've been using http://jsonlint.com/ for all of my validation. That code is just a section of my entire config, I've also replaced the actual numbers with zeros for this post.

The brackets seem to be working fine in cnMaestro now. Thank you so much for the help!

Replying to this thread to note that this issue has been fixed with the latest 1.5.0 release.