I made some minor advancements but still can't solve the problem.
- changed the serialavailable function as noted by CosineKitty
- if I leave all default connection settings I get syncing problems...however if on the terminal I change to
stop bits=2 (instead of 1 as default and as specified in the arduino preferences)
I get it almost right...
90% of the time it gets the right data.
can it be an issue that maybe it is compiling with settings that aren't really specified in the preferencese txt?