more G-Labs products

Author Topic: Temperature sensor widget's cannot be "named"  (Read 7185 times)

January 13, 2015, 12:25:33 AM
Reply #15

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
an online server is: http://test.mosquitto.org/

I've been using this one for early testing. Off course all messages will be public and visible to all other connected clients, so this is just for testing purpose.

Cheers,
g.

January 13, 2015, 10:24:57 PM
Reply #16

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

installed MQTT broker mosquitto-1.3.5
Followed instructions and got the event system working.
Events are still lost in the homegenie box/cell that receives the events.
Events are generated at a speed of one per second.

Gene I'll provide you a a decent report, but I need more time to do tests and write the report.

Best regards,
Wibo.



January 14, 2015, 08:05:33 PM
Reply #17

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

this is my test report for using MQTT with HomeGenie.

Setup:

Win7 pro box running in vmware workstation upgraded with latest HG r447 (394 didn't have MQTT)
Don't forget to backup, the windows installer forces you to uninstall and everything gets lost unless
you have a backup.
Enabled MQTT and forgot to recompile.
Did some other stuff and noticed the webbrowser indicated a restart of HG once in a minute or so.
After recompiling MQTT HG was stable.
When both boxes were configured and some restarts/recompiles/etc. of HG were done (don't remember the
exact order) events arrived and the module was added.


RPi B+ box with downloaded HG image revision 431, I modified all raspberry-sharp IO binaries
Tried to disable all modules that could cause events.
Disabled interconnections, enabled MQTT and yes you really need to recompile before it connects.
Enabled the FakeTemperatureSensorCluster with only one sensor sending one event per second.
CPU utilization was about 5% peeks to 30% (I need a graphical tool)

End Setup


So I started testing...

I throwed away every html/threadpoollimit/overfloodprotection thing I could think of...
In other words:
Closed all browsers and deleted all widgets, checked if the interconnection were still disabled.
Disabled all polling sensors except for one sensor generating an event every second.
Booted RPi and Win7 box to get a clean start.

Facts:
RPi is logging every event, tail of the homegenie.log is attached as RPiboxHomeGenieLog.txt
Win7 misses events in the homegenie.log, attached as Win7boxHomeGenieLog.txt

That's the end of test day 1


When I came home next day and started testing, the http server on the RPi was down.
(SSH)Putty was working and top didn't show mono anymore, obviously HG had died.
Copied(WinSCP) the tail of the homegenie.log into RPiHttpServerDown.txt which is attached.
This was the first time in weeks HG died on RPi, normally it's rocksolid.
Rebooted the RPi and everything was fine again.

So, what am I going to do now?

Find out what's causing the nasty mqtt exception in de logs.
Install the mqtt client app to see if the events are arriving at the mqtt broker.
Let win7 box send events to see if there's anything different.
Debug code in win7 box if it has the same problem
Update boxes to last revision.

Don't know what and in what order I should test, still a newbie.
Any pointers are welcome.

Think curiosity wins and mqtt client app gets installed first, results will be posted.

Best regards,
Wibo.


January 14, 2015, 09:38:34 PM
Reply #18

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
What MQTT broker are you using? Where is it running on?
I think you did too much things =) Just to make this simple:

1) install HG
2) recompile MQTT client app and configure server address and port, then start the app
3) enable the flag "publish on mqtt network" on modules you want to share with the other HG-MQTT clients
4) on the other HG (after at least one event is sent from modules on the publishing HG) you will be able to pick remote modules from the modules list

that's it. No need to touch anything else if you're coming from a fresh HG install.

Cheers,
g.

January 14, 2015, 10:44:56 PM
Reply #19

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

sorry forgot to mention the MQTT broker, it's Mosquitto on the win7 box.

Already considered a fresh install on RPi, fresh install on win7 didn't change anything.

I've been testing a few things and the report is almost finished...

January 14, 2015, 10:50:21 PM
Reply #20

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

figured out how to monitor mqtt and the result was surpising.

Used: C:\Program Files\mosquitto\mosquitto_sub.exe -d -t #

The # is a wildcard that shows ALL messages.

Messages came in at bursts, time between bursts 1-2 sec and sometimes 5-6 sec
Every burst was large like in 30kB and the size of the bursts increased every burst.
This is not good for a "realtime" system

Since the message contained "Statistics" I wanted to disable Statistics in HG.
Untill now I don't know how to disable that.

Attached is one single burst of data.

Think I will try fresh install on RPi tomorrow or find a way to disable statistics.

Best regards,
Wibo.



January 14, 2015, 11:02:13 PM
Reply #21

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Please try upgrading to r453 by using update manager.
If Statistics fields is still there, this is a bug. It shouldn't be serialized. Anyway, only first time the whole module structure is sent, after that only one line for each new event should be sent.

Cheers,
g.

January 14, 2015, 11:09:15 PM
Reply #22

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Well... I confirm this is a bug. I already fixed it, but if you want file a issue on github just to keep track of it.
Thanks for helping with this =)

Cheers,
g.

January 15, 2015, 03:32:02 PM
Reply #23

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Wibo,

the MQTT fix is available in r455. This can be obtained from source code only at the moment:

https://github.com/genielabs/HomeGenie

as there's some work in progress involving other topics, the update will be pushed later, before the end of the month I suppose.

Cheers,
g.

January 15, 2015, 07:15:06 PM
Reply #24

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

thanks for your effort!

Checked HG at the RPi when I came home, it was dead again, so the crash is reproducible.

Last 2 lines of the HG log:
2015-01-15T15:39:07.8760580+01:00   RaspberryPi.FakeTSC   Sensor1   Virtual Module   Sensor.Temperature   16.6
2015-01-15T15:39:08.2744460+01:00   HomeAutomation.HomeGenie   UnhandledExceptionTrapper   System.IO.IOException: Write failure ---> System.Net.Sockets.SocketException: The socket ha

Going to make an attempt to upgrade to rev 455, sooner or later I have to learn this anyway.
I'm used to svn and already have your code checked out some time ago, so no problems there.

I'm only doubting what would be the most efficient approach.
I already did an "xcopy deployment" when I modified the raspberry-sharp.io, but never with all the HG binaries and if the database design has changed this won't work.
I have the rev 432 code compiling in VS2010 only had to fix a few issues that were not compatible with VS2010.

I could also try to create an install package after reading your docs about that again.

I could also try to update to the r453 and try xcopy deployment after that.

Any advice?

Best regards,
Wibo.



January 15, 2015, 11:21:18 PM
Reply #25

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Wibo,

just wondering why did you need modifying raspberry-sharp-io?
Btw there's an HG specific fork:

https://github.com/genielabs/raspberry-sharp-io

Cheers,
g.

January 15, 2015, 11:30:15 PM
Reply #26

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

using vs2010
updated to r455
fixed merge conflict with raspberry-sharp.IO
changed 4.5 into 4.0 (TargetFrameworkVersion) in Windows.csproj
Rebuild all Succeeded

Kinda stuck with building the RPi image, the Packager in the HomeGenie_Linux solution does not build, the only options are reload and delete.
VS2010 doesn't like it when starting up.

I started a thread to find out what you're using, this thread is already messy enough.

Best regards,
Wibo.


January 15, 2015, 11:34:29 PM
Reply #27

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

I needed hardware support for a temperature sensor that was not supported, a sensor that could do things others could not.

128 sensors on I2c on one raspberry pi theoretical.

Asked you already if you wanted me to post a story of the project and where...

Best regards,
Wibo.

January 16, 2015, 01:07:07 AM
Reply #28

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Off course you can post the story if you want. In the "Story" discussion board and/or in the HomeGenie G+ community.
Hopefully we will make it work with HG.

Cheers,
g.

January 16, 2015, 07:00:32 PM
Reply #29

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
I'm very confident we can make it work else I wouldn't spend so much time. ;)

I will soon start a thread in the story discussion board, so everybody can read what I'm trying to accomplish.

FYI:
Yesterday evening I disabled MQTT after booting RPi and HG was still running when I came home today.

Going to setup a clean HG vmware, because my current one is pretty messy after testing so many domotica projects and IDE's.

regards,
Wibo.