SQNSNVW +CME ERROR: operation not supported

Hi I’m using the GM02SP with firmware UE8.2.2.1 attempting to add certificates to it using:

AT+SQNSNVW=“certificate”,5,788\r\n

-----BEGIN CERTIFICATE-----

CERTIFICATE DATA

-----END CERTIFICATE-----

but just get +CME ERROR: operation not supported as a response once i finish sending the certificate, i can read certificate 1-3

and get the following when i send AT+SQNSNVW=?\r\n
OK

+SQNSNVW: “certificate”,(5,6,11-19),(0-8192)

+SQNSNVW: “privatekey”,(0-19),(0-2048)

+SQNSNVW: “strid”,(0-19),(0-1024)

OK

the certificate is valid i even tried adding one extra byte to the size and using one less byte for the size to see if i was off by one on the parameter, but got the same operation not supported

AT+SQNSNVW=“certificate”,5,787\r\n

AT+SQNSNVW=“certificate”,5,789\r\n

so I’m not sure why it would be having this issue, is there a certificate someone has that is known to work so i can try uploading it? or is there something else I’m missing?

Hi Brandon,

The issue seems to be linked to the exact certificate size, like including any \n or \r\n characters added during copy-and-paste into the serial terminal tool.
Is that possible you can review the certificate content with text editor like Notepad++.
(In Notepad++, it is possible to see all symbols with the menu View → Show Symbol → Show All Characters)
The newline character (\n) should not be transmitted. Since the file was converted from plain text into a C character array, line endings were converted into line feed (LF) and carriage return (CR) characters. The 0x0A character (line feed) should not be included in the transmitted data.

Hi cmchen,

yeah unfortunately i already stripped and new line and carriage returns are the bytes only suppose to include the bytes between “-----BEGIN CERTIFICATE-----” and “-----END CERTIFICATE-----”? i am currently including those in the total length. or is it possible it only accepts certain certificate types?

Hi Brandon,

AT+SQNSNVW do not filter the specific certificate types. In this case, is that possible you can share the certificate file then I can run it with my setup.

sure, here it is I’m using the following command and cert

AT+ =“certificate”,5,788\r\n

-----BEGIN CERTIFICATE-----MIICIzCCAcigAwIBAgIUYjSvKG8aSdVX9AG0vs179cV7IAAwCgYIKoZIzj0EAwIwdzELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApJbnRlbGxpaG90MREwDwYDVQQLDAhTZWN1cml0eTEbMBkGA1UEAwwSSW50ZWxsaWhvdCBSb290IENBMB4XDTI2MDkwMTE0MTIwNFoXDTM2MDgyOTE0MTIwNFowdzELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApJbnRlbGxpaG90MREwDwYDVQQLDAhTZWN1cml0eTEbMBkGA1UEAwwSSW50ZWxsaWhvdCBSb290IENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQirBhgtKzwYkk1iSyfIOV72z2ZrxwpRlkMhI0uqnekpQ0S7qKhYhjrnTdlZEjJ06k+nrk56KXc+Dp7idct/vz6MyMDAwHQYDVR0OBBYEFMA76d1/pyuFRTyjaMslPexEa4gaMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhAMR4f0exRSyIRDW8HxxnoZTUuxtDDTg9U/PgL3+bDHctAiEAgLIvYxlCCz7/3RDwlRuW4/sMLZRsqHBYXeDXmvkL6BI=-----END CERTIFICATE-----

does anyone have a certificate that is known to work? so i can try it and see if there is some other reason this certificate might be failing to upload

Hi Brandon,

Sorry the the delayed reply.
I manage to reproduce the error by the certificate file which you shared before.
I am clarifying it and will back to you later.

Hi Brandon,

I manage to write certificate file into NVRAM of GM02SP and the notes are:
1\ Make sure line endings in your certificate/key file are Unix (LF), not Windows (CRLF), or the byte count won’t match what you specified.

2\File size: Here I got 802 bytes and following description is how I count it into 802:

  1. The base64 payload is 736 characters, wrapped at 64 chars/line = 12 lines.
  2. Total bytes = -----BEGIN CERTIFICATE-----\n + 12 base64 lines each ending in \n + -----END CERTIFICATE-----\n = 802 bytes, counting each line ending as a single LF (\n), not CRLF.

Working command example:
AT+SQNSNVW=“certificate”,5,802

Then, after the > prompt appears, send exactly this data:
-----BEGIN CERTIFICATE-----
MIICIzCCAcigAwIBAgIUYjSvKG8aSdVX9AG0vs179cV7IAAwCgYIKoZIzj0EAwIw
dzELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGlj
YWdvMRMwEQYDVQQKDApJbnRlbGxpaG90MREwDwYDVQQLDAhTZWN1cml0eTEbMBkG
A1UEAwwSSW50ZWxsaWhvdCBSb290IENBMB4XDTI2MDkwMTE0MTIwNFoXDTM2MDgy
OTE0MTIwNFowdzELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAwDgYD
VQQHDAdDaGljYWdvMRMwEQYDVQQKDApJbnRlbGxpaG90MREwDwYDVQQLDAhTZWN1
cml0eTEbMBkGA1UEAwwSSW50ZWxsaWhvdCBSb290IENBMFkwEwYHKoZIzj0CAQYI
KoZIzj0DAQcDQgAEQirBhgtKzwYkk1iSyfIOV72z2ZrxwpRlkMhI0uqnekpQ0S7q
KhYhjrnTdlZEjJ06k+nrk56KXc+Dp7idct/vz6MyMDAwHQYDVR0OBBYEFMA76d1/
pyuFRTyjaMslPexEa4gaMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSQAw
RgIhAMR4f0exRSyIRDW8HxxnoZTUuxtDDTg9U/PgL3+bDHctAiEAgLIvYxlCCz7/
3RDwlRuW4/sMLZRsqHBYXeDXmvkL6BI=
-----END CERTIFICATE-----