fishpepper / OpenSky

opensource implementation of the frsky protocol for multiple targets (D4R-ii, VD5M)
http://fishpepper.de/projects/opensky/
GNU General Public License v3.0
154 stars 70 forks source link

Telemetry Broken on D4R-II #11

Closed Zebble closed 7 years ago

Zebble commented 7 years ago

Can't seem to get telemetry to work on a D4R-II.

If I set DEBUG 1 and TELEMETRY_DO_TEST 1, I get the following no matter what baud rate I set the FC (Naze32 running BetaFlight 3.0.1) to, or if I switch between telemetry_inversion ON/OFF.

Log always just shows a bunch of S's when in this mode. S's stop when I pull the telemetry pin from the FC.

Telemetry works by swapping in a stock D4R-II.

OpenSky - BUILD_TARGET - (c) by github.com/fishpepper

uart: init done wdt: init timeout: init storage: init hal_storage: freeing i2c bus with clock train hal_storage: i2c free again storage: reading hal_storage: i2c read_buffer(0x0000, ..., 51) hal_storage: reading 51bytes: 01 B9 BB 02 AC 6B 2A D4 93 52 11 BB 7A 39 E3 A2 61 20 CA 89 48 07 B3 70 31 D9 98 57 16 C0 7F 3E E8 A7 66 25 CF 8E 4D 0C B6 75 34 DE 9D 5C 1B C5 84 43 14 . done. hal_storage: read done storage: loaded hoptable[] = 02 AC 6B 2A D4 93 52 11 BB 7A 39 E3 A2 61 20 CA 89 48 07 B3 70 31 D9 98 57 16 C0 7F 3E E8 A7 66 25 CF 8E 4D 0C B6 75 34 DE 9D 5C 1B C5 84 43 frsky: init cc25xx: init frsky: cc25xx partnum 0x80 version 0x03 frsky: got valid part and version info frsky: configure frsky: configure done frsky: BIND jumper set = NO -> no binding frsky: using txid 0xB9BB frsky: calib pll frsky: tuning hop[] = 02 AC 6B 2A D4 93 52 11 BB 7A 39 E3 A2 61 20 CA 89 48 07 B3 70 31 D9 98 57 16 C0 7F 3E E8 A7 66 25 CF 8E 4D 0C B6 75 34 DE 9D 5C 1B C5 84 43 frsky: calib fscal0 = 20 frsky: calib fscal1 = 1A 23 20 1C 25 22 1F 1B 24 21 1D 26 23 1F 1C 25 22 1E 1A 24 20 1D 26 22 1F 1B 24 21 1E 26 23 20 1C 25 22 1E 1B 24 20 1D 26 23 1F 1C 25 21 1E frsky: calib fscal2 = 0x0C frsky: calib fscal3 = 0xAC frsky: calib pll done frsky: init done adc: init sbus: init sbus: init done failsafe: init telemetry: init soft_serial: init SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

fishpepper commented 7 years ago

1) Please give me more info about how you connected it (which pin goes to which fc pin).

2) FC settings:

3) which fc

The telemetry do test stuff is just for internal testing, however a printed 'S' means startbit framing error/invalid. So probably the invertion is configured wrong. So it is probably just a matter of configuration settings ;)

Zebble commented 7 years ago

Thanks fishpepper!

  1. FC is connected:

Naze32 GND and RX Pin 0 (+5V) connected to D4R servo channel 4. Naze32 RX Pin 4 connected to D4R servo channel 4. Naze32 RX Pin 6 (softserial1 TX) connect to D4R Rx pin on 4-pin molex.

Power is connected to one of the other servo ports on D4R to power the D4R and Naze32.

Naze32 has BaseFlight 3.0.1:

Softserial is enabled, and softserial1 is set to FrSky Telemetry, 9600. Telemetry_inversion is set to ON. Same results if telemetry_inversion is set to OFF. Receiver is set to serial, SBUS, on UART2.

OpenSky compiled with SBUS_ENABLED and disabled SBUS_INVERTED.

Naze32 doesn't have built-in SBUS inversion, so this seems to work as expected. SBUS is rock solid.

OpenSky sbus inversion is off. Telemetry inversion in BaseFlight ON or OFF - no difference.

3.

Naze32 Deluxe

fishpepper commented 7 years ago

I do not know how they implement softserial in your fc firmware. You could try to enable

define HUB_TELEMETRY_INVERTED

This would fix your issues when your softserial is outputting inverted serial data. Telemetry inversion on/off does not have any effect on stm32f1 targets (no hw support for that).

Zebble commented 7 years ago

Thanks fishpepper,

I will give this a try this evening. FYI, if I pop in an original D4R with original firmware, telemetry works perfectly through softserial1 with telemetry_inversion = ON in BetaFlight. If I set telemetry_inversion = OFF, it stops working, so sounds like the soft inversion through softserial1 on the Naze32 is actually working through BetaFlight.

Zebble commented 7 years ago

Quick question:

Do you have a D4R with your firmware working with telemetry with a CleanFlight or BetaFlight flight controller? Which controller?

Zebble commented 7 years ago

Hey FishPepper,

s3v0 on the forums appears to be having the same issue. He discovered that the config.h for board/d4rii/ is the only config that doesn't have HUB_TELEMETRY_PIN or HUB_TELEMETRY_PORT defined. Could this have anything to do with what we're experiencing?

fishpepper commented 7 years ago

ok, it was my fault... I messed up some defines/detections. I verified it to be working with the following setup:

define HUB_TELEMETRY_INVERTED

define SBUS_INVERTED

(i connected it to a sp racing f3 on bf 3.0.1)

please re-test with current master. you might need other settings as i do. HUB_TELEMETRY_PIN/HUB_TELEMETRY_PORT is only used on cc25xx targets.

Zebble commented 7 years ago

I left hub telemetry uninverted, and inverted SBUS. Naze32 works exactly as expected. No inverter required on the SBUS is so nice! Great work FP!