-->
Page 1 of 1

Serial Communication - Parity Problem - missing zeros

PostPosted: Sat Aug 14, 2021 4:49 am
by micronano
Hello ESP Friends, i am in trouble with the serial port settings of my ESP8266.

the 8266 serial port is configured to: 2400, SERIAL_8E1

the expected hex values would be: 68FAFA6853FF000167DB084B464D...............
the hex values i get: 68FAFA6853FF0167DB84B464D.......

so, there are missing "0" - for example after FF, after DB ....

the test prg i use:

Code: Select all/*
 ESP8266 Serial Communication
*/

void setup() {
  Serial.begin(2400, SERIAL_8E1);   
}

// the loop function runs over and over again forever
void loop() { 
  if(Serial.available()>0)    //Checks is there any data in buffer
  {
    Serial.print(Serial.read(),HEX);  //Read serial data byte and send back to serial monitor
  }
  else
  {
    Serial.println("\n");
    delay(1500);                      // Wait
  }
}


It seems the Parity Configuration would be ignored.
The right HEX Values I got from a python Prg on the Raspberry Pi.

Re: Serial Communication - Parity Problem - missing zeros

PostPosted: Mon Aug 16, 2021 11:15 pm
by Pablo2048
The problem is i this line:
Code: Select all    Serial.print(Serial.read(),HEX);

Unfortunately Arduino print just 0 instead of 00...