Comments (9)
Try to commet out the second send code and check if its now sent only once.
/*
if (GetNMEA0183Message2() == true) { // Get NMEA sentences from serial#2
SendNMEA0183Message(buf2); // Send to clients
}
*/
And check that there is no shortcut between both serial RX lines.
from nmea0183-wifi-multiplexer.
Thanks.
I tried but unfortunately the result is the same. There is also no connection at D6 and D7.
$GPGSV,1,1,0079
$GPGSV,1,1,0079
$GLGSV,1,1,0065
$GLGSV,1,1,0065
$GNGLL,,,,,,V,N7A
$GNGLL,,,,,,V,N7A
$GNRMC,,V,,,,,,,,,,N4D
$GNRMC,,V,,,,,,,,,,N4D
$GNVTG,,,,,,,,,N2E
$GNVTG,,,,,,,,,N2E
$GNGGA,,,,,,0,00,99.99,,,,,,56
$GNGGA,,,,,,0,00,99.99,,,,,,56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GPGSV,1,1,0079
$GPGSV,1,1,0079
$GLGSV,1,1,0065
$GLGSV,1,1,0065
$GNGLL,,,,,,V,N7A
$GNGLL,,,,,,V,N7A
is it maybe necessary to have a delay when reading softserial?
$GPGSV,1,1,0079
$GLGSV,1,1,0065
$GNGLL,,,,,,V,N7A
$GNRMC,,V,,,,,,,,,,N4D
$GNVTG,,,,,,,,,N2E
$GNGGA,,,,,,0,00,99.99,,,,,,56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
$GPGSV,1,1,0079
$GLGSV,1,1,0065
$GNGLL,,,,,,V,N7A
$GNRMC,,V,,,,,,,,,,N4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
so it comes directly from the gps
best regards max
from nmea0183-wifi-multiplexer.
Can you please add a Serial output command in the receive function:
while (swSer1.available()) {
Char = swSer1.read();
Serial.println(Char);
if ( (Char == '\n') || (Char == '\r') ) {
ReceivedChars = 0;
return true;
}
Just to check if the strange behaviour is comming from the receive or send code part.
from nmea0183-wifi-multiplexer.
Here is the output
here everything has been disabled by swSerial2
68
13
$GNRMC,,V,,,,,,,,,,N4D
10
$GNRMC,,V,,,,,,,,,,N4D
36
71
78
86
84
71
44
44
44
44
44
44
44
44
44
78
42
50
69
13
$GNVTG,,,,,,,,,N2E
10
$GNVTG,,,,,,,,,N2E
36
71
78
71
71
65
44
44
44
44
44
44
48
44
48
48
44
57
57
46
57
57
44
44
44
44
44
44
42
53
54
13
$GNGGA,,,,,,0,00,99.99,,,,,,56
10
$GNGGA,,,,,,0,00,99.99,,,,,,56
36
71
78
71
83
65
44
65
44
49
44
44
44
44
44
44
44
44
44
44
44
44
44
57
57
46
57
57
44
57
57
46
57
57
44
57
57
46
57
57
42
50
69
13
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
10
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
36
71
78
71
83
65
44
65
and here swSerial 1 and 2 is active
46
57
57
44
57
57
46
57
57
42
50
69
13
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
10
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.992E
36
71
80
71
83
86
44
49
44
49
44
48
48
42
55
57
13
$GPGSV,1,1,0079
10
$GPGSV,1,1,0079
36
71
76
71
83
86
44
49
44
49
44
48
48
42
54
53
13
$GLGSV,1,1,0065
10
$GLGSV,1,1,0065
36
71
78
71
76
76
44
44
44
44
44
44
86
44
78
42
55
65
13
$GNGLL,,,,,,V,N7A
10
$GNGLL,,,,,,V,N7A
36
71
78
best regards max
from nmea0183-wifi-multiplexer.
Each character is received only once. That's OK so far. But then the buffer is sent twice. One time after CR (\n) and another time after receiving LF (\r). But that should not happen.
Please add these both lines in both receive functions:
if(ReceivedChars == 0 && (Char == '\r')) return false;
if(ReceivedChars == 0 && (Char == '\n')) return false;
before this code:
if ( (Char == '\n') || (Char == '\r') ) {
ReceivedChars = 0;
return true;
}
Then it should work. It looks like my test system only sent one of the line end codes.
from nmea0183-wifi-multiplexer.
wonderful thanks worked.
one more question, how can I filter different gps sets so that they are not sent further or specify which ones to go through?
$GNVTG
$GPGSV
$GLGSV
Unfortunately, switching off the gps data sets in the gps itself is not an option.
best regards max
from nmea0183-wifi-multiplexer.
You have to parse the NME0183 messages. You can try to use this library https://github.com/ttlappalainen/NMEA0183). But I think it's not directly working with SoftwareSerial.
from nmea0183-wifi-multiplexer.
Hi Max,
I added a sofware version that is able to parse the messages with the NME0183 library. But I can't test it at the moment du to missing hardware to test. Please feel free to use the software as a staring point.
Regards,
Andreas
from nmea0183-wifi-multiplexer.
Thank you very much, it looks like this is working perfectly.
I modified that a bit. looks awesome
` if (NMEA0183_1.GetMessage(NMEA0183Msg)) { // Get NMEA sentences from serial#1
if (!((strcmp(NMEA0183Msg.Sender(), "GP") == 0) && NMEA0183Msg.IsMessageCode("GSV") ||
(strcmp(NMEA0183Msg.Sender(), "GN") == 0) && NMEA0183Msg.IsMessageCode("VTG") ||
(strcmp(NMEA0183Msg.Sender(), "GN") == 0) && NMEA0183Msg.IsMessageCode("GLL") ||
(strcmp(NMEA0183Msg.Sender(), "GL") == 0) && NMEA0183Msg.IsMessageCode("GSV"))) {
if (NMEA0183Msg.GetMessage(buf, MAX_NMEA0183_MESSAGE_SIZE - 1)) {
SendNMEA0183Message(buf); // Send to clients`
best regards max
from nmea0183-wifi-multiplexer.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmea0183-wifi-multiplexer.