www.homeseer.com    
 

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Plug-ins by Author > Click Here for List of Author Forums > MCS Plug-Ins and Scripts > mcsMQTT (3P)

mcsMQTT (3P) Discussion of mcsMQTT plug-in

Reply
 
Thread Tools Display Modes
  #41  
Old May 17th, 2018, 10:57 PM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by vasrc View Post
It's quite simple in mosquitto. In the config file look for the section labeled Extra Listeners. This is where you define another port to listen on. Each listener has it's own SSL settings so make sure you're setting the cafile, certfile and certkey on the correct listener. The certs are for the port 8883 listener. Restart the broker and you should now be able to accept traffic from both non-secure (1883) and secure (8883) devices.

I haven't been able to get the plugin on windows to accept a self-signed cert as it needs some internal programming to catch those exceptions. It works well on both my ESP8266 and ESP32 devices though. Haven't tried it on a PI yet, have to try that still.

Additionally, since this is SSL the CN of the cert (you enter this when you make it) will need to match the DNS name of your broker so that assumes you either have a DNS in your system to resolve IP's to names or your host file defines it.

Z
Having now done my share of reading, and testing. I can safely say some of that is incorrect (I am not on windows, so some does not apply).

MQTT by protocol has port 1833 (both TCP & UDP) and 8883 (secure-mqtt, both TCP & UDP) reserved with IANA (Internet Assigned Numbers Authority). So, by having my secure-MQTT operating on 1833, I am 'against' protocol. However, it works just fine. Like many other services on the web, I can utilize whichever port I so choose.

With my mosquitto.conf configured, I have a single listener, and I can change it to "listener 8683". Then I restart mosquitto and change my client devices and I see:

Code:
1526610607: mosquitto version 1.4.15 (build date Sat, 07 Apr 2018 11:13:41 +0100) starting
1526610607: Config loaded from /etc/mosquitto/mosquitto.conf.
1526610607: Opening ipv4 listen socket on port 8683.
1526610607: Opening ipv6 listen socket on port 8683.
1526610660: New connection from [OwntracksDevice] on port 8683.
My phone, by way of Owntracks is using both the CA cert and a P12 client key communicates to the broker and won't communicate if I remove them. The broker is using TLS1.2 over port 8683 (Previously 1883). We can safely ignore the port issue.

The only thing I'm wondering about is DNS, since everything comes back to DNS and since HS3 is running on the MQTT Broker itself.

Otherwise, this comes back to mcsMQTT.

Thanks for the pointers however, I'll dig into DNS, it's always fun.
Reply With Quote
  #42  
Old May 18th, 2018, 06:27 AM
vasrc's Avatar
vasrc vasrc is offline
Seer Master
 
Join Date: May 2003
Location: Locust Dale, VA
Posts: 1,203
Quote:
Originally Posted by Jeeves View Post
Having now done my share of reading, and testing. I can safely say some of that is incorrect (I am not on windows, so some does not apply).

MQTT by protocol has port 1833 (both TCP & UDP) and 8883 (secure-mqtt, both TCP & UDP) reserved with IANA (Internet Assigned Numbers Authority). So, by having my secure-MQTT operating on 1833, I am 'against' protocol. However, it works just fine. Like many other services on the web, I can utilize whichever port I so choose.

With my mosquitto.conf configured, I have a single listener, and I can change it to "listener 8683". Then I restart mosquitto and change my client devices and I see:

Code:
1526610607: mosquitto version 1.4.15 (build date Sat, 07 Apr 2018 11:13:41 +0100) starting
1526610607: Config loaded from /etc/mosquitto/mosquitto.conf.
1526610607: Opening ipv4 listen socket on port 8683.
1526610607: Opening ipv6 listen socket on port 8683.
1526610660: New connection from [OwntracksDevice] on port 8683.
My phone, by way of Owntracks is using both the CA cert and a P12 client key communicates to the broker and won't communicate if I remove them. The broker is using TLS1.2 over port 8683 (Previously 1883). We can safely ignore the port issue.

The only thing I'm wondering about is DNS, since everything comes back to DNS and since HS3 is running on the MQTT Broker itself.

Otherwise, this comes back to mcsMQTT.

Thanks for the pointers however, I'll dig into DNS, it's always fun.
You are absolutely correct, the port is SSL agnostic, you can select any port number you want to run on. I run two ports so I can support both secure and non-secure devices.

I'd guess that since the PI is running Mono, it's still pretty much a windows device and may fail for the same reason a plugin running on Windows would. When I add a ValidationCallback to the SSL verify in the test plugin I use, I can get it to accept a self-signed cert, but I'm not 100% convinced it's not a DNS/CN issue still?

LMK if you get it working.

Z
Reply With Quote
  #43  
Old May 18th, 2018, 09:27 PM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by vasrc View Post
You are absolutely correct, the port is SSL agnostic, you can select any port number you want to run on. I run two ports so I can support both secure and non-secure devices.

I'd guess that since the PI is running Mono, it's still pretty much a windows device and may fail for the same reason a plugin running on Windows would. When I add a ValidationCallback to the SSL verify in the test plugin I use, I can get it to accept a self-signed cert, but I'm not 100% convinced it's not a DNS/CN issue still?

LMK if you get it working.

Z
Mono adds it's own layers of frustration at time, but in essence does make most of the .NET application work much like windows.

I was already mid-migration, so I decided to finish things up. I moved off the pi, and onto an Odroid with Ubuntu and migrated the HS3 install across.

With that. I'm on a new host, I've configured, tested and generated new certs. My phone connects to the broker just like it used to, again using p12 certs.

I can't get mcsMQTT to accept a self-signed cert to save my life. Now the documentation is sparse, so there's no explanation of what formats anything should be in. But still, I've tried p12, the certs themselves as they come out of openssl, etc. Worse yet, with debug loggin there's nothing even written in the mcsMQTT Debug log. I'm pretty much at an impasse it seems. Unless I ignore TLS (ugh) and go simple auth, it's unusable.


Worse yet, while mcsMQTT is doing *NOTHING*, it seems to be burning the CPU as hard as it can. I had already uninstalled and reinstalled it, hence the mis-matched start time. If I leave it running, it crashes and takes hs3 with it. This might be a bug report on it's own?

From ps aux:
Code:
 hs3      1328  6.9  5.8 233528 118860 ?       Ssl  18:47   2:05 /usr/bin/mono /usr/local/homeseer/HSConsole.ex
hs3      1368  0.4  1.7  84680 36140 ?        Sl   18:47   0:08 /usr/bin/mono /usr/local/homeseer/HSPI_BLOccup
hs3      1369  0.4  1.7  86800 35444 ?        Sl   18:47   0:07 /usr/bin/mono /usr/local/homeseer/HSPI_BLEmail
hs3      1371  0.6  2.9 115848 60840 ?        Sl   18:47   0:12 /usr/bin/mono /usr/local/homeseer/HSPI_ImperiH
hs3      1373  0.3  1.9  90184 39364 ?        Sl   18:47   0:05 /usr/bin/mono /usr/local/homeseer/HSPI_SCREPOS
hs3      1375  0.5  3.3 126000 68840 ?        Sl   18:47   0:10 /usr/bin/mono /usr/local/homeseer/HSPI_BULLET.
hs3      1377  0.6  2.9 121900 59924 ?        Sl   18:47   0:11 /usr/bin/mono /usr/local/homeseer/HSPI_ULTRANE
hs3      2294  101  3.0 117924 62904 ?        Sl   19:09   8:32 /usr/bin/mono /usr/local/homeseer/HSPI_MCSMQTT
Reply With Quote
  #44  
Old May 18th, 2018, 09:49 PM
Pete's Avatar
Pete Pete is offline
OverSeer
 
Join Date: Jan 2001
Location: House
Posts: 15,118
Relating to using SSL with mcsMQTT it is not soup yet and ready to utilize.

Going to try to set up a Mosquitto broker here on one of my test micro routers running OpenWRT using Python and try the encryption stuff again. (currently using Node Red on two RPi's)

Michael has asked for our help getting the plugin to work with SSL.


Curious what activity you see in your debug logs when this (HS3 Debend) is happening?

A few days back on an earlier revision of the plugin some sql chit chat took down Homeseer Pro here.

Homeseer Pro is running in Ubuntu 16.04 64 bit with an iSeries CPU / 16Gb of RAM.

I posted about this issue here:

Version 3.3.x.x

Also testing plugin on HS3 lite on a Pine64 2Gb / Ubuntu 16.04 64 bit server and it does well.
__________________
- Pete

Automator

HS3 Pro & Lite Edition Beta 3.0.0.435

HS3 Wintel Touch | Ubuntu 16.04 64 bit | Oracle Windows Virtual Box ==> for Wintel only SAPI and HS3 plugins | Speech - Microsoft SAPI - Neospeech - Amazon Echo | Hardware | Haswell Intel iSeries 3 - 16Gb | Pine64 - 2Gb computers | Openpeak Intel Atom SoC tabletop touchscreens (15 HS tabletop tablets) | Touchscreens - Windows embedded POE connected |Light switches - X10,UPB, ZWave and Zigbee | Firewall - PFSense - 2 WAN plus 4 LAN interfaces | Network - Gb managed switches / POE WAP(s) | CCTV - Zoneminder IPHD cams - variety | Audio - Russound - AB8SS | Security - Leviton HAI Omni Pro 2 | Weather - Davis Vantage Vue - MeteoStick - WeeWx | 1-Wire - AAG, Midon and HB | OWFS - Mosquitto - Node Red - Python - RPi Stretch - OpenWRT
Reply With Quote
  #45  
Old May 18th, 2018, 10:44 PM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by Pete View Post
Relating to using SSL with mcsMQTT it is not soup yet and ready to utilize.
That is unfortunate. Hopefully some progress will be made, I'd love to get TLS up and running. Is there a more direct way to provide feedback? I had hoped/expected he would read/chime into threads in his sub-forum.

Quote:
Originally Posted by Pete View Post
Curious what activity you see in your debug logs when this (HS3 Debend) is happening?
Do you mean the high cpu usage?

Since mcsMQTT is not in communication with the broker, it should not be doing anything. It has nothing to communicate to.

When I enable the plugin, this is what it does:

Startup:
Code:
5/18/2018 8:14:16 PM    3       | mcsMQTT Version 3.3.8.0 running at /usr/local/homeseer, HS is at /usr/local/$
5/18/2018 8:14:16 PM    20      | mcsMQTT InitHW ComputerName= odie, IOEnabled=False
5/18/2018 8:14:17 PM    309     | mcsMQTT Debug InitHW Database Ready
5/18/2018 8:14:17 PM    315     | mcsMQTT Debug Receive Ready
5/18/2018 8:14:17 PM    319     | mcsMQTT Debug Trigger Ready
5/18/2018 8:14:17 PM    455     | Spawning MQTT Threads
5/18/2018 8:14:17 PM    455     | mcsMQTT Debug MQTT Ready
5/18/2018 8:14:17 PM    455     | HW Init Complete
5/18/2018 8:14:17 PM    457     | Background Init Started
5/18/2018 8:14:17 PM    466     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    466     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    467     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    467     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    467     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    467     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    468     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    468     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    468     | MQTT Thread Started with broker 192.168.1.35, Shutdown=False, Disconnect=Fal$
5/18/2018 8:14:17 PM    468     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    468     | MQTT Thread Not Connected Yet
5/18/2018 8:14:17 PM    468     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    468     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    469     | PopulateReceiveDict , PluginDevice=False
5/18/2018 8:14:17 PM    469     | PopulateReceiveDict , PluginDevice=False
... there's plenty more here, I'm trimming for space and this doesn't really belong in this thread anyway.

End of Log
Code:
5/18/2018 8:14:22 PM    5998    | AddToMQTTSend1 94, inDict = False
5/18/2018 8:14:22 PM    6000    | PopulateSendDict 94, PluginDevice=False
5/18/2018 8:14:22 PM    6015    | AddToMQTTSend1 95, inDict = False
5/18/2018 8:14:22 PM    6017    | PopulateSendDict 95, PluginDevice=False
5/18/2018 8:14:23 PM    6035    | AddToMQTTSend1 96, inDict = False
5/18/2018 8:14:23 PM    6037    | PopulateSendDict 96, PluginDevice=False
5/18/2018 8:14:23 PM    6054    | AddToMQTTSend1 97, inDict = False
5/18/2018 8:14:23 PM    6056    | PopulateSendDict 97, PluginDevice=False
5/18/2018 8:14:23 PM    6073    | AddToMQTTSend1 98, inDict = False
5/18/2018 8:14:23 PM    6074    | PopulateSendDict 98, PluginDevice=False
5/18/2018 8:14:23 PM    6090    | AddToMQTTSend1 99, inDict = False
5/18/2018 8:14:23 PM    6091    | PopulateSendDict 99, PluginDevice=False
5/18/2018 8:14:23 PM    6091    | Background Send
5/18/2018 8:14:23 PM    6107    | Background Init Filters - Background Complete
5/18/2018 8:15:23 PM    66978   | Page Timing Start
5/18/2018 8:15:25 PM    68765   | Page Timing End
Past this point, mcsMQTT still is running and the CPU load is extreme. Nothing further gets written to the log.

It doesn't matter if "Disconnect from MQTT Broker" is checked. CPU load is the same and the same messages are written to the log.

Last edited by Jeeves; May 18th, 2018 at 10:55 PM.
Reply With Quote
  #46  
Old May 19th, 2018, 02:35 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,634
If it is cpu load that is being investigated then I can help with that. Is debug enabled from General tab? I can also add additional to isolate the particular cause. In the past there were issues with earlier version of Mono. There was also a startup burst and page rendering where the page was just too big for browser. All of these were addressed with design changes.

Next steps can be on board or email mcsSolutions at century tel dot net. If on board open a separate thread since it has little to do with SSL.

For SSL my problem is lack of experience with it so I have no insight of what may or may not be of issue. The dll used by mcsMQTT is m2mqtt.dll with source available and various tidbits from google search. I’ll work with others or provide source, but I cannot lead the investigation. Do you have a background in this area?
Reply With Quote
  #47  
Old May 19th, 2018, 10:37 PM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by Michael McSharry View Post
If it is cpu load that is being investigated then I can help with that. Is debug enabled from General tab? I can also add additional to isolate the particular cause. In the past there were issues with earlier version of Mono. There was also a startup burst and page rendering where the page was just too big for browser. All of these were addressed with design changes.

Next steps can be on board or email mcsSolutions at century tel dot net. If on board open a separate thread since it has little to do with SSL.

For SSL my problem is lack of experience with it so I have no insight of what may or may not be of issue. The dll used by mcsMQTT is m2mqtt.dll with source available and various tidbits from google search. I’ll work with others or provide source, but I cannot lead the investigation. Do you have a background in this area?
Debug was enabled, and the logs are posted above. Nothing was being written while CPU use was high.

If i do a trace on the process I see this:
Code:
clock_gettime(CLOCK_MONOTONIC, {tv_sec=92741, tv_nsec=274027787}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=92741, tv_nsec=274181874}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=92741, tv_nsec=274320752}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=92741, tv_nsec=274458589}) = 0
futex(0x73f918, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=9862163}) = -1 ETIMEDOUT (Connection timed out)
clock_gettime(CLOCK_MONOTONIC, {tv_sec=92741, tv_nsec=284757537}) = 0
futex(0x73f8d4, FUTEX_WAKE_PRIVATE, 1)  = 0
And that's all. I'd assume there's a bug in the time code causing high cpu utilization?

As for SSL. I do not have a 'background' persay, just an avid System Administrator. I'll look around the forum, I did not realize the source was available, maybe that will give some clues.
Reply With Quote
  #48  
Old May 20th, 2018, 12:29 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,634
For SSL, vasrc looks to have a solution using callback approach to authentication of the certificate. He is now trying to integrate it into the mcsMQTT source.

Can you provide some insight into the environment you are running mcsMQTT? Based upon your debug it looks like you have nothing selected for publication so no callbacks for device changes from HS and you indicated no connection the broker was setup.

The main is in a 10 ms loop monitoring the HS connection. This is boilerplate from the HS3 SDK.

There is a MQTT thread that wakes up on 10 second intervals to assess the broker connection. This does update the Statistics tab so you can see if it is being refreshed with at least elapsed time.

There are many synchronization wait loops. In each case the reason for waiting is written to the debug log. Since you have none of these in the log we should be able to rule them out.

There is a thread that wakes up on HS event callbacks. Since you have no callbacks in the log we can rule out this thread.

There is a thread to run GNUPlot on Linux on chart requests. Since no data exists for charting and I doubt if you tried to generate a chart this one can be ruled out too.

There is MQTT callback thread from broker message received. No broker connection and nothing in the log so this is not a candidate.

There is Browser ajax postback at 2 second intervals. In some versions I have this in the debug. I can add it back on the next iteration.

Give me a little background on your setup and I will put together some debug in the candidate loops. The Statistics tab updating will mean that the ajax postbacks are being processed.
Reply With Quote
  #49  
Old May 20th, 2018, 12:53 AM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by Michael McSharry View Post
Can you provide some insight into the environment you are running mcsMQTT? Based upon your debug it looks like you have nothing selected for publication so no callbacks for device changes from HS and you indicated no connection the broker was setup.

Give me a little background on your setup and I will put together some debug in the candidate loops. The Statistics tab updating will mean that the ajax postbacks are being processed.
This seems to be the wrong thread for this, if you'd like this somewhere else, please say so.

Both of the environments I've installed mcsMQTT in experienced this after installation.

Currently: Ubuntu 18.04, Mono 5.12, the broker is on the same device (localhost), Broker using TLS 1.2.
Prevously: Debian 8.10, Mono 5.12, the broker is on the same device (localhost), no TLS.

Currently: I have nothing selected for publish and the plugin is minimally configured, it has been uninstalled and reinstalled to test. The connection to the broker is configured, but it cannot be reached because the broker is behind TLS1.2 and mcsMQTT cannot talk to it.

Previously: The plugin ran for a week before over port 1833 with several associations from the broker from other devices. After installation the device started rebooting frequently prompting the move (high CPU load seemed to be the cause). Nothing from HS3 was being published or controlled at that point.

I've just installed plugin v3.4.0.0, CPU spiked and the trace seems to show the same, although I'm not sure it's really useful:

Code:
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341022}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341243}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341375}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341495}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341648}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341838}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=341993}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=342145}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=342269}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=342420}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=342578}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=342884}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343142}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343260}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343418}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343636}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343755}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=343908}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344064}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344189}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344345}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344500}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344659}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344855}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=344999}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=345220}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=345376}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=345593}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=345735}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=345874}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=346009}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=346166}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=346339}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=346546}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=346790}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=347172}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=347506}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=347882}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=348094}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=348259}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=348477}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=348688}, NULL) = 0
[pid  3897] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=348811}, NULL) = 0
[pid  3897] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... clock_gettime resumed> {tv_sec=101372, tv_nsec=971166930}) = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=348946}, NULL) = 0
[pid  3897] futex(0x7718d4, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... futex resumed> )       = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=349140}, NULL) = 0
[pid  3897] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... clock_gettime resumed> {tv_sec=101372, tv_nsec=971631108}) = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=349396}, NULL) = 0
[pid  3897] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... clock_gettime resumed> {tv_sec=101372, tv_nsec=971811779}) = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=349575}, NULL) = 0
[pid  3897] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... clock_gettime resumed> {tv_sec=101372, tv_nsec=972004534}) = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=349780}, NULL) = 0
[pid  3897] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  3913] gettimeofday( <unfinished ...>
[pid  3897] <... clock_gettime resumed> {tv_sec=101372, tv_nsec=972194455}) = 0
[pid  3913] <... gettimeofday resumed> {tv_sec=1526792189, tv_usec=350035}, NULL) = 0
[pid  3897] futex(0x771918, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=9810079} <unfinished ...>
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=350242}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=350402}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=350556}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=350752}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=350989}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351121}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351237}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351385}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351519}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351657}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351783}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=351941}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=352056}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=352327}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=352585}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=352820}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=353186}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=353648}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=353774}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=353922}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=354076}, NULL) = 0
[pid  3913] gettimeofday({tv_sec=1526792189, tv_usec=354233}, NULL) = 0
With "Disconnect from broker" checked, I tried to start the plugin like so: " mono --trace HSPI_MCSMQTT.exe" and this is what it was doing over and over (however, this may not be a valid way to start a plugin by hand, so this trace may be useless too):
Code:
[0xb6f35010: 50.06988 4] ENTER: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.06990 5] ENTER: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.06991 6] ENTER: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.06992 6] LEAVE: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()result=0
[0xb6f35010: 50.06995 5] LEAVE: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()result=0
[0xb6f35010: 50.06997 4] LEAVE: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()result=0
[0xb6f35010: 50.07001 4] ENTER: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)() ip: (nil)
[0xb6f35010: 50.08011 4] LEAVE: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)
[0xb6f35010: 50.08016 4] ENTER: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.08018 5] ENTER: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.08019 6] ENTER: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.08020 6] LEAVE: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()result=0
[0xb6f35010: 50.08025 5] LEAVE: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()result=0
[0xb6f35010: 50.08028 4] LEAVE: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()result=0
[0xb6f35010: 50.08030 4] ENTER: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)() ip: (nil)
[0xb6f35010: 50.09041 4] LEAVE: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)
[0xb6f35010: 50.09046 4] ENTER: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.09047 5] ENTER: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.09048 6] ENTER: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.09050 6] LEAVE: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()result=0
[0xb6f35010: 50.09053 5] LEAVE: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()result=0
[0xb6f35010: 50.09055 4] LEAVE: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()result=0
[0xb6f35010: 50.09058 4] ENTER: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)() ip: (nil)
[0xb6f35010: 50.10068 4] LEAVE: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)
[0xb6f35010: 50.10073 4] ENTER: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.10074 5] ENTER: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.10076 6] ENTER: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.10076 6] LEAVE: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()result=0
[0xb6f35010: 50.10078 5] LEAVE: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()result=0
[0xb6f35010: 50.10081 4] LEAVE: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()result=0
[0xb6f35010: 50.10083 4] ENTER: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)() ip: (nil)
[0xb6f35010: 50.11093 4] LEAVE: (wrapper managed-to-native) System.Threading.Thread:SleepInternal (int)
[0xb6f35010: 50.11098 4] ENTER: HSCF.Communication.ScsServices.Client.ScsServiceClient`1<T_REF>:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.11099 5] ENTER: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.11100 6] ENTER: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()() ip: (nil)
[0xb6f35010: 50.11100 6] LEAVE: HSCF.Communication.Scs.Communication.Channels.CommunicationChannelBase:get_CommunicationState ()result=0
[0xb6f35010: 50.11103 5] LEAVE: HSCF.Communication.Scs.Client.ScsClientBase:get_CommunicationState ()result=0

Last edited by Jeeves; May 20th, 2018 at 01:22 AM.
Reply With Quote
  #50  
Old May 20th, 2018, 02:29 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,634
I moved the thread to https://forums.homeseer.com/showthre...53#post1366753

The mono trace shows the main thread that is simply maintaining a socket connection with HS.

The OS level debug does not give me much insight as there are multple layers between the application and the OS. The mcsMQTT_Debug.txt is most helpful for me as we progress in the investigation.
Reply With Quote
  #51  
Old May 20th, 2018, 04:11 PM
Jeeves Jeeves is offline
Seer
 
Join Date: Dec 2016
Location: New Mexico
Posts: 18
Quote:
Originally Posted by Michael McSharry View Post
For SSL, vasrc looks to have a solution using callback approach to authentication of the certificate. He is now trying to integrate it into the mcsMQTT source.
CPU debugging issue aside, if I can help with testing this once it's to a point, I'd be happy to.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mcsMQTT Plugin Michael McSharry mcsMQTT (3P) 286 Today 05:59 PM
mcsMQTT and RPi 1-Wire hub Pete mcsMQTT (3P) 30 May 11th, 2018 08:52 AM
mcsMQTT Triggers Michael McSharry mcsMQTT (3P) 15 March 27th, 2018 10:23 PM
mcsMQTT - High CPU Utilization Theron mcsMQTT (3P) 6 March 1st, 2018 01:39 PM
mcsMQTT Plugin Testing Pete mcsMQTT (3P) 2 February 27th, 2018 06:59 PM


All times are GMT -4. The time now is 10:58 PM.


Copyright HomeSeer Technologies, LLC