Counting time, calculate and display?
Moderators: grovkillen, Stuntteam, TD-er
Re: Counting time, calculate and display?
Thank you for the hints.
If it says so, and since I now know how to read it with your help, it will be easy.
As soon as the parts arrive here, I will upload a picture immediately. They will probably arrive later than the ESPs from AliExpress that I ordered yesterday... We'll see.
At least I have now printed the cover... Unfortunately, several times. The bezel needs a lot of support. Standing on the side edge wasn't particularly visually stunning. At times I also had problems with my geared direct extruder, which produced additional waste.
I ended up printing it flat with the outside facing up; There was a lot of support and therefore very unpleasant on the inside, but no one can see that...
If it says so, and since I now know how to read it with your help, it will be easy.
As soon as the parts arrive here, I will upload a picture immediately. They will probably arrive later than the ESPs from AliExpress that I ordered yesterday... We'll see.
At least I have now printed the cover... Unfortunately, several times. The bezel needs a lot of support. Standing on the side edge wasn't particularly visually stunning. At times I also had problems with my geared direct extruder, which produced additional waste.
I ended up printing it flat with the outside facing up; There was a lot of support and therefore very unpleasant on the inside, but no one can see that...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Problems with the geared direct drive extruder does sound like "debris" in the nozzle.
Did you maybe print white filament?
If so, then I suggest to clean out the nozzle.
If you printed PETG, you can maybe try to feed in some PLA and try to do a "cold pull" as PLA does have a lower melting temperature.
I stopped printing large prints with white filament as it appears to be filled with titanium oxide which is quite abrasive to the nozzle and also to the PTFE tube inside the print head.
Did you maybe print white filament?
If so, then I suggest to clean out the nozzle.
If you printed PETG, you can maybe try to feed in some PLA and try to do a "cold pull" as PLA does have a lower melting temperature.
I stopped printing large prints with white filament as it appears to be filled with titanium oxide which is quite abrasive to the nozzle and also to the PTFE tube inside the print head.
Re: Counting time, calculate and display?
... nope ... Was a plain mechanical problem ...
For reasons of space (collision Z at the top right), I replaced the pressure spring with a short screw and Viton O-ring as a spring. For whatever reason, the screw tightened on its own and pushed the filament square. This in turn led to a “tooth failure” on the drive wheel.
Luckily I still had a gear. And I have now additionally secured the screw against ghost adjustment. After that everything was fine again...
I rarely have clogged nozzles. Only when I print wood filament or other filaments with solids does it become problematic with my standard 0.3 nozzle.
EDIT: Looks this today...
For reasons of space (collision Z at the top right), I replaced the pressure spring with a short screw and Viton O-ring as a spring. For whatever reason, the screw tightened on its own and pushed the filament square. This in turn led to a “tooth failure” on the drive wheel.
Luckily I still had a gear. And I have now additionally secured the screw against ghost adjustment. After that everything was fine again...
I rarely have clogged nozzles. Only when I print wood filament or other filaments with solids does it become problematic with my standard 0.3 nozzle.
EDIT: Looks this today...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Little Update...
Yesterday I received an almost identical message from the alleged "Jenny", which only differs in the last part. Then she tells me that, contrary to her initial announcement, she doesn't want to send an ESP32 and doesn't want to send a return label, but will refund the amount.
Just some minutes ago I got the money back...
Yesterday I received an almost identical message from the alleged "Jenny", which only differs in the last part. Then she tells me that, contrary to her initial announcement, she doesn't want to send an ESP32 and doesn't want to send a return label, but will refund the amount.
I then became a bit annoyed because she also asked if I could change the rating to a positive rating... I told her that my gut feeling didn't deceive me into not trusting her and that she should do whatever she thinks is right, but immediately without any further delays or pointless blah blah.Dear Customer,
We are extremely sorry that you have lost trust in us due to our delayed response. May we offer you a direct refund as a solution? Would it be okay for you not to return the item to us? This error is ours, and we sincerely hope that this will help us regain your trust in our eBay listings.
Despite this incident, would you still consider ordering from us? We promise to track your orders with the utmost care and attention.
Would you be willing to reconsider your rating? Your opinion is incredibly valuable to us and helps us to continually improve our service.
We thank you very much for your understanding and hope for your support.
Best regards,
Jenny
Just some minutes ago I got the money back...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
So they found out the other ESP32 units they sell are not 16 MB
Re: Counting time, calculate and display?
... jepp, I think so also... And (maybe) a retoure to China is more expensive as simple cash back...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
... I'm still waiting for the ESP's from Ali. I'm curious to see whether they can keep their 6-day promise...
But today another idea came to me in this context:
The heating control also has a timer with a weekly program so that, for example, the night time reduction can be set depending on the time of day and day of the week.
So today I was thinking about whether this day/time programming could be regulated via the ESP in addition to the oil quantity count? Because there, in contrast to the (quite inaccurate) quartz watch, I already have a precise time available through the GPS.
You would just have to ensure (with buttons?) that the user can set his weekly program (two switching points per weekday, 3 channels each) and, if necessary, temporarily override it manually (holidays, parties, ...)...
Do you know what I mean by that? Would it work?
EDIT:
I'm pleasantly surprised. Exactly 6 days and therefore a precise landing.
That's exactly what I wanted, isn't it?
But today another idea came to me in this context:
The heating control also has a timer with a weekly program so that, for example, the night time reduction can be set depending on the time of day and day of the week.
So today I was thinking about whether this day/time programming could be regulated via the ESP in addition to the oil quantity count? Because there, in contrast to the (quite inaccurate) quartz watch, I already have a precise time available through the GPS.
You would just have to ensure (with buttons?) that the user can set his weekly program (two switching points per weekday, 3 channels each) and, if necessary, temporarily override it manually (holidays, parties, ...)...
Do you know what I mean by that? Would it work?
EDIT:
I'm pleasantly surprised. Exactly 6 days and therefore a precise landing.
That's exactly what I wanted, isn't it?
DLzG
Micha
Micha
Re: Counting time, calculate and display?
any went wrong ?!?
... goes into this fast scrolling after reset at the Port:
... goes into this fast scrolling after reset at the Port:
DLzG
Micha
Micha
Re: Counting time, calculate and display?
You should use the ESP32s3 build, not the ESP32...
/Ton (PayPal.me)
Re: Counting time, calculate and display?
I didn't know that there were different builds for the SX types.
. .
.
I download that again ... This ... correct?
.../espeasy_mega_20240331_esp32s3_binaries.zip
. .
.
I download that again ... This ... correct?
.../espeasy_mega_20240331_esp32s3_binaries.zip
DLzG
Micha
Micha
Re: Counting time, calculate and display?
You should also check the flash size.
The screenshot of the ESP download tool shows the detected flash size is 16 MB.
So you can select a "MAX" build.
This only leaves the check which is very specific to the ESP32-S3; Whether or not you have 2 MB PSRAM (or no PSRAM) or 8 MB PSRAM.
If you have 8 MB PSRAM, then you must select the build with "PSRAM" in the name as it requires a very specific configuration of the SPI bus.
Only for the S3, if you select the wrong build regarding PSRAM, then the ESP will enter a bootloop and then you must use the flash tool again to flash another build as there is no other way to get out of this loop.
Also, why not using the web flasher?
Then you only need to search for the "MAX" build and look for "S3" in the label.
The flash tool will then automatically select the right build for you based on the connected chip. (as long as it is mentioned in your selection of course)
The screenshot of the ESP download tool shows the detected flash size is 16 MB.
So you can select a "MAX" build.
This only leaves the check which is very specific to the ESP32-S3; Whether or not you have 2 MB PSRAM (or no PSRAM) or 8 MB PSRAM.
If you have 8 MB PSRAM, then you must select the build with "PSRAM" in the name as it requires a very specific configuration of the SPI bus.
Only for the S3, if you select the wrong build regarding PSRAM, then the ESP will enter a bootloop and then you must use the flash tool again to flash another build as there is no other way to get out of this loop.
Also, why not using the web flasher?
Then you only need to search for the "MAX" build and look for "S3" in the label.
The flash tool will then automatically select the right build for you based on the connected chip. (as long as it is mentioned in your selection of course)
Re: Counting time, calculate and display?
Ok, I have use the ESP_Easy_mega_20240331_max_ESP32s3_16M8M_LittleFS_OPI_PSRAM_CDC_ETH.factory.bin and it seems to be working. Have just set the WLAN credentials via terminal and I'm connected well now and can reach the GUI...
It's simple if you/I doing well
It's simple if you/I doing well
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Ok, all set what I need for basics. Now time for the connection of the GPS.
I'm right if I connect the GPS to the RX/TX named PIN's on the board (top right under GND)? If so what GPIO's are this for "ESP RX GPIO ← TX" and "ESP TX GPIO → RX(optional)" ? I haven't find a hint for this Q right now...
I'm right if I connect the GPS to the RX/TX named PIN's on the board (top right under GND)? If so what GPIO's are this for "ESP RX GPIO ← TX" and "ESP TX GPIO → RX(optional)" ? I haven't find a hint for this Q right now...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
The pins labelled RX/TX on your board are the ones you also use to program the board.
So better not use those.
You can setup using just about any other pin as long as you don't use the pins mentioned here: https://espeasy.readthedocs.io/en/lates ... n-esp32-s3
So try to find 2 pins which are easily accessible and use "HW Serial 1" or "HW Serial 2" in your selection as "Serial0" is the one wired to the pins labelled RX/TX on the silkscreen.
So better not use those.
You can setup using just about any other pin as long as you don't use the pins mentioned here: https://espeasy.readthedocs.io/en/lates ... n-esp32-s3
So try to find 2 pins which are easily accessible and use "HW Serial 1" or "HW Serial 2" in your selection as "Serial0" is the one wired to the pins labelled RX/TX on the silkscreen.
Re: Counting time, calculate and display?
AHHH! Ok... So they are in parallel to the onboard ser2usb then... So good that we have talked about
The I use some other...
Some else:
I have seen that I can set many things for the GPS-device, but not the also transmitted time/date. At the moment I use my local NTP via WLAN as time source, but I like to use the GPS later instead of the NTP. Have I overseen any?
The I use some other...
Some else:
I have seen that I can set many things for the GPS-device, but not the also transmitted time/date. At the moment I use my local NTP via WLAN as time source, but I like to use the GPS later instead of the NTP. Have I overseen any?
DLzG
Micha
Micha
Re: Counting time, calculate and display?
As soon as the GPS has a fix, then it will set the system time.
Re: Counting time, calculate and display?
ohhh, that I haven't await; that's cool! Then I can stop searching and reading to find the howto for that Thanx a lot...
Time to heat on the iron...
Just an idea comes in my mind:
For things without internet and available NTP like my project, maybe a good idea that you can declare the ESP with the GPS-time source as NTP for other p2p ESP's...
Time to heat on the iron...
Just an idea comes in my mind:
For things without internet and available NTP like my project, maybe a good idea that you can declare the ESP with the GPS-time source as NTP for other p2p ESP's...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Already way ahead of you
When multiple ESPEasy nodes can see eachother, they will announce what time they think it is, including some expected time wander.
This is calculated based on the last time sync and their time source.
For example the "RTC memory" is one of the least accurate ones as you have no idea how long the ESP was no longer updating the RTC time before rebooting/crashing.
GPS is the most accurate as it doesn't show any time drift.
NTP and P2P as time source have an accuracy of a few tens of msec.
A RTC external clock (battery powered, via I2C connected) has an accuracy of +/- 500 msec as the resolution is 1 sec.
All these are then taken into account when receiving the time from other ESPEasy p2p nodes.
So if you have multiple ESPEasy nodes, you hardly ever have to worry about the system time.
Just have one with GPS and you're fine. (though it may take some time to get a fix after a power outage, so a battery powered external RTC clock is still useful)
When multiple ESPEasy nodes can see eachother, they will announce what time they think it is, including some expected time wander.
This is calculated based on the last time sync and their time source.
For example the "RTC memory" is one of the least accurate ones as you have no idea how long the ESP was no longer updating the RTC time before rebooting/crashing.
GPS is the most accurate as it doesn't show any time drift.
NTP and P2P as time source have an accuracy of a few tens of msec.
A RTC external clock (battery powered, via I2C connected) has an accuracy of +/- 500 msec as the resolution is 1 sec.
All these are then taken into account when receiving the time from other ESPEasy p2p nodes.
So if you have multiple ESPEasy nodes, you hardly ever have to worry about the system time.
Just have one with GPS and you're fine. (though it may take some time to get a fix after a power outage, so a battery powered external RTC clock is still useful)
Re: Counting time, calculate and display?
Shit
Now I was very happy that I had a great idea and then the big hammer came, other persons, in this case you, was faster again...
I'm going to cry for a bit now...
EDIT:
Looks ok so far (indoor near window)
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Just realize "great minds think alike"
And good it is working.
And good it is working.
Re: Counting time, calculate and display?
LOL... Ty for the compliment.
Crash into next...
Why I don't see a 1 or 0 at the display if I do this at line 2 ...
. .
... where the GPS device is called this ...
. .
.
.
EDIT:
Meanwhile I have changed the Display device to "framed" due I need that later on.
I also have try to set "Header" to "DATE" and "Header2" to "TIME" and also "Interval" to 2
But I can do what ever I get in mind: The Header-line respectively the DATE and TIME fight against each other on that line. I also don't find a way to disable the WLAN-icon on the top right...
What I really like to have is a header-line without the WLAN icon and just Date and time in the notation of "dd.mm.yy - hh:mm:ss" without the need for an interval of 1 sec to update the second. I have no idea if that will be possible.
It will also ok if the problem with the fighting DATE and TIME as header are solved and a way to kill the WLAN-icon...
Crash into next...
Why I don't see a 1 or 0 at the display if I do this at line 2 ...
. .
... where the GPS device is called this ...
. .
.
.
EDIT:
Meanwhile I have changed the Display device to "framed" due I need that later on.
I also have try to set "Header" to "DATE" and "Header2" to "TIME" and also "Interval" to 2
But I can do what ever I get in mind: The Header-line respectively the DATE and TIME fight against each other on that line. I also don't find a way to disable the WLAN-icon on the top right...
What I really like to have is a header-line without the WLAN icon and just Date and time in the notation of "dd.mm.yy - hh:mm:ss" without the need for an interval of 1 sec to update the second. I have no idea if that will be possible.
It will also ok if the problem with the fighting DATE and TIME as header are solved and a way to kill the WLAN-icon...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
The top 3 values aren't available by those names from the plugin, and the "Fix" value isn't available at all As an alternative you can add event handlers for GPS#GotFix and GPS#LostFix, and store that state in a Dummy task
The exact value names are available in the documentation: https://espeasy.readthedocs.io/en/lates ... ent-values.
/Ton (PayPal.me)
Re: Counting time, calculate and display?
Ahh ok... Then I haven't to wonder about. I will try that from back through the eye
Last Qu for today:
On the Board there are an multicolor LED. I think that's a NeoPixel? If so, what is the GPIO for it? I don't find any documentation about this board
Last Qu for today:
On the Board there are an multicolor LED. I think that's a NeoPixel? If so, what is the GPIO for it? I don't find any documentation about this board
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Not sure if we should add more options to the already really crowded OLedFramed pluginM*I*B wrote: ↑09 Apr 2024, 19:12 EDIT:
Meanwhile I have changed the Display device to "framed" due I need that later on.
I also have try to set "Header" to "DATE" and "Header2" to "TIME" and also "Interval" to 2
But I can do what ever I get in mind: The Header-line respectively the DATE and TIME fight against each other on that line. I also don't find a way to disable the WLAN-icon on the top right...
What I really like to have is a header-line without the WLAN icon and just Date and time in the notation of "dd.mm.yy - hh:mm:ss" without the need for an interval of 1 sec to update the second. I have no idea if that will be possible.
It will also ok if the problem with the fighting DATE and TIME as header are solved and a way to kill the WLAN-icon...
You do have a valid point, in that this header isn't really configurable, although quite recently I added 2 custom values for setting the header to. But that doesn't really solve your issue.
As there currently isn't an open PR on that plugin, I'll consider adding an option to only show the date/time (it will be in the generally used date notation, not DE...), or have a custom value. Not sure yet what the exact solution will be
/Ton (PayPal.me)
Re: Counting time, calculate and display?
Yes, it's usually a NeoPixel, most likely at GPIO 8, though I've also seen boards with an R/G/B led using 3 GPIO pins
/Ton (PayPal.me)
Re: Counting time, calculate and display?
Ty for the many answers... I will try that...
And for the framed: It's ok... I really don't know about the code behind so if you say that's hard to do or impossible then I can use that to ship arround ...
Ok... Time for a little relaxing...
EDIT:
It's a NeoPixel on GPIO 48
And for the framed: It's ok... I really don't know about the code behind so if you say that's hard to do or impossible then I can use that to ship arround ...
Ok... Time for a little relaxing...
EDIT:
It's a NeoPixel on GPIO 48
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Let's hope it didn't take you 40+ attempts to find it
Re: Counting time, calculate and display?
... nope, just 20 ... I ever start in the middle
No not really; Joking aside...
If they're new, there's probably a little mini-program running that always controls the LED in a circle r>g>b>r... I used the scope to see where the signal for this comes from..
I think I will print a transparent light transport and use the LED for things like HeartBeat, GPS ok/bad or things like that... I will see later...
No not really; Joking aside...
If they're new, there's probably a little mini-program running that always controls the LED in a circle r>g>b>r... I used the scope to see where the signal for this comes from..
I think I will print a transparent light transport and use the LED for things like HeartBeat, GPS ok/bad or things like that... I will see later...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Good morning all together ...
... some hint to lighten the day:
Ok, back to topic...
The route via the framed display doesn't really work as well as I thought it would. I'm encountering display problems that I didn't expect. But one after anonther:
1.: Header line
It actually works, apart from the fact that the WLAN symbol cannot be removed or, at best, you can choose one symbol from several (WLAN, BT, GPS, ...). However, this immediately goes wrong if you set "Header" = Date and "Header (alternate)" = Time. The two data sets then overwrite each other alternately. I assume this is a BUG?
2.: Font
Unfortunately, the font is not proportional. This makes it extremely difficult to format the output data fairly neatly on the display.
3.: Justification
I read in https://espeasy.readthedocs.io/en/lates ... /P036.html that you can use the pipe in the command "oledframedcmd,<line>,<text>" to create a quasi-justified sentence, which means that the left part is shown left-aligned and the right part is shown right-aligned in the display. But this doesn't seem to work if I use the pipe symbol in the line contents of the device itself; doesn't work here (or I'm doing something wrong).
So if I enter e.g. in line 2 in the device itself...
Oil consumption: | 1329,8L
... then the pipe itself is displayed, but the line is otherwise not formatted in justified form as expected.
^forget point 3; I'm simple stupid
Video for 1 can be found here:
https://steamradio.de/esp/240410,%20fra ... oblems.mp4
Last but not least, I unfortunately had to realize that I had forgotten a lot in the many months that I hadn't worked with ESPeasy.
Because of point 1. I actually wanted to switch off the header completely and build my own, which should look like this (_ is space):
dd.mm.yy__var__hh:mm:ss
I wanted "var" filled with "GPS", "NTP" or "???", depending on where the time information comes from. It took me quite a long time to remember that I can't save ASCII in a custom-var or a dummy. I put that aside for now because I ran out of ideas...
Now I will go to my garden and check my healthy ...
EDIT:
Is it possible to create an event by any valoe of an device insteed of a single / named value?
Example:
Device TEMP have 3 values from 3 sensors, let say T1, T2 and T3. So this work well as known:
So I like to create an event independent from T1 to T3. With other words: If one of the values T1, T2 or T3 change. So like this (what don't work):
Is there a way to do that?
EDIT 2:
I have try to work on the counter. Base is a generic switch where I like to count the time the switch is "on" (GPIO to GND). For that I have defined the counter2 with 100ms.
If the switch goes to GND and create an event, I start the counter. If the switch goes open and also create an event, I stop the counter and try to grab the time the counter was running meanwhile.
I have try to use the example written in the docs under "Sub-second resolution and loop timers" but the %eventvalue2% is ever "0". I can see the timer running and stoping in the log viewer but that's it.
I think the %eventvalue2% will give me the status of the Switch-value and not the counted time from timer2.
So question is how I can grab the count-value and store them into the dummy "Speicher"?
EDIT 3:
This is a possible solution but limited to 1sec resolution and not 100msec I like to have:
EDIT 4:
And now nothing goes... The ESP isn't able to connect to the known WiFi. Have try to unpower a longer time, do a reset and some mor... No way...
Last EDIT:
I'm tired and giving up; no chance of getting it back into the network, neither as a client nor via AP mode.
I'll throw that one away and, perhaps in the coming days, flash the next one and start over. But if he dies also within 2 or 3 days, then I will bury the project.
After all, what use is a great oil meter if at some point it can no longer be read? Well... it's no use at all...
... some hint to lighten the day:
Code: Select all
For men over 50, a urine sample in the garden is sufficient for a health check:
Go to the garden early in the morning on an empty stomach and pee.
- If ants gather on the ground, you have elevated sugar and probably diabetes
- If it drips onto the tips of your feet, you have problems with your prostate
- If your wrist hurts when you shake it off, then you have osteoarthritis
- If you can't stop shaking, you have Parkinson's
- If you're back in the apartment and it's still hanging out, then you have Alzheimer's
- If you no longer know why you were in the garden, then it is dementia
Ok, back to topic...
The route via the framed display doesn't really work as well as I thought it would. I'm encountering display problems that I didn't expect. But one after anonther:
1.: Header line
It actually works, apart from the fact that the WLAN symbol cannot be removed or, at best, you can choose one symbol from several (WLAN, BT, GPS, ...). However, this immediately goes wrong if you set "Header" = Date and "Header (alternate)" = Time. The two data sets then overwrite each other alternately. I assume this is a BUG?
2.: Font
Unfortunately, the font is not proportional. This makes it extremely difficult to format the output data fairly neatly on the display.
3.: Justification
I read in https://espeasy.readthedocs.io/en/lates ... /P036.html that you can use the pipe in the command "oledframedcmd,<line>,<text>" to create a quasi-justified sentence, which means that the left part is shown left-aligned and the right part is shown right-aligned in the display. But this doesn't seem to work if I use the pipe symbol in the line contents of the device itself; doesn't work here (or I'm doing something wrong).
So if I enter e.g. in line 2 in the device itself...
Oil consumption: | 1329,8L
... then the pipe itself is displayed, but the line is otherwise not formatted in justified form as expected.
^forget point 3; I'm simple stupid
Video for 1 can be found here:
https://steamradio.de/esp/240410,%20fra ... oblems.mp4
Last but not least, I unfortunately had to realize that I had forgotten a lot in the many months that I hadn't worked with ESPeasy.
Because of point 1. I actually wanted to switch off the header completely and build my own, which should look like this (_ is space):
dd.mm.yy__var__hh:mm:ss
I wanted "var" filled with "GPS", "NTP" or "???", depending on where the time information comes from. It took me quite a long time to remember that I can't save ASCII in a custom-var or a dummy. I put that aside for now because I ran out of ideas...
Now I will go to my garden and check my healthy ...
EDIT:
Is it possible to create an event by any valoe of an device insteed of a single / named value?
Example:
Device TEMP have 3 values from 3 sensors, let say T1, T2 and T3. So this work well as known:
Code: Select all
On TEMP#T1 Do
oledframedcmd,2,'WW: [TEMP#T1] °C
Endon
Code: Select all
On TEMP# Do
oledframedcmd,2,'WW: [TEMP#T1] °C
Endon
EDIT 2:
I have try to work on the counter. Base is a generic switch where I like to count the time the switch is "on" (GPIO to GND). For that I have defined the counter2 with 100ms.
If the switch goes to GND and create an event, I start the counter. If the switch goes open and also create an event, I stop the counter and try to grab the time the counter was running meanwhile.
I have try to use the example written in the docs under "Sub-second resolution and loop timers" but the %eventvalue2% is ever "0". I can see the timer running and stoping in the log viewer but that's it.
Code: Select all
On Ventil#STA Do
If [Ventil#STA]=0
looptimerset_ms,2,100
Elseif [Ventil#STA]=1
looptimerset_ms,2,0
logentry,%eventvalue2%
TaskValueSet Speicher,S,'[Speicher#S] + %eventvalue2%
Endif
Endon
So question is how I can grab the count-value and store them into the dummy "Speicher"?
EDIT 3:
This is a possible solution but limited to 1sec resolution and not 100msec I like to have:
Code: Select all
On Ventil#STA Do
If [Ventil#STA]=0
Let,5,%unixtime%
Else
TaskValueSet Speicher,S,'[Speicher#S] + %unixtime% - %v5%'
Endif
Endon
And now nothing goes... The ESP isn't able to connect to the known WiFi. Have try to unpower a longer time, do a reset and some mor... No way...
Code: Select all
00:07:13.412 : (252596) Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
00:07:13.412 : (252720) Info : WiFi : WifiDisconnect()
00:07:13.624 : (252176) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:13.725 : (252680) Info : Reset WiFi.
00:07:13.728 : (252616) Info : WiFi : Start network scan all channels
00:07:16.314 : (251744) Info : WiFi : Scan finished, found: 12
00:07:16.316 : (252372) Info : WiFi : Best AP candidate: Buchholz 3C:37:12:5F:4E:E1 Ch:4 (-45dBm)WPA2/PSK (bgn)
00:07:16.327 : (252432) Info : NVS : Load WIFICANDIDATE
00:07:16.328 : (252504) Info : WiFi : Added known candidate, try to connect
00:07:16.330 : (251836) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #49
00:07:16.346 : (252348) Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
00:07:16.357 : (252324) Info : WiFi : WifiDisconnect()
00:07:16.559 : (252552) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:16.660 : (252480) Info : WiFi : WifiDisconnect()
00:07:16.862 : (252464) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:16.963 : (252440) Info : Reset WiFi.
00:07:16.966 : (252376) Info : WiFi : Start network scan all channels
00:07:19.553 : (251652) Info : WiFi : Scan finished, found: 11
00:07:19.554 : (252196) Info : WiFi : Best AP candidate: Buchholz 3C:37:12:5F:4E:E1 Ch:4 (-46dBm)WPA2/PSK (bgn)
00:07:19.555 : (252252) Info : NVS : Load WIFICANDIDATE
00:07:19.566 : (252328) Info : WiFi : Added known candidate, try to connect
00:07:19.578 : (252188) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #50
00:07:19.584 : (252168) Info : WIFI : Arduino wifi status: WL_CONNECT_FAILED 4 ESPeasy internal wifi status: DISCONNECTED
00:07:19.695 : (252292) Info : WIFI : Set WiFi to OFF
00:07:20.012 : (268080) Info : WIFI : Set WiFi to STA
00:07:20.119 : (252300) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #51
00:07:20.748 : (252036) Info : EVENT: WiFi#Disconnected
00:07:20.893 : (252432) Info : EVENT: WiFi#Disconnected
00:07:20.933 : (252520) Info : EVENT: WiFi#Disconnected
00:07:20.999 : (252616) Info : EVENT: GPS#LostFix
00:07:21.306 : (252616) Info : EVENT: GPS#GotFix
00:07:40.124 : (252640) Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
00:07:40.124 : (252760) Info : WiFi : WifiDisconnect()
00:07:40.336 : (252744) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:40.437 : (252720) Info : Reset WiFi.
00:07:40.440 : (252648) Info : WiFi : Start network scan all channels
00:07:43.027 : (251868) Info : WiFi : Scan finished, found: 11
00:07:43.028 : (252408) Info : WiFi : Best AP candidate: Buchholz 3C:37:12:5F:4E:E1 Ch:4 (-46dBm)WPA2/PSK (bgn)
00:07:43.039 : (252480) Info : NVS : Load WIFICANDIDATE
00:07:43.040 : (252544) Info : WiFi : Added known candidate, try to connect
00:07:43.042 : (252404) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #52
00:07:43.058 : (252388) Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
00:07:43.069 : (252512) Info : WiFi : WifiDisconnect()
00:07:43.271 : (252592) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:43.372 : (252520) Info : WiFi : WifiDisconnect()
00:07:43.574 : (252504) Info : WIFI : Disconnected! Reason: '(1) Unspecified'
00:07:43.675 : (252480) Info : Reset WiFi.
00:07:43.678 : (252416) Info : WiFi : Start network scan all channels
00:07:46.265 : (251776) Info : WiFi : Scan finished, found: 10
00:07:46.266 : (252232) Info : WiFi : Best AP candidate: Buchholz 3C:37:12:5F:4E:E1 Ch:4 (-46dBm)WPA2/PSK (bgn)
00:07:46.267 : (252304) Info : NVS : Load WIFICANDIDATE
00:07:46.278 : (252368) Info : WiFi : Added known candidate, try to connect
00:07:46.290 : (252228) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #53
00:07:46.296 : (251684) Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
00:07:46.397 : (251972) Info : WIFI : Set WiFi to OFF
00:07:46.724 : (268120) Info : WIFI : Set WiFi to STA
00:07:46.831 : (252352) Info : WIFI : Connecting Buchholz 38:10:D5:32:43:42 Ch:4 (RTC) WPA2/PSK (bgn) attempt #54
00:07:46.849 : (252440) Info : EVENT: WiFi#Disconnected
00:07:47.404 : (252380) Info : EVENT: WiFi#Disconnected
00:07:47.445 : (252420) Info : EVENT: WiFi#Disconnected
00:07:48.098 : (252616) Info : EVENT: GPS#LostFix
00:07:49.290 : (252260) Info : EVENT: GPS#GotFix
I'm tired and giving up; no chance of getting it back into the network, neither as a client nor via AP mode.
I'll throw that one away and, perhaps in the coming days, flash the next one and start over. But if he dies also within 2 or 3 days, then I will bury the project.
After all, what use is a great oil meter if at some point it can no longer be read? Well... it's no use at all...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
That is supposed to work as you expect it to, so not sure what's going sideways hereM*I*B wrote: ↑10 Apr 2024, 10:53 1.: Header line
It actually works, apart from the fact that the WLAN symbol cannot be removed or, at best, you can choose one symbol from several (WLAN, BT, GPS, ...). However, this immediately goes wrong if you set "Header" = Date and "Header (alternate)" = Time. The two data sets then overwrite each other alternately. I assume this is a BUG?
That's what the checkbox "Single event with all values" is introduced for. You'll then get an event TEMP#All with all values, up to 4, as %eventvalue1%..%eventvalue4%, so you can process them as needed at the same timestamp/moment.M*I*B wrote: ↑10 Apr 2024, 10:53 EDIT:
Is it possible to create an event by any valoe of an device insteed of a single / named value?
Example:
Device TEMP have 3 values from 3 sensors, let say T1, T2 and T3. So this work well as known:So I like to create an event independent from T1 to T3. With other words: If one of the values T1, T2 or T3 change. So like this (what don't work):Code: Select all
On TEMP#T1 Do oledframedcmd,2,'WW: [TEMP#T1] °C Endon
Is there a way to do that?Code: Select all
On TEMP# Do oledframedcmd,2,'WW: [TEMP#T1] °C Endon
I think you need this Rules example: Register power used for a heaterM*I*B wrote: ↑10 Apr 2024, 10:53 EDIT 2:
I have try to work on the counter. Base is a generic switch where I like to count the time the switch is "on" (GPIO to GND). For that I have defined the counter2 with 100ms.
If the switch goes to GND and create an event, I start the counter. If the switch goes open and also create an event, I stop the counter and try to grab the time the counter was running meanwhile.
I have try to use the example written in the docs under "Sub-second resolution and loop timers" but the %eventvalue2% is ever "0". I can see the timer running and stoping in the log viewer but that's it.
Via serial you can send the commands for setting up the WiFi connection:M*I*B wrote: ↑10 Apr 2024, 10:53 EDIT 4:
And now nothing goes... The ESP isn't able to connect to the known WiFi. Have try to unpower a longer time, do a reset and some mor... No way...
...
Last EDIT:
I'm tired and giving up; no chance of getting it back into the network, neither as a client nor via AP mode.
I'll throw that one away and, perhaps in the coming days, flash the next one and start over. But if he dies also within 2 or 3 days, then I will bury the project.
After all, what use is a great oil meter if at some point it can no longer be read? Well... it's no use at all...
Code: Select all
WiFissid,<your_wifi_name>
WiFikey,<your_wifi_password>
save
And AP-mode can also be started by sending the command WiFiAPmode.
That are ways to reset the WiFi settings, as these seem to be messed up in some way.
/Ton (PayPal.me)
Re: Counting time, calculate and display?
Yes, I know. That the normal way I setup the connection; I normally don't use the AP-mode for setup. Work's better and faster with a hTerm-macro. But here nothing works. Not the client connection to my WLAN neither the AP-mode. I can connect to the AP but I can't call the GUI or anything other. Also a Ping don't answer but the connection is still on...Ath wrote: ↑10 Apr 2024, 20:13 Via serial you can send the commands for setting up the WiFi connection:And the same WiFi commands can be used for the second set of WiFi credentials by appending a 2 to the commands. That way you can also invalidate the WiFi settings so it should start AP-mode.Code: Select all
WiFissid,<your_wifi_name> WiFikey,<your_wifi_password> save
And AP-mode can also be started by sending the command WiFiAPmode.
That are ways to reset the WiFi settings, as these seem to be messed up in some way.
Meanwhile, I have grabbed the 2nd one, flash it and run the same setup macro; no problem. Back to the 1st one, flash it and let the macro go on... Connection to the AP are possible but no call to the GUI as before... That thing is for the trash... I'm sure...
Anyway... Many thanx for the hints. I will try them if I'm lost my angry about that hardware crap the next days... Also take a while to bring all back to where I was...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Before you trash it, maybe you can either wipe it and start over, or give it the command to erase WiFi calibration data:
Then let it run for a few seconds (5+ sec) and power cycle the node.
Code: Select all
erasesdkwifi
Re: Counting time, calculate and display?
... that's all in my hTerm-script... Look yourselfe:
BTW:
For GPS I can ask for fix via event handler. So can I do same for NTP respectively can I check in any way if NTP available (ping?)?
Have time... I go to bed now...
Have a nice n8 all together
Code: Select all
EraseSDKwifi
ClearPassword
IP,192.168.1.210
Subnet,255.255.255.0
DNS,192.168.1.111
Gateway,192.168.1.111
NTPHost,192.168.1.1
UseNTP,1
DST,1
WifiSSID,blabla
WifiKey,blubblub
Rules,1
TimeZone,60
Save
Reboot
For GPS I can ask for fix via event handler. So can I do same for NTP respectively can I check in any way if NTP available (ping?)?
Have time... I go to bed now...
Have a nice n8 all together
DLzG
Micha
Micha
Re: Counting time, calculate and display?
You might want to enter the WiFi lines again one line at a time.
Or make sure you are connected to the "COM" or "UART" port and not the "USB" or "OTG" port.
I have seen the "Native USB" port may sometimes drop some characters when entering commands in bulk.
Or make sure you are connected to the "COM" or "UART" port and not the "USB" or "OTG" port.
I have seen the "Native USB" port may sometimes drop some characters when entering commands in bulk.
Re: Counting time, calculate and display?
What do you mean by GPS event handling?
There are some events sent, like whether the time is set.
There are some events sent, like whether the time is set.
Re: Counting time, calculate and display?
... ha... just catch me go with my finger to the power switch of the PC...
For GPS I can use GPS#GotFix and GPS#LostFix to check. What I have understand is that without a GPS-fix it falls back to NTP source. But what happens if NTP are also gone (no network, NTP-server down, ...)? How can I check by event or simple by if/then... if NTP are working or not?
For GPS I can use GPS#GotFix and GPS#LostFix to check. What I have understand is that without a GPS-fix it falls back to NTP source. But what happens if NTP are also gone (no network, NTP-server down, ...)? How can I check by event or simple by if/then... if NTP are working or not?
DLzG
Micha
Micha
Re: Counting time, calculate and display?
That goes line by line, ended with LF/CR, that very slow and also always await an OK from host. That also works well with the small ESP's. Have never go wrong (for the smalls I use another macro for sure...). That's why I like my hTerm
DLzG
Micha
Micha
Re: Counting time, calculate and display?
There is the %isNTP% variable (no ESPEasy at hand here, better check the System Variables page)
/Ton (PayPal.me)
Re: Counting time, calculate and display?
Good morning all...
Apart from the fact that this variable is not suitable for determining whether the system can reach the NTP server in my eyes, it generally always seems to be stay to true. I have now had the IP point to nirvana AND switched off NTP in the ESP. Stays still true for over 30 minutes since then...
EDIT:
Stays still on true after reboot without GPS and nirvana-IP and NTP disabled ...
... yes, there is. But that don't work. This var stay still true if I stop the local NTP-server and/or bend the IP in ESP to a non-existing one. Also, if I completely disable the use of NTP in ESP they stay still true.
Apart from the fact that this variable is not suitable for determining whether the system can reach the NTP server in my eyes, it generally always seems to be stay to true. I have now had the IP point to nirvana AND switched off NTP in the ESP. Stays still true for over 30 minutes since then...
EDIT:
Stays still on true after reboot without GPS and nirvana-IP and NTP disabled ...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
The %ntp% variable is probably named poorly as it just indicates whether the time has been set.
Why do you need to know whether NTP is ready?
You do get an event when the time has been set (again). See: https://espeasy.readthedocs.io/en/lates ... ore-events
There is Time#Initialized and Time#Set
The last one should be fired whenever the time has been updated, either by GPS or NTP.
Maybe we could add the time source as an eventvalue.
Why do you need to know whether NTP is ready?
You do get an event when the time has been set (again). See: https://espeasy.readthedocs.io/en/lates ... ore-events
There is Time#Initialized and Time#Set
The last one should be fired whenever the time has been updated, either by GPS or NTP.
Maybe we could add the time source as an eventvalue.
Re: Counting time, calculate and display?
OK (thinking... thinking... grab a coffee... thinkin...). But then I don't understand it either...
If this variable shows whether the time is set or not, then it should go to false/0 if neither a GPS nor an NTP source is present during/after a reset...
Or do I now have a knot in my brain?
I would like to show the current time source on the display. So either GPS or NTP or ERR.TD-er wrote: ↑11 Apr 2024, 09:01 Why do you need to know whether NTP is ready?
You do get an event when the time has been set (again). See: https://espeasy.readthedocs.io/en/lates ... ore-events
There is Time#Initialized and Time#Set
The last one should be fired whenever the time has been updated, either by GPS or NTP.
There is usually no internet available at the planned location and therefore no NTP server unless I am on site for service and provide the internet via tethering from the mobile phone network. As long as the GPS works, everything is fine. But if GPS fails (for whatever reason) and no NTP server is available, the absence of any time source must be displayed and logged.
That would be a good idea. Makes it a lot easier for fools like me...
Regardless, I just encountered another problem:
I'm currently checking whether GPS is available or not:
Code: Select all
on GPS#GotFix do
Let,1,1
endon
on GPS#LostFix do
Let,1,0
endon
I have to think about how I can provoke an event after reset or how I can get around this problem differently.
DLzG
Micha
Micha
Re: Counting time, calculate and display?
I think I can add a new variable to the GPS Plugin, providing that Fix value, it seems useful...
/Ton (PayPal.me)
Re: Counting time, calculate and display?
...for now I've circumnavigated this cliff from behind through the eyes ...
Apparently turning off the GPS device and then turning it back on again forces an event. Not pretty, but it works for now.
Code: Select all
On system#boot Do
TaskDisable,GPS
Let,1,0
LoopTimerSet,1,1
TimerSet,2,30
oledframedcmd,1,'ERROR: No time source !'
Endon
On Time#Initialized Do
Let,1,1
Endon
On Rules#Timer=2 Do
TaskEnable,GPS
Endon
on GPS#GotFix do
Let,1,2
endon
on GPS#LostFix do
Let,1,1
endon
on rules#timer=1 do // Create header, check GPS, NTP time source
if %v1% = 2
oledframedcmd,1,'%sysday_0%.%sysmonth_0%.%sysyears% GPS %systime%'
elseif %v1% = 1
oledframedcmd,1,'%sysday_0%.%sysmonth_0%.%sysyears% NTP %systime%'
else
oledframedcmd,1,'ERROR: No time source !'
endif
endon
DLzG
Micha
Micha
Re: Counting time, calculate and display?
You can give the commands "gps,sleep" and "gps,wake" to put the GPS to sleep and wake it up.
This does reduce power consumption significantly and I think it will also cause the GPS to loose its fix.
Or commands like "taskdisable,N" and "taskenable,N" which will disable the task with taskindex N.
GPS data which is not set as task value can still be queried and "fix_qual" should be one of them.
So let's assume you have named your GPS task "gps", then [gps#fix_qual] Should also result in a value.
Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8
This does reduce power consumption significantly and I think it will also cause the GPS to loose its fix.
Or commands like "taskdisable,N" and "taskenable,N" which will disable the task with taskindex N.
GPS data which is not set as task value can still be queried and "fix_qual" should be one of them.
So let's assume you have named your GPS task "gps", then [gps#fix_qual] Should also result in a value.
Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8
Re: Counting time, calculate and display?
Ahhh ok, that should be also a way to go. I will try that also to learn. Thanx a lot!
Meanwhile I crash into one more problem (BUG?) with framed display:
If I declare GPIO17 for a momentary switch (reverse, pullup) and also disable "Wake display on receiving text" and set the display timeout higher than 1sec, the display don't go to sleep. With 1sec it works, more then 1sec not...
Edit: "Scroll long lines" also have no effect; or if that woks only for header lines if used?
Meanwhile I crash into one more problem (BUG?) with framed display:
If I declare GPIO17 for a momentary switch (reverse, pullup) and also disable "Wake display on receiving text" and set the display timeout higher than 1sec, the display don't go to sleep. With 1sec it works, more then 1sec not...
Edit: "Scroll long lines" also have no effect; or if that woks only for header lines if used?
Last edited by M*I*B on 11 Apr 2024, 11:57, edited 1 time in total.
DLzG
Micha
Micha
Re: Counting time, calculate and display?
... has no effect if I change to 8 or any other not listed as "baba". All timeouts over 1 don't work ...
DLzG
Micha
Micha
Re: Counting time, calculate and display?
Nah, must have been something we're missing here or else... you may have found a bug?
I think it is just missing documentation here
Assuming you didn't actually use GPIO-8 as that is connected to the flash
I think it is just missing documentation here
Assuming you didn't actually use GPIO-8 as that is connected to the flash
Who is online
Users browsing this forum: No registered users and 2 guests