Android Question [Solved] arduino sent data not equal to received data

D

Deleted member 103

Guest
Deleted
 
Last edited by a moderator:

emexes

Expert
Licensed User
Yes, the error is not always the same.
What sort of errors are you getting? (as in: what character code numbers? or even better, per Erel: what bytes are received via NewData Buffer parameter?)

Coincidentally, a friend telephoned me out of the blue a few hours ago about a serial communication issue between an Arduino Uno and a SIM7600CE-T shield. Perhaps is caused by a solar flareup or sunspots?!?! :cool:
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
Every time a wrong character code arrives, a UFO flies over my house. ?
Lol, but nonetheless... our previous house was under the approach path of a nearby airport, and every time something flew over, the television would go nuts for a few seconds.

Another odd thing at that house was that everytime the boarder came home from work and walked through the front door, there would be a cry of pain from my son room as he was knocked out of his online gaming session. We eventually pinned it down to the wifi hotspot only handling a limited number of connections, and as soon as the boarder's phone came into range, it would connect to the hotspot which would dump my son to make room. Had us mystified for weeks, but obvious once you know. ?

Now I think about it, wouldn't surprise me if the flyovers affected wifi there too, but that it righted itself quick enough that we didn't notice the dropout or that the two events were related. ?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
are you initializing with Prefix?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
As the communication is asynchronous it relies on the clocks in both devices serial interfaces to be similar. If they are more than 10% out then you can get bit errors in single characters. Try to look at the actual byte value received. If the clocks are running out the errors are most likely to be at the most significant end of the byte. Errors caused by noise will probably be more randomly distributed.

As I have said previously in this forum, for this and other reasons, designing a bullet-proof serial comms protocol is not as simple as as it may at first appear. First step is to enable parity checking if it is available.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
If you are sure that both ends are set to the correct baud rate then clock run-out in these modern times is most unlikely, though I might have a look with a scope just to check. However noise looks more likely with earth loops the most likely source. As you are using an Arduino are you for example, trying to use TTL/CMOS levels over several feet of cable?
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
For tests, download a program such as Serial Bluetooth Terminal from the google store and check if there are such errors there too ...
 
Upvote 0
Top