You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello !
So, I know that support for SoftwareSerial is limited, however I'm having an issue that I think it might be not related to it.
I was wondering if the library is compatible with Arduino Nano Every (AtMega4809 or AtMega4808) family, which is ran under MegaCoreX board framework. It's still 8-bit AVR, all my other libraries work, just this one does not.
I replaced Nano @ AtMega328p in a project with a Nano Every (clone) @ AtMega 4808 as I needed more memory, and ran the same code.
My surprise was to see that though I had stable serial communication between two MCUs (AtMega4808 and ESP8266, tested without the library), with this library, the received data between the MCUs was totally different.
For example, I used the SendDatum over UART examples. Works totally fine with the little amount of data present in the examples.
But as soon as I added more data to it, I was receiving totally different numbers on the other side.
For example, on the Nano Every (AtMega4808) I sent the following struct:
struct __attribute__((packed)) STRUCT {
char z;
float y;
int q;
int t;
int p;
} testStruct;
And on the receiving end (ESP8266) I was receiving the following data: 18:46:36.307 -> $ | 4.50 | 13238373 | 1701314964 | 7302252
Which looks to me more like a bit-conversion issue rather than something with SoftwareSerial.
And it worked somewhat fine with the Nano 328p.
(I say "somewhat", as with the Nano 328p I was receiving a lot of CRC_ERRORs due to low memory I guess -- I had only 91 bytes RAM left, however with Nano Every 4808 there are no errors present whatsoever, just the data isn't the same).
Same thing applies if I try to send it the other way (from ESP8266 to Nano Every 4808). With little data is ok. As soon as I add more, I receive totally different numbers.
Any lead to fix this would be very helpful.
Thank you.
The text was updated successfully, but these errors were encountered:
Looks like an "endian" difference between the two MCUs. Try swapping the byte order on the ints on the receiver and see if it helps. Might also be useful to set the int size manually.
So that might not be it.
It also fails with floats, not only ints.
Weird thing that the CRC validates the packets, so has to be some bit-shifting issue, just can't figure out what...
Hello !
So, I know that support for
SoftwareSerial
is limited, however I'm having an issue that I think it might be not related to it.I was wondering if the library is compatible with
Arduino Nano Every
(AtMega4809
orAtMega4808
) family, which is ran under MegaCoreX board framework. It's still8-bit AVR
, all my other libraries work, just this one does not.I replaced
Nano @ AtMega328p
in a project with aNano Every (clone) @ AtMega 4808
as I needed more memory, and ran the same code.My surprise was to see that though I had stable serial communication between two MCUs (
AtMega4808
andESP8266
, tested without the library), with this library, the received data between the MCUs was totally different.For example, I used the SendDatum over UART examples. Works totally fine with the little amount of data present in the examples.
But as soon as I added more data to it, I was receiving totally different numbers on the other side.
For example, on the
Nano Every (AtMega4808)
I sent the following struct:and the data:
And on the receiving end
(ESP8266)
I was receiving the following data:18:46:36.307 -> $ | 4.50 | 13238373 | 1701314964 | 7302252
Which looks to me more like a bit-conversion issue rather than something with
SoftwareSerial
.And it worked somewhat fine with the
Nano 328p
.(I say "somewhat", as with the
Nano 328p
I was receiving a lot ofCRC_ERROR
s due to low memory I guess -- I had only 91 bytes RAM left, however withNano Every 4808
there are no errors present whatsoever, just the data isn't the same).Same thing applies if I try to send it the other way (from
ESP8266
toNano Every 4808
). With little data is ok. As soon as I add more, I receive totally different numbers.Any lead to fix this would be very helpful.
Thank you.
The text was updated successfully, but these errors were encountered: