Skip to content
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

MWP --forward-to second bluetooth device appears in-op TBS Crossfire source, GhettoStation receiver. #35

Closed
markandkymward opened this issue Feb 4, 2018 · 13 comments

Comments

@markandkymward
Copy link

Data Source - Taranis 9XD with Crossfire transmitter. Bluetooth device on CRSF is set to MAVEmu. MWP ground station is connected to CRSF via bluetooth device (/dev/rfcomm0). MWP receives and interprets the mavlink data perfectly. "Forward-To" appears to connect to GhettoStation BT device (/dev/rfcomm1) OK, but it appears that no data is forwarded. BT device was checked outside of the data-loop for proper serial link via serial monitor using "echo and cat." BT link is 9600 baud. Multiple baud rates and settings were attempted via changes to the BT device (HC-05). Tried gsettings set org.mwptools.planner forward "minLTM." When run, logging similar to the following is output. Again, MWP receives and processes the info OK.

2018-02-04T16:55:32-0500 Connected /dev/rfcomm0
2018-02-04T16:55:32-0500 set forwarder /dev/rfcomm1
2018-02-04T16:55:32-0500 LTM/Mavlink mode
2018-02-04T16:55:32-0500 Comm error count 5
2018-02-04T16:55:32-0500 MAVCRC Fail, got b58a != 8121 [1 c8] (cmd=147, len=36)
2018-02-04T16:55:32-0500 init icon 0
2018-02-04T16:55:32-0500 Armed 0
2018-02-04T16:55:32-0500 Using espeak for speech
2018-02-04T16:55:32-0500 Comm error count 6
2018-02-04T16:55:32-0500 MAVCRC Fail, got 5709 != eced [33 44] (cmd=109, len=9)
2018-02-04T16:55:32-0500 Comm error count 7
2018-02-04T16:55:32-0500 MAVCRC Fail, got 985e != acf5 [1 c8] (cmd=147, len=36)
2018-02-04T16:55:33-0500 Comm error count 8
2018-02-04T16:55:33-0500 MAVCRC Fail, got be62 != 8ac9 [1 c8] (cmd=147, len=36)
2018-02-04T16:55:34-0500 Comm error count 9
2018-02-04T16:55:34-0500 MAVCRC Fail, got 38de != c75 [1 c8] (cmd=147, len=36)
2018-02-04T16:55:34-0500 Comm error count 10
2018-02-04T16:55:34-0500 MAVCRC Fail, got 3511 != 1ba [1 c8] (cmd=147, len=36)
2018-02-04T16:55:35-0500 Comm error count 11
2018-02-04T16:55:35-0500

@stronnag
Copy link
Owner

stronnag commented Feb 4, 2018

mwp doesn't forward MAVLINK (but MSP and LTM). It could do; due to the way that mwp does forwarding (it rewrites each message) it will need a bit of thought,but it's easily doable.

I'll have a look at the MAVLink that Ghettostation consumes, and see what would be useful to forward.

2 CRCs / second is more that I'd expect, but not catastrophic.

Leave it with me.

@stronnag
Copy link
Owner

stronnag commented Feb 4, 2018

And mwp doesn't know about MAVlink message 147, and MAVlink has a specific CRC seed for each message;so it's not surprising that it errors each 147. So really the error rate is acceptably low. I'll sort that out too.

Any chance you can capture a stream of mavlink off the CRSF to see exactly that it's outputting ?

@markandkymward
Copy link
Author

Hex dump. CRSF BT set to MAVemu. GPS not receiving signal.

0000000 7f17 09fe 3389 6d44 0000 0000 a1b6 0002
0000020 3900 fecc 8a09 4433 006d 0000 b600 5f9f
0000040 0000 a4f7 09fe 338b 6d44 0000 0000 9db6
0000060 005a c200 fea2 8c09 4433 006d 0000 b600
0000100 56a1 0000 e690 1ffe 018d 01c8 0000 0000
0000120 0000 0000 0000 8f00 c801 001e 0000 e300
0000140 9ba5 c3bc 2a64 4dbc 3815 0040 0000 0000
0000160 0000 0000 0000 2000 feed 9024 c801 9d93
0000200 000a ff00 ffff ffff 007f 0000 0000 0000
0000220 0000 0000 0000 0000 0000 0000 0000 0000
0000240 0000 9c28 fe94 9109 4433 006d 0000 b600
0000260 51a1 0000 0556 09fe 3392 6d44 0000 0000
0000300 a1b6 004c 4600 fece 9309 4433 006d 0000
0000320 b600 45a1 0000 49cf 09fe 3394 6d44 0000
0000340 0000 a1b6 003e 1800 fea3 9509 4433 006d
0000360 0000 b600 399f 0000 3fba 09fe 3396 6d44
0000400 0000 0000 a1b6 0033 4300 24d5 fe36 9809
0000420 4433 006d 0000 b600 2b9d 0000 b1d5 09fe
0000440 3399 6d44 0000 0000 a1b6 0026 5100 9ce7
0000460 c801 001e 0000 e300 9ba5 c3bc 2a64 4dbc
0000500 3815 0040 0000 0000 0000 0000 0000 f100
0000520 fe0b 9d24 c801 9d93 000a ff00 ffff ffff
0000540 007f 0000 0000 0000 0000 0000 0000 0000
0000560 0000 0000 0000 0000 0000 c928 feb7 9e09
0000600 4433 006d 0000 b600 20a3 0000 cac4 0000
0000620 32fa 09fe 33a0 6d44 0000 0000 9db6 0018
0000640 e100 fe44 a109 4433 006d 0000 b600 00a1
0000660 ff00 fe59 a209 4433 006d 0000 b600 0e9f
0000700 0000 2786 09fe 33a3 6d44 0000 0000 9fb6
0000720 000b 3b00 fe37 a409 4433 006d 0000 b600
0000740 05a3 0000 4a1f 09fe 33a5 6d44 0000 0000
0000760 a1b6 0064 2200 a9a7 c801 001e 0000 e300
0001000 9ba5 c3bc 2a64 4dbc 3815 0040 0000 0000
0001020 0000 0000 0000 9300 fe28 aa24 c801 9d93
0001040 000a ff00 ffff ffff 007f 0000 0000 0000
0001060 0000 0000 0000 0000 0000 0000 0000 0000
0001100 0000 f528 fe91 ab09 4433 006d 0000 b600
0001120 60a1 0000 34c0 09fe 33ac 6d44 0000 0000
0001140 96b6 005d 3700 fe67 ad09 4433 006d 0000
0001160 b600 579f 0000 9417 09fe 33ae 6d44 0000
0001200 0000 9db6 0051 3b00 fe4a af09 4433 006d
0001220 0000 b600 4aa1 0000 9484 09fe 33b0 6d44
0001240 0000 0000 9fb6 0043 bd00 fe91 b109 4433
0001260 006d 0000 b600 419d 0000 c0a9 09fe 33b2
0001300 6d44 0000 0000 9db6 003f 9000 b5b7 c801
0001320 001e 0000 e300 9ba5 c3bc 2a64 4dbc 3815
0001340 0040 0000 0000 0000 0000 0000 4000 fe14
0001360 b624 c801 9d93 000a ff00 ffff ffff 007f
0001400 0000 0000 0000 0000 0000 0000 0000 0000
0001420 0000 0000 0000 0000 9e28 fe89 b709 4433
0001440 006d 0000 b600 3e9f 0000 30f0 09fe 33b8
0001460 6d44 0000 0000 9fb6 003d d900 958a fe72
0001500 ba09 4433 006d 0000 b600 3ca3 0000 c857
0001520 09fe 33bb 6d44 0000 0000 9fb6 0038 b000
0001540 8067 09fe 33bd 6d44 0000 0000 9fb6 0033
0001560 c800 fea9 be09 4433 006d 0000 b600 329f
0001600 0000 364d 09fe 33bf 6d44 0000 0000 9fb4
0001620 0030 8700 c279 c801 001e 0000 e300 9ba5
0001640 c3bc 2a64 4dbc 3815 0040 0000 0000 0000
0001660 0000 0000 3400 fe2e c324 c801 9d93 000a
0001700 ff00 ffff ffff 007f 0000 0000 0000 0000
0001720 0000 0000 0000 0000 0000 0000 0000 0000
0001740 9b28 fe1d c409 4433 006d 0000 b600 2d9d
0001760 0000 732d 09fe 33c5 6d44 0000 0000 9fb4
0002000 002b 8300 fe58 c609 4433 006d 0000 b600
0002020 279f 0000 44df 09fe 33c7 6d44 0000 0000
0002040 9db6 0025 cb00 7815 fe3c c909 4433 006d
0002060 0000 b400 229f 0000 bd3a 09fe 33ca 6d44
0002100 0000 0000 9fb6 0020 2400 fe0f cb09 4433
0002120 006d 0000 b600 1d9d 0000 a03b 0000 879d
0002140 09fe 33d1 6d44 0000 0000 9fb6 0017 7d00
0002160 feae d209 4433 006d 0000 b600 159f 0000
0002200 1435 09fe 33d3 6d44 0000 0000 9fb6 0014
0002220 6400 fe76 d409 4433 006d 0000 b600 12a1
0002240 0000 f810 09fe 33d5 6d44 0000 0000 9fb6
0002260 000e 0600 fe67 d609 4433 006d 0000 b600
0002300 089f 0000 afa2 754b 0000 86ef 09fe 33d9
0002320 6d44 0000 0000 9fb6 0001 2500 fec9 da1f
0002340 c801 0001 0000 0000 0000 0000 0000 0000
0002360 d000 0039 0000 0000 0000 0000 0000 0000
0002400 2800 243d 01dc 1ec8 0000 0000 a5e3 bc9b
0002420 64c3 bc2a 154d 4038 0000 0000 0000 0000
0002440 0000 0000 9221 24fe 01dd 93c8 0a9d 0000
0002460 ffff ffff 7fff 0000 0000 0000 0000 0000
0002500 0000 0000 0000 0000 0000 0000 0000 2800
0002520 304f 09fe 33de 6d44 0000 0000 9fb4 0063
0002540 6600 09fe 33df 6d44 0000 0000 a1b4 0061
0002560 9300 fee3 e009 4433 006d 0000 b600 60a1
0002600 0000 1bf2 09fe 33e1 6d44 0000 0000 9fb6
0002620 005e c100 fe32 e209 4433 006d 0000 b400
0002640 5c9f 0000 80df 09fe 33e3 6d44 0000 0000
0002660 9fb4 005b 1400 fea9 e409 4433 006d 0000
0002700 b600 589f 0000 f408 09fe 33e5 6d44 0000
0002720 0000 9fb6 0055 6d00 e901 c801 001e 0000
0002740 e300 9ba5 c3bc 2a64 4dbc 3815 0040 0000
0002760 0000 0000 0000 0000 4300 feb1 ea24 c801
0003000 9d93 000a ff00 ffff ffff 007f 0000 0000
0003020 0000 0000 0000 0000 0000 0000 0000 0000
0003040 0000 0000 7328 fe16 eb09 4433 006d 0000
0003060 b400 529d 0000 a99c 09fe 33ec 6d44 0000
0003100 0000 9fb6 004e 5000 fe93 ed09 4433 006d
0003120 0000 b400 4c9f 0000 dc9a 09fe 33ee 6d44
0003140 0000 0000 a1b6 004a 0100 fea9 ef09 4433
0003160 006d 0000 b600 469d 0000 e33e 09fe 33f0
0003200 6d44 0000 0000 9fb6 0040 1f00 fef7 f109
0003220 4433 006d 0000 b600 379d 0000 9219 09fe
0003240 33f2 6d44 0000 0000 a3b6 0037 4e00 f5a4
0003260 c801 001e 0000 e300 9ba5 c3bc 2a64 4dbc
0003300 3815 0040 0000 0000 0000 0000 0000 9000
0003320 fe8d f624 c801 9d93 000a ff00 ffff ffff
0003340 007f 0000 0000 0000 0000 0000 0000 0000
0003360 0000 0000 0000 0000 0000 1828 fe0e f709
0003400 4433 006d 0000 b600 359f 0000 b38a 09fe
0003420 33f8 6d44 0000 0000 9fb6 0034 d500 fa30
0003440 fe31 fa09 4433 006d 0000 b600 339d 0000
0003460 8ca8 09fe 33fb 6d44 0000 0000 9fb6 0031
0003500 bc00 fedd fc09 4433 006d 0000 b600 2e9f
0003520 0000 dc63 09fe 33fd 6d44 0000 0000 a1b6
0003540 002c 9600 fe2e fe09 4433 006d 0000 b600
0003560 299f 0000 7696 09fe 33ff 6d44 0000 0000
0003600 9fb6 0027 3e00 01a6 93c8 0a9d 0000 ffff
0003620 ffff 7fff 0000 0000 0000 0000 0000 0000
0003640 0000 0000 0000 0000 0000 0000 2800 9d00
0003660 09fe 3304 6d44 0000 0000 9db6 0026 8900
0003700 fe76 0509 4433 006d 0000 b400 239f 0000
0003720 78ea 09fe 3306 6d44 0000 0000 9fb6 0020
0003740 4f00 fed6 0709 4433 006d 0000 b600 1d9f
0003760 0000 6fd8 f9c9 09fe 3309 6d44 0000 0000
0004000 c729 09fe 330a 6d44 0000 0000 9fb6 0018
0004020 bf00 fe63 0b09 4433 006d 0000 b600 159f
0004040 0000 96da 09fe 330c 6d44 0000 0000 9fb6
0004060 0012 7c00 0fb1 c801 001e 0000 e300 9ba5
0004100 c3bc 2a64 4dbc 3815 0040 0000 0000 0000
0004120 0000 0000 9100 fed6 1024 c801 9d93 000a
0004140 ff00 ffff ffff 007f 0000 0000 0000 0000
0004160 0000 0000 0000 0000 0000 0000 0000 0000
0004200 8128 fe93 3309 6d44 0000 0000 9db6 0010
0004220 6500 fe2a 1209 4433 006d 0000 b600 0a9f
0004240 0000 f7fd 09fe 4433 006d 0000 b600 0c9f
0004260 0000 95ac 09fe 3314 6d44 0000 0000 9fb4
0004300 0009 2a00 0083 3800 fe29 1609 4433 006d
0004320 0000 b600 019f 0000 9370 b0fa 09fe 3318
0004340 6d44 0000 0000 9fb4 0060 7700 feff 1909
0004360 4433 006d 0000 b600 5a9f 0000 1997 c801
0004400 001e 0000 e300 9ba5 72bc 0e8a 4dbc 3815
0004420 0040 0000 0000 0000 0000 0000 9700 feff
0004440 1d24 c801 9d93 000a ff00 ffff ffff 007f
0004460 0000 0000 0000 0000 0000 0000 0000 0000
0004500 0000 0000 0000 0000 d428 feb0 1e09 4433
0004520 006d 0000 b600 569f 0000 fe24 09fe 331f
0004540 6d44 0000 0000 9db6 0052 aa00 fee4 2009
0004560 4433 006d 0000 b600 4b9f 0000 246c 09fe
0004600 3321 6d44 0000 0000 9fb6 0044 7f00 fee8
0004620 2209 4433 006d 0000 b600 3e9f 0000 edaa
0004640 09fe 3323 6d44 0000 0000 9db6 0037 ab00
0004660 fe7c 2409 4433 006d 0000 b600 319f 0000
0004700 513e 09fe 3325 6d44 0000 0000 9db6 002d
0004720 c900 786d febd 271f c801 0001 0000 0000
0004740 0000 0000 0000 0000 d000 0039 0000 0000
0004760 0000 0000 0000 0000 2800 1460 1efe 0128
0005000 18c8 bf20 0002 0000 0000 0000 0000 0000
0005020 0000 0129 1ec8 0000 0000 a5e3 bc9b 8a72
0005040 bc0e 154d 4038 0000 0000 0000 0000 0000
0005060 0000 dcf5 24fe 012a 93c8 0a9d 0000 ffff
0005100 ffff 7fff 0000 0000 0000 0000 0000 0000
0005120 0000 0000 0000 0000 0000 0000 2800 96e8
0005140 09fe 332b 6d44 0000 0000 a1b6 0027 8800
0005160 fef3 2c09 4433 006d 0000 b600 219f 0000
0005200 7dfc 0000 8ff1 09fe 332e 6d44 0000 0000
0005220 9fb6 0017 4000 fe87 2f09 4433 006d 0000
0005240 b600 12a1 0000 2294 09fe 3330 6d44 0000
0005260 0000 9fb6 000e 5b00 fe8a 3109 4433 006d
0005300 0000 b600 099f 0000 a390 09fe 3332 6d44
0005320 0000 0000 9fb6 0004 2100 35ab c801 001e
0005340 0000 e300 9ba5 c3bc 2a64 4dbc 3815 0040
0005360 0000 0000 0000 0000 0000 f100 fe2f 3624
0005400 c801 9d93 000a ff00 ffff ffff 007f 0000
0005420 0000 0000 0000 0000 0000 0000 0000 0000
0005440 0000 0000 0000 8328 fe8e 3709 4433 006d
0005460 0000 b600 019f 0000 4825 09fe 3338 6d44
0005500 0000 0000 9db6 0064 fa00 4b36 fef4 3a09
0005520 4433 006d 0000 b400 629f 0000 9e6a 09fe
0005540 333b 6d44 0000 0000 9fb6 005f ab00 fe2f
0005560 3c09 4433 006d 0000 b800 5d9f 0000 5ff8
0005600 09fe 333d 6d44 0000 0000 9fb6 005b 2a00
0005620 fe53 3e09 4433 006d 0000 b600 57a1 0000
0005640 f249 09fe 333f 6d44 0000 0000 a1b6 0054
0005660 6e00 fea9 4409 4433 006d 0000 b600 529f
0005700 0000 0bc7 09fe 3345 6d44 0000 0000 9fb4
0005720 0050 0a00 fe44 4609 4433 006d 0000 b600
0005740 4ba1 0000 79b8 baa6 09fe 09fe 334a 6d44
0005760 0000 0000 9fb6 0043 d300 fe35 4b09 4433
0006000 006d 0000 b600 3e9f 0000 9af3 09fe 334c
0006020 6d44 0000 0000 9fb6 0039 5500 4fbd c801
0006040 001e 0000 e300 9ba5 c3bc 2a64 4dbc 3815
0006060 0040 0000 0000 0000 0000 0000 4100 fe4f
0006100 5024 c801 9d93 000a ff00 ffff ffff 007f
0006120 0000 0000 0000 0000 0000 0000 0000 0000
0006140 0000 0000 0000 0000 0728 fe14 5109 4433
0006160 006d 0000 b400 35a1 0000 23b9 09fe 3352
0006200 6d44 0000 0000 9fb6 0031 5400 fe6f 5309
0006220 4433 006d 0000 b600 28a1 0000 9e15 fe8f
0006240 5509 4433 006d 0000 ab00 209f 0000 b7a6
0006260 0000 2d58 09fe 0157 00c8 0000 f395 09fe
0006300 3358 0044 7b00 fe2c 5909 4433 006d 0000
0006320 b600 189f 0000 7539 015c 1ec8 0000 0000
0006340 a5e3 bc9b 64c3 bc2a 154d 4038 0000 0000
0006360 0000 0000 0000 0000 a990 24fe 015d 93c8
0006400 0a9d 0000 ffff ffff 7fff 0000 0000 0000
0006420 0000 0000 0000 0000 0000 0000 0000 0000
0006440 0000 2800 3752 09fe 335e 6d44 0000 0000

@stronnag
Copy link
Owner

stronnag commented Feb 5, 2018

Perfect, thanks.

@stronnag
Copy link
Owner

stronnag commented Feb 5, 2018

As of now there's a test branch with (mwpid 1.036.603, commit bcdcbab) that works if you use /dev/rfcommX. Damn, I need to pay attention when you tell me stuff doesn't work, you can't currently use BT addresses. Actually, the whole comms sub-system is based on the premise there's only one serial device. I need to fix that next (not that it seems unsafe ..).

Now, here I have
Tricopter, unconditional mavlink => 3DR => /dev/rfcomm1
Computer1, /dev/rfcomm1 forwarded to /dev/rfcomm2

/dev/rfcomm2 is bridged to a HC-12 radio

Computer 2 has a USB connected HC-12 radio.

Same picture on both computers, via four radios.

@stronnag
Copy link
Owner

stronnag commented Feb 5, 2018

Forwarding to a BT address is now disabled; device nodes (/dev/rfcommX) work OK.

In order to forward Mavlink, it is necesary to set the forward key to either 'all' or 'minMav' (currently synonymous)

$ gsettings range  org.mwptools.planner forward
enum
'none'
'LTM'
'minLTM'
'minMAV'
'all'

I'm not convinced that 9600 is fast enough for Mavlink; I see data loss / backlog on the final screen in the above chain (the 3DR is 19200, the HC-12 is 9600), whereas with a faster forward link, the two screens update simultaneously (this is using iNav's Mavlink telemetry as the source).

Also, in your sample, there is > 15% data loss whereas at 19200 I got just one CRC error in more than an hour's testing.

From your sample:

$ ./hxreader mavex.txt # simple test tool for parsing a mav hexdump
...
OK   (109 6d) 9 68 33 44
Fail (109 6d) 9 69 440a 440d :  fe 09 45 33 44 6d 00 00 00 00 b4 9f 50 00 00 0a 44
...
135 msgs:  good 111,  bad 24

@stronnag
Copy link
Owner

stronnag commented Feb 5, 2018

merged into development ... so you should use that

git pull
git checkout development
git pull
make && sudo make install

@markandkymward
Copy link
Author

Stronnag - Thanks for this. I have to pause testing the GhettoStation setup because I seem to have trashed yet another HC05 serial bluetooth device. Another pile is on order. I did manage to get output transferred to my second computer before the HC05 died. Those devices are so finicky.
I'll be back to you after the postman does his thing.

@markandkymward
Copy link
Author

I found my old stash of HC05s. I really need to clean up my shop. I verified that I am indeed getting connectivity via the --forward-to. BT baud rate set at 19200 and used --forward-to /dev/rfcommx@19200 switch. Set gsettings org.mwptools.planner forward all. Ghettostation TM input rate set at 19200. Tried all applicable protocols, multiwii, lighttelemetry and mavlink. No joy on connecting. Same setup was previously working when receiving LTM data via 3DR radio. Looks like either the "MAVEmu" data packets aren't quite Mavlink or something is happening in the MWP forwarding?

@stronnag
Copy link
Owner

stronnag commented Feb 6, 2018

Please try the latest development commit. A few improvement, including BT forwarding working with BT addresses as well as /dev/rfcommX device nodes, tolerance of the forward device failing / not keeping up and retrying opening the forwarding device if it fails.

btw: your earlier note that using a BT address for forwarding caused mwp to lock up or slow down was most likely a symptom of the the link being too slow and blocking everything, which is now fixed.

If you're still having problems with 1.037.686 (023080b) or later, please post the mwp console output here.

@stronnag
Copy link
Owner

stronnag commented Feb 6, 2018

Also, as of 1.037.686 (023080b), gsettings forward 'minMav' only sends the mavlink understood by ghetto-station, while 'all' will forward everything.

@markandkymward
Copy link
Author

markandkymward commented Feb 6, 2018

'minMAV' did the trick. Works like a champ. In summary - ground station running a tinkerboard w/tinker OS. Receives telemetry data from short range bridge (fancy term for bluetooth) on the TBS Crossfire. TBS Crossfire is configured to output MAVemu data. This is on /dev/rfcomm0. BT baud rate is set to 19200. Ghettostation antenna with HC05 BT adapter is connected to the groundstation via /dev/rfcomm1. mwp --forward-to /dev/rfcomm2 command line. As long as I have Crossfire connectivity, I have valid gps position data being fed to the tracker.

Recommend close. Thanks Stronnag!

@stronnag
Copy link
Owner

closing, as the specific dev branch is now merged into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants