Character array weirdness
if (len &gt; 8) pwdReadBuffer[len] = 0;


This line is unsafe.  You declared pwdReadBuffer to be only 8 bytes in size, but this line of code will either do nothing, or write outside of the target buffer, with unpredictable results.

You make a related mistake here:

if (len &gt; 8) lampCmdRead[len] = 0;


First the test should be &gt;= but again, such a value would be beyond the end of the target buffer.

Also consider that if you receive 8 or more characters, you will have no room for a terminating null in pwdReadBuffer, and so cannot pass it to anything that expects a null terminated string.

If you want to use null-terminate storage for a string of up to 8 bytes size, you need 9 bytes of storage.  And of course you need to only use in-range indices to access the elements.