-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
TSL2561 not working #2415
Comments
Just to be sure, you have set the correct GPIOs to the Sensor in the Device Configuration page on the WebUI, right? Some Sensors need a restart 1 of the device before they show up. i noticed this by myself with the BME280 and it takes some seconds till the data is showing up after restart. https://github.com/arendst/Sonoff-Tasmota/wiki/Sensor-Configuration#device :
did you see this wiki page: https://github.com/arendst/Sonoff-Tasmota/wiki/Wemos-D1-Mini#tsl2561-luminosity-sensor-i2c |
Yes, correct PIN. Device is recognized; see timestamp 21:03:49 I2C: TSL2561 found at 0x39 |
Same problem here with a GY-2561 breakout board and 5.12.0i. I2CScan detects a device at 0x39, but TSL2561 doesn't work. ADS1117 (0x48) and BME680 (0x76) work fine. I also triple-checked |
Just re-flashed my Wemos with 5.12.0k with TSL2561 enabled using user_config_override.h ...
The TSL is detected (takes a couple of seconds) after a reboot.
My config is the same as described on the Wemos-D1-Mini. |
I tried my TSL2561 now on a Wemos D1 mini. Same Firmware flashed (5.12.0k). Here it works. Strange |
Just tried 5.12.0l on ESP8266 SMD Adapter Breakout Board R2.1, generic module, SDA on GPIO12 and SCL on GPIO14. Again a device is detected at 0x39 by I2CScan but no sensor data. |
Hi, |
Problem still exists with Tasmota Version 5.13.1a. Is 0x39 the correct I²C-address for your library? |
@renne Try a different device. I tested the sensor again on my NodeMCU. |
@renne 0x39 is one of the three possible adresses for tsl2561 my lib checks. But if it cannot find a device on one of the adresses it just does nothing. Especially no message containing 0x39. Where did you get that adress from? |
ah, and maybe try to use pullup resistors for the i2c bus. |
@Jason2866 @joba-1 user_config.h:
|
looks all fine to me. Can you increase the debug level and post the
complete log from boot to, say, 2nd tele message?
Maybe there is something in it that tells me or Theo something.
Or try the testing.ino example I provide with the lib, and if this doesn’t
work, provide the log.
--
iphone so i typo
|
Testing.ino uses |
yes, aka D1 for SCL and D2 on Node MCUs.
--
iphone so i typo
|
The TSL2561 seems to work. Are the fluctuations of the Full spectrum and IR only normal? |
yes, fine, wiring and chip work.
And yes, fluctuations of raw readings are normal. You can better see them
in the Utility.ino example. Generally accuracy is best with exposure and
gain set, so that raw sensor values are somewhere in the middle of the
range. That is what my autogain function aims for and what tasmota uses.
…--
iphone so i typo
|
After running the Testing.ino the TSL2561 worked once with Tasmota. When I held my hand over the TSL2561 to check for value changes it vanished. This is LOG_LEVEL_DEBUG_MORE:
I do not have SHT sensors and the TSL2561 was the only device connected via I2C. |
Hm, so sollte das aussehen:
17:49:19 I2C: TSL2561 gefunden bei 0x39
17:49:20 HTP: Hauptmenü
17:49:20 Beleuchtungsintensität g:1, e:1, f:5780, i:2448 -> 68.618 lx
17:49:20 MQT: tele/lowvolt2/STATE =
{"Time":"2018-05-13T17:49:20","Uptime":"0T00:00:13","Vcc":3.366,"POWER1":"OFF","POWER2":"OFF","Dimmer":24,"Color":"1C3D04","HSBColor":"95,93,24","Channel":[11,24,2],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"job.fritz.ssid","RSSI":60,"APMac":"00:18:39:C6:B6:32"}}
17:49:20 Beleuchtungsintensität g:1, e:1, f:5780, i:2448 -> 68.618 lx
17:49:20 MQT: domoticz/in =
{"idx":13,"nvalue":0,"svalue":"69","Battery":76,"RSSI":6}
17:49:20 MQT: tele/lowvolt2/SENSOR =
{"Time":"2018-05-13T17:49:20","TSL2561":{"Illuminance":68.618}}
Leider hab ich keine Ahnung was da schief läuft. Den einzigen Unterschied,
den ich sehe, ist dass mein MQT läuft und Domoticz konfiguriert ist.
Auf der Haupt-Webseite deines Devices wird nichts angezeigt?
…--
iphone so i typo
|
Do you have your ESP device on a breadboard? |
Is your mqtt broker off? |
@joba-1 @Jason2866 The log of breakout R3.0 showed "Vcc":3.013i", so I suspected a power-supply problem and rearranged the wiring with R2.1 which supplied 3.5V. Still no joy. I also commented out all I2C-sensors in user_config.h except TSL2561. Same result. |
Wild guess: maybe the esp sdk 2_4_1 is the problem? I see it in your version string(?) but not mine. |
@renne My TSL was always detected too. I tried it again on the NodeMCU. I hooked the sca and scl pins |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not solved, yet. |
with the info given, I see only one possible reason: the way the firmware was built. Where did you get it? If built yourself: please retry with a prebuilt version from here: https://github.com/arendst/Sonoff-Tasmota/releases . We cannot help more, because it works for us with the same environment you describe and it fails to detect your sensor not in our code but in a core library (wire) that is very unlikely to have issues. |
I build it from the current github repo (git clone https://github.com/arendst/Sonoff-Tasmota.git). After that I configured the module in generic mode and two GPIOs as SCL and SDA. On both devices I2CScan shows the TSL2561 on 0x29h but nothing about the TSL2561 in the teleperiod message or web-interface. |
A few minutes ago I did a
and flashed it on the H801 with the Arduino IDE. Afterwards I configured generic module and SCL/SDA GPIOs again. This is the result:
|
You have a general problem. You get no mqtt connection. |
I usually test without the MQTT server configured to avoid side effects. A sensor should work without MQTT enabled. After setting the MQTT server IP address the TSL2561 is detected but there seems to be a communications problem:
... and so on ... |
Yes, but that could be normal for his setup and should not influence detecting sensors. Status is: it does not work for renne with identical software that works for others. Means: it is hardware related. Still it is strange that i2cscan detects the device, but my lib (if it is called at all) does not when used within tasmota (but works with the examples on his hardware). @renne : would you please retry with this function replaced in sonoff/xsns_16_tsl2561.ino:
If my lib is called, then there must be some kind of output with debug level activated, no matter if the sensor is detected or not. |
Hm, missed your answer renne. But still, please try my changed code. It could tell me how the detection is not working right. If tasmota does not work when not connected to a configured MQTT is another issue and something @arendst might want to look into. I think this should not change local behaviour. Obviously: leave it connected for now. You can ignore the SHT: lines. They refer to another sensor. |
I added some debug messages to check out when the code in |
Ok, so my changes above are obsolete. Detection works now. Fast progress. Since autogain must have returned true, you got values from the sensor.
instead of this:
|
This is the console output with your code:
|
This says raw sensor values at highest sensitivity are always zero. |
Output of Testing.ino: Got luminosity after 419 ms. Full spectrum is 285 and IR only is Testing Tsl2561 at address 39: NOT found Testing Tsl2561 at address 49: NOT found Next test in 5s |
Output of Simple.ino: Starting Tsl2561 simple loop |
Output of Utility.ino: Starting Tsl2561Util loop Tsl2561 addr: 0x29, id: 0x50, sfull: 12, sir: 6, gain: 0, exp: 0, full: 5766, ir: 2956, lux: 37.930 Tsl2561 addr: 0x29, id: 0x50, sfull: 12, sir: 6, gain: 0, exp: 0, full: 5766, ir: 2956, lux: 37.930 |
Output of Autogain.ino: Starting Tsl2561Util autogain loop |
ok, it is not the calculations. |
|
great news! I‘ll update the driver with the longer delay and think about how to make the cause more obvious. |
This release increases the wait time to 430ms and should solve this issue: |
Remove TSL2561 debug message and update library (#2415)
Hi, Could you managed to solve this issue with last version? |
@ascillato2 |
Great! Closing this issue then. Please, reopen it if needed. Thanks! |
Remove TSL2561 debug message and update library (arendst#2415)
Make sure these boxes are checked before submitting your issue - Thank you!
NodeMCU
status 0
21:07:45 CMD: Status 0
21:07:45 RSL: Group 0, Index 1, Command STATUS, Data 0
21:07:45 MQT: stat/sonoff-5D3631/STATUS = {"Status":{"Module":18,"FriendlyName":[],"Topic":"sonoff-5D3631","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.ino.bin","RestartReason":"Software/System restart","Uptime":"0T00:04:10","StartupUTC":"2018-04-10T19:03:35","Sleep":1,"BootCount":94,"SaveCount":129,"SaveAddress":"FA000"}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS2 = {"StatusFWR":{"Version":"5.12.0k","BuildDateTime":"2018-04-10T20:20:43","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24ac9)"}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":3,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["Jason_Home_WLAN",""],"TelePeriod":300,"SetOption":["00000009","55818000"]}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS4 = {"StatusMEM":{"ProgramSize":497,"Free":504,"Heap":21,"ProgramFlashSize":1024,"FlashSize":4096,"FlashMode":3}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS5 = {"StatusNET":{"Hostname":"sonoff-5D3631-5681","IPAddress":"192.168.2.122","Gateway":"192.168.2.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.2.1","Mac":"60:01:94:5D:36:31","Webserver":2,"WifiConfig":3}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.2.114","MqttPort":1883,"MqttClientMask":"sonoff-5D3631","MqttClient":"sonoff-5D3631","MqttUser":"openhabian","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS7 = {"StatusTIM":{"UTC":"Tue Apr 10 19:07:45 2018","Local":"Tue Apr 10 21:07:45 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":99,"Sunrise":"06:32","Sunset":"19:56"}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS10 = {"StatusSNS":{"Time":"2018-04-10T21:07:45"}}
21:07:45 MQT: stat/sonoff-5D3631/STATUS11 = {"StatusSTS":{"Time":"2018-04-10T21:07:45","Uptime":"0T00:04:10","Vcc":2.871,"Wifi":{"AP":1,"SSId":"Jason_Home_WLAN","RSSI":100,"APMac":"00:A0:57:2A:BD:19"}}}
WebConsole Log (DEBUG Mode) after Start:
00:00:00 CFG: Loaded from flash at FB, Count 128
00:00:00 APP: Boot Count 94
00:00:00 Project sonoff NodeMCU (Topic sonoff-5D3631, Fallback sonoff-5D3631, GroupTopic sonoffs) Version 5.12.0k-2_3_0
00:00:00 CFG: Saved to flash at FA, Count 129, Bytes 2048
00:00:00 WIF: Attempting connection...
00:00:00 WIF: Patch issue 2186
00:00:00 WIF: Connecting to AP1 Jason_Home_WLAN in mode 11N as sonoff-5D3631-5681...
00:00:01 WIF: Attempting connection...
00:00:02 WIF: Attempting connection...
00:00:03 WIF: Attempting connection...
00:00:04 WIF: Attempting connection...
00:00:05 WIF: Attempting connection...
00:00:06 WIF: Connected
00:00:06 HTP: Web server active on sonoff-5D3631-5681 with IP address 192.168.2.122
00:00:07 MQT: Attempting connection...
00:00:07 MQT: Connected
00:00:07 MQT: tele/sonoff-5D3631/LWT = Online (retained)
00:00:07 MQT: cmnd/sonoff-5D3631/POWER =
00:00:07 MQT: Subscribe to cmnd/sonoff-5D3631/#
00:00:07 MQT: Subscribe to cmnd/sonoffs/#
00:00:07 MQT: Subscribe to cmnd/sonoff-5D3631/#
00:00:07 MQT: tele/sonoff-5D3631/INFO1 = {"Module":"Generic","Version":"5.12.0k","FallbackTopic":"sonoff-5D3631","GroupTopic":"sonoffs"}
00:00:07 MQT: tele/sonoff-5D3631/INFO2 = {"WebServerMode":"Admin","Hostname":"sonoff-5D3631-5681","IPAddress":"192.168.2.122"}
00:00:07 MQT: tele/sonoff-5D3631/INFO3 = {"RestartReason":"Software/System restart"}
00:00:09 APP: (UTC) Tue Apr 10 19:03:44 2018, (DST) Sun Mar 25 02:00:00 2018, (STD) Sun Oct 28 03:00:00 2018
21:03:45 HTP: Main Menu
21:03:47 HTP: Console
21:03:49 I2C: TSL2561 found at 0x39
21:03:50 MQT: tele/sonoff-5D3631/STATE = {"Time":"2018-04-10T21:03:50","Uptime":"0T00:00:15","Vcc":2.937,"Wifi":{"AP":1,"SSId":"Jason_Home_WLAN","RSSI":100,"APMac":"00:A0:57:2A:BD:19"}}
Any idea? I enabled the sensor in user comfig.h
The text was updated successfully, but these errors were encountered: