dgatf / msrc

Multi Sensor for RC with RP2040 - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec
GNU General Public License v3.0
168 stars 41 forks source link

Problem with "IBUS_TYPE_S32"? #60

Closed erwann56 closed 2 years ago

erwann56 commented 2 years ago

Thank you for your work. The last code is better (less latency) however the telemetry for LAT, LON and ALT blocks the feedback from all sensors. When I comment out the first 3 gps sensors in IBUS.cpp, the telemetry works again. A problem with "IBUS_TYPE_S32"?

Comment GPS with comment GPS without comment

dgatf commented 2 years ago

There was some issues with IBUS types and also lat/lon were swapped. Fixed with f0f213df78c5358053702289dd7a25e72e4757d6 Please try latest code and check if the problem persists

dgatf commented 2 years ago

If still doesn't work, change type to _IBUS_TYPES16:

sensorIbusP = new SensorIbus(AFHDS2A_ID_GPS_LAT, IBUS_TYPE_S16, gps->latP(), gps);
addSensor(sensorIbusP);
sensorIbusP = new SensorIbus(AFHDS2A_ID_GPS_LON, IBUS_TYPE_S16, gps->lonP(), gps);
addSensor(sensorIbusP);
sensorIbusP = new SensorIbus(AFHDS2A_ID_GPS_ALT, IBUS_TYPE_S16, gps->altP(), gps);
erwann56 commented 2 years ago

I tried with 2 GPS to be sure. With the modification f0f213d, same result. All values ​​sensors are frozen at 0. By modifying S32 by S16, the sensors work but for the GPS I have as before: LAT, LON and SPE at 0. COG and ALT work. I also have a compilation error (see photo). I had tested another code some time ago. All GPS data uploaded correctly in my remote control. (https://create.arduino.cc/projecthub/yvesmorele/low-cost-telemetry-and-data-logger-flysky-turnigy-8491d1) error Ibus_cpp

dgatf commented 2 years ago

I've implemented AC packets to be able to send AFHDS2A_ID_GPS_FULL packet. Commit 924d1e6206e8fed0f8a646994b0a5dbce328f309

Please try updated code

erwann56 commented 2 years ago

Flysky speed, cog and voltage are set to zero. Lat, Lon, Alt data are displayed but with inconsistent values ![Uploading IMG_20220206_180629.jpg…]()

dgatf commented 2 years ago

Please comment lines 297 and 298 in ibus.cpp and check if cog, spd and voltage works:

//sensorIbusP = new SensorIbusGps(AFHDS2A_ID_GPS_FULL, IBUS_TYPE_GPS, gps->latP(), gps->lonP(), gps->altP(), gps);
//addSensor(sensorIbusP);
erwann56 commented 2 years ago

I will try. Thank you

dgatf commented 2 years ago

Lat, Lon, Alt data are displayed but with inconsistent values

Please post the correct values

erwann56 commented 2 years ago

cog and voltage values ​​are ok. speed never worked. the actual values ​​should be: alt 202m 43.37 -0.35 flysky2

dgatf commented 2 years ago

This will be trial error. It is not clear the format for the multi packet for GPS

I've modified the GPS packet format.

Please flash the updated code. But this time do not connect your GPS to pin Rx, instead enable SIM_SENSORS in config.h. It will be easier for me the check the values if needed

erwann56 commented 2 years ago

I will try tomorrow.

erwann56 commented 2 years ago

IMG_20220207_084304 With the last code and SIM_sensors. GPS was unplugged.

dgatf commented 2 years ago

There was an issue in the definition of AC packets. Most likely is fixed now. Please try updated code

erwann56 commented 2 years ago

With the last code, I have the GPS values ​​at 0. The voltage sensor is missing. In order to confirm the hardware, I tested the other code( https://create.arduino.cc/projecthub/yvesmorele/low-cost-telemetry-and-data-logger-flysky-turnigy-8491d1). There is just a problem with the speed which must be multiplied by 100 (I tested with my car)

Other code ) IMG_20220207_140124

erwann56 commented 2 years ago

With SIM_SENSORS, it is the same result. GPS values ​​at 0 and the voltage, speed, cog sensors have also disappeared.

PS: MRSC_gui win does not generate lines for rpm pinion, teeth...

dgatf commented 2 years ago

Please try updated code. Should be ok now

dgatf commented 2 years ago

PS: MRSC_gui win does not generate lines for rpm pinion, teeth...

Binaries updated. Fixed

erwann56 commented 2 years ago

I'm not at home. I will test tomorrow evening. Thank you

erwann56 commented 2 years ago

Great!! Values ​​are going up nicely. There is just an adjustment to be made with the GPS speed which is divided by 200 (0.2km/h instead of 40km/h). So I will soon be able to test the BMP280 sensor (-; Thanks again for your project. IMG_20220209_180141

dgatf commented 2 years ago

There is just an adjustment to be made with the GPS speed which is divided by 200 (0.2km/h instead of 40km/h).

Speed multiplier fixed.

I've also added the number of sats for GPS.

erwann56 commented 2 years ago

LUA TX16S Perfect. The speed data is correct. If I can, I test the BMP280 this afternoon. (Do you know if there is a LUA script or a widget that would allow to have a graphic feedback on the TX16S as in the photo?)

dgatf commented 2 years ago

There are several scripts lua scripts in this link