CJMCU-101 Light Analog Light Intensity Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

CJMCU-101 Light Analog Light Intensity Sensor

#1 Post by Copitano » 06 Jul 2021, 15:40

I have an OPT101 sensor coupled to the analog pin (A0) of a Wemos D1 mini. On the Wemos I have ESP_Easy_mega_20210503_normal_ESP8266_4M1M running.
I also get values ​​on the Analog input - internal. If I have understood correctly, the Wemos itself has built-in resistors so that the A0 pin can handle 3.3 volts. The sensor is powered with 3.3 volts from the Wemos D1. As soon as I cover the sensor the value goes (as might be expected almost) to 0. As soon as I remove the cover it goes in in normal daylight to value 840. I then measure 2.5 volts on the data line to the Wemos. That level is already reached at about 250 lux (measured with an app on my iPhone). If I place the LED of my iPhone over the sensor and turn it on, the value of 840 does not increase any further. That also seems to be the maximum. I already tried putting a 10k potentiometer between pins 1M + OUT and the A0 of the Wemos. However, that makes very little difference. (the voltage only drops to 2.43 volts) In this setup, the maximum seems to be reached at about 250 Lux. Because I want to use the sensor to have an indication of the global radiation of the sun on my solar panels (full sun up to 100,000 lux), this will not work yet. The maximum should then only be reached at 100,000 lux.
How could I fix that. I'm not very good at calculating resistors that might be needed and where they should be. Valuable tips are highly appreciated.
My plan is attached below.
Attachments
IMG_7967 klein.jpg
IMG_7967 klein.jpg (93.74 KiB) Viewed 16064 times
IMG_7966 klein.jpg
IMG_7966 klein.jpg (113.75 KiB) Viewed 16064 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#2 Post by TD-er » 06 Jul 2021, 15:54

The sensor can be fed (according to the datasheet) with a voltage upto 36V.
See: https://www.ti.com/lit/ds/symlink/opt101.pdf

Just based on the block diagram, I can see the output voltage will never be higher than the input voltage as it is just an opamp and a photo cell.

Thus if you're hitting the max voltage at a low light level, you can do 2 things:
- Increase the voltage to the sensor (warning!)
- decrease the feedback resistor value as can be seen in the datasheet on page 7.

It seems the "feedback" resistor is by default 1M between pin 2 and 4.
So based on the chart on page 7, I would connect a 50k resistor between pin 4 & 2 (assuming you have connected pin 5 & 4)
If pins 5&4 are not connected, you can add the resistor between pin 5 & 2

When the sensor keeps clipping at roughly the same voltage as it does now, then you can increase the voltage to the sensor, but make sure you're not exceeding the 3v3 over the analog input pin.
So you may want to add some extra resistors to divide the voltage from the sensor.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#3 Post by Copitano » 06 Jul 2021, 21:03

I first tested the first suggestion with 3.3 volt power supply. No luck. Then I ramped up the power supply to 5 volts and reduced the initial analog output with R1 = 100k and R2 = 470k back to 3.2 volts. The analog was not yet connected to the A0 pin of the Wemos. The moment it was connected, the analog voltage dropped to 2.55 volts. Apparently I somehow also have to take into account the internal resistances between the A0 pin and the 8266 chip that reduce the voltage from 3.3 volts to 1 volt???
The sensor does indeed seem super sensitive!
In the meantime, I'm starting to wonder whether the sensor is suitable for measuring sunlight. :roll: With 1024 steps and assuming 100,000 lux in full sunlight, that is about 100 lux per step. 3 steps is then all the level in the house not too far from a window on a cloudy day like today in the Netherlands.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#4 Post by TD-er » 06 Jul 2021, 21:17

Depends on what you want to use it for.

Another option is to use the TSL2561 or TSL2591.
The first one can loose precision on a sunny day in the Netherlands as it has a max. of 65k lux.
The IR part of the sensor is clipping long before, so I had to add some tricks to get some reasonable value out of it on really sunny days.

As a work-around to hide it from direct sunlight, but still get a good idea of "daylight" you can point the sensor more to the north.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#5 Post by Copitano » 07 Jul 2021, 00:05

Until today I use the data from a KNMI weather station 5 km as the crow flies from my house to determine a ratio between global radiation (10 minutes) and the yield of my solar panels. Because that is not always accurate (especially with changing clouds and wind direction) I want to try to build a meter myself (read on an Rpi in domoticz => Grafana). So north is possible, but then I probably measure more diffuse sunlight and not the direct sunlight And really just because I like learning about electronics :ugeek: and taking on these kinds of challenges (without much knowledge of electronics at the moment) with a little help on different forums. Another type of sensor (BH1750 ) is on order but won't arrive until August ;)
I still had the OPT101 lying around.

EDIT: Also tried this: https://www.domoticz.com/forum/viewtopi ... 09#p277009 No luck!

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#6 Post by Copitano » 08 Jul 2021, 18:28

@TD-er I don't think I will be able to get the OPT101 in the correct measuring range (up to approx. 100,000 lux) I have now ordered an adafruit TSL2591. However, it does not (yet?) appear in the device list of ESP_Easy_mega_20210503_normal_ESP8266_4M1M. I did find this: https://github.com/letscontrolit/ESPEas ... SL2591.ino. Only I have no idea how to install that plugin on the Wemos D1 mini and can't really find a very clear manual for it anywhere.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#7 Post by TD-er » 08 Jul 2021, 20:03

Should be supported in P074: https://github.com/letscontrolit/ESPEas ... SL2591.ino
It is included in "testing A": https://espeasy.readthedocs.io/en/lates ... al-plugins

And please try to use the builds from https://td-er.nl/ESPEasy/ as the builds there do have some WiFi issues fixed.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#8 Post by Copitano » 08 Jul 2021, 22:39

@TD-er Super! I used the latter option and installed ESP-Easy_mega_20210615_TEST_A_ESP8266_4M1M. That really went like clockwork. The Wemos D1 mini is now preconfigured. :D Now waiting for the sensor to arrive. Bring it on (tomorrow or Monday). Many many thanks for your help ;) . This way it remains fun to add new parts all the time, even without having in-depth knowledge of scripting and such. Stay curious if anyone ever comes up with a nice solution for the OPT101. It works quite well at low light levels (0-300 to 400 lux) :lol: .

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#9 Post by Copitano » 19 Jul 2021, 16:54

@TD-er. Do you appreciate feedback with data form SL2591 for further testing/development?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#10 Post by TD-er » 19 Jul 2021, 19:30

Copitano wrote: 19 Jul 2021, 16:54 @TD-er. Do you appreciate feedback with data form SL2591 for further testing/development?
Sure if you have some indication something can be improved...

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#11 Post by Copitano » 20 Jul 2021, 11:39

I'm trying to find a formula to convert the output of the TSL2591 from Lux to W/m². I have found some clues for that, such as https://www.hoogendoorn.nl/wp-content/u ... 312090.pdf. However, I don't really get close to the Global radiation of a KNMI station 5 km from here as the crow flies. On average that should be a reasonable indication on beautiful clear days such as yesterday and the day before yesterday. However, the pattern roughly follows the production of my solar panels.
Any idea about this? keep on digging. :geek:

Image
Image

After working fine this morning, for some reason, the values suddenly drop at prime time while the sensor has a clear view and the sun is shining. Although the presented figures (<65,000 lux) do not seem to give rise to this thought, possibly the sensor is reaching its max. of 88,000 lux??? From 3 p.m., plausible values will come through again :?:
Image
Attachments
Schermafbeelding 2021-07-20 153152.jpg
Schermafbeelding 2021-07-20 153152.jpg (227.43 KiB) Viewed 15716 times
Schermafbeelding 2021-07-20 141646.jpg
Schermafbeelding 2021-07-20 141646.jpg (81 KiB) Viewed 15721 times
Schermafbeelding 2021-07-20 141053.jpg
Schermafbeelding 2021-07-20 141053.jpg (127.11 KiB) Viewed 15722 times
Schermafbeelding 2021-07-20 120802.jpg
Schermafbeelding 2021-07-20 120802.jpg (122.85 KiB) Viewed 15728 times
Schermafbeelding 2021-07-20 120621.jpg
Schermafbeelding 2021-07-20 120621.jpg (132.37 KiB) Viewed 15728 times
Last edited by Copitano on 20 Jul 2021, 15:44, edited 3 times in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#12 Post by TD-er » 20 Jul 2021, 15:35

Not 10% sure about the 2591, but the 2561 does have issues with high lux values as the IR sensor gets saturated.
For the 2561 I have written some "extrapolation" which assumes the last non-clipped IR value (or at least the ratio between the 2 sensor values) to extrapolate the used formula to compute the Lux values. (typically the ratio is 1:3)
The Lux is a computed value, which essentially uses the ratio between the 2 optical sensors inside.
But as soon as the IR sensitive sensor clips to its max. the ratio is no longer making sense and thus the computed value no longer makes sense.

I think that's what is happening here.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#13 Post by Copitano » 20 Jul 2021, 17:54

Hmmm, unfortunately I only get the Lux value in domoticz. So I can't log the other values. But if the ratio is 1:3 would the IR sensor become saturated at about 88,000/3 is about 30,000? I don't think I've seen it that high before. I'll pay special attention to it tomorrow. The sensor seems to get confused for a few hours at the highest sun position for the past 3 sunny days and then just pick up the thread again.

According to the specifications of the TSL2591, you can set that maximum yourself. However, I don't master scripting myself and I don't see that possibility in ESPeasy either. How can I fix that?
Attachments
Schermafbeelding 2021-07-20 180119.jpg
Schermafbeelding 2021-07-20 180119.jpg (139.16 KiB) Viewed 15706 times
Schermafbeelding 2021-07-20 180004.jpg
Schermafbeelding 2021-07-20 180004.jpg (76.89 KiB) Viewed 15706 times
Schermafbeelding 2021-07-20 175458.jpg
Schermafbeelding 2021-07-20 175458.jpg (197.9 KiB) Viewed 15707 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#14 Post by TD-er » 20 Jul 2021, 19:43

Just based on the chart, it looks like the computed Lux hits 65535.
So it could also be the conversion hits some kind of overflow. (e.g. value stored in 16 bit unsigned int)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#15 Post by TD-er » 20 Jul 2021, 19:50

Ah found the issue.

Should be:
const float lux = P074_data->tsl.calculateLuxf(full, ir); // get LUX

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#16 Post by TD-er » 20 Jul 2021, 19:54

Already fixed it: https://github.com/letscontrolit/ESPEas ... 1787ee1c8c
I can make a test build for you, for tomorrow to test.
Which one do you need?

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#17 Post by Copitano » 20 Jul 2021, 23:14

I have ESP-Easy_mega_20210615_TEST_A_ESP8266_4M1M installed now. Would be nice tot have the test build :D
I build a twin sensor that I want to test side by side tomorrow to compare the results.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#18 Post by TD-er » 21 Jul 2021, 00:04

You cannot use 2 devices on the same I2C bus with the same address.
And I think you are running into some WiFi bug which I'm also working on.
In the test build I will make for you it has improved, but tomorrow I will try to fix another issue which I found out today regarding WiFi.

So in a few minutes I will make a test build for the light sensor.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#19 Post by TD-er » 21 Jul 2021, 00:10

A test build: https://www.dropbox.com/s/knvq3ejr34m6l ... M.bin?dl=0
I have also included the external RTC support I'm working on.
Not sure if you also have those chips laying around.

At least it should now allow for a higher range in Lux values.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#20 Post by Copitano » 21 Jul 2021, 00:40

thx again. I will flash tomorrow and tape de sensor on the chimney again and wait for bright Sunshine 8-) .
No RTC chips laying around.
EDIT: I now have two TSL2591's working, each on its own Wemos D1.
EDIT2: First impression: It seems to work. Just peaked at 66,250 lux without the sensor collapsing. Unfortunately some thin clouds approaching prime time. To be continued.......
Attachments
Schermafbeelding 2021-07-21 094120.jpg
Schermafbeelding 2021-07-21 094120.jpg (29.73 KiB) Viewed 15641 times

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#21 Post by Copitano » 22 Jul 2021, 00:32

@DT-er: It looks a lot better although there is still something strange in the measurement. This is the sensor output compared to the yield of 6 panels that are almost flat on the west (slope 7 degrees) on the roof.
EDIT: This morning I also mounted the second sensor on top of the chimney. The first now with the new build and the second with the previous build of the TEST_A. I am now analyzing the data from last day from sensor 1 to see if an algorithm can be made for conversion from Lux to W/m². Linear as I sometimes come across via Google, it is not (for this sensor) in any case. I can already see that.
Attachments
IMG_8033.jpg
IMG_8033.jpg (2 MiB) Viewed 15591 times
Schermafbeelding 2021-07-22 002405.jpg
Schermafbeelding 2021-07-22 002405.jpg (200.1 KiB) Viewed 15591 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#22 Post by TD-er » 22 Jul 2021, 11:39

Maybe it is possible you are seeing some internal reflection in the sensor?
Or maybe your panels (some of them) reach a critical angle where most of the sunlight is not bent inside the panel glass, but reflects?
The same can of course happen to the sensor as it does have a flat window if I remember correctly.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#23 Post by Copitano » 22 Jul 2021, 12:45

@TD-er: I don't think it's the panels. As you can see in the graph, the yield goes up for all 6 panels. However, the value displayed by the sensor decreases in the same time period.
The surface of the sensor is indeed horizontal. This is deliberate because I am looking for the relationship between the measured Lux and the global radiation in W/m².
I just noticed that the sensor on the new test build you sent me also has an inexplicable drop in value when approaching prime time. It is almost cloudless here during that time period. The production of the solar panels also continues (red line). The dark blue line is the sensor on the new test build and the light blue line is the sensor on the previous build. The Wifi is now no problem in both cases. Today I will continue to test with the given setup. Tonight I will also flash the modified build on the second Wemos D1 so that tomorrow I can continue testing with two exactly identically configured sensors. I'll keep you posted on the results.
Attachments
Schermafbeelding 2021-07-22 123247.jpg
Schermafbeelding 2021-07-22 123247.jpg (222.98 KiB) Viewed 15568 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#24 Post by TD-er » 22 Jul 2021, 21:59

Maybe you should also log the other values of that sensor, so we can see what happens with the IR part.

A lot of unknowns and possible causes here
- Sensor heats up, causing an offset in the IR reading
- Sunlight approaching critical angle where light may cause internal reflections -> amplifying itself
- Sunlight approaching critical angle where all sunlight is absorbed in the solar panels heating them a lot (typical 0.5% loss per degree C)
- IR sensor gets saturated (thus need for logging all values)

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#25 Post by Copitano » 23 Jul 2021, 00:42

I would love to also log the other values, but I don't have the ability/sufficient knowledge to log the other values as well :( . They are not forwarded to Domoticz as far as I can see. The (complicated) route I follow is as follows: ESPEasy=>Domoticz (only Lux possible)=>Influxdb=>Grafana=>.csv of graph data=>MS Excel 2010. After that it is still a lot of work in Excel to store data to clean and fill holes.
The results of yesterday's measurements will look like this after a bit of fitting of the different quantities. It proves that KNMI station Berkhout (Yellow) is not a fully adequate reference for Hoorn.
By now I do have a fairly good start of an algorithm to convert Lux to W/m² global radiation. The line of calculated global irradiance (Blue) fits quite nicely with the total output of the set of solar panels (red) although it still needs some fine-tuning.For the conversion I use the following formula: 88.000/65.535*0.010139. I borrow the last part of the formula from https://www.hoogendoorn.nl/wp-content/u ... 312090.pdf

The alternation of the red and the blue line can partly be explained by the fact that there are more panels on the west than on the eastside of the roof. The jump around 1.30 pm because 4 west panels will be fully exposed to the sun at that time. What I really need to be able to further test and analyze properly is a full clear sky day :D .
Attachments
Schermafbeelding 2021-07-23 002645.jpg
Schermafbeelding 2021-07-23 002645.jpg (346.23 KiB) Viewed 15505 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#26 Post by TD-er » 24 Jul 2021, 00:22

Do you have the "Cache controller" in the build you're running?
This one can log the data to flash and you can use a piece of JavaScript to decode it into CSV.
See: https://github.com/letscontrolit/ESPEas ... Controller

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#27 Post by Copitano » 24 Jul 2021, 15:04

I didn't add anything to the build you sent me in dropbox. It may sound very stupid, but I don't know if that's where the cash controller is. How do I find out?
The link you send to a cash controller for the ESP32. In my case it runs on a Wemos D1 mini in both cases. Does it work on Wemos as well?
Other than uploading a full build, I've never uploaded any additional stuff. What steps do I have to take to upload?
I see these possibilities:
Attachments
Schermafbeelding 2021-07-24 150338.jpg
Schermafbeelding 2021-07-24 150338.jpg (73.73 KiB) Viewed 15421 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#28 Post by TD-er » 24 Jul 2021, 21:24

Well just to temper your hopes and/or expectations... it is a "cache" controller, not a "cash" controller ;)
I don't have a lot of cash, that needs a specific controller ;)

The "cache controller" is maybe also not the best descriptive name.
Its initial use case was to cache the data untill we got a (lost) connection, like in a moving vehicle which gets out of range of the network connection.

But most use cases will be about storing the data to a binary blob on the file system until you can fetch it.

It is probably included in the "custom" build.
But I guess for the next few days you won't hit the > 65'000 Lux.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#29 Post by Copitano » 25 Jul 2021, 01:34

Hahaha, okay "cache" :lol: . The misspelling may have distracted attention too much from the question how I know if it's included and if not what steps I take to upload ;) . Sorry, in this field i am Noob :oops: .
And as the weather forecast looks like now, the maximum value will indeed not be reached in the next days. Not in the least because the test set-up is again on the kitchen table instead of on the chimney. As soon as a nice stable day comes for testing, I want to have everything ready :ugeek: .

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#30 Post by Copitano » 29 Jul 2021, 13:34

@TD-er: please think about my questions from my previous post. I've googled quite a bit, but can't really find a clear instruction/manual for it.
1) How do I check if it's there in the costumbuild? If I understand well, there should be e extra tab in ESPEasy? It's not there at the moment and I can not find anything that looks like it in "Tools"
2) If not how do I ad/upload the plugin to existing build on the Wemos D1 mini?
3) How do I activate logging of all measurements?
Thanks in advance

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#31 Post by TD-er » 29 Jul 2021, 14:33

The cache controller is a controller, just like "Domoticz HTTP" and "OpenHAB MQTT"
If it isn't in your list of controllers (on the controller tab) you need another build.

Can you give a list of plugins and controllers you need, then we can make a build for you.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#32 Post by Copitano » 29 Jul 2021, 18:20

@TD-er: As you advised viewtopic.php?p=53973#p53973I would like to install this plugin: https://github.com/letscontrolit/ESPEas ... Controller
I am now running build: on the Wemos D1 mini: ESP_Easy_mega_20210721_test_A_ESP8266_4M1M
With this controllers included:
Attachments
Controllers.PNG
Controllers.PNG (27.09 KiB) Viewed 14996 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#33 Post by TD-er » 29 Jul 2021, 18:41

Just created a build based on the current 'mega' branch including the cache controller.
https://www.dropbox.com/s/05w3kqf4omqjo ... M.bin?dl=0

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#34 Post by Copitano » 30 Jul 2021, 11:15

@TD-er: Thanks again :D. I will reinstall today and try to log all data.
EDIT: Okay, the new ESP_Easy_mega_20210729_test_A_ESP8266_4M1M is on the Wemos D1 mini and the .bin file is receiving data.
Next step: decode data and download it to .csv.
However, if I follow this https://github.com/letscontrolit/ESPEas ... Controller, the .bin file is not decoded yet (it is exported to a windows 10 laptop)
How can I fix this?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#35 Post by TD-er » 30 Jul 2021, 14:44

Did you upload the dumpX.htm file on the ESP's file system?
Then open that file from the file listing on the web interface in a new tab.
It should then show a single button and when pressed it will fetch all bin files and decode them into a CSV file.
See: https://espeasy.readthedocs.io/en/lates ... #c016-page

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#36 Post by Copitano » 30 Jul 2021, 21:54

@TD-er: It must be my inexperience, but I am unable to download the dump5.htm file (good) to my Windows machine to upload it from there. I also wonder if these are the right files that I was able to retrieve with some struggle?
The link is about ESP32. I'm using a Wemos D1 mini. Is dump5.htm intended for that?
When I upload them, they cannot be found with the file browser.
What am I doing wrong?
Please help with some more step by step instruction how to do it.
Attachments
Schermafbeelding 2021-07-30 211435.jpg
Schermafbeelding 2021-07-30 211435.jpg (140.93 KiB) Viewed 14890 times
Schermafbeelding 2021-07-30 211509.jpg
Schermafbeelding 2021-07-30 211509.jpg (172.26 KiB) Viewed 14890 times
Schermafbeelding 2021-07-30 211929.jpg
Schermafbeelding 2021-07-30 211929.jpg (77.4 KiB) Viewed 14890 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#37 Post by TD-er » 30 Jul 2021, 22:04

The file is in the ESPEasy repository: https://github.com/letscontrolit/ESPEas ... Controller
It is just HTML + JavaScript, so platform independent.

The sentence after the file name "[Cache controller] Make Cache controller work on ESP32" is a description of the last commit made where this file was included.
You can even click on the sentence (it is a link) linking to the commit in which this file was changed last.

Just to make it as simple as possible, rightclick this link and save-as it :)
https://raw.githubusercontent.com/letsc ... /dump5.htm

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#38 Post by Copitano » 30 Jul 2021, 23:41

@TD-er: Ahhhh, the way to save dump5.htm properly is hidden in my browser (Edge) under "Meer hulpprogramma's " and "Pagina opslaan als" :oops: . Now I am making progress. We have now managed to upload dump5.htm and open it in a new tab :D . Unfortunately, however, it looks like there are only headers and no data in the .csv file.
EDIT: I now get 100% when I hit the fetch cache files button. But the result in excel is the same.
Attachments
Schermafbeelding 2021-07-30 233533.jpg
Schermafbeelding 2021-07-30 233533.jpg (16.94 KiB) Viewed 14871 times
Schermafbeelding 2021-07-30 233643.jpg
Schermafbeelding 2021-07-30 233643.jpg (92.44 KiB) Viewed 14871 times
Schermafbeelding 2021-07-30 234347.jpg
Schermafbeelding 2021-07-30 234347.jpg (45.58 KiB) Viewed 14871 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#39 Post by TD-er » 31 Jul 2021, 01:06

Can you try another browser?
I never tested it using Edge.

I have tested it using Chrome and even Chrome on Android.
And excuse me for not being able to predict how Dutch texts of software is being translated.
There is a reason I've configured all my software and PCs etc. to be set to English.... Uit respect voor het Nederlands, want alle vertalingen van software zijn vreselijk.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#40 Post by Copitano » 31 Jul 2021, 02:16

@TD-er: Used Chrome this time. No difference in .csv output. :?
Also tried Safari on my iphone. No data, only headers.
Looks like only test.bin can be download as .csv and not cache_X.bin. If I try opening cache_X.bin in a new tab, it downloads cache_X.bin to my windows computer. Not the .csv :?
Attachments
Schermafbeelding 2021-07-31 130319.jpg
Schermafbeelding 2021-07-31 130319.jpg (113.46 KiB) Viewed 14816 times
Last edited by Copitano on 31 Jul 2021, 14:39, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#41 Post by TD-er » 31 Jul 2021, 14:35

OK, I will test it here.
No need to let you try all kinds of tests, as I probably can reproduce it here on my breadboard.

Will get back to you later today.

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#42 Post by Copitano » 31 Jul 2021, 14:41

Top! Thx :D

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#43 Post by Copitano » 02 Aug 2021, 12:41

@TD-er: Maybe this will help you find where it goes wrong:
There are now 14 .bin files on the Wemos D1. Fetching files now takes a little longer. So probably the .bin files are fetched but not converted to .csv?
Attachments
Schermafbeelding 2021-08-02 123927.jpg
Schermafbeelding 2021-08-02 123927.jpg (218.63 KiB) Viewed 14655 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#44 Post by TD-er » 02 Aug 2021, 13:00

Can you send me one of those bin files to my email address? (or via DM)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: CJMCU-101 Light Analog Light Intensity Sensor

#45 Post by TD-er » 02 Aug 2021, 13:18

I just tested it here on my breadboard.
Initially the first file wasn't filled far enough, so the JavaScript did create only the CSV header.
But after a few minutes (only have a single Dallas task with 4 sensors sending to the cache controller), I get this:

Code: Select all

UNIX timestamp;UTC timestamp;task index;oled#OLED;oled#;oled#;oled#;gps#;gps#;gps#;gps#;test#txpwr;test#freeheap;test#;test#uptime;oled2#OLED;oled2#;oled2#;oled2#;#Position;#LimitA;#LimitB;#State;sw#State;sw#;sw#;sw#;dum#Dummy;dum#;dum#;dum#;Dallas#temperature;Dallas#temperature2;Dallas#temperature3;Dallas#temperature4;load#load;load#;load#;load#;temp3#temperature;temp3#temperature2;temp3#temperature3;temp3#temperature4;pulse11#Count;pulse11#Total;pulse11#Time;pulse11#;temp2#T1;temp2#T2;temp2#T3;temp2#T4
1627902519;2021-08-02T11:08:39.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902529;2021-08-02T11:08:49.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902539;2021-08-02T11:08:59.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.75;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902549;2021-08-02T11:09:09.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.5;23.8125;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902551;2021-08-02T11:09:11.000Z;8;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.5;23.8125;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902559;2021-08-02T11:09:19.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902569;2021-08-02T11:09:29.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902579;2021-08-02T11:09:39.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.8125;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902589;2021-08-02T11:09:49.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.8125;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902599;2021-08-02T11:09:59.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.8125;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902609;2021-08-02T11:10:09.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.75;33.74847412109375;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902611;2021-08-02T11:10:11.000Z;8;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.75;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902619;2021-08-02T11:10:19.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.8125;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902629;2021-08-02T11:10:29.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.8125;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902639;2021-08-02T11:10:39.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.8125;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902649;2021-08-02T11:10:49.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.8125;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902659;2021-08-02T11:10:59.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902669;2021-08-02T11:11:09.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;36.9725341796875;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902671;2021-08-02T11:11:11.000Z;8;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5;23.1875;23.4375;23.75;33.812950134277344;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1627902679;2021-08-02T11:11:19.000Z;7;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;23.5625;23.1875;23.4375;23.75;33.812950134277344;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
So it does seem to work here.
It is based on the latest sources.
Can you test this build: https://www.dropbox.com/s/q5im8zbmmhf1p ... M.bin?dl=0

Copitano
Normal user
Posts: 24
Joined: 18 Oct 2019, 21:11
Location: NL

Re: CJMCU-101 Light Analog Light Intensity Sensor

#46 Post by Copitano » 02 Aug 2021, 17:42

@TD-er: I would like to send one of the .bin files by e-mail, but I don't have an e-mail address and also no permission to send an e-mail directly from the forum. I have sent a .bin to an educated guessed email address derived from your website. Can you confirm that the file has been received. Subject is ".csv bestand" (yes very original :lol: )
EDIT: I installed the latest build you send me. Unfortunately, the TSL2591 sensor is missing. It doesn't matter for the output of .bin to .csv.

Code: Select all

UNIX timestamp;UTC timestamp;task index;TSL2591 Lux sensor#Lux;TSL2591 Lux sensor#Full;TSL2591 Lux sensor#Visible;TSL2591 Lux sensor#IR;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#
Reinstalled the former build. Fetched cache again and now waiting for a couple of minutes before downloading to the Windowscomputer :idea: .
Waited for about 10 minutes. No luck :(

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests