jim-mckeown / SP200A-Client

SP200A SonarPhone master client running on ESP32
1 stars 1 forks source link

Depth fractions #2

Open nikgangas opened 6 months ago

nikgangas commented 6 months ago

Hello,

Wonderful work! I tested it with my 2021 SP200 unit and an ESP32 it works perfectly! Thank you for sharing!

My very very small contribution to the project is that depth fractions should be divided by 10 and not by 100. In 1.4 meters depth it was showing 1.04 and when depthfrac divided by 10 it showed 1.4 correctly, side-by-side compared with my iphone and sonarphone app.

I also suspect that this could be the case with other fractions ie battery voltage but haven't tested this since I didn't use it in my project.

Also FYI I noticed that in the sonarphone app, sea temp shows decimals. After extended testing I couldn't find any byte which would carry the temp fractions (for example the near bytes 27-28 etc) so I concluded that the temperature is software filtered done inside the app and it shows decimals as a means of smoother temp degrees transition.

Regards Nick

jim-mckeown commented 6 months ago

Hello Nick,

Thanks for testing this and for your feedback.

Is your project using SeaTalk? I seem to remember having an issue with the chart plotter displaying depth in meters when selected but maybe I did not fully resolve that. I will look into that deeper as soon as I can.

Also, I had substituted battery voltage for depth during bench testing at one point. Battery voltage can be adjusted on the bench while depth always reports zero without the transducer. That may not have been fully undone in the code I posted as well.

Do you have the same issue when displaying depth in feet?

You may be right about some filtering of temperature in the phone app but my observation was that the SP200A always sent temperature in whole degrees C at byte 26 in the REDYFC message. The conversion to degrees F was internal to the phone app. If you take any temperature reading from the phone app and convert it back to C, it should always be a whole number. Can you confirm this in your project?

- Jim

nikgangas commented 6 months ago

Regarding temp, sp200 always sends whole numbers at byte 26. It is during transitions that the software makes an average and shows decimals. I was warming up the transducer with my hand and while heating and passing from 26 to 27 deg C it showed something like 26.3 in the app. So it is software filtering for sure.

I don’t use Seatalk, I just used terminal to see how it works for now. Later on I will send some data to an android app I have made for the boat. Didn’t think to test in feet instead of meters. It could be that in feet it would need to be /100. Division by 10 practically gives you 1 decimal point which is 10cm and is also what sonarphone app is using as well plus I don’t think this transducer has more accuracy than that.. But if you see 2 decimal points when in feet it coulb be the case..