davwys / arduino-sport-to-mavlink

Arduino Sketch for converting FrSky S.Port telemetry data to MAVLink format
18 stars 6 forks source link

S.Port Voltage level incorrect #4

Open Nannk opened 10 months ago

Nannk commented 10 months ago

Using arduino nano (usbC variant), the data in the mavlink packages is all the default values, even though the S.Port is enabled and Taranis shows telemetry. Mission Planner does not want to connect too. Right after the start of the connection process the interface updates time but innediately goes into Trying to reconnect mode. After 30 seconds it fails with No Heartbeat packets recieved. In Mavlink inspector the data only shows up during the connection process. image

Ive tried to change the baud of the serial output to match the baud of s.port (57600), but it results in the same behaviour. The s.port signal is present on the pin im connecting to, i can see it on a scope, and rs232 converter spews data in the serial console.

I believe im connecting to the wrong pin on the arduino, though it does not explain why the mission planer does not work.

upd: The qgroundcontrol seems to work better than ardupilor mission planer, as it does connect to the serial and reads the mavlink packages in mavlink inspector. image

upd2: there are 2 voltage levels present on the same wire - 5v signal from arduino (how? its 3.3V ic) and 3v signal from R9M. I believe that is not normal and is the reason for that reading issue.

davwys commented 10 months ago

Did you happen to omit the resistor on the s.port line? That resistor is necessary for the correct logic level voltage, if I recall correctly. It's been a few years 😄 Is everything wired exactly as shown in the diagram? Maybe you could post a picture of your hardware setup.

Nannk commented 10 months ago

I did use the correct resistor, as described in the Readme. I also connected directly to the pin. The result was the same. I even tried to use a bidirectional logic level converter. Didnt work. RS232 adapter to serial did read the data so its not the logic level problem (lowest threshold for high is 3v iirc). So ive tried to look at the data and found out that the existing documentation from yaapu does not correlate with the data ive captured from r9m s.port pin using rs232 converter (i believe it is communication between r9m and the taranis radio).

Example:

7e1b100008fe7c8b00e0
> Host (taranis): 7e 1b-(P.ID27) 
> Sensor (R9M): 10-(Sensor Data Frame) 0008-(???? no data id with that value) fe7c8b00-(data i guess) e0

but if

> Host (Taranis): 7e 1b-(P.ID) 
>Sensor (R9M): 10-(Sensor Data Frame) 00-(??) 08fe-(L.ID) 7c8b00e0-(data) (no crc) 

i guess it makes more sense

Im waiting for a more advanced logic analyser, but the data captured with a scope did align with what rs232 converter did find.

Nannk commented 9 months ago

The logic analyser confirmed that the data captured with rs232 concerter is, indeed, the data sent by the radio.