mstrens / oXs_on_RP2040

version of openXsensor to be used on raspberry pi pico RP2040 (more protocols, more functionalities)
83 stars 22 forks source link

Logger for oXs_RP2040 #111

Closed Satcomix closed 9 months ago

Satcomix commented 9 months ago

Hello Mstrens, Can I open the issue here or on Logger GitHub? Board RPi 2040 Pico In the meantime I tried to play the .uf2 from the logger project onto a board. If I press ? and Enter, I don't see any help for entering commands. Greeting, Torsten

Rebooted by Watchdog!

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++

Satcomix commented 9 months ago

First test with Challenger RP2040 SD/RTC

Rebooted by Watchdog!

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++ error in sd.begin

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

Commands can be entered to change the config parameters

-To get the current config, just press Enter

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

Satcomix commented 9 months ago

For the ILabs Challenger RP2040 SD/RTC

You must use these GPio: RP2040 SD Card connector Connection between MCU and the SD card. The processor connects to the SD card via the second spi (SPI1) communication channel. SPI1 Pin usage:

GPIO10 is the serial clock (SCK)
GPIO12 is the serial data input (SDI)
GPIO11 is the serial data output (SDO)
GPIO9 is the SD Card chip select signal (#CS)

In addition to the described signals a card detect signal is also connected to the connector. When this signal is logically low a card has been inserted and when it is high the card has been removed. D14/GPIO13 card detect (Has a weak external pull (220K) up for low power consumption).

https://ilabs.se/challenger-rp2040-sd-rtc-datasheet/

mstrens commented 9 months ago

I expect that you could not make any test because the logger did not allow to use SPI1.

I put on github a version 2.0.1 that should support SPI1. To use SPI1 you have to change some parameters with usb command (set SPI to 1 and change gpio). Default is still SPI0

Satcomix commented 9 months ago

Hello Mstrens, I can't stop testing at all. :-))) Thank you for the new version, I have a problem with my Arduino IDE and with VSCode. I cannot modify and create builds for the logger myself. I will test your version 2.0.1 directly. greetings, Torsten

Satcomix commented 9 months ago

Hello Mstrens, As I wrote, I'm trying in vain to create a build with changes for the Challenger RP2040 SD/RTC. MISO, MOSI, SCLK, and CS must be changed as specified (see post above) and the LED is on GPio pin 18. Maybe it would be possible for you to create the build for me, or can you please adjust the GPio range in the logger software for terminal output. Can`t change SPI to 1 with the command SPI=1 Cmd to execute: SPI = 1 Wrong command: command is discarded

Thank you very much, Torsten

oXs Logger Ver.0.0.1

mstrens commented 9 months ago

In principe, you should be able to use the uf2 provided on github. As I had to write the program with arduino, the uf2 is in build directory. You should (in theory) be able to change the parameter via usb command (so no need to recompile).

As this is a debug version, the program blocks at start on. You have to send a char to let it really begin. Once it begins to really run, you can send the ENTER command to get the config and the ? to get the list commands. I forgot to adapt some msg about the ? command. I think it is now done in 0.0.3

Anyway, perhaps I can help you about arduino/vscode compilation.

Satcomix commented 9 months ago

First Test with Ver.0.0.3 SD=1 CS=9 MOSI=11 MISO=12 SCLK=10 DATA=5 for the Challenger RP2040 SD/RTC

Version = 0.0.3 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands config has been saved

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

Satcomix commented 9 months ago

After first commands and test, the board doesn`t response after reboot. No ? and ENTER

Clean boot

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++

Satcomix commented 9 months ago

Only Nuke and a new flash with Version 0.0.3 bring back the RP2040 SD/RTC

Version = 0.0.3 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

Satcomix commented 9 months ago

Version = 0.0.3 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands config has been saved

Satcomix commented 9 months ago

oXs RP2040 GPio0 to GPio5 oXs Logger with 115200baud, nothing happens. The Radio X20S with FBUS protocol and LOG=0 tells me every second "SENSOR LOST" LOG=255 everything is ok.

Version = 0.0.3 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

mstrens commented 9 months ago

In this github issue, it is not clear if the fields to be logged have a + or a - in front of the name. Only those with a + should be logged.

In oXs on rp2040, did you define the gpio to be used to generate the data to the logger?

In oXs logger, do you get some file (even empty) on the Sd card?

Satcomix commented 9 months ago

It's the default config from logger, most parameters are +, even ads is -. In the Post above i write that i connect oXs GPio0 to oXs Logger GPio5. When i activate on normal oXs BoardLog=0 , i get massive Sensor lost. I will make the next tests tomorow morning. Greetings, Torsten

mstrens commented 9 months ago

If you have many sensors defined in normal oXs, it could be that oXs has to many values to transmit and that 115200 baud is to slow to transmit all of them. Could you start (to morrow) with a test where oXs does not get any RC channels (e.g. no Sbus) and where there is only one voltage to measure (so disabling gps, I2C, ...). In this case, oXs should log much less data and (I hope) avoid sensor lost. This is the only test I made a few weeks ago and it was OK. Still I had no connection with a receiver and so I had also no way to detect sensor lost.

If this works, then we can try to let oXs generates step per step more data e.g. the RC channels (this supposes to connect again oXs to a receiver connected to an handset).

Satcomix commented 9 months ago

Good morning Mstrens, First Test with Version 2.8.29 and Logger Ver.0.0.3 TLM=1 LOG=0 V1=26 All other GPio=255 Protocol: S.PORT 115200baud With FBUS protocol there are errors with the FBUS Frame Size. The Challenger RP2040 SD/RTC Board doesnt work anymore after power-down and up with version 0.0.3 after configuration the MISO, MOSI, CS, SLCK GPios. No way to get any information over terminal. After a NUKE and reconfig the ports everything seems ok, when you dont repower the board. There is no file/folder on the sd-card

Clean boot

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++

mstrens commented 9 months ago

About the challenger that does not react to commands: It could be that there is some issue while changing SPI parameters because it is not possible to change the SPI number and the SPI pins simultaneously.

I made a small change in 0.0.4 in order to avoid configuring SPI as long the config is not OK. Hoping it help.

In your post you say that protocol is Sport but you say also that with FBUS protocol there are errors with the FBUS Frame Size. I presume that it concerns 2 different tests?

mstrens commented 9 months ago

Note: I just made a small test with my board (using SPI and not SPI1) and even I do not connect an oXs device, the logger creates a new file on the SD card when I power on the logger.

I get e.g. those messages: log file will be in oXsLog001.csv No data within 7867 No data within 5001 No data within 5001

The No data within... is because I have no oXs connected

Satcomix commented 9 months ago

When I set the protocol to FBUS, I keep getting the error message about FBUS frame size. Then I switched to S.PORT and the error message went away. So it's somewhere related to the PWM or SBUS. I will test the 0.0.4 now.

Satcomix commented 9 months ago

First test with 0.0.4 SD=1 MISO=12 MOSI=11 SCLK=10 CS=9

Version = 0.0.4 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands config has been saved

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

Satcomix commented 9 months ago

After repower, no chance to set a ? and ENTER in IDE Terminal. Clean boot

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++

mstrens commented 9 months ago

It is strange. I will try to change the wiring of my board in order to use the same SPI and SPI pins as you.

mstrens commented 9 months ago

I found the bug. it was about initialisation of SPI1. On my side a file is created on Sd card. So version is 0.0.5

Note : I changed the default parameters in logger config.h in order to match your setting (and so use SPI1 from a clean installation.

About the issue with fbus in oXs, can you give me the exact message. Do you still have this message when the logging is not activated.

Anyway, I suggest to test the logger step by step; so first with sport and only one sensor. Then perhaps more sensors Then with Sbus and no receiver connected Then with Sbus and a receiver connected to the handset.

Satcomix commented 9 months ago

Version 0.0.5 works, but there is an error with the SD card. The strange thing is: After repowering, the terminal display only works after I? and Enter, the board does not respond to a normal ENTER.

Clean boot

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++ error in sd.begin

max ms between 2 call to main loop= 0 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0

mstrens commented 9 months ago

This is a debug version. Currently I ask the user to enter a character at power on (like "a"+"enter") to continue the start up. So you have more opportunity to get all messages on the serial terminal.

Is your sd card formatted in fat32. Currently the logger needs a card formatted in fat32.

Satcomix commented 9 months ago

I changed the SD-CARD from 64GB to 32GB Now i can see the messages

gpio to receive data from oXs = 5
Baudrate = 115200

Protocol is O (oXs + csv) Led color is normal (not inverted)

Config parameters are OK Press ? + Enter to get help about the commands No data within 5001

max ms between 2 call to main loop= 9 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0 No data within 5001 No data within 5001 No data within 5001 No data within 5001

max ms between 2 call to main loop= 1 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 0 max us to fill csv rec= 0 max % used of fromNbr queue= 0 max % used of lastWritten queue= 0 max us to write on sd card= 0 max us to synchro on sd card= 0 total bytes written in csv file= 0 No data within 5001 No data within 5001

mstrens commented 9 months ago

Fine. Now, if you connect oXs with a voltage sensor, I presume, it would record some data

Satcomix commented 9 months ago

Now it works with oXs Version 2.8.29 Protocol S.PORT TLM=1 LOG=0 V1=26 any GPio= 255

Version = 0.0.5 Fields in CSV log (+ = included; - = not included)

Config parameters are OK Press ? + Enter to get help about the commands

max ms between 2 call to main loop= 11 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 1 max us to fill csv rec= 138 max % used of fromNbr queue= 1 max % used of lastWritten queue= 1 max us to write on sd card= 4973 max us to synchro on sd card= 21823 total bytes written in csv file= 75495

Satcomix commented 9 months ago

After switching to PROTOCOL=F TLM=255 PRI=5 LOG=0 V1=26

fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame

Satcomix commented 9 months ago

Next Test:

oXs_RP2040:

processing cmd

Version = 2.8.29 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 1 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 12 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 13 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 2 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 4 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 14 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 15 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 26 27 28 29 (V1 / V4 = 26, 27, 28, 29) Logger . . . . . . . . . = 0 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 255 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is not defined

Protocol is Sport (Frsky) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz

Voltage parameters: Scales : 1.000000 , 1.000000 , 0.100000 , 1.000000 Offsets: 0.000000 , 0.000000 , 2.000000 , 0.000000 One temperature sensor is connected on V3 RPM multiplier = 1.000000 Baro sensor is detected using MS5611 Sensitivity min = 100 (at 100) , max = 300 (at 1000) Hysteresis = 5 Acc/Gyro is detected using MP6050 Acceleration offsets X, Y, Z = 449 , 85 , -2802 Gyro offsets X, Y, Z = 3 , -163 , -192 Aispeed sensor is detected using MS4525 Vspeed compensation channel = 7 First analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Second analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Foreseen GPS type is Ublox (configured by oXs) :GPS is detected but has not (yet) a fix Led color is normal (not inverted) Failsafe uses predefined values Chan 1...4 = 1500 1500 1500 1500 Chan 5...8 = 1500 1500 1500 1500 Chan 9...12 = 1500 1500 1500 1500 Chan 13...16= 1500 1500 1500 1500

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 255} ( 100 O ) {0 100 255} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 255} ( 90 O ) {0 100 255} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 255} ( 80 O ) {0 100 255} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 255} ( 70 O ) {0 100 255} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 255} ( 60 O ) {0 100 255} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 255} ( -50 P ) {0 -100 255}

Config parameters are OK Press ? + Enter to get help about the commands

Challenger RP2040 SD/RTC

Clean boot

Config parameters are OK Press ? + Enter to get help about the commands

Type any character to begin +++++++++++ log file will be in oXsLog001.csv No data within 7273 Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx

max ms between 2 call to main loop= 7273 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 13 max us to fill csv rec= 274 max % used of fromNbr queue= 8 max % used of lastWritten queue= 6 max us to write on sd card= 6131 max us to synchro on sd card= 25461 total bytes written in csv file= 289270 Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx

max ms between 2 call to main loop= 1 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 10 max us to fill csv rec= 270 max % used of fromNbr queue= 6 max % used of lastWritten queue= 4 max us to write on sd card= 5361 max us to synchro on sd card= 21845 total bytes written in csv file= 775135 Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx Reset writeIdx

max ms between 2 call to main loop= 1 max % used of Serial2 fifo= 0 max % of bytes in csvbuf= 12 max us to fill csv rec= 278 max % used of fromNbr queue= 6 max % used of lastWritten queue= 5 max us to write on sd card= 6232 max us to synchro on sd card= 25837 total bytes written in csv file= 1258795 Reset writeIdx Reset writeIdx Reset writeIdx

Satcomix commented 9 months ago

With the last config (see above post) the sequencer don`t work anymore. You can see the push on the button1-3 in PWM, but nothing happened at GPio6-8

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 255} ( 100 O ) {0 100 255} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 255} ( 90 O ) {0 100 255} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 255} ( 80 O ) {0 100 255} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 255} ( 70 O ) {0 100 255} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 255} ( 60 O ) {0 100 255} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 255} ( -50 P ) {0 -100 255}

Config parameters are OK Press ? + Enter to get help about the commands processing cmd

Cmd to execute: PWM PWM values us (sbus) 1... 8 1500( 992) 1500( 992) 2012( 1811) 1500( 992) 1500( 992) 1500( 992) 1500( 992) 1500( 992) PWM values us (sbus) 9...16 1500( 992) 1500( 992) 1500( 992) 1500( 992) 1500( 992) 1500( 992) 1500( 992) 1500( 992)

mstrens commented 9 months ago

I do not understand why sequencer do not work. Previously it worked and I did not change the code. I see that you use a keep delay of 255. In the new logic of sequencer, 255 does not mean anymore that the PWM must be hold. it now means that it has to wait 255*20ms = about 5 sec before changing the PWM value. Did you wait the 5 sec?

Satcomix commented 9 months ago

Hello Mstrens, With FBUS and LOG=255 it works perfect!, and you dont`t have to wait 5sec. When i push the button, the reaction of the servo is without delay.

Satcomix commented 9 months ago

No function of the sequencer with SBUS and S.PORT. Telemetry is ok.

processing cmd

Version = 2.8.29 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 1 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 12 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 13 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 2 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 4 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 14 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 15 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 26 27 28 29 (V1 / V4 = 26, 27, 28, 29) Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 255 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is not defined

Protocol is Sport (Frsky) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz

Voltage parameters: Scales : 1.000000 , 1.000000 , 0.100000 , 1.000000 Offsets: 0.000000 , 0.000000 , 2.000000 , 0.000000 One temperature sensor is connected on V3 RPM multiplier = 1.000000 Baro sensor is not detected Acc/Gyro is not detected Airspeed sensor is not detected Vspeed compensation channel = 7 First analog to digital sensor is not detected Second analog to digital sensor is not detected Foreseen GPS type is Ublox (configured by oXs) :GPS is not (yet) detected Led color is normal (not inverted) Failsafe uses predefined values Chan 1...4 = 1500 1500 1500 1500 Chan 5...8 = 1500 1500 1500 1500 Chan 9...12 = 1500 1500 1500 1500 Chan 13...16= 1500 1500 1500 1500

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 255} ( 100 O ) {0 100 255} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 255} ( 90 O ) {0 100 255} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 255} ( 80 O ) {0 100 255} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 255} ( 70 O ) {0 100 255} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 255} ( 60 O ) {0 100 255} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 255} ( -50 P ) {0 -100 255}

Config parameters are OK Press ? + Enter to get help about the commands

Satcomix commented 9 months ago

processing cmd

Version = 2.8.29 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 1 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 12 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 13 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 2 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 4 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 14 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 15 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 26 27 28 29 (V1 / V4 = 26, 27, 28, 29) Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 255 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is not defined

Protocol is Sport (Frsky) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz

Voltage parameters: Scales : 1.000000 , 1.000000 , 0.100000 , 1.000000 Offsets: 0.000000 , 0.000000 , 2.000000 , 0.000000 One temperature sensor is connected on V3 RPM multiplier = 1.000000 Baro sensor is detected using MS5611 Sensitivity min = 100 (at 100) , max = 300 (at 1000) Hysteresis = 5 Acc/Gyro is detected using MP6050 Acceleration offsets X, Y, Z = 449 , 85 , -2802 Gyro offsets X, Y, Z = 3 , -163 , -192 Aispeed sensor is detected using MS4525 Vspeed compensation channel = 7 First analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Second analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Foreseen GPS type is Ublox (configured by oXs) :GPS is detected and has a fix Led color is normal (not inverted) Failsafe uses predefined values Chan 1...4 = 1500 1500 1500 1500 Chan 5...8 = 1500 1500 1500 1500 Chan 9...12 = 1500 1500 1500 1500 Chan 13...16= 1500 1500 1500 1500

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 255} ( 100 O ) {0 100 255} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 255} ( 90 O ) {0 100 255} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 255} ( 80 O ) {0 100 255} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 255} ( 70 O ) {0 100 255} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 255} ( 60 O ) {0 100 255} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 255} ( -50 P ) {0 -100 255}

Config parameters are OK Press ? + Enter to get help about the commands processing cmd

Cmd to execute: PWM PWM values us (sbus) 1... 8 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) PWM values us (sbus) 9...16 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0) 881( 0)

mstrens commented 9 months ago

You said: With FBUS and LOG=255 it works perfect!, and you dont`t have to wait 5sec. When i push the button, the reaction of the servo is without delay.

Indeed it is the expected behavior.

mstrens commented 9 months ago

I am a little lost with the different tests. 1) Is it so that sequencer with FBus works when logger is not activated 2) Is it so that sequencer with FBus does not work when logger is activated 3) Is it so that sequencer with Sport + Sbus never works

Satcomix commented 9 months ago

I'm a bit lost right now too, because I don't know what I've already tested because of all the tests.

I can see the outputs/function of the sequencer exactly because I have PWM meters connected to the output. If it doesn't work, no PWM value is displayed.

mstrens commented 9 months ago

Just a little comment: You have e.g. a sequencer with [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 255} ( 100 O ) {0 100 255}

There is nothing wrong with it; but you would have exactly the same result without the O and the P if you want that a new function is applied immediately. [ 6 0 20 3 -100 -100 100 ] ( 50 ) {0 -100 255} ( 100 ) {0 100 255}

mstrens commented 9 months ago

Perhaps we can try to let first focus on sequencer without logger activated for SBUS and FBUS.

Satcomix commented 9 months ago

I use the P in Sequence as a priority button

mstrens commented 9 months ago

The P is not required when the other sequence has no U and no O

Satcomix commented 9 months ago

I know

Satcomix commented 9 months ago

"Perhaps we can try to let first focus on sequencer without logger activated for SBUS and FBUS". I will do the next tests only for sequencer with S.PORT, SBUS and one test with FBUS

Satcomix commented 9 months ago

FBUS Test: OK

processing cmd

Version = 2.8.29 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 255 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 12 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 13 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 2 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 4 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 14 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 15 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 26 27 28 29 (V1 / V4 = 26, 27, 28, 29) Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 255 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is not defined

Protocol is Fbus(Frsky) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz

Voltage parameters: Scales : 1.000000 , 1.000000 , 0.100000 , 1.000000 Offsets: 0.000000 , 0.000000 , 2.000000 , 0.000000 One temperature sensor is connected on V3 RPM multiplier = 1.000000 Baro sensor is detected using MS5611 Sensitivity min = 100 (at 100) , max = 300 (at 1000) Hysteresis = 5 Acc/Gyro is detected using MP6050 Acceleration offsets X, Y, Z = 449 , 85 , -2802 Gyro offsets X, Y, Z = 3 , -163 , -192 Aispeed sensor is detected using MS4525 Vspeed compensation channel = 7 First analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Second analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Foreseen GPS type is Ublox (configured by oXs) :GPS is detected and has a fix Led color is normal (not inverted) Failsafe uses predefined values Chan 1...4 = 1500 1500 1500 1500 Chan 5...8 = 1500 1500 1500 1500 Chan 9...12 = 1500 1500 1500 1500 Chan 13...16= 1500 1500 1500 1500

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 1} ( 100 O ) {0 100 1} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 1} ( 90 O ) {0 100 1} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 1} ( 80 O ) {0 100 1} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 1} ( 70 O ) {0 100 1} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 1} ( 60 O ) {0 100 1} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 1} ( -50 P ) {0 -100 1}

Config parameters are OK Press ? + Enter to get help about the commands

Satcomix commented 9 months ago

Test with S.PORT and SBUS: no Function on Sequencer, all telemetry data ok I can see the PWM values of CH1-16 and SBUS_out work on all channels On SBUS_out i can see at CH3 the button press.

processing cmd

Version = 2.8.29 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 1 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 12 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 13 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 2 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 4 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 14 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 15 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 26 27 28 29 (V1 / V4 = 26, 27, 28, 29) Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 255 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is not defined

Protocol is Sport (Frsky) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz

Voltage parameters: Scales : 1.000000 , 1.000000 , 0.100000 , 1.000000 Offsets: 0.000000 , 0.000000 , 2.000000 , 0.000000 One temperature sensor is connected on V3 RPM multiplier = 1.000000 Baro sensor is detected using MS5611 Sensitivity min = 100 (at 100) , max = 300 (at 1000) Hysteresis = 5 Acc/Gyro is detected using MP6050 Acceleration offsets X, Y, Z = 449 , 85 , -2802 Gyro offsets X, Y, Z = 3 , -163 , -192 Aispeed sensor is detected using MS4525 Vspeed compensation channel = 7 First analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Second analog to digital sensor is detected using ads1115 Measurement setup: 4 , 5 , 6 ,7 Gains: 1 , 1 , 1 ,1 Rates: 5 , 5 , 5 ,5 Offsets: 0.000000 , 0.000000 , 0.000000 ,0.000000 Scales: 1.000000 , 1.000000 , 1.000000 ,1.000000 Averaged on: 10 , 10 , 10 ,10 Foreseen GPS type is Ublox (configured by oXs) :GPS is detected and has a fix Led color is normal (not inverted) Failsafe uses predefined values Chan 1...4 = 1500 1500 1500 1500 Chan 5...8 = 1500 1500 1500 1500 Chan 9...12 = 1500 1500 1500 1500 Chan 13...16= 1500 1500 1500 1500

Number of: sequencers=6 sequences=12 steps= 12 Sequencer = [ Gpio Type(0=servo,1=analog) Clock(msec) ChannelNr Default Min Max ] Sequence = ( RC_value(-100...100) to_Repeat Uninterrupted Only_priority_interrupted is_a_Priority_seq ) Step = { Smooth(clocks) Pwm(-100...100) Keep(clocks) } SEQ= [ 6 0 20 3 -100 -100 100 ] ( 50 P ) {0 -100 1} ( 100 O ) {0 100 1} [ 7 0 20 3 -100 -100 100 ] ( 40 P ) {0 -100 1} ( 90 O ) {0 100 1} [ 8 1 500 3 0 0 100 ] ( 30 P ) {0 0 1} ( 80 O ) {0 100 1} [ 9 0 20 3 -100 -100 100 ] ( 20 P ) {0 -100 1} ( 70 O ) {0 100 1} [ 10 0 20 3 -100 -100 100 ] ( 10 P ) {0 -100 1} ( 60 O ) {0 100 1} [ 11 0 20 3 -100 -100 100 ] ( -100 O ) {0 100 1} ( -50 P ) {0 -100 1}

Config parameters are OK Press ? + Enter to get help about the commands

Satcomix commented 9 months ago

I deactivate the ACC, but no change. No Vspeed compensation channel defined; oXs uses default settings ACC=255

mstrens commented 9 months ago

I loaded 2.8.30. I hope it solves the bug about sequencer not working with sbus

Satcomix commented 9 months ago

In version 2.8.30 the squencer works perfect with SBUS and S:PORT Protocol. FBUS protocol is also ok.

mstrens commented 9 months ago

I also uploaded 2.8.31. It will perhaps solve the issue with messages with Fbus messages (about first pos) when logger is activated.

Satcomix commented 9 months ago

I download 2.8.31 In Terminal it shows Version 2.8.30 Sensor lost every time. fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame fbus: first pos not a valid length frame