(SOLVED) Raspberry pi MQTT problems

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

Moderator: hvxl

(SOLVED) Raspberry pi MQTT problems

Postby rsluiman » Wed Nov 15, 2017 6:26 pm

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 12:59 pm, edited 1 time in total.
rsluiman
Starting Member
Starting Member
 
Posts: 10
Joined: May 2017

Re: Raspberry pi MQTT problems

Postby mike7 » Thu Nov 16, 2017 9:45 am

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

PS. mqtt definitely working in otmonitor
mike7
Member
Member
 
Posts: 69
Joined: December 2013

Re: Raspberry pi MQTT problems

Postby rsluiman » Thu Nov 16, 2017 10:04 am

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 1557 times
rsluiman
Starting Member
Starting Member
 
Posts: 10
Joined: May 2017

Re: Raspberry pi MQTT problems

Postby mike7 » Thu Nov 16, 2017 7:56 pm

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
mike7
Member
Member
 
Posts: 69
Joined: December 2013

Re: Raspberry pi MQTT problems

Postby rsluiman » Thu Nov 16, 2017 8:09 pm

I'm getting the same result as enabling trhough the web interface
rsluiman
Starting Member
Starting Member
 
Posts: 10
Joined: May 2017

Re: Raspberry pi MQTT problems

Postby mike7 » Fri Nov 17, 2017 5:44 am

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
mike7
Member
Member
 
Posts: 69
Joined: December 2013

Re: Raspberry pi MQTT problems

Postby rsluiman » Fri Nov 17, 2017 4:39 pm

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
rsluiman
Starting Member
Starting Member
 
Posts: 10
Joined: May 2017

Re: Raspberry pi MQTT problems

Postby mike7 » Sat Nov 18, 2017 5:24 am

I found
Code: Select all
enable false

in your settings file, if it is enabled and doesn't work try to connect without authentication.
mike7
Member
Member
 
Posts: 69
Joined: December 2013

Re: Raspberry pi MQTT problems

Postby rsluiman » Sat Nov 18, 2017 12:58 pm

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
rsluiman
Starting Member
Starting Member
 
Posts: 10
Joined: May 2017

Re: (SOLVED) Raspberry pi MQTT problems

Postby mike7 » Sun Nov 19, 2017 9:54 pm

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
mike7
Member
Member
 
Posts: 69
Joined: December 2013


Return to Opentherm Gateway Forum

Who is online

Users browsing this forum: No registered users and 1 guest