-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
MPU-6050 no sensor reading #4521
Comments
Hi, your version is 6.3.0.7 but the fixes were applied in the 6.3.0.12 Please, update to latest 6.3.0.15 |
If after updating, you still have issues, we can ask to @VerboteneZone @Bunkerschild for help. |
my fault: I've reported the 'status 0' of the wrong sonoff... At the moment I have 2 sonoffs SV, both upgraded to 6.3.0.15, both with I2C on GPIO4&5, both with an MPU6050 connected. On both devices, I2Cscan reports:
On both devices i get:
|
status 0 for first sonoff:
status 0 for second sonoff:
|
maybe this help:
|
In your previous issue, your sensor was working fine right? What happened? |
No. In my previous issue I was reading something but the MQTT message was incorrect. I don't think this is an issue on the specific sensor, because I'm using 2 different sensors on 2 different sonoffs. BTW, I'm going to test the sensors with an arduino, just to be sure. |
Ok, so we need the help of @VerboteneZone and @Bunkerschild. |
Maybe I found the problem: shitty chinese sensors. I made a short video to explain: https://www.dropbox.com/s/pwnrooxhc8qf9wm/_mpu6050-fsck.mp4?dl=0 I'm shaking only the sensor, so I suppose the raspberry/sonoff/arduino side is ok. |
Ok, That is good news and bad news. So, if it is hardware issue, the driver is OK. It is bad because you need to buy another. Please, let us know if it works with the new sensors. Thanks. |
bad news... |
@VerboteneZone, @Bunkerschild Help please |
Did You try to upload a minimal working example (one of the various ARDUINO sketches on the internet) to your ESP8266 and did this work reliably? I just did this and while the simple sketch runs without a hitch as I just type this, my TASMOTA-builds with the MPU-6050 from today all crash. |
With the help of a friend, I did a new set of tests, with both sensors (2 chinese + 1 amazon). In the evening, or maybe tomorrow, I'll try to flash the exact arduino sketch on both the sonoff-sv and a real arduino, and hope for the best. |
I will do some further tests. |
I'll update my experience.
with
because I needed to specify the correct pins for I2C. On the arduino I get:
on the sonoff I get:
Interesting fact: if I disconnect the sensor from the sonoff, when I power it on, I get the same values... |
Questions:
|
From your last post. You upload the arduino sample sketch to an arduino and also to the esp8266 and in the esp8266 didn't work right? Are you powering the sensor from another power source? Or using the 3.3v from your sonoff? There are some sensors that requiere 5v. May be you are using 5v from your arduino to your sensor and 3.3v from your sonoff to your sensor. Can you try power it up from your arduino (vcc and gnd) but the I2C pins and gnd from your sonoff? (the gnd from arduino needs to be connected also to your sonoff for this test) |
It is still a bit unclear, but it seems, that the sensor readings where always working under the hood in Tasmota, but the construction of the tele message is not working (in my case it even crashes). Can you confirm this? Update: I just read/understood , that even the simple Arduino-sketch does not work on your Sonoff/ESP8266, right? |
Okay, so far so good: I am really scratching my head, why I had to change some things in the code to prevent a repeatable TASMOTA-crash and why it does not crash in the same way for you @paspo. I will try to repeat and extend the tests and then maybe I will do a PR. |
Please, share your changes. May be we can help to determine the crash you experienced. |
Okay, but please understand, that I changed some things in parallel and that it took me a while to find THE crash reason ... and I am still not totally shure. Basically I did the following: #define MQTT_MAX_PACKET_SIZE 1200 (from 1000) in sonoff_post.h snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,"%s":{"Temperature":%s%s%s%s%s%s%s}"), and reduced the sizes for the char[] above the last line from 40 to 30. I am still in the middle of changing values for testing and have one or two additional ideas for the driver. |
cool, thanks for sharing. Just an observation: the Please, try with 1000 again. Thanks. |
Yes, you are right. It still works with 1000. |
D_JSON_TEMPERATURE is just a text |
Yes, I find this strange too and have no explanation how this breaks it for me. |
When you are compiling by yourself, take into account to erase before flash, and to use core 2.3.0 or 2.4.2 |
@ascillato Same results with Tasmota. |
To my knowledge the operating voltage supply for the MPU-6050 should be 2,375 - 3,46 V. Is it really 5V compliant? |
@Staars all the MPU-6050 boards I have here have got small 3v3 voltage regulator onboard. From the spec sheet the input voltage range is 2 to 10V. |
Okay, then I am running out of ideas. I can see no obvious error in your setup. To summarize my point of view: |
I managed to have it working with a very simple arduino sketch without using any external libraries. So I modified this function in xsns_32_mpu6050.ino:
And while readings are correct now (yeah!), I found thins in the console:
which is incorrect and maybe the cause of the errors... So:
Even if this solves my problem (I have to detect a 90 degrees tilt, and get a temperature), I still believe we have to better integrate it into tasmota, maybe with 2 devices support. |
The issue with |
If you have questions regarding DMP, then feel free to ask.
Thatswhy I added DMP. |
@paspo I have done the PR. I would be nice, if you can confirm that it works for you - or not. |
Hi guys, Im working on weather station and experimenting with this module 6050, but cant compile bin file it exits with error code. Can you please have a look what is the problem? |
Hi elik745i, which kind of error code? Please send the error log. |
All good, sorted, using VisualStudio from now on, the problem was with ArduinoIDE. Now I have problems with Magnetic Field Sensor, I need support on that one (( : |
Describe the bug
The values from the sensor aren't updated.
Also, make sure these boxes are checked [x] before submitting your issue - Thank you!
status 0
:To Reproduce
Connect the sensor via I2C and check the returned values in the webui/console
Expected behavior
I expected the values to change (it's a gyro+temperature sensor, so any movement should change the values)
Screenshots
An extract from the console:
On reboot I get a different read, but the Temperature is always wrong and most of the values are zero.
The text was updated successfully, but these errors were encountered: