The problem is described in this thread http://www.b4x.com/forum/questions-help-needed/3155-receiving-byte-value-0x1a.html
To be able to use Serial2 for binary transfers the extra EOF event needs to be ignored so the event code needs to be something like this
To be able to use Serial2 for binary transfers the extra EOF event needs to be ignored so the event code needs to be something like this
B4X:
private void sp_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
if ([COLOR="Red"]e.EventType == SerialData.Eof [/COLOR]|| !enableOnComm)
return;
if (OnCom != null)
OnCom(eventObject, null);
}