dtgbot - Domoticz TeleGram BOT
Moderator: leecollings
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
Then zip up the dtg.log and your config and email that to jvdzande AT yahoo DOT com.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 18
- Joined: Wednesday 05 December 2018 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Italy
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Done
edit...
get back email wrong address, sent at the correct address just now.
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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:
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?
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 ?
I don't know how to solve this.
any help?
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Thank you,
I have replaced the files for the newer files of your branch in /home/pi/dtgbot
I did
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
but when i check the status with
I get
so somehow the service won't start.
What did I do wrong?
Thanks for your help
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 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
Code: Select all
sudo service dtgbot status
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)
What did I do wrong?
Thanks for your help
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
Another option is to run it manually yourself so you can see any error messages.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
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
Code: Select all
sudo systemctl start dtgbot
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
The service starts dtgbot/systemd-dtgbot.sh and in there you define your information:
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
#!/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
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"
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Code: Select all
export TempFileDir="/tmp/log"
export BotLuaLog=$TempFileDir"dtb.log"
then
Code: Select all
bash systemd-dtgbot.sh
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 ?
Last edited by DomoFlits on Sunday 23 February 2025 9:26, edited 1 time in total.
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
Btw, I am also a satisfied user of your garbage calendar script.
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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.
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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I tried removed all traces of dtgbot first:
then delete everything in the dtgbot folder, replaced all files by your branch, updated system-dtgbot.sh
After that:
then checked if it is working. but unfortunately is said failed to start
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:
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
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
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
Code: Select all
sudo systemctl status dtgbot.service
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 ?
Thanks for your patience and help
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
But did you reverse this step?: https://wiki.domoticz.com/Remote_Contro ... _Libraries
Removing the wrong lua libaries?
Just remove those and try .
Removing the wrong lua libaries?
Just remove those and try .
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 39
- Joined: Thursday 06 October 2016 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Bld16583
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I have renamed the 5.2 folders:
and
this indeed did the trick.
since when I did
the feature finally started running (after setting the TempFileDir correct in systemd-dtgbot.sh)

thanks for your patience and help
Code: Select all
cd /usr/local/share/lua
sudo mv 5.2 old
Code: Select all
cd /usr/local/lib/lua
sudo mv 5.2 old
since when I did
Code: Select all
cd
cd dtgbot
bash systemd-dtgbot.sh

thanks for your patience and help
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Great ... enjoy

New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
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:
Please PM/Email me in case you are interested, after which I will point you to the right place.
Thanks Jos
Some teasers:
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
Please PM/Email me in case you are interested, after which I will point you to the right place.
Thanks Jos

Some teasers:
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Anybody interested?

New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest