2022 05 05 Node Red MOASII client JSON fix
YCCC MOAS II Client is now working with both radios. Thanks to Alan WA9WUD for helping me on a 2 hour TeamViewer session this afternoon. I was having an issue when reading the MOAS II server output into my flow. I kept getting invalid JSON messages from the JSON input node. Using a debug node I could see that some of the messages were concatenated JSON. After troubleshooting with Alan we were able to write the JSON to a log file so we could examine the output. Reading the server output into a split node we identified up to 5 JSON messages concatenated together. The concatenated JSON was split on }{ with a split node and I used the index and count of the split node to add a beginning, ending or both curly brackets to the resulting string to get valid JSON. Reading the output into a JSON node is now error-free and the flow loads and colors the display buttons correctly. I still have some work to do with the MOAS II client functions and need to clean up the JSON commands I send to the MOAS II server. Thanks!
YCCC MOAS II Client is now working with both radios. Thanks to Alan WA9WUD for helping me on a 2 hour TeamViewer session this afternoon. I was having an issue when reading the MOAS II server output into my flow. I kept getting invalid JSON messages from the JSON input node. Using a debug node I could see that some of the messages were concatenated JSON. After troubleshooting with Alan we were able to write the JSON to a log file so we could examine the output. Reading the server output into a split node we identified up to 5 JSON messages concatenated together. The concatenated JSON was split on }{ with a split node and I used the index and count of the split node to add a beginning, ending or both curly brackets to the resulting string to get valid JSON. Reading the output into a JSON node is now error-free and the flow loads and colors the display buttons correctly. I still have some work to do with the MOAS II client functions and need to clean up the JSON commands I send to the MOAS II server. Thanks!