-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRXL2 rc protocol #16620
Comments
Spektrum seems to discontinue products using the old protocol now. So this should be interesting for Spektrum users. |
I'm also interested in this -- the pinouts seems to match. I'm using:
|
Oh yeah I forgot all about this... I got pretty far but then ran out of steam. Communication worked and I had some basic telemetry working going back, it was mostly a matter of cleaning stuff up to make it presentable for submission. If someone is interested in bringing life back into this, I can send my patches, but they're likely to be very stale at this point. |
Yea, if you upload a branch (or I could email you) I'll take a look and give it a try :) |
I had three branches locally that I don't think were ever completed. I forget what the rssi branches were for, but they were likely prerequisite for the main changes on pr-spektrum-telemetry (bulk that that includes srxl support). I apologize for the archaeological expedition I've sent you on, but here it all is: https://github.com/kekiefer/Firmware/tree/pr-spektrum-rssi Take a look and let me know if I can help. |
I just completed a test setup today for this, so also interested. |
Nice. I can also help out with the testing part. Do you prefer an implementation using the Spektrum repo as a git submodule, or an independent implementation? (Is the license ok for your project?) |
I quickly looked at the code and it looks generally good. The Spektrum code is pretty complex and I would much prefer to work off the commits shared here than trying to pull the Spektrum implementation in. |
Ahhh, would you please clarify? Do you mean you have some hardware you'd want to verify the patch against? |
@kekeifer
Anyway, I got this branch rebased on I'm still getting up to speed on the codebase, so apologize if I ask any stupid questions... |
@teyrana the
And yes, this is to use the half-duplex UART. When singlewire mode is enabled, the serial port was configured with |
I have the hardware setup to test, but I don't realistically have time on the HW front. |
@kekiefer @LorenzMeier Ah. Thank you for clarifying. I'll post my progress image once I have something interesting working on my side. |
Since you really require singlewire for this to work, it's not really any better to check the board first, you can just try and fail later if it doesn't work when you try to set it up. This is what frsky does in |
Okay, I'll give that a try. I don't suppose there's another driver I could use as an example, is there? Still working on learning the code base -- particularly how board-specific hardware is defined. Please bear with me :/ WIP Branch is at: |
The right example module is this one: https://github.com/PX4/PX4-Autopilot/tree/master/src/drivers/rc_input You can see that two other telemetry systems have already been implemented. It also references this DSM parser implementation: https://github.com/PX4/PX4-Autopilot/tree/master/src/lib/rc |
okay, so this is getting complicated... --cut-- |
I noticed there's multiple reference locations for the dsm parsers... is there a particular reason not to merge this patch with the existing |
I'm not sure what you mean. IIRC the |
I have a development branch .... building. The debug port connects, and I can run 'rc_input', but the module doesn't seem to be producing output? |
Hi all, I am somewhat new to this so forgive me if I am missing anything obvious. I currently have a Holybro PX4, a Spektrum DX8e and a Spektrum SPM4650 receiver. I am able to successfully bind the receiver and transmitter, however QGC does not seem to recognize this. I get the following error when attempting to calibrate my radio: "Detected 0 radio channels. To operate PX4, you need at least 5 channels." Correct me if I am wrong but this is likely occurring due to the unsupported SRXL2 protocol right? I have seen that there is an unsupported workaround using ArduPilot and one of the telemetry ports. I would rather not do this, but that may be my only option (aside from purchasing a different receiver). Is there anything I can do to help you all with developing this? Thanks for your help, |
@srodgers070 The things that would be helpful are (1) understanding of the development board hardware at a detailed level , (2) willingness to code, and (3) flight testing ... Unfortunately, I have not been able to reproduce either the telemetry or the control functionality, even on the bench, but when it's ready for testing, I will definitely post here. |
Update: First bytes: I've gotten the fmu to read traffic from the receiver:
If you're curious, the above is a handshake request frame from the receiver. Unfortunately, the receiver won't do anything interesting until it receives a handshake reply... so I'll have to work on that before we see anything interesting. |
|
I was using the DSM/SBUS RC port on the pixhawk 4. You'd have to look up what that is mapped to.
I'm pretty sure it was all going through rc input, based on the fact that I had changes there. |
Ah. Okay, that's about where I got, as well. I guess it's just too long ago, eh? |
Did you open the port for read/write? What is the error you are seeing? No error message but no messages on the logic analyzer? |
Have you put the port (the RX pin) into single wire mode? Do you know how to do that? Similar to this, but MAKE SURE that it is configured for the RX pin, as you will otherwise not receive anything after that because the TX pin is being used:
|
Update: It seems to be workingBy "working", I mean:
The settings I'm currently using are:
p.s. I don't have a logic analyzer. Sample traffic:
|
@kekiefer |
For Discussion:
Is the mapping between throttle percentage and pwm width explictily documented anywhere? I don't have a sufficient physical hardware to test this (i.e. airframes) and I wouldn't want to base any implementation off one airframe, anyways.... |
Example debug logs(including control frames from the SRXL receiver)
|
@teyrana I rebased https://github.com/kekiefer/Firmware/tree/pr-spektrum-telemetry in the last couple days, and now baseline reception of RC data via SPM4649T is working again. Something is wrong with the way it plays with the telemetry task that I haven't looked into yet. |
@kekiefer Do you have any advice for how to scale the channels? |
The protocol for these receivers is handled with the same routines as for dsm -- I'm curious if the code I sent will also work for your receiver. The telemetry task won't start by default, and so normal rc reception should work. In addition to fixing telemetry, the other thing that needs to be sorted is pairing the receiver. I left a routine |
I'm asking a more specific question -- what are the specifications, on the px4 side, for what the expected channel values are -- in a uorb "input_rc " msg? The units are completely different -- what percentage of the pulse-width maps to what percentage of throttle (+/-)? But the SRXL protocol seems to have different units than the "dsm" protocol? (percentage throttle vs usec of pwm signal at ..... ¿50hz?) Furthermore, the existing code is.... not the best documented. It contains fields the SRXL spec doesn't -- SRXL spec, p14: "7.7 Control Data Packet" And also contains magic numbers which don't apply to SRXL.... or at the very least, aren't apparent -- the limits in the existing dsm.cpp are applied after several transformations which are also undocumented / uncited.
I mean, I have a pared-back branch that's working... I could just submit that, and let people start commenting on actual code... perhaps that would be more productive? |
A PR is available that implements basic SRXL2 support: see #17555 . |
Resolving this issue would be very helpful, since I'm not aware of Spektrum still selling SRXL (rather than SRXL2) receivers. I hope this PR doesn't get abandoned, but would anyone else please post currently sold Spektrum receivers that can directly connect to the SBUS/DSM port without needing the SRXL2 feature? |
@mfry90 I suggest you ask in the slack -- you'll get many more eyes on it, than here. |
Hi all,
I was looking for a receiver compatible with my radio (Spectrum DX8G2) and I found that Spectrum suggests (here) the following models for copter: SPM4650 and SPM4651T.
Both of them use the new SRXL2 serial protocol, but unfortunately, PX4 doesn't support it right now and the flight controllers don't have a dedicated port.
I would like to know if in the next releases there will room for the integration of the SRXL2 protocol or not.
I found here the open-source library developed by Spektrum, so the work should be a matter of integration, but honestly, I don’t know where to start.
Is there anybody interested in the topic?
The text was updated successfully, but these errors were encountered: