Is there a conflict between I2C and ESP8266WiFi, PubSubClien
Posted: Wed Jul 24, 2019 9:05 am
I can't get it on one line. I'm running an MQTT client on an ESP8266 with some relays and sensors. I have a TSL2561 light detector that runs stand alone fine, however, if I integrate it with my MQTT app, it returns an invalid number. From the info call:
but the output from the
is
65536.00 lux
Since the I2C is bit-banged, I'm wondering if an interrupt from the web activity is interfering in reading the sensor? The test sketch for the light sensor runs with a few modifications without fail.
I copied the relevant code from the test sketch into my MQTT sketch.
Any ideas?
Thanks,
Jim.
Code: Select all
------------------------------------
Sensor: TSL2561
Driver Ver: 1
Unique ID: 12345
Max Value: 17000.00 lux
Min Value: 1.00 lux
Resolution: 1.00 lux
------------------------------------
------------------------------------
Gain: Auto
Timing: 13 ms
------------------------------------
but the output from the
Code: Select all
sensors_event_t event;
tsl.getEvent(&event);
/* Display the results (light is measured in lux) */
if (event.light)
{
Serial.print(event.light); Serial.println(" lux");
lastLight=event.light;
}
is
65536.00 lux
Since the I2C is bit-banged, I'm wondering if an interrupt from the web activity is interfering in reading the sensor? The test sketch for the light sensor runs with a few modifications without fail.
Code: Select all
Light Sensor Test
D4 and D3 2 0
------------------------------------
Sensor: TSL2561
Driver Ver: 1
Unique ID: 12345
Max Value: 17000.00 lux
Min Value: 1.00 lux
Resolution: 1.00 lux
------------------------------------
------------------------------------
Gain: Auto
Timing: 13 ms
------------------------------------
78.00 lux
77.00 lux
77.00 lux
75.00 lux
75.00 lux
75.00 lux
I copied the relevant code from the test sketch into my MQTT sketch.
Any ideas?
Thanks,
Jim.