FrSky X4R-SB Smart Port hack and Naze32

Continuing from my previous FrSky X4R-SB hack (read for some context), I really wanted Smart Port telemetry to work with Naze32. I forked the original baseflight firmware and added two key new functionalities:

  • implemented the Smart Port telemetry protocol
  • GPS can be assigned to any serial port (as opposed to only one port)
    • this is important because we are running out of ports
    • I made it possible for GPS to be connected to software/bitbang serial, to free up a hardware UART

please read my fork’s wiki, at this time, I can only test with my limited hardware, more help testing/coding would be appreciated.

Update 10/26/2014: I was asked to make the same contribution to Cleanflight, which I have done today.

The new forked firmware requires a circuit modification on both the X4R-SB and Naze32, see pictures:






Quick Demo Video 10/25/2014:

(do not confuse this X4R-SB with the D4R-II, the D4R-II uses a completely different protocol, I am not using a D4R-II because it does not use S.BUS)

21 thoughts on “FrSky X4R-SB Smart Port hack and Naze32

  1. Martin

    Hi Frank

    after reading your hack i did some my own, so i did almost the same on my X8R and the scematics are identical.

    So i did the hardeware change and now i am trying to find a firmwarefile witch is supporting the Smart Port Telemetry but the latest baseflight firmwarefiles icould get have no provider 2.

    Cause i just have startet to look at the code i would like to ask you if i could get the fimeware hex file from you ?

    thx in advance

    Martin

    PS: xorry for my english, i am from austria 😉

    Reply
    1. Admin Post author

      In the github repo, under the obj folder, there’s the hex file

      By now, it is slightly out of date in comparison to the master baseflight repo

      Reply
  2. arekm

    Wouldn’t putting chip like TXB0108 between receiver and naze32 side be more clean/compatible solution? No need to modify existing hw, keeping compatibility with “official” smart port.

    (just asking, new in this thing and I’ll be trying to use smart port)

    EDIT FROM ADMIN: arekm later sent a correction: the TXB0108 is not the correct part number.

    Reply
    1. Admin Post author

      Compared to having an entire “inverter cable”, my solution looks more clean visually, and every gram counts, especially when I 3D print my frames because plastic is much heavier than carbon fiber.

      If I need compatibility with official SmartPort stuff, I’ll just buy another RX unit.

      Reply
  3. Jeff

    Do you know if it is possible in clean flight to use softserial for Smart Port telemetry? You could then just enable telemetry inversion in software. (using flip32+)

    Reply
  4. ImTrying

    I’ve tried implementing this mod but have had no luck so far. I’ve got:
    feature TELEMETRY
    telemetry_provider = 2
    serial_port_1_scenario = 1
    msp_baudrate = 115200
    And I’m using the v1.7.2 build which looks like it contains your modifications.

    First I don’t understand why telemetry_provider=2 instead of 3.
    Do you have any hints before I pull out a scope?

    Reply
  5. Beren

    Would a converter cable be possible? The X8R which is hard to perform this mod on comes with most X9D’s these days. Do you think a converter cable would be possible or easy?

    Reply
    1. Admin Post author

      Of course a converter cable is possible. I’m pretty sure somebody already sells them somewhere. Also I already designed and tested such a cable, and gave the design to somebody. If I can get permission to post it, I’ll post it here.

      Reply
  6. Dirk Basford

    Hey Frank,

    I’m using an X8R with a Naze 32 on Cleanflight and trying to get telemetry working. Looks like to necessary software changes for smart port were pulled into Cleanflight and I plan on building a bi-directional inverter cable of the schematic found here http://www.multiwii.com/forum/viewtopic.php?f=8&t=4507. My question is do I need the pull up resistor on the Naze still using this approach?

    Reply
    1. Admin Post author

      Technically, R2 in his schematic is the same thing as the pull-up resistor. So I’m going to say you do not need another one.

      Reply
      1. sguarin

        That schematic its for full duplex, and frank’s code sets cleanflight USART as half bidirectional on TX.
        Is any schematic to aproach this scenario without modding the receiver?

        thanks,,
        Sebastian

        Reply
  7. John

    Would the frsky s.port to uart converter do the trick? It’s not as clean/light, but I’m not a good enough solderer to trust myself around my receivers…

    Reply
  8. Marek

    Hi,

    I have found FrsKy SPORT to UART converter.
    Is it possible to avoid the s.port hack and use the converter to uart connected directly to the rx/tx on the naze?
    As the smartport telemetry protocol is already a part of the clearflight, would that work wihout any additional hacking?

    Thanks!

    Reply
  9. Dan Holmes

    This is great! Love this and your s.bus solution. I hope you can help with my situation.
    I have a problem with my d4r-ii. I’m using a flip32 which doesn’t have an inverter like the naze for me to use the telemetry (non smart port) unless I use soft serial, but I would also like to use the led functions which won’t run with soft serial active. So could I bypass the telemetry inverter on the D4R-11? How would I go about working out what to do?
    Thanks,Dan

    Reply
  10. Matt

    Is this still the best way (no added cable inverters) to get SBUS and telem working on a naze rev5 with the x4r? I was hoping to only do the SBUS non-inverted mod. I only need simple batt telem and rssi, can’t really see myself using all the other data.

    Reply
  11. Marcelo Farinon

    Hi…I have the same questions above…I’ve been trying to find a solution without soldering my X4R Sb. Any news especially now with CleanFlight 1.10? Tnks.

    Reply
  12. Stephen Sumner

    Yes since the Naze32 rev6 has an integrated telemetry inverter no reciever mod right? But what about the resistor mod on the FC???

    Reply
  13. Reuben Abrahams

    Hi Frank

    I see you mention on the photo of board R28 and R24 .. are changes required here ? Also can this modification work with Pixhawk Telemetry .. or i need a different solution .. I have D4R II working with pixhawk using one wire connected direct to pin 31 on the stm32 rx unit … but not sure of the settings required for the x4r -sb rx any help really welcome ..Thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *