Px4-autopilot: Spektrum DX8G2 doesn't work with PX4

Created on 9 Dec 2020  路  21Comments  路  Source: PX4/PX4-Autopilot

My Spektrum radio doesn't work on PX4 software.
I am using the DX8 G2 transmitter and the SPM9645 remote satellite receiver.
According to the documentation, all the Spektrum models are supported but reading the discussion group and the repository issues I found that several people had similar problems (for instance see here).

To test my system I temporarily switch to Ardupilot, where everything works fine. Hence I guess the problem lies in the PX4 software, where every time I try to calibrate my radio I got the following message from QGC: "detected 0 radio channels. to operate px4 you need at least 5 channels". (Obviously, the radio has already been manually bound).

I saw that recently there has been some software modification and decoding improvement, but from my side, the problem is still there.

I checked my radio setup and the PX4 source code, I have noticed (but I am not completely sure about) that the PX4 code (RCinput.cpp and dsm.cpp) manages the DSMX protocol with a frame rate of 11ms.
My setup seems to use the DSMX protocol with a 22ms frame rate. This is a config that I am not able to change.
Is it possible that this is the source of error?
Can someone help me and all other people who bought the Spektrum radio system?
Someone from the Maintenance Team to talk with?

Thanks in advance

bug

All 21 comments

I am looking into this.

Thanks @LorenzMeier
I checked again... I don't know if the problem is on the frame rate. Looking at the source code seems it can manage the DSMX/22ms frame rate configuration.
Is there anything I can do to report the issue more precisely (log, dmesg, ..)?

Could you take a picture of the setup of the autopilot setup? I just want to make sure I understand what is connected to what and which HW you're using.

Here the pics...
IMG_20201210_154639

IMG_20201210_155838

The pixhawk is powered by USB cable and there is attached only the satellite receiver.
In the following the dmesg print:
Screenshot 2020-12-10 at 16 11 18

Is there something wrong with the hardware?
I excluded the possibility since with Ardupilot the setup works...

What is the output of px4io status on the shell?

here you are:
Screenshot 2020-12-10 at 16 22 54

Screenshot 2020-12-10 at 16 23 02

sorry, I need to instal all the required packet to launch mavlink_shell.py...

I have an SPM9645, I will cross-test.

thank you.
Let m know if I can help.

I have tested several software version, but all the time the radio doesn't work.
I can tell you that Ardupilot runs on ChibiOS. Does it matter?

Hi @ilNonn0 and @LorenzMeier , in case it saves you any time, I investigated this briefly in regard to #15201 but didn't have time to actually fix anything. I spoke briefly with @dagar , but the most likely reason the QGC issued bind command isn't working is because it is calling here but it likely needs to call here. I might be wrong because I obviously haven't fixed it, but just in case it saves anyone some time debugging, FWIW.

Thanks, @mcsauder.
Tomorrow morning I am going to invstigate better the poblem.
I would like to debug step by step through the code but first I have to rearrange cables and some old electronics in the Lab in order to realize a SWD interface.
By the way, I skipped the bind issue. My problem is that even with the radio already buond (manullay, i.e. without using QGC), I got not channels recognition pressing "Calibrate" button in QGC.

Hi @ilNonn0 , what I found was that the receiver that I used to bind the satellite impacts the serial data stream format and causes the PX4 driver to not communicate properly with the satellite. For example, an AR6210 works fine to bind satellites but as a 6 channel will give you 22ms DSMX and only 6 channel capability. However, with an AR9020, labeled "with X-plus technology", the satellite will bind just fine as 11ms DSMX but will fail to communicate with the PX4 driver. If you find another (preferably older) receiver that is SRXL, not SRXL2, or if you could use the native PX4 bind function I suspect your issue will be resolved.

Intermediate results: I can reproduce this on my local setup (which used to work and is unchanged). I've already tried a couple of things like downgrading the DSM parser, which didn't yield the desired outcome. I will work this over the weekend. Stay tuned and thanks for the patience!

@davids5 I'm also considering the UART layer since the main thing that changed was the NuttX upgrade.

Could you give this branch a try? https://github.com/PX4/PX4-Autopilot/compare/pr-dsm_bind_always_dsmx_11?expand=1

It defaults to binding as DSMX 11 ms (recommend by Spektrum). https://www.spektrumrc.com/ProdInfo/Files/Remote%20Receiver%20Interfacing%20Rev%20A.pdf

Selecting the 11ms mode automatically allows either 11ms or 22ms protocols to be used.

Hi @dagar, sorry for the delay. It's Christmas time and I am at home with a personal laptop not able to build the firmware...
I struggled a bit to get the .bin file.
I just answer into the link you provided, however, the firmware doesn't work.
I saw your changes, but I think the main problem isn't the binding process since this can also be done "outside" QGC (in my case I used the procedure shown in the Spektrum manual). What do you think?

@ilNonn0 Sorry for the delay - I have been out over Christmas, but I'm spending more time on it today. I had first to build the test setup, which I have now.

We are making progress, but not finished yet: https://github.com/PX4/PX4-Autopilot/pull/16469

I've also ordered an NX10 so we get a head-start on SRXL2 and potential issues there.

Fixed here: https://github.com/PX4/PX4-Autopilot/pull/16470 - works for me now - could you re-test and report back?

@ilNonn0 and @LorenzMeier , I bench tested current master with a Spektrum DX8 G2 and spektrum satellite serial receivers spm4647 and SPM9645. Everything works as expected. Nice work @LorenzMeier

Hi, @LorenzMeier great job.
Now everything works here: Spektrum DX8G2, remote satellite SPM9645 and DSMX 22ms as binding protocol.
First I have bounded the transmitter with the receiver, then I calibrated the radio Channel successfully.

Initially, I had troubles since I triggered the binding process by the Spektrum menu and it doesn't work, later I used the bind button at the radio power on and it immediately works.
In my case, I left the SYS_USE_IO parameter to the default value (1). Putting it to 0 I was not able to bind the radio.

What was the problem? Didn't the parsing address the DSMX 22ms case?

The root cause is a horrible protocol design by Spektrum where some of their receivers communicate without a header and or checksum. We tried to harden the parser, but that required you to use the PX4 binding process (which always worked on FMUv5 and FMUv2/3 if you had your system fully disarmed, but most people have the safety off by default - something that I've now allowed).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dk7xe picture dk7xe  路  3Comments

Stifael picture Stifael  路  3Comments

huangwen0907 picture huangwen0907  路  3Comments

julianoes picture julianoes  路  3Comments

zhanghouxin07 picture zhanghouxin07  路  5Comments