We have moved at community.getvera.com

Author Topic: DataYours on Raspberry Pi  (Read 38050 times)

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #15 on: March 08, 2015, 06:07:51 pm »
Yes.  That error is because the mechanism used on Vera to recover the IP address of the machine is not available on the RPi.  It generates an error, but then goes ahead and uses the 127.0.0.1 IPv4 loopback 'localhost' address, which is fine for the purpose.

So what next?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #16 on: March 08, 2015, 06:29:32 pm »
Yes.  That error is because the mechanism used on Vera to recover the IP address of the machine is not available on the RPi.  It generates an error, but then goes ahead and uses the 127.0.0.1 IPv4 loopback 'localhost' address, which is fine for the purpose.

So what next?

I've intended you have to add some code to Rpi to access the data from DataDash and DataGraph on Veraedge.

Is it correct ?

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #17 on: March 08, 2015, 07:04:51 pm »
...you have to add some code to Rpi to access the data from DataDash and DataGraph on Veraedge.

Is it correct ?

Possibly.  I take it that your storage on the RPi is not visible from Vera (you didn't want to use CIFS)?  So I need to check that DataGraph can access DataCache remotely with some other mechanism (native Graphite cache access.)

Well, we are making some progress, anyway!

PS: I'd be interested to know the asymptotic value of the cpu percentage that you get if you leave things running a while on the RPi.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #18 on: March 09, 2015, 03:49:16 am »
Hi akbooer,

Yes i'd like to install less extra software as possible on VeraEdge .

Porting datagraph on Rpi too will simplify the remote access of datadash ?

Ps: i'll measure the cpu Usage of datacache running.

Donato


Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi (or BeagleBone Black)
« Reply #19 on: March 10, 2015, 06:55:38 am »
Porting datagraph on Rpi too will simplify the remote access of datadash ?
Yes, in fact I'll take a look at moving DataDash there as well.  I have just discovered that the BeagleBone Black comes with CIFS ready installed (not sure if this is so for the RPi) so it's trivial to have the Whisper database sitting on a NAS.

Quote
Ps: i'll measure the cpu Usage of datacache running.

You might take a look at the memory usage too... it was a delight to see enormous amounts of free space available - quite a difference from Vera.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi (or BeagleBone Black)
« Reply #20 on: March 10, 2015, 08:47:45 am »
Porting datagraph on Rpi too will simplify the remote access of datadash ?
Yes, in fact I'll take a look at moving DataDash there as well.  I have just discovered that the BeagleBone Black comes with CIFS ready installed (not sure if this is so for the RPi) so it's trivial to have the Whisper database sitting on a NAS.

Quote
Ps: i'll measure the cpu Usage of datacache running.

You might take a look at the memory usage too... it was a delight to see enormous amounts of free space available - quite a difference from Vera.

I've verified : Rpi comes with CIFS ready  installed too.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #21 on: March 11, 2015, 07:04:08 pm »
Just an update on progress: I now have both DataCache and DataGraph running unmodified on my BeagleBone Black, and now see no barrier (famous last words) in doing the same for DataDash.

This means that with only DataWatcher running on Vera to pick up variable changes, the rest of the DataYours daemons could be run remotely on RPi or BBB.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #22 on: March 11, 2015, 07:06:24 pm »
Just an update on progress: I now have both DataCache and DataGraph running unmodified on my BeagleBone Black, and now see no barrier (famous last words) in doing the same for DataDash.

This means that with only DataWatcher running on Vera to pick up variable changes, the rest of the DataYours daemons could be run remotely on RPi or BBB.

Wonderful !!

great job akbooer !!

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #23 on: March 12, 2015, 07:25:35 pm »
DataDash is now working on my BeagleBone Black, but I do want to make some changes because it was written (not unreasonably) with the assumption that it was actually running on a Vera, and that's not now true.  So I can get you up and going and would be grateful for a test on a RPi.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #24 on: March 13, 2015, 03:33:40 am »
DataDash is now working on my BeagleBone Black, but I do want to make some changes because it was written (not unreasonably) with the assumption that it was actually running on a Vera, and that's not now true.  So I can get you up and going and would be grateful for a test on a RPi.
Ok akbooer,

Give me info for the installation in Rpi and I'll test .

Tnks Donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #25 on: March 13, 2015, 01:42:56 pm »
The only error message is :

sh: 1: GetNetworkState.sh: not found

Have you any idea ?

You can suppress this message by creating the file /usr/bin/GetNetworkState.sh with the contents:
Code: [Select]
echo -n 172.16.42.88
replacing the IP address with that of your own (RPi) machine. 

Then, all the DataYours components will pick up the right address.  I'm not Unix savvy enough to make this pick up the machine IP automatically (and it seems, in fact, to be far from straight-forward.)

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #26 on: March 13, 2015, 02:25:04 pm »
The only error message is :

sh: 1: GetNetworkState.sh: not found

Have you any idea ?

You can suppress this message by creating the file /usr/bin/GetNetworkState.sh with the contents:
Code: [Select]
echo -n 172.16.42.88
replacing the IP address with that of your own (RPi) machine. 

Then, all the DataYours components will pick up the right address.  I'm not Unix savvy enough to make this pick up the machine IP automatically (and it seems, in fact, to be far from straight-forward.)

Hi akbooer,

I've tested and the error message disappeared. Good !! Thanks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #27 on: March 13, 2015, 03:20:37 pm »
Give me info for the installation in Rpi and I'll test .

OK.  Here we go...

The standard Vera installation files you will need on your RPi are:
Code: [Select]
L_DataCache7.lua
L_DataDaemon7.lua
L_DataGraph7.lua
L_DataLibrary7.lua
L_DataWhisper7.lua

The attached files:
Code: [Select]
OpenLuup.lua
RPI_BBB_DataYours_Beta1.lua
L_DataDash7.lua   (very slightly modified from the App Store release)

Also
Code: [Select]
akb-json.lua
...available from here: http://forum.micasaverde.com/index.php/topic,29989.msg213050.html#msg213050

BEFORE YOU DO ANYTHING ELSE: you must modify the RPI_BBB_DataYours_Beta1.lua file: the two parameters LOCAL_DATA_DIR and VERAS need to be changed to your particular needs.

Then you just need to run that file with the command:
Code: [Select]
lua5.1 RPI_BBB_DataYours_Beta1.lua
(or maybe just lua instead of lua5.1)

This will (should) create a virtual Luup environment, creating three devices, and away you go.

-----------

[Edit: you also need to create a /www/ directory on the RPi for the DataGraph configuration file.]

« Last Edit: March 13, 2015, 07:36:30 pm by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #28 on: March 13, 2015, 06:57:36 pm »
Great akbooer !!

I've followed your clear indications and all seem OK.
At the moment the data are stored on the Rpi SD .

I've left on VeraEdge only Datayours7 and the Watcher.

I've added a device to VeraEdge and it seems that in Dashboard I can see it only after a restart of your lua programs.

donato

 

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #29 on: March 13, 2015, 07:00:34 pm »
Excellent!

Yes, the device configuration is only read at initialisation.  Adding devices is not something which happens too often.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.