-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON deserialisation of Hammingstream, can't get it to work #9
Comments
Hi @TLS1000, Please apologize for the exceptional delay in my response; I'm currently very busy, and I didn't find the time to get a look into this issue. I'll get back to you as soon as possible. Best regards, |
Hi Benoit, no problem. As for now I'll use the bufferingstream class. Let me know if you would like me to test something as I have the setup ready. I think using the json and hammingstream between two controllers would be a very good combo. |
Hi @TLS1000, I was going to reproduce your setup when I saw several problems in your programs. First, in the sender, you write directly to while (eccSerial1.available()) {
Serial1.write(eccSerial1.read());
//Serial1.write(bufferedSerial.read());
}` Indeed, the error correction can recover from a flipped bit, but not from inserted bytes. Secondly, from my experience, the baud rate used for logging should be significantly higher than the transmission link (at least x10); otherwise, the logging could slow down the program to the point where the transmission link drops bytes. Lastly, from your message, I understand that Also, ESP32 has a 3.3V UARL whereas the Mega has a 5V UART; are you using a level adapter. Best regards, |
Hi Benoit, I simplified the test of the hammingstream: sender:
receiver:
I would expect to see 'a'-s printed to the receivers' monitor, but each loop it prints '61' On hardware, I use level shifters, and also the bufferstream class works so I don't suspect level conversion issue. |
Does the hammingstream class also chop the payload to be sent into managable pieces for eg the UART? In fact, instead of using the hammingstream, I would prefer using the bufferingstream but with a CRC16 check. Wouldn't it be a good idea to enable this automatically inside the readbufferingstream class? |
Hi, I'm using a mega as port externder for a ESP32 via UART. The idea is to send JSON files with IO-status and requests back and forth. Because the size of the JSON doc is larger than UART capacity, it needs to be sent in pieces. I've tested it with the readBufferingstream class and this works great (thank you by the way)! I wanted to add some errorchecking by trying the hammingstream-class. In my test setup I make some dummy JSON about 800bytes. I think the sending works ok (I see it on scope) using the "serializeJson(doc, eccSerial1);", but on the receiver side the "DeserializationError err = deserializeJson(doc, eccSerial1);" returns error.
sender (arduino mega)
receiver(ESP32):
The text was updated successfully, but these errors were encountered: