-
Notifications
You must be signed in to change notification settings - Fork 23
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
Working devices #14
Comments
Sounds Good, @me-no-dev is critiquing / formatting / fixing for inclusion into the main branch. Chuck. |
maybe if I leave this open others will add to it. |
That was the plan.
…On Sat, Dec 2, 2017 at 9:10 PM, chuck todd ***@***.***> wrote:
maybe if I leave this open others will add to it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0jL_YxAq3OUxQSv0rLCT4keGbxmEugks5s8a7MgaJpZM4QzbLT>
.
|
Yea, well, I was excited to have an issue that I could close. ♐️ (any Idea what this means?) I type sarcastic and got Sagittarius? |
Working I2C Slave Devices: MCP23008, 24LC512, 24LC64, 24LC32, DS1307, Arduino Uno as Slave, |
Working I2C slave TSL2561 Light sensor |
BMP280, MCP23017 and ADS1115 confirmed working and stable for several days (running 24\7). AT24C32 not working for me but most likely the library I'm using ((https://github.com/sleemanj/DS3231_Simple) although I cannot see the issue... |
@chinswain looked through that library, Here is the necessary change. uint8_t DS3231_Simple::readEEPROMByte(const uint16_t address)
{
uint8_t b = 0;
if(!i2cReady(EEPROM_ADDRESS)) return 0; // device did not answer
Wire.beginTransmission(EEPROM_ADDRESS); // DUMMY WRITE
Wire.write((uint8_t) ((address>>8) & 0xFF));
Wire.write((uint8_t) ((address) & 0xFF));
#ifdef ARDUINO_ARCH_ESP32
if(Wire.endTransmission(false)!=7) // don't fail on Bare Restart queued
#else
if(Wire.endTransmission(false)) // Do not send STOP, just restart
#endif
{
return 0;
}
if(Wire.requestFrom(EEPROM_ADDRESS, (uint8_t) 1))
{
b = Wire.read();
}
Wire.endTransmission(); // Now send STOP
return b;
} Chuck. |
@stickbreaker I assume I need to add this also to the library?:
|
@chinswain Na, cut the reference to i2cReady(). Didn't see I added that. I went through that library and adjusted it, but the more I looked the less I liked it. the library was kinda written 'general' purpose, but it's pagewrite(), EEPROM_BYTES does not handle >32k eeproms (24lc32..24lc256 only). The reason I use i2cRead() is a design philosophy. This library assume (ass u me) that the EEPROM is always ready when I wants to write/read to it. It then does it's work(read/write) then waits until it is done. uint8_t DS3231_Simple::writeBytePagewizeEnd()
{
if(Wire.endTransmission() > 0)
{
// Failure
return 0;
}
// Poll for write to complete
while(!Wire.requestFrom(EEPROM_ADDRESS,(uint8_t) 1));
return 1;
} This my I just pushed my modified into my fork at stickbreaker/DS3231_simple Chuck. |
Thanks Chuck - I was only using it as it was part of the DS3231 code. Have you come across any Arduino libraries for the AT24C32 that work on the esp32 in an acceptable manner? I'm looking to store a small structure with a handful of dates long term (Load values on boot, update rarely). |
@stickbreaker Confirmed working! |
@chinswain This library extEEPROM looks like it would do what you want. Simple, direct, not flowery. Chuck. |
You can add the MPU9250 to the list of working devices. This did not work with the current git pull of the core. |
@mjs513 will do! |
PCA9685 seems to work well using Adafruit's library |
Another successful story. Thanks Chuck for your i2c fixes. SSD1306 + CCS811 + BME680 = It works now. I applied your fix to latest ESP32 from master (commit a153f6a on Thu Feb 8 15:56:13 2018 +0200). I'm using Adafruit libraries for those 3 i2c sensors/display on a HUZZAH32 – ESP32. I did not have to change my sketch due to API changes :) . The sketch updates display with sensed data every second and sends data via HTTP to a server every 20 seconds. I'm not playing with threads directly. Once in a while I get this in the Serial port but everything keeps working after that. Before this fix it used to crash and not be able to recover from Bus busy/timeout.
Thanks again for this amazing fix. I can finally use the ESP32!!! Gaston |
@gdombiak I'm pleased it works for you. This error message is not actually an error. It is just a message that the total transaction took longer than the calculated time. The calculate transfer time, usings the current bitrate rounded to zero milliseconds, but it actually took two milliseconds, so this device at 0x5A did some clock stretching.
I did not expect this code to still exist in it's current state, it is more of a proof of concept. So, it is way more verbose than it needs to be. Are you using the current release? The current release has a default timeout of 50ms. Earlier version did not have this default. If you are using the current release Chuck. |
Hey @stickbreaker, thanks for the prompt response and detailed explanation. I installed the released version arduino-esp32-master-V0.1.2.zip and applied it to master latest of ESP32. Looking into Wire.cpp I see that the TwoWire constructor uses a timeout of 50 (line 49). I have not configured a timeout explicitly on my code. I can check if Adafruit libraries are changing the Wire.timeout. Let me know if you want me to look or test something locally. Another good news: ESP32 (nodeMCU-32S) + SSD 1306 (128x64) + SHT31-D = success! Thanks, |
@gdombiak The problem was mine, it is debug code that should not trigger at the ERROR level of debugging. See my comment on issue #21. I have incorporated the change in the main repo, but I haven't yet made a new release. You can follow the instructions to apply the change yourself, it will be a while before I make a new release. I am working on SLAVE MODE. Chuck. |
@stickbreaker thanks again! Should I apply your master or just apply your individual/last commit to my local files? Thanks, |
@gdombiak Yea, that will work if you have a fork. Most people just download the zip or manually merge the files into the current espressif/arduino-esp32. My fork is not up to date with the espressif/arduino-esp32. It is a couple of months old. Chuck. |
Tested sucessfully: DOIT Devkit V1 and Devkit and AZDelivery ESP32 DevKitC with following i2c devices:
|
Just to confirm that I have NO problems anymore with: |
MMA8452 Great fixes. Thanks! |
PCF8575 not working although I suspect it's an incompatibility with the library (https://github.com/skywodd/pcf8574_arduino_library/tree/master/PCF8575) |
I want to confirm that I have the following devices working properly with your code:
DS3231 (RTC)
AT24C32 (EEPROM)
BME680 (TEMP/PRES/HUMI/GAS SENSOR)
Noteworthy is, that I have all I2C communication coded so I never have to use endTransmission(false);
The text was updated successfully, but these errors were encountered: