I did a lot of research and Im trying since one day but I didnt find my mistake.
Im trying to send the values of fourth sensor via RS232 to Python/Capl(CANoe).
First of all I send every data seperatly via Serial.println, this isnt a big thing and its working fine but I will get timing issues if I not received all four sensor data at the same time.
For this I changed my communication from Serial.println to the SerialTransfer lib.
Im trying to send the sensor datas (the values are longs) via a struct but if I try to send something I will only get thrash.
So I start reducing my program to the basic (just sending two integer) but this doesnt work either!
Somebody of you has maybe an idea, where I did the mistake?
int data1 = 53;
int data2 = 54;
uint8_t sendSize = 0;
myTransfer.txObj(data1, sizeof(data1), sendSize);
sendSize += sizeof(data1);
myTransfer.txObj(data2, sizeof(data2), sendSize);
sendSize += sizeof(data2);
you appear to be transmitting int type which on the Arduino are 16 bit signed integers
check what the receiver expects, e.g. I don't know about Python but C++ on a PC using gcc int is usually a 32bit signed integer
yeah but in the serial monitor is also crap.. there should it be right.
the data is transferred as packets see SerialTransfer (https://github.com/PowerBroker2/SerialTransfer) therefore if you look at it as though it is normal ASCII if will appear as corrupt characters
the receiver needs to unpack it - see pySerialTransfer (https://github.com/PowerBroker2/pySerialTransfer)