Skip to content
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

i2c Write Issue #834

Closed
PhilColbert opened this issue Nov 14, 2017 · 125 comments
Closed

i2c Write Issue #834

PhilColbert opened this issue Nov 14, 2017 · 125 comments

Comments

@PhilColbert
Copy link

Attaching a ms5611 ( GY86 ) to the esp32 on i2c - works perfectly for about 5-10 minutes - some strange values do come in however it seems to work pretty well.

Then loads of

[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 77

Board needs to be reset to start again

Any ideas?

Thanks

@atanisoft
Copy link
Collaborator

seems similar to #811 or #741.

@PhilColbert
Copy link
Author

Yes, seems so :( Just wondered if anyone had a solution yet !? :)

Seems strange this has only come up now, surely theres a lot of people that use i2c on the esp32 !

@lonerzzz
Copy link
Contributor

lonerzzz commented Nov 14, 2017

@PhilColbert No solution as of yet. @stickbreaker and myself have been working it. The latest code that I submitted increased the timeout, but there appear to be hardware timing issues that need to be adapted in software. At the same time, @stickbreaker is working to add interrupt based handling to better meet the timing needs. So far it is slow going as we are dealing with a chip having a number of hardware defects and a poor interrupt handling design.

I also added code for resetting the I2C subsystem. I have been running this code for weeks with it being able to recover; it is just avoiding the errors in the first place that is more problematic.

@PhilColbert
Copy link
Author

PhilColbert commented Nov 14, 2017

Is it possible to try this code that allows reset ? :)

Thanks

@josmunpav
Copy link

josmunpav commented Nov 14, 2017

I am getting an issue with my MCP7940 (RTC) that constantly is saying this annoying message:

[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 6f.

The only "fix" is to be all the time resetting the I2C protocol in order to access to my device. I am only accessing this device about once a second but in my product will be another I2C device using the bus far more often.

Pullup resistors for SDA and SCL lines are 4.7K. Tried with several frequencies up to 400KHz which is the maximum supported by the MCP7940. All behave the same so I am not sure what is the problem.

Any ideas what is going on? Btw I am using multiple core tasks (one for WiFi/web server, another for logic), no Bluetooth

@stickbreaker
Copy link
Contributor

Look thru the code library that you are using. If it uses Wire.endTransmission(false); or Wire.requestFrom(id,length,false); You are probably running into this timeout issue because of a task switch. @lonerzzz and I are attempting to create a solution.

The current Wire() library implements the ReSTART I2C operation by just pausing the I2C operation. If the I2C operation is not resumed within a small fixed window, the I2C hardware explodes with a TimeOut Error. The method I am currently working on queues Wire() operations until a STOP is encountered. Then it executes all of the I2C operations in one continuous sequence. I am hopeful that I will have a ALPHA version available for testing in the next week or two.

It is enough different than the Wire() library standard that I suspect adoption by espressif/Arduino-ESP32 will be difficult. I don't have all I2C devices to test it against. So my Limited subset of compatibly testing may be judged inadequate.
But, I'm having fun building it! 😀

Chuck.

@atanisoft
Copy link
Collaborator

atanisoft commented Nov 15, 2017

@stickbreaker, when you have it ready I can test on a few I2C devices as well (LCDs and OLEDs are what I have now)

@PhilColbert
Copy link
Author

Thanks for the work ! I have a few different i2c devices so can test aswell.

@stickbreaker
Copy link
Contributor

@atanisoft @PhilColbert @josmunpav try my fork at stickBreaker:arduino-esp32
It should solve your problems, Or your money Back! 😀

Chuck.

@jlhavens
Copy link

I am very appreciative of your efforts on the I2C front, but having tried your library I may be requesting a partial refund. The ESP32 problem I have encountered is simultaneously using I2C and WiFi . In particular, I am using an ADS1115 and BMP280 while accessing the data over the internet. Initially, everything is fine, but after 1-4 hours the I2C stops working correctly--when one I2C device fails the other does too. I tried all kinds of power supply remedies without success, and eventually found other users reporting I2C problems. I tried a couple different 'reset' routines, and they might work a couple times, but eventually that recovery failed, too. The problem remains unresolved.

Anyway, since I had a GY521 on a breadboard I tried your modified library on that. The code I am using is basically from Section 4 ('readings that make sense') of https://olivertechnologydevelopment.wordpress.com/2017/08/17/esp8266-sensor-series-gy-521-imu-part-1 . When I compiled and ran the code I got consistent readings, but they were incorrectly factored. The easiest to understand are the AcX , AcY , AcZ which should add to 1 g (gravitation unit) (like AcX = 0.98 g| AcY = 0.02 g| AcZ = -0.01 g), but mine added up to 0.25 g like (AcX = 0.24 g| AcY = 0.01 g| AcZ = -0.01 g). Using the standard ESP32 core and libraries, I got the correct scaling so I didn't make any effort to trouble-shoot the problem.

I'm not asking you to solve this particular problem. I've made this comment to let you know there are people out here who are appreciative of your efforts and hoping they will solve our problems. This is just one data point that 'might' indicate some issue with writing to the device.

Thanks, Jeff.

@stickbreaker
Copy link
Contributor

@jlhavens are you running under arduino?
this code is designed to give debug output when it fails, in order to see this output, you have to select board as "ESP32 Dev Module" and set the "Core Debug Level:" to "Error"

If you could do this and post a capture of the debug output it would be helpful.

thanks,

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens Did you notice any difference between the mainBranch Arduino and my code? Did they both fail about the same amount or at the same time?
Reports of any differences would be valuable.
Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens on the timeout: Are you are getting a "Gross Timeout Dead" on the console? I may have been too optimistic on my ISR timeout, I only allow a calculated (bit rate based)+50ms for the I2C transactions to be completed. If this is your Error message it is easy to fix.
But if the timeout is the I2C bit timeout that will be harder. The I2C hardware will only allow upto 13ms before it triggers a hard Timeout. Currently I have if configured to the max.

@jlhavens
Copy link

I'm sorry, I should have realized that you are a lot more interested in a report on the results of your efforts to improve stability than what is probably a lesser glitch in the implementation of a particular sensor.

I didn't really allow this to run until the I2C issue occurred. When I didn't get the correct results, I let it run a couple minutes and went on to something else. Sorry. Taking a closer look at the data I see that the raw data (sensor reading) is the same when using both your and the standard libraries. The program both sends the scaling factors, and reads them back later, every loop through. The received scaling_factor values are used to scale the raw data and those are different in the two environments. Since the raw data is the same in both environments but the read back scale factors are different, I would guess that the reading back the scale factors is amiss. This is the code:

Set in loop() -------- setMPU6050scales(MPU_addr, 0b00000000, 0b00010000);

void setMPU6050scales(byte addr, uint8_t Gyro, uint8_t Accl) {
Wire.beginTransmission(addr);
Wire.write(0x1B); // write to register starting at 0x1B
Wire.write(Gyro); // Self Tests Off and set Gyro FS to 250
Wire.write(Accl); // Self Tests Off and set Accl FS to 8g
Wire.endTransmission(true);
}

void getMPU6050scales(byte addr, uint8_t &Gyro, uint8_t &Accl) {
Wire.beginTransmission(addr);
Wire.write(0x1B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(addr, 2, true); // request a total of 14 registers
Gyro = (Wire.read()&(bit(3) | bit(4))) >> 3;
Accl = (Wire.read()&(bit(3) | bit(4))) >> 3;
}

Sending Gyro = 0x00 Accl = 0x10
Reading back Gyro = 0x10 Accl = 0x00 in your environment (incorrect scaling)
Reading back Gyro = 0x00 Accl = 0x10 in normal environment (correct results)

Sorry, none of this answers any of your questions.

I will set the system up again with the "Core Debug Level:" to "Error" and see if I can capture an error message. I have output going to the serial monitor and assume that the error output will go there?

I'll let you know how it goes.
Jeff

@jlhavens
Copy link

I didn't mention. I got some compiler warning and have cut and pasted them into
CompileWarnings.txt

@jlhavens
Copy link

In order to test on a target I knew had a history of failing, I compiled the software known to run for a while (usually a couple hours) on my real target using your library. It crashed after a few seconds. The setup has an HM10 on HardwareSerial(2) , BMP280, ADS1115, and a DS18B20. The DS18B20 and (BMP280 and ADS1115) are each running in separate tasks pinned to core 1. The DS18B20 runs alone just fine with WIFI. Each task takes new reading at about 1 second intervals. It is reading the sensors and sending results over WIFI on a page that calls for an update every second--so the WiFi is regularly getting hit. The data that I got seemed to be fairly correct, but a few fliers. The software sends the data to the serial port only when a WiFi update is requested. I sends a '.' to serial every time the data updates whether it is sent out on WiFI or not. I typically got 1-10 readings before an error was thrown. If the WIFI isn't calling for data, it seemed to go without error for quite a few data updates-- a long row of dots. I didn't run this to failure with the WiFi not calling for data, but it went about 20 minutes without error while I was writing this message.

I've sent a chunk of output in
Error_output.txt.

It shows the output and Gross Timeout Error is seen frequently.

Every once in a while it has some data (1-10 readings at 1 second intervals) that looks like this
.T==74.37 F T_DS==70.70 F P=72.17 mm V=9063 V
.T==74.37 F T_DS==70.70 F P=72.17 mm V=9072 V
.T==74.35 F T_DS==70.70 F P=72.17 mm V=9048 V
If I stop the WiFi data request, the output looks like this (with 1 second (reading) for each '.')
.............................................
like at the very end of the file.

I included so much data in case there is something to see when it first threw the error compared to the subsequent error cycle.

Hope this is helpful.

Jeff

@stickbreaker
Copy link
Contributor

stickbreaker commented Nov 18, 2017

@jlhavens
Looking at that error ouput, the i2cProcQueue() is timing out waiting for the ISR EventGroup flags to change.

[E][esp32-hal-i2c.c:1643] i2cProcQueue():  Gross Timeout Dead st=2492, ed=2542, =50, max=50 error=1
[E][esp32-hal-i2c.c:1103] dumpI2c(): i2c=0x3ffc1040
[E][esp32-hal-i2c.c:1104] dumpI2c(): dev=0x60013000
[E][esp32-hal-i2c.c:1105] dumpI2c(): lock=0x3ffd343c
[E][esp32-hal-i2c.c:1106] dumpI2c(): num=0
[E][esp32-hal-i2c.c:1107] dumpI2c(): mode=1
[E][esp32-hal-i2c.c:1108] dumpI2c(): stage=3
[E][esp32-hal-i2c.c:1109] dumpI2c(): error=1
[E][esp32-hal-i2c.c:1110] dumpI2c(): event=0x3ffd34c0 bits=0
[E][esp32-hal-i2c.c:1111] dumpI2c(): intr_handle=0x3ffd08d4
[E][esp32-hal-i2c.c:1112] dumpI2c(): dq=0x3ffe1734
[E][esp32-hal-i2c.c:1113] dumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:1114] dumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:1115] dumpI2c(): byteCnt=4
[E][esp32-hal-i2c.c:1120] dumpI2c(): [0] 90 W STOP buf@=0x3ffc3542, len=3, pos=3, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:1468] i2cDumpInts(): row  count   INTR    TX     RX
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [01] 0x0001 0x0002 0x0004 0x0000
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [03] 0x0004 0x0040 0x0000 0x0000
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0000  

that top line:

[E][esp32-hal-i2c.c:1643] i2cProcQueue(): Gross Timeout Dead st=2492, ed=2542, =50, max=50 error=1

is saying that the xTaskTick was 2492 when the ISR was started, and xEventGroupGetBits() returned at
2542, a difference of 50, and the maxTimeOut was set to 50.
Based on other values in this dump, it looks like when the ISR was exiting, Setting the values for event in line :1110 it got preempted. and the 50ms timeout expired for the call.
byteCnt = 4 shows that 4bytes moved through the I2C state machine, the DumpInts() show a successful transfer.

As a fix increase the timeout for the ISR at line 1592 in esp32-hal-i2c.c
that calculation is probably too tight. It calculates an 10 bits of clock for each byte, each byte is actually only 9 clocks, each START is one clock and each STOP is one clock. Then adds 50ms.
Change the 50 to? Well how about 500. One half second should be long enough.

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens Those compiler warning are all my fault, This code is dirty. Before we release it they will all be fixed.

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens
At line 773 of the debug output is show that the I2C hardware was locked up busy, at Boot. Usually this means that one of the I2C slave devices was confused by the ESP crash and is holding the SDA low, There is coding in the wire library to recover. but It look like the recovery failed.

[E][esp32-hal-i2c.c:947] i2cInitFix(): Busy at initialization!
[E][esp32-hal-i2c.c:1103] dumpI2c(): i2c=0x3ffc1040
[E][esp32-hal-i2c.c:1104] dumpI2c(): dev=0x60013000
[E][esp32-hal-i2c.c:1105] dumpI2c(): lock=0x3ffd343c
[E][esp32-hal-i2c.c:1106] dumpI2c(): num=0
[E][esp32-hal-i2c.c:1107] dumpI2c(): mode=1
[E][esp32-hal-i2c.c:1108] dumpI2c(): stage=3
[E][esp32-hal-i2c.c:1109] dumpI2c(): error=6
[E][esp32-hal-i2c.c:1110] dumpI2c(): event=0x3ffd6aa0 bits=92
[E][esp32-hal-i2c.c:1111] dumpI2c(): intr_handle=0x3ffd08d4
[E][esp32-hal-i2c.c:1112] dumpI2c(): dq=0x3ffd6aec
[E][esp32-hal-i2c.c:1113] dumpI2c(): queueCount=2
[E][esp32-hal-i2c.c:1114] dumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:1115] dumpI2c(): byteCnt=0
[E][esp32-hal-i2c.c:1120] dumpI2c(): [0] ec W STOP buf@=0x3ffc3542, len=1, pos=1, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:1120] dumpI2c(): [1] 48 W STOP buf@=0x3ffc3542, len=3, pos=0, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:1468] i2cDumpInts(): row  count   INTR    TX     RX
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [01] 0x0001 0x0002 0x0002 0x0000
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [02] 0x0001 0x0100 0x0000 0x0000
[E][esp32-hal-i2c.c:1103] dumpI2c(): i2c=0x3ffc1040
[E][esp32-hal-i2c.c:1104] dumpI2c(): dev=0x60013000
[E][esp32-hal-i2c.c:1105] dumpI2c(): lock=0x3ffd343c
[E][esp32-hal-i2c.c:1106] dumpI2c(): num=0
[E][esp32-hal-i2c.c:1107] dumpI2c(): mode=1
[E][esp32-hal-i2c.c:1108] dumpI2c(): stage=3
[E][esp32-hal-i2c.c:1109] dumpI2c(): error=6
[E][esp32-hal-i2c.c:1110] dumpI2c(): event=0x3ffd6aa0 bits=92
[E][esp32-hal-i2c.c:1111] dumpI2c(): intr_handle=0x3ffd08d4
[E][esp32-hal-i2c.c:1112] dumpI2c(): dq=0x3ffd6a7c
[E][esp32-hal-i2c.c:1113] dumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:1114] dumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:1115] dumpI2c(): byteCnt=0
[E][esp32-hal-i2c.c:1120] dumpI2c(): [0] 76 R STOP buf@=0x3ffc34bc, len=1, pos=0, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:1468] i2cDumpInts(): row  count   INTR    TX     RX
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [01] 0x0001 0x0002 0x0004 0x0000
[E][esp32-hal-i2c.c:1471] i2cDumpInts(): [02] 0x0001 0x0100 0x0000 0x0000

error = 6, is timeout
the event bits 0x92 is saying timeOut_error, Done, Error
bytepos = 0, no bytes moved through the I2C hardware

DumpInts [01] shows the txEmpty IRQ (0x0002) fired once (0x0001), and moved two bytes (0x0002) into the fifo.
DumpInts [02] shows the timeOut IRQ (0x0100)fired once (0x0001) and that was all she Wrote!
Basically the ISR work, but the Hardware refused to touch the I2C bus.

I think increasing the Gross Timeout would eliminate this cascade.

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens Looking at the code, The ISR was in it's exit stage but yielded when it called
xEventGroupSetBits() at line 1273 of esp32-hal-i2c.c and that yield exceeded 50ms.

Definitely, a O/S task switch issue. Increasing that Gross TimeOut should resolve it.

in a reply to: #844 I said this:

I just made a new branch NoYield, It just comments out the portYIELD_FROM_ISR() calls in the ISR. Try commenting them out in
/cores/eps32/esp32-hal-i2c.c
lines:
1269,1275,1329,1334,1375,1384,1436

But, based on your error Report, the Yield happened during the xEventGroupGetBits(). Not after it. So commenting out the following yields would not have any effect.

I'll have to look a the xEventGroup timeout, maybe loop again? I don't know how to release/return to the ISR. I would expect the ISR to have higher priority than the Main Loop(i2cProcessQueue)?

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens @lonerzzz @me-no-dev More Research, changed conclusion.
With more exploration, I have came to another conclusion.
Changing the Timeout would not solve this problem.
Reading the FreeRTOS documentation on xEventGroupSetbitsFromISR(). I think the call to it failed in the ISR.
The way I understand it, xEventGroupSetBitsFromISR() tries to creates a message in the RTOS daemon task that actually does the bit setting. If the RTOS daemon Task's timer Command Queue was full this messages was never created.

Page. 311 of FreeRTO_Reference_Manual_V9.0.0.pdf

So, the Bits were Never set.

So, the TimeOut is guaranteed.

I'm going to recode the exit to test xEventGroupSetBits()'s return code. And try to catch this error.

Chuck.

@stickbreaker
Copy link
Contributor

@jlhavens attached is a modified esp32-hal-i2c.c that may work around this issue. Can you please try it. It looks like your code explodes with out any delay. ReCreating failures is always the hardest Part.

esp32-hal-i2c.zip

Chuck.

stickbreaker added a commit to stickbreaker/arduino-esp32 that referenced this issue Nov 19, 2017
@jlhavens in [espressif#834 of espressif/arduino-esp32](espressif#834) is encountering some issues that could be related to a FreeRTOS Timer Daemon message Queue Full.  This change is a trial work around
@jlhavens
Copy link

I did the esp32_hal_i2c.c substitution and this is the resulting output Error_output2.txt

I also modified the program to strip out the DS18B20 and BMP280, so that only the ADS1115 was being read and reported by WiFi. At the start I got errors similar to the ones from the previous program. I recompiled with the new hal and have attached the output. Error_output3.txt. Once it got past the first error, it ran fine for an hour with the WiFI asking for updates every second.

I initially had a 25 ms delay before the first ADS1115 read but tried to remove it. When I did that, I got continuous reboots. It turned out that I needed at least a 2 ms delay before the very first read, but after that none was required. While writing this it occurred to me to have a longer delay might prevent the error at start-up. With a 5 second delay before the first ADS1115 read I don't get the startup error in the ADS1115 only code. Output looked like this.
Error_output4.txt

Jeff

@stickbreaker
Copy link
Contributor

@jlhavens
Output2.txt shows what I was expecting, The FreeRTOS dispatch Daemon is being overrun, Some task is being piggy and not allowing the dispatch Daemon to do its work. I can work around it I think, but It is a symptom of bigger problems.
from the first of output2.txt

 Dallas sensors found.
..[E][esp32-hal-i2c.c:1629] i2cProcQueue(): EventGroup Failed:0x0!=0x10
[E][esp32-hal-i2c.c:1629] i2cProcQueue(): EventGroup Failed:0x0!=0x10
[E][esp32-hal-i2c.c:1629] i2cProcQueue(): EventGroup Failed:0x0!=0x10
[E][esp32-hal-i2c.c:1275] i2cIsrExit(): Clear Event Running Failed
[E][esp32-hal-i2c.c:1286] i2cIsrExit(): set ExitCode Failed, ec=0x10
[E][esp32-hal-i2c.c:1629] i2cProcQueue(): EventGroup Failed:0x0!=0x10

The first 3 lines show timeOut's but they don't show the ISR got a fail when it tried to set the progress bits.

the Last 3 lines are what I was expecting, Those are all on the exit path. 1&2 in ISR, 3 the timeout back in i2cProcessQueue()

How are you communicating with the OneWire Devices? I Know that protocol is very time sensitive. Are you disabling interrupts to get accurate timing?

I think the WiFi is being piggy. While it is initing, it is not allowing other processes any time. I do not know how to prove this 'theory' but it feels correct.

If you allow the 5 second delay at boot, then start your sensor scans (including the OneWire devices) how does is respond?

How fast are you polling the ads1115?

All I can see from # 3 is 12 cycles that EventGroups failed. between the two period(.) markers

It does not show how many completed without errors.

Even those 12 should have correctly return/written data from/to the ads1115.

is output4 what you expect? Halfway down # 25 has two periods?

I chose to use EventGroups to synchronize the hand off of queue data to the ISR and accept it back when the ISR had completed. The Timeouts were caused when the ISR was not able to hand the batten back to i2cProcessQueue(). With the modified code, the timeout causes a +50ms delay in APP. As long as the ISR actually completes it work, before the +50ms expires, the effect is minor.

If EventGroup are not stable, I'll have to think of something else.

Chuck.

@jlhavens
Copy link

I left the system that is only reading the ADS1115 and sending to WiFi running overnight and it ran without error (about 10 hours). That is a good result. Using the standard library I wouldn't have expected it to go that long error free, but I didn't previous have this exact program running so no absolute conclusion can be drawn.

Replies:
How are you communicating with the OneWire Devices? I Know that protocol is very time sensitive. Are you disabling interrupts to get accurate timing? -->Here is the basic code One_Wire.txt, but I am not the author. I don't see any indication that interrupts are disabled, but I don't know what is happening in the OneWire Library. I found this code in a forum where someone else also had a problem using the standard Dallas library with either the esp32 or the esp8266.

If you allow the 5 second delay at boot, then start your sensor scans (including the OneWire devices) how does is respond?--> Have not yet done that, but I can.

How fast are you polling the ads1115?--> About once every second I am taking 20 consecutive reading and then averaging them. There is a built in 8 ms delay in the Adafruit library that waits for the conversion to complete. I set a timer and the read cycle is taking about 180ms.

All I can see from # 3 is 12 cycles that EventGroups failed. between the two period(.) markers
It does not show how many completed without errors .--> The two periods indicate that two readings were completed. A period is printed at the end of a read cycle. The actual data is only sent to the serial output when the wifi calls for an update.

is output4 what you expect? Halfway down # 25 has two periods? --> yes, output is as expected. Two periods together just indicate that two readings were taken between WiFi updates.

I will go back to the code that read all the sensors and see what the 50ms delay does. I think I will then try the bmp280/WiFi combination to see how well that works.

Jeff

@jlhavens
Copy link

Chuck,

I added a 5 sec delay before the first reading in the system with I2C and OneWire (ADS1115,BMP280,DS18B20). It ran for somewhat longer, but failed after about 20 readings. The output is here.
Error_output_AllSensors_50ms_Delay.txt

I then took the same code and stripped out the BMP280 calls. That gave error free startup and it ran for about 15 minutes without errors. I stopped it to continue other tests. So the ADS1115 and DS18B20 were both running error free.

I realized that in my code I was starting the tasks to read the sensors before I started the WiFi, Like this:

void setup(void){
...
xTaskCreatePinnedToCore(
A2DTask, //Function to implement the task
"A2DTask", // Name of the task
4000, // Stack size in words
NULL, // Task input parameter
5, //Priority of the task
NULL, // Task handle.
1); // Core where the task should run

WiFi.begin(ssid, password);

// attempt to connect to Wifi network:
while(WiFi.status() != WL_CONNECTED) {
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
delay(500);
mySerial.print(".");
}
...
}

I considered that the WiFi startup was the resource hog causing problems at the beginning, so I moved the xTaskCreatePinnedToCore call to after the WiFi.begin and wait for the WiFi.status change. After that edit, the program started error free without the 5 second delay (or any delay) before the first A2D conversion. It has run for 20 minutes without any errors.

Jeff

@stickbreaker
Copy link
Contributor

@jlhavens Sounds like you have found the correct sequence. There is a BackTrace decode that you could use to see where the Guru failure occurred.

I hope it was not in my code 😬 😨
Chuck.

@jlhavens
Copy link

Chuck,

I moved on to the BMP280 sensor. I set up a program like that ADS1115 that reads the data in a separate task and then when the WiFi calls for an update it sends the data both to WiFi and serial.
That setup seemed to work okay for a 5-10 minutes, so I made a change.

I set it to read the bmp280 in both a separate task and in-line. In the task, it reads the device and assigns the result to a variable that's used when data is called for. In-line it simply reads the device while it is generating the output and sends it -- like Serial.print( (bmp.readTemperature()*(9.0/5.0))+32);
That ran for a10 minutes then threw an error. It rebooted and then after a couple minutes threw another error. The output contains both the task-read value and the in-line value. The failure seemed to take place when the in-line reading was taking place. The data output looks like
12:12 T=74.61 *C T=74.59 *C P=73.60 mm P=73.60 mm Calc=0ms
where the first T= is Task-read and the second T= is in-line, The same for the two P=.
The failed output look like this:
12:14 T=74.59 *C T=74.59 *C P=73.60 mm P=Guru Meditation Error of type LoadProhibited occurred on core 1. Exception was unhandled.
Which looks to me like it fails at the second P= which is the in-line reading. I've attached the output here. Error_output_BMP280_3.txt

I used the BackTrace on the output (two different times) and got Error_output_BMP280_3_decode.txt. It is pointing to esp32-hal-i2c.c

I have continued to pursue this and have found that inserting a 25ms delay before the data is read in the task gave me 20 minutes run time without any errors. When I only read the data in-line it also ran for 20 minutes without error. If I only read the data in the task (without the 25ms delay) it ran for 20 minutes without error. In a retest, I read both in-line and in-task without the 25ms delay and in 10 minutes I got an error.

I'll try to setup something for a longer test tonight.

Jeff

@rrobinet
Copy link

rrobinet commented Jan 7, 2018

Hi,
I use a BME280E connected with I2C on a Wemos Lolin 32 and I am regularly losing the connection with the BME module.
Currently the only solution I have is to reboot the Wemos. Is there a final solution for this issue or should I better connect it via SPI.

Thanks
Robert

@stickbreaker
Copy link
Contributor

@rrobinet are you using my fork stickbreaker/arduino-esp32 or the official fork (this one)?

If you are not using my fork, try it. My fork is a revision to implement I2C reliably.

Chuck.

@rrobinet
Copy link

rrobinet commented Jan 7, 2018

Thanks Chuck,
I am loading it now and will see if its is more stable
Robert

@rrobinet
Copy link

@stickbreaker
Hi Chuck,
Any idea when this version will be incorporated in the official set?
Robert

@Sterpa
Copy link

Sterpa commented Jan 24, 2018

I use M5Stack(ESP32) with built-in MPU9250 and have the same problem with i2c when start WiFi.begin()
M5Stack code example for MPU9250 (based on kriswiner code) works only w/o WiFi. If WiFi turns on - i lost MPU9250 connection in a few secconds.

[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 77

So, when your version will be incorporated in the official set?)) Please!

@ifrew
Copy link

ifrew commented Jan 27, 2018

@stickbreaker Hi Chuck, I pulled down the latest core for ardunio yesterday and the latest files you have from your forked branch for the4 wire and i2c files. After compiling I started getting busy timeout error again.

Comparing what I had before (I kept a copy) I noticed that in the wire reset method that i2cFreeQueue(i2c) was missing. You had previsouly informed Phil and I in this thread that we should have that. I put it back in and I haven't been getting those timeout errors now. I have been getting exception due to heap corruption for another reason and upon reboot I immediately get the busy timeout errors. But I expect that this is due to the state of the SDA line when it is soft rebooted. Only way to clear is to do a hard reset (ie power off/on).

Just thought you would want to know

void TwoWire::reset(void)
{
// Iain added back the i2cFreeQueue

    i2cFreeQueue(i2c);
    i2cReleaseISR(i2c); // remove ISR from Interrupt chain,Delete EventGroup,Free Heap memory
    i2cReset( i2c );
    i2c = NULL;
    begin( sda, scl );
}

@stickbreaker
Copy link
Contributor

@ifrew did you download the the 'Release 1' zip or did you grab the whole fork? They are the same, I'm just curious.

I walked back through the change history of wire.cpp and I cannot find anywhere a version that had i2cFreeQueue() in it. It won't cause a problem to include it, I'll do some thinking about the ramifications and benefits of its inclusion.

I'll check my dev code when I get home. My dev code barely compiles right now. I am playing with slave mode ISR and it is kicking my ass.

Chuck.

@ifrew
Copy link

ifrew commented Feb 5, 2018

just back from vacation....I downloaded the latest fork but then just copied the 4 files across.

@stickbreaker
Copy link
Contributor

@ifrew are you still having problems?

Chuck.

@ifrew
Copy link

ifrew commented Feb 19, 2018

Unfortunately yes. But I think as discussed earlier its the mpu i2c interface of the 9250. I'm looking at alternate mpus. It's a pity though that it fails on the esp32 due to its 2 core architecture. Runs fine on the esp2866. Still waiting for idf 3.0 to release so the ardunio core can be updated. lots of heap issues still.

@nemerdaud
Copy link

Hi stickbreaker. Just to let you know, this fix works like a charm for me. I'm using MMA8453 accelerometer controlling it by i2c and it was incurring in the same problem before your pack. I'm running and testing it for over 1 month without problems. Thank you for the fix! I wonder if you think to merge this in the official release soon.

@stickbreaker
Copy link
Contributor

@nemerdaud I have had a pullrequest in since Nov 2017. Out of my hands.

Chuck.

@valki2
Copy link

valki2 commented Mar 24, 2018

@stickbreaker Just wanted to thank you for your work here!
I went nuts with my dryaging project as i simply could not understand my i2c issues... until i found your thread and branch here :)
All problems solved - THANK YOU - and hope they will pull your changes into the master soon...

@stickbreaker
Copy link
Contributor

@valki2 Glad to hear it is working for you. Over on my fork there is an open issue that lists compatible devices. If you can add your successes that would be nice.

Chuck.

@valki2
Copy link

valki2 commented May 19, 2018

@stickbreaker HI Chuck! Still everything is working pretty stable - but i get crashes every some days. I am using your latest patches and i am not sure if the the cause for the instability comes from i2c. Could you make a guess based on this log?

(the sketch is outputting "vpsat.... " etc and upon init the first task is the i2c scan.)

`vp_sat: 856.694 vp_part: 551.677 ahum_int: 3.320 lastcheck: 0
[E][esp32-hal-i2c.c:1136] i2cProcQueue(): TimeoutRecovery: expected=0ms, actual=13ms
[E][esp32-hal-i2c.c:620] i2cDumpI2c(): i2c=0x3ffc116c
[E][esp32-hal-i2c.c:621] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[E][esp32-hal-i2c.c:623] i2cDumpI2c(): lock=0x3ffce08c
[E][esp32-hal-i2c.c:625] i2cDumpI2c(): num=0
[E][esp32-hal-i2c.c:626] i2cDumpI2c(): mode=1
[E][esp32-hal-i2c.c:627] i2cDumpI2c(): stage=3
[E][esp32-hal-i2c.c:628] i2cDumpI2c(): error=1
[E][esp32-hal-i2c.c:629] i2cDumpI2c(): event=0x3ffce90c bits=210
[E][esp32-hal-i2c.c:630] i2cDumpI2c(): intr_handle=0x3ffce010
[E][esp32-hal-i2c.c:631] i2cDumpI2c(): dq=0x3ffde504
[E][esp32-hal-i2c.c:632] i2cDumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:633] i2cDumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=7
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] 89 R STOP buf@=0x3ffc4080, len=6, pos=6, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: f. d.| 66 97 20 64 eb 7c
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0001 0x0000 0x0005e612
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x0005e612
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0007 0x0040 0x0000 0x0000 0x0005e61f
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0006 0x0005e61f
vp_sat: 857.591 vp_part: 552.233 ahum_int: 3.324 lastcheck: 0
[E][esp32-hal-i2c.c:1136] i2cProcQueue(): TimeoutRecovery: expected=0ms, actual=2ms
[E][esp32-hal-i2c.c:620] i2cDumpI2c(): i2c=0x3ffc116c
[E][esp32-hal-i2c.c:621] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[E][esp32-hal-i2c.c:623] i2cDumpI2c(): lock=0x3ffce08c
[E][esp32-hal-i2c.c:625] i2cDumpI2c(): num=0
[E][esp32-hal-i2c.c:626] i2cDumpI2c(): mode=1
[E][esp32-hal-i2c.c:627] i2cDumpI2c(): stage=3
[E][esp32-hal-i2c.c:628] i2cDumpI2c(): error=1
[E][esp32-hal-i2c.c:629] i2cDumpI2c(): event=0x3ffce90c bits=210
[E][esp32-hal-i2c.c:630] i2cDumpI2c(): intr_handle=0x3ffce010
[E][esp32-hal-i2c.c:631] i2cDumpI2c(): dq=0x3ffde33c
[E][esp32-hal-i2c.c:632] i2cDumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:633] i2cDumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=9
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] ed R STOP buf@=0x3ffc4080, len=8, pos=8, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: a*.qW... 61 2a 00 71 57 00 a0 96
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0001 0x0000 0x0005f1c8
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x0005f1c8
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0009 0x0040 0x0000 0x0000 0x0005f1c9
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0008 0x0005f1c9
[E][esp32-hal-i2c.c:1136] i2cProcQueue(): TimeoutRecovery: expected=0ms, actual=13ms
[E][esp32-hal-i2c.c:620] i2cDumpI2c(): i2c=0x3ffc116c
[E][esp32-hal-i2c.c:621] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[E][esp32-hal-i2c.c:623] i2cDumpI2c(): lock=0x3ffce08c
[E][esp32-hal-i2c.c:625] i2cDumpI2c(): num=0
[E][esp32-hal-i2c.c:626] i2cDumpI2c(): mode=1
[E][esp32-hal-i2c.c:627] i2cDumpI2c(): stage=3
[E][esp32-hal-i2c.c:628] i2cDumpI2c(): error=1
[E][esp32-hal-i2c.c:629] i2cDumpI2c(): event=0x3ffce90c bits=210
[E][esp32-hal-i2c.c:630] i2cDumpI2c(): intr_handle=0x3ffce010
[E][esp32-hal-i2c.c:631] i2cDumpI2c(): dq=0x3ffde33c
[E][esp32-hal-i2c.c:632] i2cDumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:633] i2cDumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=7
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] 89 R STOP buf@=0x3ffc4080, len=6, pos=6, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: f..d.. 66 92 d5 64 c0 10
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0001 0x0000 0x0005f23d
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x0005f23d
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0007 0x0040 0x0000 0x0000 0x0005f24a
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0006 0x0005f24a
Scanning I2C Addresses
00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. 3C .. .. ..
.. .. .. .. 44 .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
70 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
Scan Completed, 5 I2C Devices found.
vp_sat: 857.890 vp_part: 552.346 ahum_int: 3.324 lastcheck: 0
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11572
entry 0x40078a5c
Initiating...
Reading config variables from NVRAM... OK
Initiating Display... [I][esp32-hal-i2c.c:1076] i2cProcQueue(): create ISR
OK
Checking I2C Bus...
Scanning I2C Addresses
00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. 3C .. .. ..
.. .. .. .. 44 .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
70 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
Scan Completed, 5 I2C Devices found.
Init I2C sensors... OK
Init Portexpander... Checking MCP Pin: 4095
Checking MCP Pin: 4095
Checking MCP Pin: 4095
OK
Init Relays... OK
Init scales... Counting 4 scales...
OK...
Init Power sensor... OK
Zero point for power sensor is 1802
Init done...

[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 2 - STA_START
[E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 4 - STA_CONNECTED
[WiFi-event] event: 4
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 7 - STA_GOT_IP
[WiFi-event] event: 7
WiFi connected
IP address:
192.168.2.18
MQTT connecting ...connected
[E][esp32-hal-i2c.c:1136] i2cProcQueue(): TimeoutRecovery: expected=1ms, actual=3ms
[E][esp32-hal-i2c.c:620] i2cDumpI2c(): i2c=0x3ffc116c
[E][esp32-hal-i2c.c:621] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[E][esp32-hal-i2c.c:623] i2cDumpI2c(): lock=0x3ffcdf3c
[E][esp32-hal-i2c.c:625] i2cDumpI2c(): num=0
[E][esp32-hal-i2c.c:626] i2cDumpI2c(): mode=1
[E][esp32-hal-i2c.c:627] i2cDumpI2c(): stage=3
[E][esp32-hal-i2c.c:628] i2cDumpI2c(): error=1
[E][esp32-hal-i2c.c:629] i2cDumpI2c(): event=0x3ffcdfc0 bits=10
[E][esp32-hal-i2c.c:630] i2cDumpI2c(): intr_handle=0x3ffcdff0
[E][esp32-hal-i2c.c:631] i2cDumpI2c(): dq=0x3ffde3cc
[E][esp32-hal-i2c.c:632] i2cDumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:633] i2cDumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=18
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] 78 W STOP buf@=0x3ffc4106, len=17, pos=17, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: @................ 40 f8 00 f0 08 08 08 08 f0 00 00 08 08 f8 08 08 00
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0012 0x0000 0x00004d3a
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x00004d3a
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0012 0x0040 0x0000 0x0000 0x00004d3c
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0000 0x00004d3c
[E][esp32-hal-i2c.c:1136] i2cProcQueue(): TimeoutRecovery: expected=0ms, actual=13ms
[E][esp32-hal-i2c.c:620] i2cDumpI2c(): i2c=0x3ffc116c
[E][esp32-hal-i2c.c:621] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[E][esp32-hal-i2c.c:623] i2cDumpI2c(): lock=0x3ffcdf3c
[E][esp32-hal-i2c.c:625] i2cDumpI2c(): num=0
[E][esp32-hal-i2c.c:626] i2cDumpI2c(): mode=1
[E][esp32-hal-i2c.c:627] i2cDumpI2c(): stage=3
[E][esp32-hal-i2c.c:628] i2cDumpI2c(): error=1
[E][esp32-hal-i2c.c:629] i2cDumpI2c(): event=0x3ffcdfc0 bits=10
[E][esp32-hal-i2c.c:630] i2cDumpI2c(): intr_handle=0x3ffcdff0
[E][esp32-hal-i2c.c:631] i2cDumpI2c(): dq=0x3ffdea00
[E][esp32-hal-i2c.c:632] i2cDumpI2c(): queueCount=1
[E][esp32-hal-i2c.c:633] i2cDumpI2c(): queuePos=0
[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=7
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] 89 R STOP buf@=0x3ffc4080, len=6, pos=6, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: f..h.< 66 8d b8 68 da 3c
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0001 0x0000 0x00004dcf
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x00004dcf
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0007 0x0040 0x0000 0x0000 0x00004ddc
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [04] 0x0001 0x0080 0x0000 0x0006 0x00004ddc
vp_sat: 858.488 vp_part: 552.756 ahum_int: 3.327 lastcheck: 0
vp_sat: 859.685 vp_part: 553.553 ahum_int: 3.332 lastcheck: 0
`

@stickbreaker
Copy link
Contributor

stickbreaker commented May 19, 2018

@valki2 those errors show the i2c comms took longer than the configured timeout, But, it also says the time out was zero?

By default it is configured to 50ms. So something has changed it to zero.

Do you have any calls to Wire.setTimeOut()?

Which version are you using?
Stickbreaker/arduino v0.2.2
Espressif/arduino/stickbreaker-i2c

Chuck.

@valki2
Copy link

valki2 commented May 20, 2018

@stickbreaker Thanks for you answer chuck - I highly appreciate that :)

I double checked my sketch and all its includes - I have no known calls to Wire.setTimeOut... even more: when I do a recursive grep -r 'Wire.setTimeOut(' there seems no call at all to that function in my whole Arduino folder :)

I am using the master branch of espressif (last checkout around 20. april) in addition to your relevant 5 files from your master branch 0.2.2:

Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-i2c.c
Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-i2c.h
Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-log.h
Arduino\hardware\espressif\esp32\libraries\Wire\src\Wire.cpp
Arduino\hardware\espressif\esp32\libraries\Wire\src\Wire.h

I double checked that too - eg. Wire.h contains "#define STICKBREAKER V0.2.2" :)

So what can I do to hunt down the reason for that zeroed timeout? Or should I try to set it to 50ms and give that a shot? :)

@valki2
Copy link

valki2 commented Jul 1, 2018

@me-no-dev Initial add of @stickbreaker i2c (13dcfe5)

Looks like your changes have been added to the main repo... is that correct?

@stickbreaker
Copy link
Contributor

@valki2 yep, Now to see how many problem it causes.
I missed you May 19th post, those message are debug output, if you reduce the Core Debug Level to 'ERROR' they will no longer be displayed. They are just reporting that the i2c communication sequence took longer than anticipated. Most i2c transaction take less than one millisecond. So the calculated duration becomes 0(zero). If DEBUG level is sent then, this test is executed:

#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
  uint32_t expected =(totalBytes*10*1000)/i2cGetFrequency(i2c);
  if((tAfter-tBefore)>(expected+1)) { //used some of the timeout Period
    // expected can be zero due to small packets
    log_d("used TimeoutRecovery: expected=%ums, actual=%ums, configured=%ums ",expected,(tAfter-tBefore),timeOutMillis);
    i2cDumpI2c(i2c);
    i2cDumpInts(i2c->num);
    }
#endif

Usually the only reason this happens is if the ISR is delayed by some higher priority task(WiFi) or the Slave is doing clock stretching.

chuck.

@valki2
Copy link

valki2 commented Jul 2, 2018 via email

@stickbreaker
Copy link
Contributor

stickbreaker commented Jul 2, 2018

@valki2 are you sure you are using the current core?

[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 70
[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 76
[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 76

These errors are not part of the current core, me-no-dev merged a modified version of my changes last week, and these error messages do not exist in the current core.

Those timeout Recovery messages are just debug status. I have just propose a pr #1574 to remove this confusing message.

The Gross Time is an actual problematic error:

[E][esp32-hal-i2c.c:634] i2cDumpI2c(): byteCnt=1
[E][esp32-hal-i2c.c:593] i2cDumpDqData(): [0] 41 R STOP buf@=0x3ffc3ac8, len=1, pos=0, eventH=0x0 bits=0
[E][esp32-hal-i2c.c:609] i2cDumpDqData(): 0x0000: ^ 5e
[E][esp32-hal-i2c.c:948] i2cDumpInts(): 0 row count INTR TX RX
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [01] 0x0001 0x0002 0x0001 0x0000 0x0079004f
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x0079004f
[E][esp32-hal-i2c.c:951] i2cDumpInts(): [03] 0x0001 0x0040 0x0000 0x0000 0x0079004f
[I][esp32-hal-i2c.c:971] i2cProcQueue(): Bus busy, reinit

This one is showing that you were doing a Wire.requestFrom(0x20,1) the Slave device answered the address byte, but then started stretching SCL. It never released SCL and the configured 50ms timeout expired. This generated the Gross Timeout . The Bus busy, reint shows that the SCL stretching was cleared by manually stimulating the bus.

What device is at 0x20? Also try increasing the timeout from 50ms. Jump clear up to 500ms. Just put Wire.setTimeOut(500); after Wire.begin();

Chuck.

@cyberman54
Copy link
Contributor

I got a similar issue since last update of arduino-esp32, while using u8g2 OLED library, raised an issue here:
platformio/platform-espressif32#107

@valki2
Copy link

valki2 commented Jul 10, 2018

Sorry @stickbreaker for my late answer... had to get some hardware (ocilloscope, logic analyzer) and learn first steps there :)

First finding: the i2c figures look "good" in the means of proper squares and no sharky figures. So as an absolute electronic noob I tend to rule out capacitive or resistance problems on the bus.

For the logic analyizer: woa lots of info there what needs some time to understand everything. but I see a good number of NAKs what may be good to take a closer look at. But again: just started playing there.

For the core: Yes - but of course I made a stupid mistake and forgot to compile it after checking out git... - no get.py executed on the first run :)
I gave it a second try but my sketch wont run either.

lots of: [I][esp32-hal-i2c.c:971] i2cProcQueue(): Bus busy, reinit

As my sketch is somehow in a "productive environment" (read: there is beef in the fridge g) I reverted to your branch and I will build up a second test area where I can play without stopping the productive esp32.

for your questions - 0x20 is a mcp23017 port expander...

@stickbreaker
Copy link
Contributor

@valki2 I use MCP23008, MCP23017 neither of them can stretch SCL, so, based on the errors received (busBusy, timeout) something else is hanging the hardware bus. The MCP's don't NAK. I know of no circumstance that they could generate a NAK. Well, unless they were not present on the bus. But, that is hardly their fault.

I'm currently working a 'injection' spurious interrupt problem. But I don't see that issue in your debug messages.

Chuck.

@valki2
Copy link

valki2 commented Jul 11, 2018

@stickbreaker I thought I basically understood what happens on the i2c bus - well until playing a day with the logic analyzer. :) 2 solutions: I am getting wrong readings or there is a lot of communication going on to unknown adresses... I am going to invest some time there now!

@valki2
Copy link

valki2 commented Jul 11, 2018

Btw - when using the latest official repo, I get:
`Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC : 0x400d8422 PS : 0x00060930 A0 : 0x800d8502 A1 : 0x3ffd2bc0
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x00400000 A5 : 0x3ffc3b1a
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x00420000 A9 : 0xff3fffff
A10 : 0x00000000 A11 : 0x3f403de6 A12 : 0x00000002 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000020 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

Backtrace: 0x400d8422:0x3ffd2bc0 0x400d84ff:0x3ffd2c00 0x400d68f4:0x3ffd2c30 0x400d3326:0x3ffd2c60 0x400d41bd:0x3ffd2c80 0x400d43f3:0x3ffd2ca0 0x4011fec3:0x3ffd2cc0
PC: 0x400d8422: i2cAddQueue at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-i2c.c line 102
EXCVADDR: 0x00000020

Decoding stack results
0x400d8422: i2cAddQueue at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-i2c.c line 102
0x400d84ff: i2cAddQueueWrite at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-i2c.c line 146
0x400d68f4: TwoWire::endTransmission(bool) at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\libraries\Wire\src\Wire.cpp line 291
0x400d3326: scani2c() at C:\Users\xxx\Documents\Arduino\ActionNode_V10T/ActionNode_V10T.ino line 1065
0x400d41bd: inits() at C:\Users\xxx\Documents\Arduino\ActionNode_V10T/ActionNode_V10T.ino line 529
0x400d43f3: setup() at C:\Users\xxx\Documents\Arduino\ActionNode_V10T/ActionNode_V10T.ino line 348
0x4011fec3: loopTask(void*) at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\cores\esp32\main.cpp line 15
`
With your repo it works quite fine (except of the occasional freezes / crashes I am investigating)

@stickbreaker
Copy link
Contributor

@valki2 That loadProhibited Error is saying that memory pointer was pointing at an invalid location. Usually zero.

I would look in your code for a memory overwrite. Something is hosing one of the i2c control structures.

probably the dq pointer.

Chuck.

@valki2
Copy link

valki2 commented Jul 15, 2018

Thanks @stickbreaker - it seems I had an inconsistency of my repo after all those tests. I cleared and reinstalled the esp32 environment (latest official repo) and now it looks way better :)

Still some [I]nfo messages popping up but now I will let it run to see if there are still locks of the i2c bus.... after all it seems that your improvements have found their way into the code :)

Example serial output (debugging level):

---------------------------------------------1236362-------------------------------------------- 
weight1: -0.012 weight2: -0.043 weight3: 0.000 weight4: 0.004 
-------------------------------------------------------------------------------------------- 
[I][esp32-hal-i2c.c:845] i2cProcQueue(): Bus busy, reinit 
---------------------------------------------1239366-------------------------------------------- 
weight1: -0.011 weight2: -0.042 weight3: 0.000 weight4: 0.004 
-------------------------------------------------------------------------------------------- 
---------------------------------------------1242368-------------------------------------------- 
weight1: -0.011 weight2: -0.043 weight3: 0.000 weight4: 0.004 
-------------------------------------------------------------------------------------------- 
[I][esp32-hal-i2c.c:845] i2cProcQueue(): Bus busy, reinit 
---------------------------------------------1245371-------------------------------------------- 
weight1: -0.011 weight2: -0.043 weight3: 0.000 weight4: 0.004 
-------------------------------------------------------------------------------------------- 
[D][esp32-hal-i2c.c:604] i2c_isr_handler_default(): raw=0x00002 status=0x00000 
[D][esp32-hal-i2c.c:610] i2c_isr_handler_default(): eject raw=0x2, int=0x0 
[D][esp32-hal-i2c.c:604] i2c_isr_handler_default(): raw=0x00002 status=0x00000 
[D][esp32-hal-i2c.c:610] i2c_isr_handler_default(): eject raw=0x2, int=0x0 
---------------------------------------------1248375-------------------------------------------- 
weight1: -0.011 weight2: -0.043 weight3: 0.000 weight4: 0.004 
-------------------------------------------------------------------------------------------- 
[D][esp32-hal-i2c.c:604] i2c_isr_handler_default(): raw=0x00002 status=0x00000 
[D][esp32-hal-i2c.c:610] i2c_isr_handler_default(): eject raw=0x2, int=0x0 
[I][esp32-hal-i2c.c:845] i2cProcQueue(): Bus busy, reinit 
---------------------------------------------1251377-------------------------------------------- 
weight1: -0.011 weight2: -0.043 weight3: 0.000 weight4: 0.004

Devices on the bus:
TCA9548A Multiplexer 0x70
MCP23017 Portsextender 0x20
Oled Display 0x3c
SHT31 Sensors 0x44 (sitting behind the Multiplexer!)

Example communication on the i2c bus:

0.000001500000000,I2C,Setup Write to [p (0x70)] + ACK 0.000018250000000,I2C,'2' (0x02) + ACK 0.000117750000000,I2C,Setup Write to [v (0x76)] + ACK 0.000136250000000,I2C,'242' (0xF2) + ACK 0.000155000000000,I2C,'1' (0x01) + ACK 0.000240000000000,I2C,Setup Write to [v (0x76)] + ACK 0.000258750000000,I2C,'244' (0xF4) + ACK 0.000277500000000,I2C,% (0x25) + ACK 0.000362500000000,I2C,Setup Write to [v (0x76)] + ACK 0.000381250000000,I2C,'245' (0xF5) + ACK 0.000399750000000,I2C,'160' (0xA0) + ACK 0.000485750000000,I2C,Setup Write to [v (0x76)] + ACK 0.000504500000000,I2C,'247' (0xF7) + ACK 0.000595250000000,I2C,Setup Read to [v (0x76)] + ACK 0.000614000000000,I2C,V (0x56) + ACK 0.000632500000000,I2C,'162' (0xA2) + ACK 0.000651250000000,I2C,'0' (0x00) + ACK 0.000670000000000,I2C,p (0x70) + ACK 0.000688750000000,I2C,[ (0x5B) + ACK 0.000707500000000,I2C,'0' (0x00) + ACK 0.000726250000000,I2C,'144' (0x90) + ACK 0.000744750000000,I2C,< (0x3C) + NAK 0.000913250000000,I2C,Setup Write to [p (0x70)] + ACK 0.000931750000000,I2C,'4' (0x04) + ACK 0.001367000000000,I2C,Setup Write to [v (0x76)] + NAK 0.001452500000000,I2C,Setup Write to [v (0x76)] + NAK 0.001534500000000,I2C,Setup Write to [v (0x76)] + NAK 0.001616250000000,I2C,Setup Write to [v (0x76)] + NAK 0.001699000000000,I2C,Setup Read to [v (0x76)] + NAK 0.001808000000000,I2C,Setup Write to [p (0x70)] + ACK 0.001823500000000,I2C,'8' (0x08) + ACK 0.001905250000000,I2C,Setup Write to [v (0x76)] + ACK 0.001922250000000,I2C,'242' (0xF2) + ACK 0.001939000000000,I2C,'1' (0x01) + ACK 0.002020500000000,I2C,Setup Write to [v (0x76)] + ACK 0.002037250000000,I2C,'244' (0xF4) + ACK 0.002054000000000,I2C,% (0x25) + ACK 0.002135250000000,I2C,Setup Write to [v (0x76)] + ACK 0.002152250000000,I2C,'245' (0xF5) + ACK 0.002169000000000,I2C,'160' (0xA0) + ACK 0.002250000000000,I2C,Setup Write to [v (0x76)] + ACK 0.002266750000000,I2C,'247' (0xF7) + ACK 0.002347250000000,I2C,Setup Read to [v (0x76)] + ACK 0.002364000000000,I2C,g (0x67) + ACK 0.002381000000000,I2C,- (0x2D) + ACK 0.002397750000000,I2C,'0' (0x00) + ACK 0.002414500000000,I2C,'131' (0x83) + ACK 0.002431500000000,I2C,'140' (0x8C) + ACK 0.002448250000000,I2C,'0' (0x00) + ACK 0.002465250000000,I2C,'138' (0x8A) + ACK 0.002482000000000,I2C,'18' (0x12) + NAK 0.022792000000000,I2C,Setup Write to [' ' (0x20)] + ACK 0.022809000000000,I2C,'18' (0x12) + ACK 0.022892750000000,I2C,Setup Read to [' ' (0x20)] + ACK 0.022909500000000,I2C,N (0x4E) + NAK 0.023184000000000,I2C,Setup Write to [' ' (0x20)] + ACK 0.023201000000000,I2C,'18' (0x12) + ACK 0.023283250000000,I2C,Setup Read to [' ' (0x20)] + ACK 0.023300000000000,I2C,N (0x4E) + NAK 0.023389250000000,I2C,Setup Write to [' ' (0x20)] + ACK 0.023406250000000,I2C,'18' (0x12) + ACK 0.023486250000000,I2C,Setup Read to [' ' (0x20)] + ACK 0.023503250000000,I2C,N (0x4E) + NAK 0.023586250000000,I2C,Setup Write to [' ' (0x20)] + ACK 0.023603000000000,I2C,'18' (0x12) + ACK 0.023687000000000,I2C,Setup Read to [' ' (0x20)] + ACK 0.023703750000000,I2C,N (0x4E) + NAK 0.408625500000000,I2C,Setup Write to [< (0x3C)] + ACK 0.408642500000000,I2C,'128' (0x80) + ACK 0.408659250000000,I2C,! (0x21) + ACK 0.408755000000000,I2C,Setup Write to [< (0x3C)] + ACK 0.408771750000000,I2C,'128' (0x80) + ACK 0.408788500000000,I2C,_ (0x5F) + ACK 0.408875500000000,I2C,Setup Write to [< (0x3C)] + ACK 0.408892250000000,I2C,'128' (0x80) + ACK 0.408909250000000,I2C,j (0x6A) + ACK 0.408991750000000,I2C,Setup Write to [< (0x3C)] + ACK 0.409008500000000,I2C,'128' (0x80) + ACK 0.409025250000000,I2C," (0x22) + ACK 0.409106750000000,I2C,Setup Write to [< (0x3C)] + ACK 0.409123500000000,I2C,'128' (0x80) + ACK 0.409140500000000,I2C,'0' (0x00) + ACK 0.409223000000000,I2C,Setup Write to [< (0x3C)] + ACK 0.409239750000000,I2C,'128' (0x80) + ACK 0.409256500000000,I2C,'2' (0x02) + ACK 0.409354250000000,I2C,Setup Write to [< (0x3C)] + ACK 0.409371250000000,I2C,@ (0x40) + ACK 0.409388000000000,I2C,'240' (0xF0) + ACK 0.409405000000000,I2C,'8' (0x08) + ACK 0.409421750000000,I2C,'8' (0x08) + ACK 0.409438750000000,I2C,'8' (0x08) + ACK 0.409455500000000,I2C,'240' (0xF0) + ACK 0.409472250000000,I2C,'0' (0x00) + ACK 0.409489250000000,I2C,'240' (0xF0) + ACK 0.409506000000000,I2C,'8' (0x08) + ACK 0.409523000000000,I2C,'8' (0x08) + ACK 0.409539750000000,I2C,'8' (0x08) + ACK 0.409556750000000,I2C,'240' (0xF0) + ACK 0.409573500000000,I2C,'0' (0x00) + ACK 0.409590500000000,I2C,'1' (0x01) + ACK 0.409607250000000,I2C,'130' (0x82) + ACK 0.409624000000000,I2C,'130' (0x82) + ACK 0.409641000000000,I2C,'130' (0x82) + ACK 0.409737500000000,I2C,Setup Write to [< (0x3C)] + ACK 0.409754250000000,I2C,@ (0x40) + ACK 0.409771250000000,I2C,'1' (0x01) + ACK 0.409788000000000,I2C,'0' (0x00) + ACK 0.409804750000000,I2C,'1' (0x01) + ACK 0.409821750000000,I2C,'2' (0x02) + ACK 0.409838500000000,I2C,'2' (0x02) + ACK 0.409855500000000,I2C,'130' (0x82) + ACK 0.409872250000000,I2C,'129' (0x81) + ACK 0.409889250000000,I2C,'0' (0x00) + ACK 0.409906000000000,I2C,'31' (0x1F) + ACK 0.409922750000000,I2C,' ' (0x20) + ACK 0.409939750000000,I2C,' ' (0x20) + ACK 0.409956500000000,I2C,' ' (0x20) + ACK 0.409973500000000,I2C,'31' (0x1F) + ACK 0.409990250000000,I2C,'0' (0x00) + ACK 0.410007000000000,I2C,'12' (0x0C) + ACK 0.410024000000000,I2C,\n (0x0A) + ACK 0.410111750000000,I2C,Setup Write to [< (0x3C)] + ACK 0.410128750000000,I2C,@ (0x40) + ACK 0.410145500000000,I2C,\t (0x09) + ACK 0.410162250000000,I2C,'8' (0x08) + ACK 0.410179250000000,I2C,? (0x3F) + ACK 0.410196000000000,I2C,'8' (0x08) + ACK 3.001260500000000,I2C,Setup Write to [p (0x70)] + ACK 3.001277250000000,I2C,'2' (0x02) + ACK 3.001376750000000,I2C,Setup Write to [v (0x76)] + ACK 3.001395500000000,I2C,'242' (0xF2) + ACK 3.001414250000000,I2C,'1' (0x01) + ACK 3.001499250000000,I2C,Setup Write to [v (0x76)] + ACK 3.001518000000000,I2C,'244' (0xF4) + ACK 3.001536750000000,I2C,% (0x25) + ACK 3.001621750000000,I2C,Setup Write to [v (0x76)] + ACK 3.001640250000000,I2C,'245' (0xF5) + ACK 3.001659000000000,I2C,'160' (0xA0) + ACK 3.001744750000000,I2C,Setup Write to [v (0x76)] + ACK 3.001763500000000,I2C,'247' (0xF7) + ACK 3.001854250000000,I2C,Setup Read to [v (0x76)] + ACK 3.001873000000000,I2C,V (0x56) + ACK 3.001891500000000,I2C,'163' (0xA3) + ACK 3.001910250000000,I2C,'0' (0x00) + ACK 3.001929000000000,I2C,p (0x70) + ACK 3.001947500000000,I2C,X (0x58) + ACK 3.001966250000000,I2C,'0' (0x00) + ACK 3.001985000000000,I2C,'144' (0x90) + ACK 3.002003750000000,I2C,: (0x3A) + NAK 3.002167000000000,I2C,Setup Write to [p (0x70)] + ACK 3.002185750000000,I2C,'4' (0x04) + ACK 3.002624250000000,I2C,Setup Write to [v (0x76)] + NAK 3.002711000000000,I2C,Setup Write to [v (0x76)] + NAK 3.002793000000000,I2C,Setup Write to [v (0x76)] + NAK 3.002874750000000,I2C,Setup Write to [v (0x76)] + NAK 3.002958000000000,I2C,Setup Read to [v (0x76)] + NAK 3.003067250000000,I2C,Setup Write to [p (0x70)] + ACK 3.003082750000000,I2C,'8' (0x08) + ACK 3.003164500000000,I2C,Setup Write to [v (0x76)] + ACK 3.003181250000000,I2C,'242' (0xF2) + ACK 3.003198250000000,I2C,'1' (0x01) + ACK 3.003279500000000,I2C,Setup Write to [v (0x76)] + ACK 3.003296250000000,I2C,'244' (0xF4) + ACK 3.003313250000000,I2C,% (0x25) + ACK 3.003394500000000,I2C,Setup Write to [v (0x76)] + ACK 3.003411250000000,I2C,'245' (0xF5) + ACK 3.003428000000000,I2C,'160' (0xA0) + ACK 3.003509250000000,I2C,Setup Write to [v (0x76)] + ACK 3.003526000000000,I2C,'247' (0xF7) + ACK 3.003606500000000,I2C,Setup Read to [v (0x76)] + ACK 3.003623250000000,I2C,g (0x67) + ACK 3.003640000000000,I2C,+ (0x2B) + ACK 3.003656750000000,I2C,'0' (0x00) + ACK 3.003673750000000,I2C,'131' (0x83) + ACK 3.003690500000000,I2C,'139' (0x8B) + ACK 3.003707500000000,I2C,'0' (0x00) + ACK 3.003724250000000,I2C,'138' (0x8A) + ACK 3.003741000000000,I2C,\t (0x09) + NAK

@stickbreaker
Copy link
Contributor

@valki2 Ok,
Reading through your i2c capture you are using 3 branches of the PCA9548

  • 0x02 0x76 answers
  • 0x04 0x76 does not answer
  • 0x08 0x76 answers

I never see the SHT11.

Do you have pullups on each branch?

I use 50k on each branch and 3.3k on the master branch. This results in 2.2k if all branches are active at the same time or 3.1k if only one branch is active at a time.

I wish your i2c capture had information on bus state. Your debug show bus busy events, but nothing in the capture.

I've have another update in the works to remove the 'eject'. My code handles the problem, the debug output is just annoying.

I recommend removing to debug log calls. At the top of static void IRAM_ATTR i2c_isr_handler_default(void* arg)
just comment out those two log lines:

  • esp32-hal-i2c.c:604 log_d("raw=0x%05x status=0x%05x",p_i2c->dev->int_raw.val, p_i2c->dev->int_status.val);
  • esp32-hal-i2c.c:610 log_d("eject raw=0x%x, int=0x%x",p_i2c->dev->int_raw.val, activeInt);

The bus busy info, is the only one I am interested in.


PCA9548 0x70 channel 02

0.000001500000000,I2C,Setup Write to [p (0x70)] + ACK 
0.000018250000000,I2C,'2' (0x02) + ACK 

0.000117750000000,I2C,Setup Write to [v (0x76)] + ACK 
0.000136250000000,I2C,'242' (0xF2) + ACK 
0.000155000000000,I2C,'1' (0x01) + ACK 

0.000240000000000,I2C,Setup Write to [v (0x76)] + ACK 
0.000258750000000,I2C,'244' (0xF4) + ACK 
0.000277500000000,I2C,% (0x25) + ACK 

0.000362500000000,I2C,Setup Write to [v (0x76)] + ACK 
0.000381250000000,I2C,'245' (0xF5) + ACK 
0.000399750000000,I2C,'160' (0xA0) + ACK 

0.000485750000000,I2C,Setup Write to [v (0x76)] + ACK 
0.000504500000000,I2C,'247' (0xF7) + ACK 

0.000595250000000,I2C,Setup Read to [v (0x76)] + ACK 
0.000614000000000,I2C,V (0x56) + ACK 
0.000632500000000,I2C,'162' (0xA2) + ACK 
0.000651250000000,I2C,'0' (0x00) + ACK 
0.000670000000000,I2C,p (0x70) + ACK 
0.000688750000000,I2C,[ (0x5B) + ACK 
0.000707500000000,I2C,'0' (0x00) + ACK 
0.000726250000000,I2C,'144' (0x90) + ACK 
0.000744750000000,I2C,< (0x3C) + NAK 

channel 04?

0.000913250000000,I2C,Setup Write to [p (0x70)] + ACK 
0.000931750000000,I2C,'4' (0x04) + ACK 

0.001367000000000,I2C,Setup Write to [v (0x76)] + NAK 

0.001452500000000,I2C,Setup Write to [v (0x76)] + NAK 


0.001534500000000,I2C,Setup Write to [v (0x76)] + NAK 

0.001616250000000,I2C,Setup Write to [v (0x76)] + NAK 

0.001699000000000,I2C,Setup Read to [v (0x76)] + NAK 

channel 08?
0.001808000000000,I2C,Setup Write to [p (0x70)] + ACK 
0.001823500000000,I2C,'8' (0x08) + ACK 

0.001905250000000,I2C,Setup Write to [v (0x76)] + ACK 
0.001922250000000,I2C,'242' (0xF2) + ACK 
0.001939000000000,I2C,'1' (0x01) + ACK 

0.002020500000000,I2C,Setup Write to [v (0x76)] + ACK 
0.002037250000000,I2C,'244' (0xF4) + ACK 
0.002054000000000,I2C,% (0x25) + ACK 

0.002135250000000,I2C,Setup Write to [v (0x76)] + ACK 
0.002152250000000,I2C,'245' (0xF5) + ACK 
0.002169000000000,I2C,'160' (0xA0) + ACK 

0.002250000000000,I2C,Setup Write to [v (0x76)] + ACK 
0.002266750000000,I2C,'247' (0xF7) + ACK 

0.002347250000000,I2C,Setup Read to [v (0x76)] + ACK 
0.002364000000000,I2C,g (0x67) + ACK 
0.002381000000000,I2C,- (0x2D) + ACK 
0.002397750000000,I2C,'0' (0x00) + ACK 
0.002414500000000,I2C,'131' (0x83) + ACK 
0.002431500000000,I2C,'140' (0x8C) + ACK 
0.002448250000000,I2C,'0' (0x00) + ACK 
0.002465250000000,I2C,'138' (0x8A) + ACK 
0.002482000000000,I2C,'18' (0x12) + NAK 

0.022792000000000,I2C,Setup Write to [' ' (0x20)] + ACK 
0.022809000000000,I2C,'18' (0x12) + ACK 

0.022892750000000,I2C,Setup Read to [' ' (0x20)] + ACK 
0.022909500000000,I2C,N (0x4E) + NAK 

0.023184000000000,I2C,Setup Write to [' ' (0x20)] + ACK 
0.023201000000000,I2C,'18' (0x12) + ACK 

0.023283250000000,I2C,Setup Read to [' ' (0x20)] + ACK 
0.023300000000000,I2C,N (0x4E) + NAK 

0.023389250000000,I2C,Setup Write to [' ' (0x20)] + ACK 
0.023406250000000,I2C,'18' (0x12) + ACK 

0.023486250000000,I2C,Setup Read to [' ' (0x20)] + ACK 
0.023503250000000,I2C,N (0x4E) + NAK 

0.023586250000000,I2C,Setup Write to [' ' (0x20)] + ACK 
0.023603000000000,I2C,'18' (0x12) + ACK 

0.023687000000000,I2C,Setup Read to [' ' (0x20)] + ACK 
0.023703750000000,I2C,N (0x4E) + NAK 

0.408625500000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.408642500000000,I2C,'128' (0x80) + ACK 
0.408659250000000,I2C,! (0x21) + ACK 

0.408755000000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.408771750000000,I2C,'128' (0x80) + ACK 
0.408788500000000,I2C,_ (0x5F) + ACK 

0.408875500000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.408892250000000,I2C,'128' (0x80) + ACK 
0.408909250000000,I2C,j (0x6A) + ACK 

0.408991750000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.409008500000000,I2C,'128' (0x80) + ACK 
0.409025250000000,I2C," (0x22) + ACK 

0.409106750000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.409123500000000,I2C,'128' (0x80) + ACK 
0.409140500000000,I2C,'0' (0x00) + ACK 

0.409223000000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.409239750000000,I2C,'128' (0x80) + ACK 
0.409256500000000,I2C,'2' (0x02) + ACK 

0.409354250000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.409371250000000,I2C,@ (0x40) + ACK 
0.409388000000000,I2C,'240' (0xF0) + ACK 
0.409405000000000,I2C,'8' (0x08) + ACK 
0.409421750000000,I2C,'8' (0x08) + ACK 
0.409438750000000,I2C,'8' (0x08) + ACK 
0.409455500000000,I2C,'240' (0xF0) + ACK 
0.409472250000000,I2C,'0' (0x00) + ACK 
0.409489250000000,I2C,'240' (0xF0) + ACK 
0.409506000000000,I2C,'8' (0x08) + ACK 
0.409523000000000,I2C,'8' (0x08) + ACK 
0.409539750000000,I2C,'8' (0x08) + ACK 
0.409556750000000,I2C,'240' (0xF0) + ACK 
0.409573500000000,I2C,'0' (0x00) + ACK 
0.409590500000000,I2C,'1' (0x01) + ACK 
0.409607250000000,I2C,'130' (0x82) + ACK 
0.409624000000000,I2C,'130' (0x82) + ACK 
0.409641000000000,I2C,'130' (0x82) + ACK 

0.409737500000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.409754250000000,I2C,@ (0x40) + ACK 
0.409771250000000,I2C,'1' (0x01) + ACK 
0.409788000000000,I2C,'0' (0x00) + ACK 
0.409804750000000,I2C,'1' (0x01) + ACK 
0.409821750000000,I2C,'2' (0x02) + ACK 
0.409838500000000,I2C,'2' (0x02) + ACK 
0.409855500000000,I2C,'130' (0x82) + ACK 
0.409872250000000,I2C,'129' (0x81) + ACK 
0.409889250000000,I2C,'0' (0x00) + ACK 
0.409906000000000,I2C,'31' (0x1F) + ACK 
0.409922750000000,I2C,' ' (0x20) + ACK 
0.409939750000000,I2C,' ' (0x20) + ACK 
0.409956500000000,I2C,' ' (0x20) + ACK 
0.409973500000000,I2C,'31' (0x1F) + ACK 
0.409990250000000,I2C,'0' (0x00) + ACK 
0.410007000000000,I2C,'12' (0x0C) + ACK 
0.410024000000000,I2C,\n (0x0A) + ACK 

0.410111750000000,I2C,Setup Write to [< (0x3C)] + ACK 
0.410128750000000,I2C,@ (0x40) + ACK 
0.410145500000000,I2C,\t (0x09) + ACK 
0.410162250000000,I2C,'8' (0x08) + ACK 
0.410179250000000,I2C,? (0x3F) + ACK 
0.410196000000000,I2C,'8' (0x08) + ACK 

channel 02
3.001260500000000,I2C,Setup Write to [p (0x70)] + ACK 
3.001277250000000,I2C,'2' (0x02) + ACK 

3.001376750000000,I2C,Setup Write to [v (0x76)] + ACK 
3.001395500000000,I2C,'242' (0xF2) + ACK 
3.001414250000000,I2C,'1' (0x01) + ACK 

3.001499250000000,I2C,Setup Write to [v (0x76)] + ACK 
3.001518000000000,I2C,'244' (0xF4) + ACK 
3.001536750000000,I2C,% (0x25) + ACK 

3.001621750000000,I2C,Setup Write to [v (0x76)] + ACK 
3.001640250000000,I2C,'245' (0xF5) + ACK 
3.001659000000000,I2C,'160' (0xA0) + ACK 

3.001744750000000,I2C,Setup Write to [v (0x76)] + ACK 
3.001763500000000,I2C,'247' (0xF7) + ACK 

3.001854250000000,I2C,Setup Read to [v (0x76)] + ACK 
3.001873000000000,I2C,V (0x56) + ACK 
3.001891500000000,I2C,'163' (0xA3) + ACK 
3.001910250000000,I2C,'0' (0x00) + ACK 
3.001929000000000,I2C,p (0x70) + ACK 
3.001947500000000,I2C,X (0x58) + ACK 
3.001966250000000,I2C,'0' (0x00) + ACK 
3.001985000000000,I2C,'144' (0x90) + ACK 
3.002003750000000,I2C,: (0x3A) + NAK 

channel 04
3.002167000000000,I2C,Setup Write to [p (0x70)] + ACK 
3.002185750000000,I2C,'4' (0x04) + ACK 

3.002624250000000,I2C,Setup Write to [v (0x76)] + NAK 

3.002711000000000,I2C,Setup Write to [v (0x76)] + NAK 

3.002793000000000,I2C,Setup Write to [v (0x76)] + NAK 

3.002874750000000,I2C,Setup Write to [v (0x76)] + NAK 

3.002958000000000,I2C,Setup Read to [v (0x76)] + NAK 

channel 08
3.003067250000000,I2C,Setup Write to [p (0x70)] + ACK 
3.003082750000000,I2C,'8' (0x08) + ACK 

3.003164500000000,I2C,Setup Write to [v (0x76)] + ACK 
3.003181250000000,I2C,'242' (0xF2) + ACK 
3.003198250000000,I2C,'1' (0x01) + ACK 

3.003279500000000,I2C,Setup Write to [v (0x76)] + ACK 
3.003296250000000,I2C,'244' (0xF4) + ACK 
3.003313250000000,I2C,% (0x25) + ACK 

3.003394500000000,I2C,Setup Write to [v (0x76)] + ACK 
3.003411250000000,I2C,'245' (0xF5) + ACK 
3.003428000000000,I2C,'160' (0xA0) + ACK 

3.003509250000000,I2C,Setup Write to [v (0x76)] + ACK 
3.003526000000000,I2C,'247' (0xF7) + ACK 

3.003606500000000,I2C,Setup Read to [v (0x76)] + ACK 
3.003623250000000,I2C,g (0x67) + ACK 
3.003640000000000,I2C,+ (0x2B) + ACK 
3.003656750000000,I2C,'0' (0x00) + ACK 
3.003673750000000,I2C,'131' (0x83) + ACK 
3.003690500000000,I2C,'139' (0x8B) + ACK 
3.003707500000000,I2C,'0' (0x00) + ACK 
3.003724250000000,I2C,'138' (0x8A) + ACK 
3.003741000000000,I2C,\t (0x09) + NAK

Chuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests