more G-Labs products

Author Topic: DS18B20 Sensors  (Read 12523 times)

September 20, 2014, 10:15:41 PM
Reply #15

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
The module show temperatureC and TemperatureF, and i would like have some time of datetime stamp to know the last time the values are updated.

For instance if i disable the program (or for some reason stop working) the modules keep show the last values and we will not know if they are current values or not.

September 20, 2014, 10:46:37 PM
Reply #16

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
All right... there was missing code in the sensor widget. I added it.
To update copy the attacched sensor.json file to the /usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/ folder.
Then refresh the browser page and the date should appear like the screenshot.

g.
« Last Edit: September 20, 2014, 10:49:52 PM by Gene »

September 20, 2014, 11:18:53 PM
Reply #17

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
HG is crash after some time, and the the program reports errors...


"Line 0, Column 0 (Code to Run):
    Input string was not in the correct format"

September 20, 2014, 11:34:43 PM
Reply #18

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Does it happen sometime when restarting the program or while it's running?
What do you mean that HG crash? Did you have to restart HG or just the program?

g.

September 20, 2014, 11:37:18 PM
Reply #19

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
i must start HG because it stops... i try to understand what happen because everything has working... but then when i go try the new *.json file hg has stopped...

I start up and the the one wire program not run anymore, and report errors when i try update the script

September 21, 2014, 12:19:06 AM
Reply #20

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Do this have some type off cache? I remove the modules, i reset all hg and now i can't even run the first hgx you send me... all of them returns the same string error.

September 21, 2014, 12:37:50 AM
Reply #21

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
My bad, after chage the script i save and click run and i think that is the problem.. i do back and only then hit save... the script editor reports errors, but it is working again... let see if hg crash or no

September 21, 2014, 08:08:08 PM
Reply #22

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
 :-[ Gene, the crash still occur, i can't identify why, but after some time homegenie stop working and i must start it again... before onewire program this don't happen

September 21, 2014, 09:01:51 PM
Reply #23

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Looks like it is some issue related to mono / IronPython. I'll try updating IronPython libraries but this will require some time since latest IronLanguages release it is only available as source code.
Also I'll get one of these DS18B20 so I can make a real test.
By the way the same program can be written using C# so HG it would not crash.
Do you know how to translate the script code from Python to C#?

Cheers,
g.

September 21, 2014, 09:03:31 PM
Reply #24

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Not really.. i would prefer python :)

However if you can point me to some examples where i can see how to do c# in hg i can try :)

September 21, 2014, 09:56:49 PM
Reply #25

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
I'm doing it.
Please test the attached C# script and let me know if the app reads temperature values correctly.
You have to change the sensorid from the code at line #41.
If this is working I'll complete the script to work as the python one.

Cheers,
g.

September 21, 2014, 10:08:04 PM
Reply #26

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
when try save the changes i get this

Line -16, Column 0 (Code to Run):
    Metadata file `Microsoft.CSharp.dll' could not be found

September 21, 2014, 10:24:51 PM
Reply #27

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Missing some dependency? How did you install HG?
I'm attacching the completed version of the program.
I guess you cannot update any C# program? Can you try creating just a new empty c# program and compile it?

g.

September 21, 2014, 10:34:01 PM
Reply #28

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
i download and install the rpi version, before i run the apt command that is in the docs

September 21, 2014, 10:44:42 PM
Reply #29

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Mmm... that's strange...
We can work around this though.
Copy the precompiled app file to /usr/local/bin/homegenie/programs/ folder.
But you must change the number in the filename to match your imported program ID number.
After that, you just enable or restart the app.

Cheers,
g.