-
Notifications
You must be signed in to change notification settings - Fork 17.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
Temp sensor enable defines incorrect #27865
Comments
I added this issue, but Henry was faster at typing, so closed the duplicate. Here's the full text of my bug report: AP_TEMPERATURE_SENSOR_ENABLED = 2 adds dummy support for temperature sensors but doesn't actually enable any drivers (including the basic backend). Even to get analog temperature sensor support, custom firmware must be built to explicitly set AP_TEMPERATURE_SENSOR_ENABLED = 1. Alternatively, using the Custom Firmware Builder, one has to check both Temperature Sensor support AND at least one of the I2C or SPI devices to get support in the custom build. Our documentation states that we support up to 9 sensors, but a casual user would have to go to some length to discover why support doesn't actually exist in released firmware and figure out how to apply this workaround. Version Platform Airframe type Hardware type Logs |
This issue doesn't actually say what you want to happen. We can't change defaults on the custom build server - they're based on what's built into the firmware you're building. This feels like it should be more documentation or interface tweaks than anything else. What, exactly, do you think should happen? |
Apologies - I thought it was clear.
I initially made a PR for a big warning at the top of the Temp Sensor wiki page regarding lack of default support and the workaround via Custom Firmware Builder, but Henry argued that we should make the firmware match the expectation rather than documenting our way around it. That seems like the more logical choice to me, as well. |
actually if the temp sensor function is enabled...analog, MAX, and DroneCan,if also present, sensors should be enabled...the intent is clear, but execution off...its also a regression: #ifndef AP_TEMPERATURE_SENSOR_ANALOG_ENABLED #ifndef AP_TEMPERATURE_SENSOR_DRONECAN_ENABLED |
To be clear the PR to add When the enable value is "2," the The issue exists both before and after Peter's PR. |
Here's more info - hopefully helpful. After enabling "TEMP_MCP9600" and disabling "MODE_TURTLE" in this custom build for a Cube Orange, I was able to see the TEMPx_ params, but learned:
I can help test if needed. Some discussion here: Edit: I learned the temperature related I2C addresses are limited to 0x60 to 0x66 and during testing I had tried 0x67. I have edited this comment to remove the following: |
Looks like I should dive into this driver and fix'r'up. Thanks for the bug reports! |
I can confirm I've tested through TEMP3_ with success. |
I'm traveling and only have access to SITL right now. When I enable TEMP1_TYPE 2 I get a SITL I2C register read error crash. I've pinged @peterbarker to see if he can help me figure that out. It's unrelated to the main MCP9600 driver, just the SITL driver.. but still - the plot thickens! |
When setting type to 3 in SITL the params appear to work fine. I tested up to TEMP5. |
This was about Type = 2
Edit: at least for me it is. I can share my build from the build server |
@fadarnell I understand it's about type 2. Note, I tried type 2 on SITL and it crashed so I'm unable to test it right now... So I tried type 3 and the >3 limitation doesn't seem to be there. I'm testing in master. What version/hash are you testing on? |
From the custom build server. build.log shows: |
0d0ba0f (#24460) fixed a bug in the MCP9600 driver where we were reading 2 bytes instead of 1 for the The simulator was not adjusted for this change, so would fail hard at startup. I've fixed the simulator for this. The driver was also mucking around with a data-is-ready register bit which the simulator didn't support; I've improved its fidelity there. @magicrub I'm not sure the drivers is doing the right thing here - clearing that bit before reading the data out seems strange. I may be misunderstanding how that bit works, but that seems racey. I turned on logging and changed the simulator to just return a constant 26.5 degrees and checked that is logged successfully: I have also changed this to enable temperature sensors on all boards with more than 2MB of flash. That includes SITL but does not include the vast majority of STM32 boards (CubeRed and a few others). We do not have flash space to include this on 2MB boards by default. |
Resolved here |
Yuri reports that the enabling of the normal analog and MAX sensor is not enabled by default when temp sensor function enabled
Platform
[ x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
The text was updated successfully, but these errors were encountered: