Page 30 of 30
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 18 February 2024 20:14
by jvdz
I can have a look when you Set domoticz uservariable TelegramBotLoglevel to 99. restart dtgbot and then show this menu.
Then zip up the dtg.log and your config and email that to jvdzande AT yahoo DOT com.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 18 February 2024 20:31
by pesa1234
jvdz wrote: ↑Sunday 18 February 2024 20:14
I can have a look when you Set domoticz uservariable
TelegramBotLoglevel to 99. restart dtgbot and then show this menu.
Then zip up the dtg.log and your config and email that to jvdzande AT yahoo DOT com.
Done
edit...
get back email wrong address, sent at the correct address just now.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 16 February 2025 16:24
by DomoFlits
today migrated to a new Pi5
most of the functions are working again. but I can't get the DTGbot working
I followed the instructions in
https://wiki.domoticz.com/Remote_Contro ... legram_Bot
The contents of dtb.log.errors is:
Code: Select all
/usr/bin/lua5.2: error loading module 'socket.core' from file '/usr/local/lib/lua/5.2/socket/core.so':
/usr/local/lib/lua/5.2/socket/core.so: wrong ELF class: ELFCLASS32
stack traceback:
[C]: in ?
[C]: in function 'require'
/usr/local/share/lua/5.2/socket.lua:12: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.2/socket/http.lua:10: in main chunk
[C]: in function 'require'
/home/pi/dtgbot/dtgbot.lua:130: in main chunk
[C]: in ?
Google sends me in the direction that my pi is running on 64bit version, but LUA is in 32bit version.
I don't know how to solve this.
any help?
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 16 February 2025 16:47
by jvdz
Please try this branch/version as that is much more stable and uses standard packages for ssl & json:
https://github.com/steps39/dtgbot/tree/ ... me-ov-file
Install instructions are on the readme page.
I am considering publishing the Docker version I have been using locally now for about a year, but probably will start that on my own github account in a separate repository. This gets rid of all this kind of dependencies and incompatibilities.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 16 February 2025 20:52
by DomoFlits
Thank you,
I have replaced the files for the newer files of your branch in /home/pi/dtgbot
I did
Code: Select all
sudo apt install lua5.2
sudo apt install lua-json
sudo apt install lua-socket
sudo apt install lua-sec
I have edited systemd-dtgbot.sh
I have created a file /etc/systemd/system/dtgbot.service and copied the contents of dtgbot.service in it and gave it a CHMOD 777
I did
Code: Select all
sudo systemctl enable dtgbot
sudo systemctl start dtgbot
but when i check the status with
I get
Code: Select all
● dtgbot.service - Telegram Bot for Domoticz
Loaded: loaded (/etc/systemd/system/dtgbot.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2025-02-16 20:43:02 CET; 6s ago
Process: 4176 ExecStart=sh /home/pi/dtgbot/systemd-dtgbot.sh (code=exited, status=1/FAILURE)
Process: 4177 ExecStartPost=/bin/sh -c echo $MAINPID > /run/dtgbot.pid (code=exited, status=0/SUCCESS)
Main PID: 4176 (code=exited, status=1/FAILURE)
so somehow the service won't start.
What did I do wrong?
Thanks for your help
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 16 February 2025 20:59
by jvdz
Please send me the dtgbot.log so i can see what is going wrong. Youcan use the email address shown in github, or pm it to me as attachment.
Another option is to run it manually yourself so you can see any error messages.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 16 February 2025 23:09
by DomoFlits
Thanks for your answer
Unfortunately there is no dtgbot.log in /var/tmp/ (where I expect it)
Where to find it? Or how can I start it manually myself?
The
doesn't appear to do something.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Monday 17 February 2025 12:44
by jvdz
The service starts
dtgbot/systemd-dtgbot.sh and in there you define your information:
Code: Select all
#!/bin/bash
##### start script for dtgbot ##################
## Define some system wide env variables
export DomoticzIP="127.0.0.1"
export DomoticzPort="8080"
export TempFileDir="/tmp/"
export BotHomePath="/home/pi/dtgbot/"
export BotBashScriptPath=$BotHomePath"bash/"
export BotLuaScriptPath=$BotHomePath"lua/"
export BotLuaLog=$TempFileDir"dtb.log"
export TelegramChatId='012343553'
export TelegramBotToken="000000000:keykeykeykeykeykeykeykey"
export EmailTo="[email protected]"
# Force use of Lua 5.2 or else lua socks will fail with ltn12 error
/usr/bin/lua5.2 $BotHomePath"dtgbot.lua" >$BotLuaLog 2>>$BotLuaLog.errors
Just check that file and see if all information is present and what is in there for the
TempFileDir and
BotLuaLog
To start it manually you change the directory to dtgbot and simply start systemd-dtgbot.sh.
To see the errors/log messages in the console you temporarily change the last line to:
Code: Select all
/usr/bin/lua5.2 $BotHomePath"dtgbot.lua"
Re: dtgbot - Domoticz TeleGram BOT
Posted: Monday 17 February 2025 18:08
by DomoFlits
Code: Select all
export TempFileDir="/tmp/log"
export BotLuaLog=$TempFileDir"dtb.log"
commented the last part of the last line
then
gives:
Code: Select all
### Initialialisation process Failed:
Error-->error loading module 'socket.core' from file '/usr/local/lib/lua/5.2/socket/core.so':
/usr/local/lib/lua/5.2/socket/core.so: wrong ELF class: ELFCLASS32stack traceback:
/home/pi/dtgbot/dtgbot.lua:24: in function </home/pi/dtgbot/dtgbot.lua:23>
[C]: in ?
[C]: in function 'require'
/usr/local/share/lua/5.2/socket.lua:12: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.2/socket/http.lua:10: in main chunk
[C]: in function 'require'
/home/pi/dtgbot/dtgbot.lua:42: in function </home/pi/dtgbot/dtgbot.lua:32>
[C]: in function 'xpcall'
/home/pi/dtgbot/dtgbot.lua:31: in main chunk
[C]: in ?
/usr/bin/lua5.2: /home/pi/dtgbot/dtgbot.lua:106: Terminate DTGBOT as the initialisation failed, which frst needs to be fixed.
stack traceback:
[C]: in function 'error'
/home/pi/dtgbot/dtgbot.lua:106: in main chunk
[C]: in ?
Re: dtgbot - Domoticz TeleGram BOT
Posted: Monday 17 February 2025 18:31
by jvdz
Looks like you need to remove the files you installed in the initial old setup you did, where you copied the downloaden version to that directory, as those seem to take preference over the newly installed version.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 18 February 2025 9:08
by DomoFlits
Thanks for your patience. Is your branch working on the 64bit OS of the pi5?
Btw, I am also a satisfied user of your garbage calendar script.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 18 February 2025 9:28
by jvdz
So does it work now?
I've not tested it myself on a rpi5, but don't see any reason why not. It run also fine in a VM on my laptop.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 18 February 2025 20:22
by DomoFlits
I tried removed all traces of dtgbot first:
Code: Select all
sudo systemctl stop dtgbot
sudo systemctl disable dtgbot
sudo update-rc.d -f dtgbot remove
sudo rm /etc/init.d/dtgbot
sudo rm /etc/systemd/system/dtgbot.service
sudo systemctl daemon-reload
sudo systemctl reset-failed
then delete everything in the dtgbot folder, replaced all files by your branch, updated system-dtgbot.sh
After that:
Code: Select all
cd ~/dtgbot
chmod 755 dtgbot
chmod 755 *.sh
cd ~/dtgbot/bash
chmod 755 *.sh
cd ~/dtgbot/service
sudo mv dtgbot.service /etc/systemd/system
cd ..
rmdir service
cd /etc/systemd/system
sudo chmod +x dtgbot.service
sudo systemctl enable dtgbot
sudo systemctl start dtgbot
then checked if it is working. but unfortunately is said failed to start
Code: Select all
sudo systemctl status dtgbot.service
dtgbot.service - Telegram Bot for Domoticz
Loaded: loaded (/etc/systemd/system/dtgbot.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2025-02-18 20:04:05 CET; 7s ago
Process: 509928 ExecStart=sh /home/pi/dtgbot/systemd-dtgbot.sh (code=exited, status=1/FAILURE)
Process: 509929 ExecStartPost=/bin/sh -c echo $MAINPID > /run/dtgbot.pid (code=exited, status=0/>
Main PID: 509928 (code=exited, status=1/FAILURE)
CPU: 6ms
then started systemd-dtgbot.sh manual
and it gave the same output:
Code: Select all
### Initialialisation process Failed:
Error-->error loading module 'socket.core' from file '/usr/local/lib/lua/5.2/socket/core.so':
/usr/local/lib/lua/5.2/socket/core.so: wrong ELF class: ELFCLASS32stack traceback:
/home/pi/dtgbot/dtgbot.lua:24: in function </home/pi/dtgbot/dtgbot.lua:23>
[C]: in ?
[C]: in function 'require'
/usr/local/share/lua/5.2/socket.lua:12: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.2/socket/http.lua:10: in main chunk
[C]: in function 'require'
/home/pi/dtgbot/dtgbot.lua:42: in function </home/pi/dtgbot/dtgbot.lua:32>
[C]: in function 'xpcall'
/home/pi/dtgbot/dtgbot.lua:31: in main chunk
[C]: in ?
/usr/bin/lua5.2: /home/pi/dtgbot/dtgbot.lua:106: Terminate DTGBOT as the initialisation failed, which frst needs to be fixed.
stack traceback:
[C]: in function 'error'
/home/pi/dtgbot/dtgbot.lua:106: in main chunk
[C]: in ?
for me: I now give up on dtgbot, since I've barely used it in the past (more like a gimmic). I normally acces my domotics server via VPN and then can control domotics in the normal interface.
Thanks for your patience and help
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 18 February 2025 20:35
by jvdz
But did you reverse this step?:
https://wiki.domoticz.com/Remote_Contro ... _Libraries
Removing the wrong lua libaries?
Just remove those and try .
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 18 February 2025 21:30
by DomoFlits
I have renamed the 5.2 folders:
Code: Select all
cd /usr/local/share/lua
sudo mv 5.2 old
and
Code: Select all
cd /usr/local/lib/lua
sudo mv 5.2 old
this indeed did the trick.
since when I did
Code: Select all
cd
cd dtgbot
bash systemd-dtgbot.sh
the feature finally started running (after setting the TempFileDir correct in systemd-dtgbot.sh)

thanks for your patience and help
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 19 February 2025 8:59
by jvdz
DomoFlits wrote: ↑Tuesday 18 February 2025 21:30
I have renamed the 5.2 folders:
-snip-
the feature finally started running (after setting the TempFileDir correct in systemd-dtgbot.sh)

thanks for your patience and help
Great ... enjoy

Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 13 May 2025 16:00
by jvdz
I have been working on a Docker version for DTGBOT, which will make the whole installation very simple and avoiding all these LUA & SSL incompatibilities we have seen the last couple of years. It also has a Web front-end to make the Log checking and basic configuration easier too.
The plan is to release it somewhere in the coming period, but could use some members to assist me with:
- Testing the current available Docker version
- Checking what is incorrect or missing in the current Wiki
Testing should be simple without destroying what you have now. You could simply stop the current Docker service and Create a Docker instance of DTGBOT following the documentation.
Please PM/Email me in case you are interested, after which I will point you to the right place.
Thanks Jos
Some teasers:

- DTGBOTIndex.png (181.86 KiB) Viewed 321 times

- DTGBOTConfig_authorisation.png (135.23 KiB) Viewed 321 times

- DTGBOTMENU_keyboard_menu1 (Klein).png (287.77 KiB) Viewed 321 times

- DTGBOTMENU_inline_menu1 (Klein).png (336.63 KiB) Viewed 321 times
Re: dtgbot - Domoticz TeleGram BOT
Posted: Saturday 17 May 2025 17:47
by jvdz
jvdz wrote: ↑Tuesday 13 May 2025 16:00
... but could use some members to assist me with:
- Testing the current available Docker version
- Checking what is incorrect or missing in the current Wiki
Anybody interested?
