ptvoinfo / zigbee-configurable-firmware

PTVO firmware for CC2530, CC2531, and CC2652 Zigbee chips
https://ptvo.info/zigbee-configurable-firmware-features/
MIT License
211 stars 22 forks source link

Uart receive bytes instead of String #193

Closed Gekkotron closed 1 year ago

Gekkotron commented 1 year ago

Hello,

First thing. Thank you so much for your great work on the firmware.

I use an arduino to communicate with CC2530 in uart(P02, P03) with PTVO firmware.

But I have an issue on receive data.

I use

doc["flow"] = Meter->getCurrentFlowrate();
doc["vol"] = Meter->getCurrentVolume();
doc["P"] = actualPower;
serializeJson(doc, serialFromToZigbee);
serialFromToZigbee.println();
// for Arduino serial Output
serializeJson(doc, Serial);
Serial.println();

or direclty to test the communication : serialFromToZigbee.println("{\"flow\":0,\"vol\":0,\"P\":0}");

Result in the Arduino :

22:50:28.376 -> {"flow":0,"vol":0,"P":0}

Result in action in zigbee2mqtt frontend (or Jeedom) :

255,255,255,255,255,255,255,255,255,123,34,102,108,111,119,34,58,48,44,34,118,111,108,34,58,48,44,34,80,34,58,48,125

and sometimes I got :

{"flow":0,"vol":0,"P":0}

I already try to delay the sending data without success.

Thanks for your answer

ptvoinfo commented 1 year ago

There are unexpected bytes (255) in your data that cannot be converter to a readable character. Therefore, the standard Z2M converter outputs your data as a byte array.