Closed gitsad closed 6 years ago
Ok I resolved this by changing this condition:
decodedString.length > 1
into:
decodedString.length >= 1
Hello @gitsad it seems logical to me to use >=
instead of >
because with the latter you would miss messages of length === 1
. Does it fixed both issues (underlined in green and in red) ?
Should I consider this issue fixed? I'm curious for what you're using this project, could you tell me more?
Regards
Thank you for your response. Yeah, I've fixed it by changing this condition above. Both issues are fixed because they were connected with this missing partial data :smile: .
I'm building small measure device. This project includes small voltage detector, Arduino board, and mobile app in cordova+react+onsen to read and save data. I was little unsure when it came to building a mobile app because my second option was to build an app in react native but my hardware(Arduino) knowledge isn't as big as I want and also I didn't find library in React Native which would be directly related to connecting Arduino with mobile app :thinking: . For now I'm glad that I chose cordova+react apart from little problems which I had. Your lib helps me a lot :+1:
Great to hear! I have in mind to port this to react native, but I cannot find the time!
Have fun!
Hi,
I've got a little problem, but first here is my code:
cordova code
arduino code
The problem is that when my android is receiving data, some of this data is missing Screenshot below:
As you can see, in this picture the data is the number
12123
. The stringinitial data
is hardcoded string in an array to which I push received data.At the beginning after "initial data" you can notice(I underlined this with red line) that there is no
1
before2
which means that somehow the first digit missed.I thought that is little issue with which I can live but after receiving another same data(
12123
), the problem appeared again in different combination. For instance213
which I underlined with a green line and other like2123
(before that213
) or212
(in the end).I tried to resolve this but I ended without success. If someone knows how to fix it, I will be grateful to that person for helping me.