more G-Labs products

Author Topic: TESTING RELEASE  (Read 196269 times)

October 02, 2014, 08:38:07 PM
Reply #330

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I loaded HG on Firefox on my work computer (v24.7.0) and it works.  The version at home is up to date at v32.  I'll try clearing the cache this evening and reload.

October 02, 2014, 10:19:56 PM
Reply #331

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,
On my r411, i write some script (simple, only in wizard mode). But after reboot of HG or after sometimes, my script pass to state "disable".

I try the following things but with no better result:
  • Backup / Suppress / Restore the scripts
  • take a look at the HG log => No error


Code: [Select]
2014-10-02T22:06:26.8251320+02:00 HomeAutomation.HomeGenie.Automation 1017 Automation Program Program.Status Idle
2014-10-02T22:06:40.7101700+02:00 MIG.Gateways.WebServiceGateway x.x.x.x api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.HomeGenie.Automation/1013/1412280388112 HTTP POST
2014-10-02T22:06:41.2261080+02:00 MIG.Gateways.WebServiceGateway x.x.x.x api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.HomeGenie.Automation/1017/1412280388210 HTTP POST
2014-10-02T22:06:45.2997700+02:00 HomeAutomation.HomeGenie.Automation 1017 Automation Program Program.Status Disabled
2014-10-02T22:06:46.0643790+02:00 MIG.Gateways.WebServiceGateway x.x.x.x api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.HomeGenie.Automation/1017/1412280406061 HTTP POST

Any idea why ?

Bye

October 03, 2014, 04:58:59 AM
Reply #332

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Clearing the cache fixed things.  Looks great!

October 04, 2014, 05:46:54 PM
Reply #333

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I had an error last night that caused the system to stop functioning.  It appears that when a PLC command was issued HG had an issue and locked.  This is the mono log for the set of commands that led to the crash as well as the crash itself:

Code: [Select]
[20:21:52.536675] X10 > 5A 02 00 6E
[20:21:52.537080] X10 > PLCRX: 5A 02 00 6E
[20:21:52.537381] X10 > FNMAP: 00
[20:21:52.537688] X10 >  DATA: 6E
[20:21:52.538259] X10 >       0) House code = A
[20:21:52.538550] X10 >       0)  Unit code = 2
[20:21:52.984683] X10 > 5A 02 00 62
[20:21:52.985087] X10 > PLCRX: 5A 02 00 62
[20:21:52.985472] X10 > FNMAP: 00
[20:21:52.985791] X10 >  DATA: 62
[20:21:52.986276] X10 >       0) House code = A
[20:21:52.986584] X10 >       0)  Unit code = 3
[20:21:53.432797] X10 > 5A 02 00 6A
[20:21:53.433204] X10 > PLCRX: 5A 02 00 6A
[20:21:53.433503] X10 > FNMAP: 00
[20:21:53.433765] X10 >  DATA: 6A
[20:21:53.434251] X10 >       0) House code = A
[20:21:53.434537] X10 >       0)  Unit code = 4
[20:21:53.872783] X10 > 5A 02 01 62
[20:21:53.873215] X10 > PLCRX: 5A 02 01 62
[20:21:53.873531] X10 > FNMAP: 01
[20:21:53.873792] X10 >  DATA: 62
[20:21:53.874260] X10 >       0) House code = A
[20:21:53.874549] X10 >       0)    Command = ON
2014-10-03T20:21:53.8760880-07:00 HomeAutomation.X10 A4 - Status.Level 1
2014-10-03T20:21:53.8773870-07:00 HomeAutomation.HomeGenie.Automation 84 Automation Program X10 Auto Bright Kennel light<br>A4 set to 100%
[20:21:53.879523] X10 ! Collection was modified; enumeration operation may not execute.
[20:21:53.880682] X10 !   at System.Collections.Generic.List`1+Enumerator[XTenLib.X10Module].MoveNext () [0x00000] in <filename unknown>:0
  at XTenLib.XTenManager.ModulesOn (System.String housecode) [0x00000] in <filename unknown>:0
  at XTenLib.XTenManager.ReaderThreadLoop () [0x00000] in <filename unknown>:0
[20:21:54.380581] X10 < 04 6A
[20:21:54.643275] X10 ! Thread was being aborted
[20:21:54.644370] X10 !   at (wrapper managed-to-native) System.Threading.WaitHandle:WaitAll_internal (System.Threading.WaitHandle[],int,bool)
  at System.Threading.WaitHandle.WaitAll (System.Threading.WaitHandle[] waitHandles, Int32 millisecondsTimeout, Boolean exitContext) [0x00000] in <filename unknown>:0
  at XTenLib.Drivers.CM15.ReadData () [0x00000] in <filename unknown>:0
  at XTenLib.XTenManager.ReaderThreadLoop () [0x00000] in <filename unknown>:0

I upgraded to r415 a couple days ago.  I had no issues before when I was running r411, so I assume this is due to an update in the last release.

EDIT:  When I went to restart HG, it looks like the HG process actually had crashed.

Code: [Select]
pi@raspberrypi ~ $ sudo service homegenie restart
start-stop-daemon: warning: failed to kill 17721: No such process
No process in pidfile '/tmp/homegenie.pid' found running; none killed.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[ ok ] homegenie stopped.
[ ok ] homegenie started.
« Last Edit: October 04, 2014, 05:49:08 PM by bkenobi »

October 04, 2014, 05:57:47 PM
Reply #334

Gene

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

file a issue on github. I'll carry out X10 issues for the next release.

Cheers,
g.

October 04, 2014, 06:09:01 PM
Reply #335

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Will do.

I noticed that after restarting the service and logging in to HG, there was an update available.  I checked and it was for r415 but I was already at r415 from the testing release.  I updated and the notification went away.  I don't know if anything was really updated though.

October 04, 2014, 06:16:39 PM
Reply #336

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
this is ok, update/r415 contains a fix to wizard script ui that was not present in testing/r415.

g.

October 05, 2014, 07:29:16 PM
Reply #337

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene,

I am using now R415, which I downloaded after your post in regards to the wizard editor fix, bytesize is 6116920, but the current version available for download is 6111386 - was there another change?

In the version I use (6116920) the HUE colors can be set via wizard scripts and the LIRC works with two HG boxes - thanks a lot, that is really great.

Although I struggle with the DHT11, was there a change, too?

Please see the screenshot attached the remote DHT11 shows up with the prefix like lirc, too and reports data. So I turned on the local DHT11 which was inactive for a while, and shows up as PID 70. The local one is not working at all. A broken DHT would be too much of coincidence I think - any idea?

Many thanks
Jens

October 05, 2014, 10:02:09 PM
Reply #338

Gene

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

try updating the DHT-11 program code with the following:

Code: [Select]
// it makes program to respond to webservices calls:
// - http://<hg_address>/api/Components.DHT11/0/Sensor.Temperature
When.WebServiceCallReceived("Components.DHT11/0/Sensor.Temperature", ( args ) =>
{
  return "{ 'ResponseValue' : '" + Program.Parameter("Sensor.Temperature").Value + "' }";
});
// - http://<hg_address>/api/Components.DHT11/0/Sensor.Humidity
When.WebServiceCallReceived("Components.DHT11/0/Sensor.Humidity", ( args ) =>
{
  return "{ 'ResponseValue' : '" + Program.Parameter("Sensor.Humidity").Value + "' }";
});

int[] data = new int[5];

var irpin = ConnectorPin.P1Pin7.ToProcessor();
MemoryGpioConnectionDriver driver = new MemoryGpioConnectionDriver();
while (Program.IsEnabled)
{
    driver.Allocate(irpin, PinDirection.Output);
    driver.Write(irpin, true);
    //Pause(5);
  for(int a = 0; a < 30; a++)
    {
        driver.Allocate(irpin, PinDirection.Output);
        driver.Write(irpin, false);
        Pause(0.018);
        //driver.Write(irpin, true);
        //Pause(0.001);
        // 
        driver.Allocate(irpin, PinDirection.Input);
        //
        int i = 0;
        data = new int[5];
        int j = 0;
        int counter = 0;
        bool laststate = true; 
        //
        // detect change and read data
        for ( i=0; i<= 85; i++) {
          counter = 0;
          while (driver.Read(irpin) == laststate) {
            //Raspberry.Timers.HighResolutionTimer.Sleep(0.000001m);
            if (++counter == 255) {
              break;
            }
          }
          laststate = driver.Read(irpin);
     
          if (counter == 255) break;
     
          // ignore first 3 transitions
          if ((i >= 4) && (i%2 == 0)) {
            // shove each bit into the storage bytes
            data[j/8] <<= 1;
            if (counter > 40)
              data[j/8] |= 1;
            j++;
          }
        }
        //
      //Program.Notify("DHT-11", "J = " + j.ToString());
        if ((j >= 40) && (data[4] == ((data[0] + data[1] + data[2] + data[3]) & 0xFF)) )
        {
            data[2] = data[2] - 3; // temperature adjustment, due to heat excess inside the HG box
            double f = data[2] * 9D / 5D + 32;
            //Console.WriteLine("

Humidity = {0}.{1} %
Temperature = {2}.{3} *C ({4} *F)

",
            //      data[0], data[1], data[2], data[3], f);
         
          var hum = data[0] + "." + data[1];
          var tempc = data[2] + "." + data[3];
          var tempf = f.ToString();
          //if (hum != Program.Parameter("Sensor.Humidity").Value)
            {
              Program.RaiseEvent("Sensor.Humidity", hum, "DHT-11 Sensor");
            }
          //if (tempc != Program.Parameter("Sensor.Temperature").Value)
            {
                Program.RaiseEvent("Sensor.TemperatureF", tempf, "DHT-11 Sensor");
                Program.RaiseEvent("Sensor.Temperature", tempc, "DHT-11 Sensor");
            }
            break;
        }
        else
        {
            //Console.WriteLine(j + ") Data not good, skip
");
          Pause(2);
        }
    }
    //
    //Console.WriteLine(data[0]);
    //Console.WriteLine(data[1]);
    //Console.WriteLine(data[2]);
    //Console.WriteLine(data[3]);
    //Console.WriteLine(data[4]);
  //
  var pause = Program.InputField("UpdateInterval").DecimalValue;
  if (pause == 0) pause = 600; // default pause is 10 minutes
  Pause(pause);

}


g.

October 06, 2014, 08:24:44 PM
Reply #339

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene,

thanks for the fast reply. It works after changing the code. I'll keep an eye on it whether it runs stable.

Regards
Jens

October 10, 2014, 10:59:39 PM
Reply #340

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Anyone here interested in receiving a free "beta" Eden Sensor Board?

Cheers,
g.

October 11, 2014, 11:22:23 AM
Reply #341

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

I'am interesting for testing as specify in the topic Eden.

Cheers
Dani.

November 12, 2014, 07:54:32 PM
Reply #342

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
New testing release 419 is available.

https://sourceforge.net/projects/homegenie/files/testing/

12/11/2014 1.00 beta rev 419
    - Fixed ModuleParameter.DecimalValue negative values conversion (issue #43)
    - Reviewed ZWaveLib/MIG Thermostat device implementation
    - Added new thermostat widget
    - Updated MCP3008 app, now with virtual modules mapped from analog input channels
    - Added "Generic Thermostat" app for using any sensor and any switch module for implementing a thermostat logic
    - Fixed modules properties editing bug (issue #27)
    - Enhanced HTTP port binding: if default HTTP port is busy, HG will now try to bind from 8080 to 8090
    - Should fix Z-Wave discovery problem reported as issue #42

issues update/reporting: https://github.com/genielabs/HomeGenie/issues

Cheers,
g.

November 22, 2014, 12:52:57 AM
Reply #343

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
New testing release 425 is out:

https://sourceforge.net/projects/homegenie/files/testing/

21/11/2014 1.00 beta rev 425
    - Added support for Arduino sketches inside HomeGenie Program Editor
    - Added DHT-22 app
    - Added SmartIC app for using two MCP23017 I/O expanders
    - Updated Grove-RGB, OneWire, DHT-11 apps
    - Updated Jint Javascript Engine

For those interested in testing Arduino Sketches inside HomeGenie program editor a new package install is required:

Code: [Select]
sudo apt-get install arduino-mk

Cheers,
g.

November 22, 2014, 05:57:57 PM
Reply #344

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene,

I went from 416 to 425. DHT11 was not working after installation of 425 even after recompile/restart - program indicator was running.

Again, I changed the code to the code you posted some comments earlier:
>Hi Jens,
>
>try updating the DHT-11 program code with the following:

I did not check line by line - but after using that code DHT11 is back working

Something else, 425 does not include the raspberry programm for indicating that HG is runnig (eden board light), is this by intention?

Thanks
Regards
Jens