FrskySP
Frsky Smart Port protocol library
 All Classes Files Functions Variables Macros Pages
FrskySP Documentation

Arduino library for Frsky Smart Port protocol.

This library is not designed to decode data on the transmitter, but on the receiver side. OpenTX makes the rest of the job on the transmitter.

This development is completely independent of Frsky or OpenTX.

What to know about Smart Port

Receiver behavior

The receiver polls in a cyle of (a bit more of) 11 ms.

byte description
0x7E poll header
ID physical ID (1-28) computed with a CRC (see FrskySP_sensor_demo/FrskySP_sensor_demo.ino for the full list of polled IDs)

Sensor behavior

Genuine Frsky sensors: the sensor answers to every pool on its physical ID to announce its presence. If no data can be transmitted (no refresh), the sensor answers by an empty packet and a false CRC (type 0x00, ID 0x0000, value 0x00000000, CRC 0xFF).

byte(s) descrption
1 type (only 0x10 at now)
2 sensor logical ID (see FrskySP.h for the full list of IDs)
4 value
1 CRC

Slowness considerations

There are 2 recurrent discussions on Internet, that are related to what is used in this code and examples:

Although, you must be careful around those issues:

Connection draft

Smart_Port_bb.png

On this circuit, RX will hang after serial begin. There is a workaround that inverts the TX pinMode to INPUT and back to OUTPUT.

Version
devel
Author
Jean-Christophe Heger
See also
https://github.com/jcheger/frsky-arduino/ - source of this library
http://www.frsky-rc.com/
http://www.open-tx.org/
ChangeLog:
2014-06-27 - public devel release
Todo:
write an example to simulate an X8R receiver
Bug:
There is an unsolved bug with one value only, until now. While trying to send airspeed value 100 mph, converted to knots, the receiver will not detect the sensor and not send the value to the remote neither. It works perfectly with 101 or 99 mph, but 100 mph will hang.
FrskySP.sendData (FRSKY_SP_AIR_SPEED, 100 * 10 / 1.15077945); // packet: 0x10 00 0A 64 03 00 00 7E