GarbageCalendar (new version) lua scripts

Moderator: leecollings

Post Reply
BarryT
Posts: 369
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by BarryT »

BarryT wrote: Sunday 05 April 2020 16:09 I think you have to use the ical url:
Nah ... he is using the provide scripts. ;)

Jos
Pardon me :lol:
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

Sorry, my fault. I had the old (mijnafvalwijzer) and the new (GarbageCalendar) in the lua folder.
Old ones removed and no more errors. And for street just placed 'Pintelaan'.
Text Sensor data remains 'Hello World'

Does it matter for case sensitivity > PMD / pmd ?

Code: Select all

-- Add any missing records below this line
   ["PMD"]                              ={hour=19,min=22,daysbefore=1,reminder=0,text="PMD"},
   ["GFT"]                              ={hour=19,min=22,daysbefore=1,reminder=0,text="GFT"},
   ["P-K"]                           ={hour=19,min=22,daysbefore=1,reminder=0,text="Papier"},
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

Fresh start with new installed raspbian and domoticz
First he gives the following error
2020-04-05 19:53:00.479 Status: LUA: !!! table.load error:cannot open /home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data: No such file or directory
Creating the file "garbagecalendar_m_ophaalkalender-be.data"
Gives me following error
2020-04-05 19:54:00.489 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua: .../pi/domoticz/scripts/lua/garbagecalendar/table_funcs.lua:124: attempt to concatenate a nil value (local 'err')
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): #### Sun Apr 5 19:54:00 2020 ### Start garbagecalendar script v20200404-1400
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): datafilepath: /home/pi/domoticz/logs/
2020-04-05 19:54:00.484 Status: LUA: @GarbageCal(m_ophaalkalender-be): scriptpath: /home/pi/domoticz/scripts/lua/
2020-04-05 19:54:00.485 Status: LUA: @GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2020-04-05 19:54:00.486 Status: LUA: @GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
2020-04-05 19:54:00.486 Status: LUA: @GarbageCal(m_ophaalkalender-be): Start checking garbagetype_cfg table:
2020-04-05 19:54:00.486 Status: LUA: @GarbageCal(m_ophaalkalender-be): P-K change to p-k
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): PMD change to pmd
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): Glas change to glas
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): GFT change to gft
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): Restafval change to restafval
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:pmd
2020-04-05 19:54:00.487 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:restafval
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:30 Garbagetype:reloaddata
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:p-k
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:31 Garbagetype:dummy1
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:glas
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:gft
2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): Start update for text device:
2020-04-05 19:54:00.489 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua: .../pi/domoticz/scripts/lua/garbagecalendar/table_funcs.lua:124: attempt to concatenate a nil value (local 'err')
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

iTDB wrote: Sunday 05 April 2020 17:51 Sorry, my fault. I had the old (mijnafvalwijzer) and the new (GarbageCalendar) in the lua folder.
Old ones removed and no more errors. And for street just placed 'Pintelaan'.
Text Sensor data remains 'Hello World'
Does it matter for case sensitivity > PMD / pmd ?
The recent versions are case insensitive, so shouldn't matter.
iTDB wrote: Sunday 05 April 2020 20:09 2020-04-05 19:54:00.488 Status: LUA: @GarbageCal(m_ophaalkalender-be): Start update for text device:
2020-04-05 19:54:00.489 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua: .../pi/domoticz/scripts/lua/garbagecalendar/table_funcs.lua:124: attempt to concatenate a nil value (local 'err')
That error shouldn't happen and should be changed to a friendly one, so will fix that in the next release, but it means it was unable to load the data file. Could there be an issue with the rights for the process to open the file?
I really need a copy of all the log files to be able to determine issues in a better way!

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

garbagecalendar_run_m_ophaalkalender-be.log
@GarbageCal(m_ophaalkalender-be): #### Sun Apr 5 20:11:00 2020 ### Start garbagecalendar script v20200404-1400
@GarbageCal(m_ophaalkalender-be): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
@GarbageCal(m_ophaalkalender-be): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
@GarbageCal(m_ophaalkalender-be): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_ophaalkalender-be): datafilepath: /home/pi/domoticz/logs/
@GarbageCal(m_ophaalkalender-be): scriptpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
@GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
@GarbageCal(m_ophaalkalender-be): Start checking garbagetype_cfg table:
@GarbageCal(m_ophaalkalender-be): GFT change to gft
@GarbageCal(m_ophaalkalender-be): P-K change to p-k
@GarbageCal(m_ophaalkalender-be): PMD change to pmd
@GarbageCal(m_ophaalkalender-be): Restafval change to restafval
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:restafval
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:30 Garbagetype:reloaddata
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:p-k
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:Glas
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:pmd
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:gft
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:31 Garbagetype:dummy1
@GarbageCal(m_ophaalkalender-be): Start update for text device:
garbagecalendar_run_update_m_ophaalkalender-be.log
@GarbageCal(m_ophaalkalender-be): #### Sun Apr 5 19:53:00 2020 ### Start garbagecalendar script v20200404-1400
@GarbageCal(m_ophaalkalender-be): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
@GarbageCal(m_ophaalkalender-be): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
@GarbageCal(m_ophaalkalender-be): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_ophaalkalender-be): datafilepath: /home/pi/domoticz/logs/
@GarbageCal(m_ophaalkalender-be): scriptpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
@GarbageCal(m_ophaalkalender-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
@GarbageCal(m_ophaalkalender-be): Start checking garbagetype_cfg table:
@GarbageCal(m_ophaalkalender-be): P-K change to p-k
@GarbageCal(m_ophaalkalender-be): PMD change to pmd
@GarbageCal(m_ophaalkalender-be): GFT change to gft
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:p-k
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:pmd
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:31 Garbagetype:dummy1
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:Glas
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:Restafval
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:2:30 Garbagetype:reloaddata
@GarbageCal(m_ophaalkalender-be): -> NotificationTime:19:22 Garbagetype:gft
@GarbageCal(m_ophaalkalender-be): Start update for text device:
@GarbageCal(m_ophaalkalender-be): Warning: Datafile not found:/home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data . Start webupdate now.
@GarbageCal(m_ophaalkalender-be): start foreground webupdate for module m_ophaalkalender-be of file /home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data
@GarbageCal(m_ophaalkalender-be): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_ophaalkalender-be.lua "/home/pi/domoticz/scripts/lua/" "9000" "59" "" "/home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data" "/home/pi/domoticz/logs/garbagecalendar_web_m_ophaalkalender-be.log" "" "Pintelaan"
@GarbageCal(m_ophaalkalender-be): Unable to load the data. please check your setup and runlogfile :/home/pi/domoticz/logs/garbagecalendar_run_m_ophaalkalender-be.log
@GarbageCal(m_ophaalkalender-be): ### Warning: No valid records found in the datafile: /home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data
@GarbageCal(m_ophaalkalender-be): ### Please check the garbagecalendar log files for issues : /home/pi/domoticz/logs/garbagecalendar_web_m_ophaalkalender-be.log and /home/pi/domoticz/logs/garbagecalendar_run_m_ophaalkalender-be.log
@GarbageCal(m_ophaalkalender-be): - End -----------------
@GarbageCal(m_ophaalkalender-be): ==> found schedule:
@GarbageCal(m_ophaalkalender-be): Update device from:
Hello World
replace with:
garbagecalendar_web_m_ophaalkalender-be.log
@m_ophaalkalender-be:#### Sun Apr 5 19:53:00 2020 ### Start garbagekalerder module m_ophaalkalender-be (v20200317-1600)
@m_ophaalkalender-be:Loaded JSON.lua.
@m_ophaalkalender-be:!!! perform background update to /home/pi/domoticz/logs/garbagecalendar_m_ophaalkalender-be.data for Zipcode 9000 - 59 (optional) Hostname:
@m_ophaalkalender-be:---- web update ----------------------------------------------------------------------------
@m_ophaalkalender-be:sQuery=curl "https://www.ophaalkalender.be/Calendar/ ... pcode=9000" 2>nul
lua: .../scripts/lua/garbagecalendar/m_ophaalkalender-be.lua:113: attempt to index global 'adressdata' (a nil value)
stack traceback:
.../scripts/lua/garbagecalendar/m_ophaalkalender-be.lua:113: in function 'Perform_Update'
.../scripts/lua/garbagecalendar/m_ophaalkalender-be.lua:175: in main chunk
[C]: ?
@m_ophaalkalender-be:Web_Data=
@m_ophaalkalender-be:Error: Empty result from curl command
@m_ophaalkalender-be:adressid:
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Did you check you have curl installed on your system?
I can only replicate this error when curl isn't available.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

It's installed

Code: Select all

pi@raspbian:~ $ lua -v
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
pi@raspbian:~ $ curl --version
curl 7.64.0 (arm-unknown-linux-gnueabihf) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

iTDB wrote: Monday 06 April 2020 1:11 It's installed

Code: Select all

pi@raspbian:~ $ curl --version
curl 7.64.0 (arm-unknown-linux-gnueabihf) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
So what happens when you go onto your RPI and do these commands:

Code: Select all

cd /home/pi/domoticz/scripts/lua/
curl "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

He Jos, and other helpers,
I had to reinstall an older version of domoticz, because I had trouble with domoticz 2020.1 and OZW.
But in this version (v4.11605) from my backup, I cannot manage to get Garbage collection script working.
I get a message in log:

Code: Select all

2020-04-06 16:07:00.338 Status: LUA: #### 16:07:00 start garbagecalendar script v20200404-1400
2020-04-06 16:07:00.344 Status: LUA: Ensure you have copied "garbagecalendarconfig_model.lua" to "garbagecalendarconfig.lua" and modified it to your requirements.
2020-04-06 16:07:00.346 Status: LUA: Also check the path in variable "scriptpath= " is correctly set.
2020-04-06 16:07:00.346 Status: LUA: 1
2020-04-06 16:07:00.341 Error: LUA: !!! Error: failed loading "garbagecalendarconfig.lua" from : "/home/pi/domoticz/scripts/lua/garbagecalendar/"
2020-04-06 16:07:00.346 Error: EventSystem: Lua script /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua did not return a commandArray 
files:

Code: Select all

pi@rpi-domoticz:~/domoticz/scripts/lua $ ls -l
totaal 120
drwxr-xr-x 2 pi pi  4096 apr  6 16:09 garbagecalendar
-rw-r--r-- 1 pi pi 50533 mei 10  2019 JSON.lua
-rw-r--r-- 1 pi pi  1870 mei 10  2019 script_device_demo.lua
-rw-r--r-- 1 pi pi  1932 mei 10  2019 script_time_demo.lua
-rw-r--r-- 1 pi pi 26990 apr  6 15:45 script_time_garbagecalendar.lua
-rw-r--r-- 1 pi pi  5968 nov 24 08:36 xml2lua.lua
drwxr-xr-x 2 pi pi  4096 nov 24 08:36 xmlhandler
-rw-r--r-- 1 pi pi 12387 nov 24 08:36 XmlParser.lua
pi@rpi-domoticz:~/domoticz/scripts/lua $ 

and:
pi@rpi-domoticz:~/domoticz/scripts/lua $ ls -l garbagecalendar/
totaal 136
-rw-r--r-- 1 pi pi 9746 apr  6 16:09 garbagecalendarconfig.lua
-rw-r--r-- 1 pi pi 7798 feb 11 19:39 garbagecalendarconfig.lua.bkup
-rw-r--r-- 1 pi pi 9727 apr  6 15:55 garbagecalendarconfig_model.lua
-rw-r--r-- 1 pi pi 7455 apr  6 15:45 m_deafvalapp.lua
-rw-r--r-- 1 pi pi 7554 apr  6 15:45 m_goeree-overflakkee.lua
-rw-r--r-- 1 pi pi 8999 apr  6 15:45 m_mijnafvalwijzer.lua
-rw-r--r-- 1 pi pi 8928 apr  6 15:45 m_montferland.lua
-rw-r--r-- 1 pi pi 7814 apr  6 15:45 m_ophaalkalender-be.lua
-rw-r--r-- 1 pi pi 9319 apr  6 15:45 m_opzet_api.lua
-rw-r--r-- 1 pi pi 8495 apr  6 15:45 m_opzet.lua
-rw-r--r-- 1 pi pi 7786 apr  6 15:45 m_westland.lua
-rw-r--r-- 1 pi pi 9867 apr  6 15:45 m_ximmio.lua
-rw-r--r-- 1 pi pi 7706 apr  6 15:45 m_zuidlimburg.lua
-rw-r--r-- 1 pi pi 3829 apr  6 15:45 table_funcs.lua
pi@rpi-domoticz:~/domoticz/scripts/lua $ 
So In my view all the files are there.
Do you understand the problem? here?
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

So did you check? :)
2020-04-06 16:07:00.344 Status: LUA: Ensure you have copied "garbagecalendarconfig_model.lua" to "garbagecalendarconfig.lua" and modified it to your requirements.
----
2020-04-06 16:07:00.341 Error: LUA: !!! Error: failed loading "garbagecalendarconfig.lua" from : "/home/pi/domoticz/scripts/lua/garbagecalendar/"
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

Yes, I did. But maybe I'm missing something. Have a look in the second codefield above this post.
-rw-r--r-- 1 pi pi 9746 apr 6 16:09 garbagecalendarconfig.lua

Code: Select all

----------------------------------------------------------------------------
-- garbagecalendarconfig.lua
-----------------------------------------------------------------------------
-- Specify your information here as needed for your needs
myGarbageDevice = 'Afvalwijzer'      -- The Text devicename in Domoticz
ShowNextEvents = 3                 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '2100aa'                       -- Your zipcode aangepast om privacy redenen
Housenr = '1'                       -- Your housnr
Housenrsuf = ''                    -- Your housnr suffix                    (Optional: a/b/c  etc)
Street=''                          -- Street name                           Only needed for: m_ophaalkalender-be
Hostname = 'afvalkalender.meerlanden.nl'      -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
                                   -- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.

-- choose one of these modules
--websitemodule = "m_deafvalapp"
--websitemodule = "m_goeree-overflakkee"
--websitemodule = "m_mijnafvalwijzer"
--websitemodule = "m_montferland"
--websitemodule = "m_ophaalkalender-be"
--websitemodule = "m_opzet"
websitemodule = "m_opzet_api"
--websitemodule = "m_westland"
--websitemodule = "m_ximmio"           --
--websitemodule = "m_zuidlimburg"

-- Switch on mydebug in case of issues and initially and check the domoticz log for any issues or missing
mydebug      = false  -- (true/false)
testdataload = false  -- (true/false)

-- Specify the appropriate directories (Raspberry Pi example)
datafilepath     = '/var/tmp'                           -- specify the directory where the garbagecalendar.data & garbagecalendar.log wil$
scriptpath       = '/home/pi/domoticz/scripts/lua'      -- specify the directory for the main "script_time_garbagecalendar.lua" script
domoticzjsonpath = '/home/pi/domoticz/scripts/lua'      -- specify the path to domoticz where the JSON.lua file can be found
-- Specify the appropriate directories (Windows example)
I upgrade earlier. Could this problem be related to the lua version used? Liblua 5.2 and 5.3 are installed. i do not know what version is used by domoticz.

Code: Select all

liblua5.2-0/stable,now 5.2.4-1.1+b1 armhf [ge�nstalleerd,automatisch]
liblua5.3-0/stable,now 5.3.3-1.1 armhf [ge�nstalleerd,automatisch]
but/and:

Code: Select all

pi@rpi-domoticz:~ $ lua -v
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

AllesVanZelf wrote: Monday 06 April 2020 17:54 Yes, I did. But maybe I'm missing something. Have a look in the second codefield above this post.
-rw-r--r-- 1 pi pi 9746 apr 6 16:09 garbagecalendarconfig.lua
-snip-
Not sure about LUA 5.1 but I am using 5.2.3 & 5.2.4 on my systems.
Everything is looking fine at first glance, so could you please provide this to see if that tells me more?:
jvdz wrote: Monday 10 February 2020 14:25 ....
In case there are issues, just ask and always provide me a copy of the following files in a zip file to my Github email, so I can see what is happening:
  • all 3 garbagecalendar*.log files
  • garbagecalendarconfig.lua
... I will be happy to have a closer look at them and let you know.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

jvdz wrote: Monday 06 April 2020 9:37 So what happens when you go onto your RPI and do these commands:

Code: Select all

cd /home/pi/domoticz/scripts/lua/
curl "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"

Jos

Code: Select all

pi@raspbian:~/domoticz/scripts/lua $ curl "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

iTDB wrote: Monday 06 April 2020 18:48

Code: Select all

pi@raspbian:~/domoticz/scripts/lua $ curl "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
So it looks like you have a version of curl installed that doesn't support ssl?
Could you check that somehow?
EDIT: There are quit some hits when searching for this error in google, so maybe you could check to see if any of the proposed suggestion work for you and let us know?
EDIT2: good info: https://medium.com/@andrewhowdencom/mys ... c29a661cb3

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

jvdz wrote: Monday 06 April 2020 18:53 So it looks like you have a version of curl installed that doesn't support ssl?
Could you check that somehow?
No idea. It is the Curl version in 2020-02-13 raspbian buster and upgrade the raspbian
jvdz wrote: Monday 06 April 2020 18:53 EDIT: There are quit some hits when searching for this error in google, so maybe you could check to see if any of the proposed suggestion work for you and let us know?
I do that
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Could you try this command to force a lower tlsv?:

Code: Select all

curl --tlsv1.0  "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

jvdz wrote: Monday 06 April 2020 19:28 Could you try this command to force a lower tlsv?:

Code: Select all

curl --tlsv1.0  "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"
Same

Code: Select all

pi@raspbian:~/domoticz/scripts/lua $ curl --tlsv1.0  "https://www.ophaalkalender.be/Calendar/findstreets/?query=Pintelaan&zipcode=9000"
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
pi@raspbian:~/domoticz/scripts/lua $
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by iTDB »

Because I am currently working with a test Raspberry Pi 3, I started again;
* 2019-09-26-raspbian-buster
* Change hostname and password
Reboot
* sudo apt-get update
* curl -L https://install.domoticz.com | bash
* Install GarbageCalendar under domoticz/scripts/lua


pi@raspbian:~/domoticz/scripts/lua $ lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
pi@raspbian:~/domoticz/scripts/lua $ curl --version
curl 7.64.0 (arm-unknown-linux-gnueabihf) libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
pi@raspbian:~/domoticz/scripts/lua $ curl "https://www.ophaalkalender.be/Calendar/ ... 9000"clear
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
pi@raspbian:~/domoticz/scripts/lua $
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

As that article states: there is are some defaults changed for ssl in buster, but i do not have a system running on buster yet so can't test.
Maybe it is possible to run a demian buster in VMware so I can test?
... else I am depending on somebody helping me out and finding the root cause for getting the data of this particular website with curl.
Ideas/suggestions welcome! :)

you could try changing that line to "curl --tlsv1.1" or 1.2 or 1.3.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

jvdz wrote: Tuesday 07 April 2020 11:07 As that article states: there is are some defaults changed for ssl in buster, but i do not have a system running on buster yet so can't test.
Maybe it is possible to run a demian buster in VMware so I can test?
... else I am depending on somebody helping me out and finding the root cause for getting the data of this particular website with curl.
Ideas/suggestions welcome! :)
you could try changing that line to "curl --tlsv1.1" or 1.2 or 1.3.
Jos
It looks like ophaalkalender.be uses tls1. This is a problem on debian.
With the introduction of openssl version 1.1.1 in Debian the defaults are set to more secure values by default. This is done in the /etc/ssl/openssl.cnf config file. At the end of the file there is:
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=2
Maybe it works if you change this value in /etc/ssl/openssl.cnf to MinProtocol = TLSv1.0.
But that looks not like a good idea to me.
Would that be the problem on that site?
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest