mstrens / oxs_on_rp2040 Goto Github PK
View Code? Open in Web Editor NEWversion of openXsensor to be used on raspberry pi pico RP2040 (more protocols, more functionalities)
version of openXsensor to be used on raspberry pi pico RP2040 (more protocols, more functionalities)
(Put RPM aside, was hoping someone steps in with testing RPM, but ...)
I received my 2nd. BETAFPV nano RX. Both RX work as no. 1 RX with RP2040 on my test board.
For testing diversity, I disabled 'model match' in both RX and also disabled telemetry in no. 2 RX.
Version = 0.3.0
Function Code Pin (255=disabled)
Primary channels input PRI 9
Secondary channels input SEC 13
Telemetry TLM 10
GPS Rx GPS_RX 11
GPS Tx GPS_TX 12
Sbus OUT SBUS_OUT 255
RPM RPM 255
SDA (baro sensor) SDA 14
SCL (baro sensor) SCL 15
PWM Channels 1, 2, 3 ,4 C1 / C4 0 1 2 3
PWM Channels 5, 6, 7 ,8 C5 / C8 4 5 255 255
PWM Channels 9,10,11,12 C9 / C12 255 255 255 255
PWM Channels 13,14,15,16 C13/ C16 255 255 255 255
Voltage 1, 2, 3, 4 V1 / V4 26 27 28 29
Protocol is CRSF (=ELRS)
CRSF baudrate = 420000
Voltage parameters:
Scales : 0.972000 , 0.972000 , 0.972000 , 0.950000
Offsets: 6.000000 , 5.500000 , 6.000000 , 5.000000
RPM multiplier = 1.000000
Baro sensor is detected using BMP280
Sensitivity min = 100 (at 100) , max = 300 (at 1000)
Hysteresis = 5
Foreseen GPS type is Ublox :GPS is detected
Failsafe type is HOLD
Config parameters are OK
Tested like that:
On testboard, no.1 RX TX nand RX connected to RP2040, no.2 RX TX NOT connected to pin 13.
Radio ON!
Testboard ON!
All working normal, telemetry on radio active, PWM output on RP2040, both RX LED steady on, RP2040 green blinking
Then I connect no.2 RX TX to pin 13.
PWM freezes, RP2040 LED changing colors.
Disconnect no.2 RX TX pin 13
PWM working, LED2040 green.
Any idea?
br - KH
Please do the correction in param.cpp 'main' V1/4
I am uncertain about the shifted PWM values ... Have a look here https://wiki.rc-network.de/wiki/PWM
Leave it, like it is, or corect it?? I can do it here for me by modify the values ...
Good news, more interest in your project!!
https://www.rc-network.de/threads/expresslrs-crossfire-f%C3%BCr-fl%C3%A4chenmodelle.11918292/page-4
br KH
Started playing with V1/4 using 1 and 2 1.5V cells.
Messung V1/4 mit Batteriequelle
Pin auf open GND 1.5V 3.0V
V1 (26) 6.8V 7.6V~ 15.2V 30.0V
V2 (27) 6.8A 8.1A~ 15.2A 30.0A
V3 (28) 71mAh 75mAh~ 152mAh 299mAh
V4 (29) 6% 7%~ 15% 30%
Strange, that when I leave one pin open, I see a stable value, but connecting that pin to GND, there is some fluctuation of the value (~)
I have been trying to build a "full-featured" receiver with telemetry (Baro) and four PWM outputs based on a FrSky R-XSR.
Telemetry and PWM work each alone. But if I activate both at the same time, i.e. assign a pin to PRI and TLM, the PWM outputs work but no telemetry data is transmitted anymore.
I have also tested this with a FrSyk X8R, with the same result.
Please let me know if you need further information or if I should do some testing.
CHL
Hello Mstrens,
I read your post in RC Groups Forum.
I have a Account, but "YOUR ACCOUNT IS CURRENTLY FLAGGED AS UNCONFIRMED!" , i wait in vain three weeks for an Answer or Email from any Admin.
Something happened in Ver.0.5.8 with my FrSky X20S Handheld.
Normaly,
oXs V1 is VFAS in Volt
oXs V2 is FASS in Ampere
oXs V3 is Temp2 in Degree °
oXs V4 is Fuel in %
Now Temp2/V3 doesnt show me anything ---
and Temp1 was FIX SATELLITES now ---
I made a new search for Sensors, and Reset the board several times, but nothing happened.
I read the telemetry_doc.txt but i dont understand, why the values disappear.
br,
Torsten
Hi there,
this is my first posting here. please advise, if this is the wrong place…
just successfully installed the compiled firmware. a gps module is already ordered
i was looking and would appreciate a possibility to log all the data directly in the RC Model on MicroSD. Similar to JLog or SM gps logger
Sorry, i can‘t examine, whether this would be technically possible or not
regards
stefan
Hello Mstrens,
I made some Test with the new Release 0.5.2-hott
With my FrSky X20S S.Port and SBUS ,i get very high GPS Alt value. Normaly ca.40m but with Ver.0.5.2-hott ca. 96-147m
With my MC28 GR24 HOTT, it shows 40m GPS Alt.
Have you any idea?
br,
Torsten
u-blox GPS with M10 chipset do not work anymore with oXs. Eventually this is because NAV-SOL messages are not supported.
From u-blox M10_ROM_5.00_ReleaseNotes_UBX-20050981:
5.2.3 Removed UBX messages
UBX-NAV-SOL PUB Use UBX-NAV-PVT instead
Is it possible to implement NAV-PVT instead or additionally?
I tested GPS, servo output and baro sensors here on my test board.
The servo values have been explained, but about the baro sensors, I have two questions.
I tested with MS5611, SPL06 and BMP280.
#1. The BMP280, you can get on shield normally has 0x76. The I2C address of BMP280 can be found in BMP280.h and in main.cpp. So on both files the I2C address has to be modified!? Please confirm.
#2. Values with MS5611 and SPL06 made sense here on the bench, but the BMP280 values looked a bit strange. High alt and vario values. Cross checked with different BMP280s, but still 'bad' values.
How can I help?
Besides, the new 'configuration' for basics in terminal is certainly helpful. but it should be pointed out, that platformio is necessary for modifications. Platformio IDE can be a bit daunting for 'normal' users like me, so maybe it should be said, that platformio CLI is sufficient to do the job.
br KH
The old OxS supported the very popular HoTT protocol for telemetry.
Is it planned to migrate this into the RP2040 project?
What about current and capacity?
Of course a current is nothing else than voltage at a sensor (shunt or hall sensor) but it is a different parameter in the telemetry protocol. Same applies to the capacity. Only FrSky calculates that in the transmitter software but not the others.
Best regards
Onki
P.S. I really like this project and the tiny little Pi Pico Zero. The configuration through the terminal is much more convenient than the config file solution.
Good morning Mstrens,
I decided to test the new version with my FrSky X20S and S.Port protocol.
Thank you for your work.
Many greetings,
Torsten
it would be nice if oXs would support I-Bus for the Flysky RX. They running often on Opentx with MPM
Playing with voltages on 'main' it seems that I cannot reset the values for V1/4 back to 255, once set to a pin.
Version = 0.2.9
Function Code Pin (255=disabled)
Primary channels input PRI 9
Secondary channels input SEC 255
Telemetry TLM 10
GPS Rx GPS_RX 11
GPS Tx GPS_TX 12
Sbus OUT SBUS_OUT 255
RPM RPM 255
SDA (baro sensor) SDA 14
SCL (baro sensor) SCL 15
PWM Channels 1, 2, 3 ,4 C1 / C4 0 1 2 3
PWM Channels 5, 6, 7 ,8 C5 / C8 4 5 255 255
PWM Channels 9,10,11,12 C9 / C12 255 255 255 255
PWM Channels 13,14,15,16 C13/ C16 255 255 255 255
Voltage 1, 2, 3, 4 V1 / V4 26 27 28 255
Protocol is CRSF (=ELRS)
CRSF baudrate = 420000
Voltage/RPM parameters:
Scales : 1.000000 , 1.000000 , 1.000000 , 1.000000
Offsets: 0.000000 , 0.000000 , 0.000000 , 0.000000
Baro sensor is detected using BMP280
Sensitivity min = 100 (at 100) , max = 300 (at 1000)
Hysteresis = 5
Foreseen GPS type is Ublox :GPS is detected
Failsafe type is HOLD
Config parameters are OK
>>
With command C5=255 I can reset PWM #5 back to 255, but trying V1=255, V2=255 or V3=255 does not work here.
Might be a problem?!
br KH
Hello,
would it be possible to get additional datetime and PDOP with the GPS sensor?
First of all, I tested V1/4.
V1/3 I could adjust up to 1/100V!! V4 is to say, usable for fuel tank level ...
But there are 3 very precise voltage inputs! For me, that is enough.
Was going to do a short test on RPM (What else could I test?)
RPM on PIN 8
See CONFIG
On the radio I see this here
br KH
Hello mstrens,
When i compile this last version, i have a compilation error.
In file included from src\param.h:4:0,
from src\crsf.cpp:17:
src\crsf_frames.h:13:26: error: redeclaration of 'CRSF_FRAMETYPE_GPS'
CRSF_FRAMETYPE_GPS = 0x02,
^~~~
compilation terminated due to -Wfatal-errors.
*** [.pio\build\raspberry-mstrens\src\crsf.o] Error 1
Did setup ADS1 in config.h these 2 lines as follows
#define ADS1_OFFSET 0.0, 0.0 , 0.0 , 0.0 // can be a float (positive or negative)
#define ADS1_SCALE 1.0, 1.0, 1.0, 1.0 // can be a float
In the terminal I see
First analog to digital sensor is detected using ads1115
Measurement setup: 4 , 8 , 8 ,8
Gains: 0 , 0 , 2 ,2
Rates: 3 , 3 , 7 ,7
Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000
Scales: 0.000000 , 0.000000 , 0.000000 ,0.000000
Averaged on: 20 , 20 , 50 ,50
Changed in config.h to
#define ADS1_OFFSET 0.5, 0.0 , 0.0 , 0.0 // can be a float (positive or negative)
#define ADS1_SCALE 1.0, 1.0, 1.0, 1.0 // can be a float
and in terminal I get
First analog to digital sensor is detected using ads1115
Measurement setup: 4 , 8 , 8 ,8
Gains: 0 , 0 , 2 ,2
Rates: 3 , 3 , 7 ,7
Offsets: 0.500000 , 0.000000 , 0.000000 ,0.000000
Scales: 0.500000 , 0.000000 , 0.000000 ,0.000000
Averaged on: 20 , 20 , 50 ,50
Satcomix just told me in German forum, that this has been reported before and it is just a simple thing to solve this issue. But as it is out-of-my-scope to search for causes and it does not make sense to do further testing with a modified code here, it would be nice if you could make the necessary changes.
But there seems to be a 2. issue here, which Satcomix does not see on his testboard.
Adding in config.h a second input
#define ADS1_MEASURE A0_TO_GND , ADS1_MEASURE A1_TO_GND , ADS_OFF , ADS_OFF
the compiler drops out here
br KH
I was trying to use a MS5611 together with a uBlox 6 GPS module and Jeti protocol.
According to the command prompt the GPS is detected correctly but I can't see any GPS related data on my transmitter (DC24 with REX7).
Just vario and height and V1. Even with a valid 3D fix at the GPS no data
When I switch over with the same configuration to S.Port I can see all GPS data on my Transmitter (TX16S with R168).
So my hardware seems to work properly.
I found this notes in the code about RPM:
-To change RPM multiplicator, enter e.g. RPM_MULT=0.5 to divide RPM by 2
// Note: ELRS has no field to transmit RPM; so RPM is sent in "attitude" frame as pitch, roll and yaw.
// Those fiels can have a max value of about 16000 and some digits are considered as decimals and lost by openTx.
// Therefore RPM value (hetz) is transmitted 3 times (once in Hetz, once in 10 X Hetz and once in 100 X Hetz)
// So the user can decide which value best fit his need// One RPM (Hz) can be measured
// Take care to limit the voltage to the range 0-3V; so if you use capacitor coupling, add diodes and resistor to limit the voltage
// All pulsed are counted (no debouncing); so use a hardware low pass filter (resistor/capitor) to avoid dummy pulses reading
//// - one RPM measurement; a scaling (SCALE4) can be used to take care e.g. of number of blades (optional)
I did set pitch, roll and yaw on same settings in the radio. I only see reaction in pitch. Nothing in roll or yaw.
I generate a square signal 3.3V pos. 100, 200, 300 .... 1000Hz
The radio displays with 100, 200,300 .... 1000Hz those values
1.00Hz, 2.10Hz, 3.21Hz,4.31Hz,5.42Hz,6.52Hz,7.63Hz.8.74Hz,9.84Hz,10.95Hz.
Here some of the screens.
With my calculation, 100Hz is a low rpm value, with a 14 magneto bl motor (ie. 7 pole) equals 857 rpm
Before looking into rpm instead of Hertz displayed, I would like your comments.
Was expecting to see 100Hz when applying 100Hz.
br - KH
I am back to zero.
Put 0.3.4 on one of my RP2040. Now blinking red
I only have PRI on 9, TLM on 10 and SEC on 13.
No GPS, no baro, no voltages.
Start the radio and the power up the RP2040. PRI, TLM and SEC not! connected to RP2040.
The receivers connect to the radio. Then I connect receiver #1 TX to PIN 9 of RP2040.
Red blinking stops and blue LED.
NO PWM.
I would like to have 0.3.3 back please!
i am on CRSF/ELRS ...
br - KH
Your project is great!
If the ELRS receiver (rp2040 + sx1280) can be integrated, the project will be perfect
Salut Michel,
Is it possible to add RPM feature for the Frsky S-Port protocol please,
Thanks,
Pierre
Hello Michel Strens,
I've spent the last few weeks getting a little more involved with openXsensor_on_328P and oXs_on_RP2040.
I tested with several RC systems.
On the one hand the S.Port protocol with FrSky X20S Ethos 1.4.6 and TD-R10 receiver and on the other hand the HOTT protocol with a Graupner MC28 4D with GR-24 receiver.
I tested with firmware up to 0.3.6_main and up to 0.4.3_hott.
As a test board I have several
Pi Pico,
Waveshare RP2040Plus,
Cytron Maker RP2040,
Cytron Maker Pico Base and my favorite board,
Pimoroni Servo2040.
All functions were tested several times on all boards.
With version 0.3.6 I could not find any noticeable error. All sensors were displayed in the FrSky Ethos telemetry with plausible values and the SBUS in or out showed me 16 channels. Can i change the predefiened PWM Output from 992 to 1500???
Ver.0.4.0 can be loaded without any problems, from Ver.0.4.1 the problems with the hardware start on some boards, with the Pimoroni Servo2040 there are massive problems. USB logs in and out, the board can no longer be addressed. These problems do not exist with Ver 0.3.6 all ports work fine, even when I reprogrammed these IO ports with Platformio, e.g. RGB LED IO 16 to 18 or 28 and I2C1 to I2C0 for the sensors, because of the onboard QT connector. Everything worked until version 0.4.1.
There are also small blemishes in the code, so offset and scale are not displayed correctly by the ADS1115.
Offset is contained twice in the Platformio script, I exchanged it with Scale.
I am available for more tests with S.Port and HOTT protocol.
I hope i can help you a little bit.
Thank you very much for your effort,
Best regards,
Torsten
In Version = 0.3.6 everything is ok!!!!
Function Code Pin (255=disabled)
Primary channel input PRI = 5
Secondary channels input SEC = 1
Telemetry TLM = 0
GPS Rx GPS_RX = 16
GPS Tx GPS_TX = 17
Sbus OUT SBUS_OUT= 11
RPM RPM = 255
SDA (baro sensor) SDA = 20
SCL (baro sensor) SCL = 21
PWM channels 1, 2, 3, 4 C1 / C4 = 2 3 4 6
PWM channels 5, 6, 7, 8 C5 / C8 = 7 8 9 10
PWM Channels 9,10,11,12 C9 / C12= 255 255 255 255
PWM Channels 13,14,15,16 C13/ C16= 255 255 255 255
Voltage 1, 2, 3, 4 V1 / V4 = 26 27 28 29
Protocol is Sport (Frsky)
CRSF baud rate = 420000
Voltage parameter:
Scales : 10.000000 , 0.100000 , 0.200000 , 3.000000
Offsets: -25.000000 , -0.250000 , 0.000000 , 0.000000
RPM multiplier = 1.000000
Baro sensor is detected using MS5611
Sensitivity min = 100 (at 100) , max = 300 (at 1000)
Hysteresis = 5
Foreseen GPS type is Ublox :GPS is detected
Failsafe uses predefined values
Chan 1...4 = 992 , 992 , 992 , 992
Chan 5...8 = 992 , 992 , 992 , 992
Chan 9...12 = 992 , 992 , 992 , 992
Chan 13...16= 992 , 992 , 992 , 992
Config parameters are OK
Version = 0.4.3
Function Code Pin (255=disabled)
Primary channels input PRI = 5
Secondary channels input SEC = 255
Telemetry TLM = 12
GPS Rx GPS_RX = 0
GPS Tx GPS_TX = 1
Sbus OUT SBUS_OUT= 13
RPM RPM = 255
SDA (baro sensor) SDA = 2
SCL (baro sensor) SCL = 3
PWM Channels 1, 2, 3 ,4 C1 / C4 = 255 255 14 15
PWM Channels 5, 6, 7 ,8 C5 / C8 = 255 255 255 255
PWM Channels 9,10,11,12 C9 / C12= 255 255 255 255
PWM Channels 13,14,15,16 C13/ C16= 255 255 255 255
Voltage 1, 2, 3, 4 V1 / V4 = 26 27 28 29
Protocol is Sport (Frsky)
CRSF baudrate = 420000
Voltage parameters:
Scales : 10.000000 , 0.100000 , 0.200000 , 0.435500
Offsets: -15.000000 , -0.200000 , -0.400000 , -0.026500
RPM multiplier = 1.000000
Baro sensor is detected using MS5611
Sensitivity min = 100 (at 100) , max = 300 (at 1000)
Hysteresis = 5
First analog to digital sensor is detected using ads1115
Measurement setup: 4 , 5 , 8 ,8
Gains: 2 , 2 , 2 ,2
Rates: 3 , 3 , 4 ,4
Offsets: 1.000000 , 1.000000 , 0.000000 ,0.000000
Scales: 10.000000 , 0.100000 , 1.000000 ,1.000000
Averaged on: 1 , 1 , 1 ,1
Second analog to digital sensor is detected using ads1115
Measurement setup: 4 , 5 , 8 , 8
Gains: 2 , 2 , 2 , 2
Rates: 3 , 3 , 4 , 4
Offsets: 1.000000 , 1.000000 , 0.000000 , 0.000000
Scales: 10.000000 , 0.100000 , 1.000000 , 1.000000
Averaged on: 1 , 1 , 1 , 1
Foreseen GPS type is Ublox :GPS is detected
Failsafe uses predefined values
Chan 1...4 = 992 , 992 , 992 , 992
Chan 5...8 = 992 , 992 , 992 , 992
Chan 9...12 = 992 , 992 , 992 , 992
Chan 13...16= 992 , 992 , 992 , 992
Config parameters are OK
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.