HomeGenie Forum

Development => Feature request => Topic started by: codedmind on September 25, 2014, 07:01:10 PM

Title: Hello world Samples
Post by: codedmind on September 25, 2014, 07:01:10 PM
I search and can't find any hello world samples to try do some programs.

Any volunteer to deploy this samples?
Title: Re: Hello world Samples
Post by: MickEE on September 28, 2014, 11:04:25 PM
I search and can't find any hello world samples to try do some programs.

Any volunteer to deploy this samples?

Start by going to
Configure -> Automation
And in the right bottom corner u can find "Add group", Press it and write "New Group" - ok.

Inside the group, press "Actions"-button in the right down corner, "Add new program", give it a name "Hello World" -ok.

Change the program type to "C# Program"
Press "edit source code"

Now you can start coding :) The easiest thing u can do is to trigger a notification:
Program.Notify("Hello", "World");

Connect the audio to your HomeGenie and let it speak:
Program.Say("Hello, World!", "en-US");

You can turn on modules (leds or lights) by running this code:
Modules.WithName("NameOfYourLight").On();

To test the code, press the "Actions"-button in the lower right corner, and "update". After it has compiled the program u can run it by pressing "Actions", "Run".


Hope this helps :)
Title: Re: Hello world Samples
Post by: codedmind on October 03, 2014, 08:56:54 PM
Hy there

Thanks for you post
After i try do update i get the following error
"Line -16, Column 0 (Code to Run):
    Metadata file `Microsoft.CSharp.dll' could not be found"

And can't go further :/
Title: Re: Hello world Samples
Post by: bkenobi on October 03, 2014, 11:09:03 PM
More details might help.  What hardware are you running on (Windows, Linux, Raspberry Pi, etc).  What version?  Perhaps export the script and post it.
Title: Re: Hello world Samples
Post by: codedmind on October 04, 2014, 12:19:00 PM
RPI lastest version

The script is simple the line hello word you post in your sample
Code: [Select]
// CSharp Automation Program Plugin
// Example for using Helper Classes:
// Modules.WithName("Light 1").On();
Program.Notify("Hello", "World");
Title: Re: Hello world Samples
Post by: MickEE on October 06, 2014, 10:22:56 PM
RPI lastest version

The script is simple the line hello word you post in your sample

I'm also running HomeGenie on the Raspberry pi version B. Check the attached image for the hello world example. It should work with the code u gave in your earlier post.

Can't say from this what the problem could be, maybe try to re-install HomeGenie. Download it from this page: http://www.homegenie.it/download.php (http://www.homegenie.it/download.php)
Title: Re: Hello world Samples
Post by: jarrettv on October 15, 2014, 11:37:58 PM
"Line -16, Column 0 (Code to Run):
    Metadata file `Microsoft.CSharp.dll' could not be found"


I'm having same issue. I was able to fix and I even sent a pull request to gene (https://github.com/genielabs/HomeGenie/pull/36). I believe he has his flag flipped in the code.

You can see related thread here: http://www.homegenie.it/forum/index.php?topic=370.0 (http://www.homegenie.it/forum/index.php?topic=370.0)

I think the people with Pi's who aren't having an issue must be running a different version of mono.

@MickEE @codeminded @bkenobi what does your "mono --version" say?
Title: Re: Hello world Samples
Post by: codedmind on October 16, 2014, 08:30:15 AM
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com (http://www.mono-project.com)
   TLS:           __thread
   SIGSEGV:       normal
   Notifications: epoll
   Architecture:  armel,vfp+hard
   Disabled:      none
   Misc:          softdebug
   LLVM:          supported, not enabled.
   GC:            sgen
Title: Re: Hello world Samples
Post by: bkenobi on October 16, 2014, 04:31:40 PM
I don't have access at the moment, but my setup is based on an older SD card image (~r300 would be my guess).  It could certainly be an older version of mono.  I'll try to remember to check tonight.
Title: Re: Hello world Samples
Post by: mvdarend on October 16, 2014, 04:44:01 PM
Here is my "mono --version", I'm not having the problems you describe

Quote
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url] ([url]http://www.mono-project.com[/url])
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen
Title: Re: Hello world Samples
Post by: MickEE on October 16, 2014, 05:51:35 PM
Here's what version of mono I'm running

Quote
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-proj]www.mono-proj[/url] ([url]http://www.mono-proj[/url])                               ect.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen
Title: Re: Hello world Samples
Post by: jarrettv on October 16, 2014, 09:17:45 PM
Here is mine:
Code: [Select]
Mono JIT compiler version 3.4.1 (master/148b100 Sun Mar 30 09:59:44 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url]
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen
Title: Re: Hello world Samples
Post by: bkenobi on October 23, 2014, 03:33:34 AM
Code: [Select]
pi@raspberrypi ~ $ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url]
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen