m5stack / M5Unit-ENV

Contains M5Stack-UNIT ENV series related case programs.ENV is an environmental sensor with integrated SHT30 and QMP6988 internally to detect temperature, humidity, and atmospheric pressure data.
MIT License
34 stars 25 forks source link

Hat ENV III on StickC Plus doesn't work #9

Closed Josecc closed 1 year ago

Josecc commented 1 year ago

I downloaded a zip of this library to use on Arduino since the latest published version was 0.0.6 and that one does not contain Env Hat III Support.

With that, I was able to compile the this sample code for the Hat ENV III on my M5StickCPlus. However, the LCD screen does not show any changes and all the values are stuck at 0:

Temp: 0.0 humi: 0% Pressure: 0Pa

I'm wondering if this is the reason the 0.0.7 is not released yet, and what I can do to get the Hat ENV III readouts working on the M5StickCPlus?

Tinyu-Zhao commented 1 year ago

Sorry, I have updated the example, please try again.

reflectingme commented 1 year ago

Despite updating the relevant code, I too have the very same issue. No response from the HAT ENVIII on the M5StickCPlus. The display prints the correct message, with label text, but no data from the SHT30 sensor is printed - exactly the same as @Josecc above.

It works fine when I attach the ENVIII Unit device via the grove connector, and when I try to see what's happening by adding the second line here:

    M5.lcd.println(F("ENVIII Hat(SHT30 and QMP6988) test"));
    M5.lcd.println(Wire.begin());

... which should return and print 0 for Unit and 1 for Hat - always returns a 1, regardless of wether a ENVIII Unit or ENVIII Hat , or both are connected AND very surprisingly, the M5StickCPlus displays the correct temp/pressure and humid when I have the Unit ENVIII connected which it shouldn't because according to the code, the SDA and SCL ports (Wire.begin(0, 26) for the HAT) should not then be correctly assigned for the ENVIII Unit.

Please can you advise further as something is not correct here. Happy to reply with more info if needed.

Thanks

Tinyu-Zhao commented 1 year ago

Please try this https://github.com/m5stack/M5Unit-ENV/tree/master/examples/Hat_ENVIII_M5StickCPlus

reflectingme commented 1 year ago

Thanks @Tinyu-Zhao - many thanks for replying so quickly, I am impressed, thank you.

I had already tried that code, but for completeness I did so again just now and I still get the same issue - no data shown on the M5StickCPlus display. It works fine when I connect the ENVIIi Unit, without even needing to recompile the code - which is strange as it should not work when this is connected without resetting the SDA and SDL lines from those used for the ENVIII HAT.

This is proving to be a very strange issue for me indeed.

Tinyu-Zhao commented 1 year ago

Thanks @Tinyu-Zhao - many thanks for replying so quickly, I am impressed, thank you.

I had already tried that code, but for completeness I did so again just now and I still get the same issue - no data shown on the M5StickCPlus display. It works fine when I connect the ENVIIi Unit, without even needing to recompile the code - which is strange as it should not work when this is connected without resetting the SDA and SDL lines from those used for the ENVIII HAT.

This is proving to be a very strange issue for me indeed.

Sorry, please try to use this new library, you need to remove the original M5Unit-ENV and pull the whole library.

https://github.com/Tinyu-Zhao/M5Unit-ENV

reflectingme commented 1 year ago

Sorry, please try to use this new library, you need to remove the original M5Unit-ENV and pull the whole library.

Just did this as you suggested and I am so sorry, this now works perfectly. I did previously update the Hat_ENVIII_M5StickCPlus directory, but hadn't updated the entire M5Unit-Env library.

Thank you so much for your support @Tinyu-Zhao - especially at what must be a time late in the day for you. Really, very much appreciated.

Thanks and greetings from South Wales, UK.👍

reflectingme commented 1 year ago

Sorry, please try to use this new library, you need to remove the original M5Unit-ENV and pull the whole library.

Just as a FYI @Tinyu-Zhao - the calibration is a fair bit out on the ENVIII HAT.

When I measure the temp on my ENVIII Unit it differs from the ENVIIi HAT

Unit: 26.8 DegC HAT: 28.2 DegC

in the same location, just next to each other. Is there any calibration code I can adjust?

Tinyu-Zhao commented 1 year ago

Sorry, please try to use this new library, you need to remove the original M5Unit-ENV and pull the whole library.

Just as a FYI @Tinyu-Zhao - the calibration is a fair bit out on the ENVIII HAT.

When I measure the temp on my ENVIII Unit it differs from the ENVIIi HAT

Unit: 26.8 DegC

HAT: 28.2 DegC

in the same location, just next to each other. Is there any calibration code I can adjust?

This is what I should do, this is a problem I will check to see if there is a solution to it.

reflectingme commented 1 year ago

This is what I should do, this is a problem I will check to see if there is a solution to it.

OK @Tinyu-Zhao - if I can help with testing or data, please let me know as I have the following units:

I also have these sensors...

... and am more than happy to test any code you update with any of those devices.

PS: I also have many other sensors, 8 unit rotary encoder, single rotary encoder, RFID cards and readers, GPS devices, and will also be buying many more of your products. 👍

reflectingme commented 1 year ago

Hi @Tinyu-Zhao - I have coded up a small alternate file that people are free to use as an alternative to the demo BCT Standing Base Unit file. Feel free to have a look and check it out. Here's the link to my GitHub repo.

https://github.com/reflectingme/M5Stack_Standing_Base_SHT30

Tinyu-Zhao commented 1 year ago

Merged. https://github.com/m5stack/M5Unit-ENV/commit/f188c61511f2298aa0e3e84176948f36680b9110