(SOLVED) Raspberry pi MQTT problems

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
rsluiman
Starting Member
Starting Member
Posts: 10
Joined: Fri May 19, 2017 7:11 pm

(SOLVED) Raspberry pi MQTT problems

Post by rsluiman »

Hi,

I've been having the OTGW running for over a few months and wanted to try something more with it.
I've got a raspberry pi and downloaded the otmonitor specific for the pi.
The problem i'm now facing is that when i enable mqtt the checkbox won't get enabled. to solve this i tried the web interface.
After enabling mqtt in the web interface i get the folowing error from otmonitor:

Code: Select all

invalid command name "mqttmessage"
invalid command name "mqttmessage"
    while executing
"mqttmessage $src"
    (procedure "otmessage" line 5)
    invoked from within
"otmessage [clock microseconds] $line [expr {$type & 7}] $id $data"
    (procedure "process" line 12)
    invoked from within
"process [append data $line]"
    (procedure "receive" line 6)
    invoked from within
"receive"
this is probably a problem in the source code but i got no experience with tcl code but i can program in other languages so if you guys can point me in the right direction i might be able to solve this myself
Last edited by rsluiman on Sat Nov 18, 2017 1:59 pm, edited 1 time in total.
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: Raspberry pi MQTT problems

Post by mike7 »

Please show mqtt settings from .otmonitorrc, I'll try to help

PS. mqtt definitely working in otmonitor
rsluiman
Starting Member
Starting Member
Posts: 10
Joined: Fri May 19, 2017 7:11 pm

Re: Raspberry pi MQTT problems

Post by rsluiman »

the mqtt settings in the settings file

Code: Select all

mqtt {
  devicetype central_heating
  deviceid otmonitor
  retransmit 10
  format json2
  port 1883
  qos 1
  keepalive 120
  username admin
  password YWRtaW4=
  enable false
  messages false
  client raspberryPiHub-otmon
  broker 192.168.0.110
}
Attachments
Capture.PNG
Capture.PNG (25.76 KiB) Viewed 7752 times
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: Raspberry pi MQTT problems

Post by mike7 »

looks good, the only difference from my setup:
I don't use authentication

Code: Select all

  username {}
  password {}
  enable true
you can try to enable mqtt directly in the settings file
rsluiman
Starting Member
Starting Member
Posts: 10
Joined: Fri May 19, 2017 7:11 pm

Re: Raspberry pi MQTT problems

Post by rsluiman »

I'm getting the same result as enabling trhough the web interface
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: Raspberry pi MQTT problems

Post by mike7 »

strange, looks like otmonitor doesn't read or reads wrong settings file

could you try to use -f command line switch like

Code: Select all

./tclkit.ahf otmonitor.vfs/main.tcl -f /home/pi/.otmonitorrc --daemon --system -w 8080
I'm using source version, you can change command for single file version
rsluiman
Starting Member
Starting Member
Posts: 10
Joined: Fri May 19, 2017 7:11 pm

Re: Raspberry pi MQTT problems

Post by rsluiman »

What makes you think it doesn't read the config? everytime i start otmonitor it reads and writes the config correctly the problem here is i think in the source code
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: Raspberry pi MQTT problems

Post by mike7 »

I found

Code: Select all

enable false
in your settings file, if it is enabled and doesn't work try to connect without authentication.
rsluiman
Starting Member
Starting Member
Posts: 10
Joined: Fri May 19, 2017 7:11 pm

Re: Raspberry pi MQTT problems

Post by rsluiman »

I've been digging through some tcl tutorials as well as the source code. you need libmposquitto installed on the pi for it to work. after installing this it works
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: (SOLVED) Raspberry pi MQTT problems

Post by mike7 »

Could you please explain what you did?
I'm using Arch Linux and mosquitto is not installed (I'm using mosquitto in container).
As I understand otmonitor is using mqtt module from lib/tcl8/8.6/mqtt-1.0.tm
Post Reply

Return to “Opentherm Gateway Forum”