We have moved at community.getvera.com

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

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
DataYours on Raspberry Pi
« on: February 15, 2015, 05:15:41 am »
Hi akbooer,
 
after some tests it seems to work fine with the data stored locally on VeraEdge. I notice that the variable "ChildrenSameRoom" is equal to 1 while I've active Cache, Dash, Watcher and Graph.

Then I've tried to use a dedicated USB stick connected to VeraEdge with a USB HUB . To USB HUB is connected a USB stick for VeraEdge log and the Serial Current Cost. I got some problems when VeraEdge restart because the dev name changes. Have you any experience with this configuration ?

Alternative to external storage seems CIFS but not working yet (Correct ?).

I've a spare Raspberry pi : do you think is possibile to use it for Datayours with the Watcher deamon running on Veraedge and store the data on a storage connected to Raspberry ?

tnks

donato

--------------------

Edit:  The original post above was torn from another thread as it was the first suggestion that DataYours could be run on hardware other than Vera.  Full credit to @d55m14 for that.  Two things have happened since then:
  • DataYours has developed further
  • The original 'DataYours on Raspberry Pi' environment has morphed into a general purpose framework to run any plugin on non-Vera hardware.

If you want to run DataYours, then this thread is the one: DataYours - App Store Release - the first post pointed to has a link to the latest (or thereabouts).

If you want to try running any plugin on non-Vera hardware, then openLuup is for you and this is the place: openLuup - running unmodified plugins on any machine

« Last Edit: December 20, 2015, 11:31:45 am by akbooer »

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #1 on: February 15, 2015, 08:06:50 am »
after some tests it seems to work fine with the data stored locally on VeraEdge.
Excellent.

Quote
I notice that the variable "ChildrenSameRoom" is equal to 1 while I've active Cache, Dash, Watcher and Graph.
That flag is set to indicate that if you put the master DataYours device into a room, then the children will follow it.  They can't be placed in separate room (I couldn't see any reason why you would want to do this.)

Quote
Then I've tried to use a dedicated USB stick connected to VeraEdge with a USB HUB . To USB HUB is connected a USB stick for VeraEdge log and the Serial Current Cost. I got some problems when VeraEdge restart because the dev name changes. Have you any experience with this configuration ?
No, none at all.  Sorry, can't advise on that.  DataYours is specifically designed NOT to mount any devices or do anything special with storage other than access it through a local path.  I saw the pain that this caused the erstwhile dataMine plugin and resolved not to go down that path.  This definitely falls into the SEP category ("somebody else's problem".)

Quote
Alternative to external storage seems CIFS but not working yet (Correct ?).
Indeed, this doesn't seem to install correctly on VeraEdge/UI7.  Again, SEP.

Quote
I've a spare Raspberry pi : do you think is possibile to use it for Datayours with the Watcher deamon running on Veraedge and store the data on a storage connected to Raspberry ?

This would be fun to do and is certainly possible.  There's two obvious approaches:
The whole point of basing DataYours on Carbon/Graphite was that it is an open system, not rooted in any particular architecture, so that you could do exactly this sort of thing.

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 #2 on: February 15, 2015, 09:23:50 am »
Quote
Quote
I've a spare Raspberry pi : do you think is possibile to use it for Datayours with the Watcher deamon running on Veraedge and store the data on a storage connected to Raspberry ?

This would be fun to do and is certainly possible.  There's two obvious approaches:
The whole point of basing DataYours on Carbon/Graphite was that it is an open system, not rooted in any particular architecture, so that you could do exactly this sort of thing.

Hi akbooer,

tnks for your reply .

For running your app on Rpi have you any documentation/instructions ? On Rpi do I have to run Graph and Dash daemon too ?

tnks again

donato
« Last Edit: February 15, 2015, 10:20:10 am by akbooer »

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #3 on: February 15, 2015, 11:11:23 am »
For running your app on Rpi have you any documentation/instructions ? On Rpi do I have to run Graph and Dash daemon too ?

I have no instructions, because I have never done it.  I have every intention of doing this, though, on my BeagleBone Black board.  Assuming that you can install Lua, and the LuaSocket library, then there's only one routine (the Luup HTTP callback handler) which has to be substituted, and I already have the code for that.

I would have thought that you would want to abandon Graph and Dash outside of the Vera environment.  However, Graph is just a subset of the Graphite Webapp and would run just as well as Cache (with the same change.)  The dashboard interface, though, is much more intimately connected with Luup and Vera, so is not so easily ported.  There are other third-party dashboards and renderers that may, perhaps, also be used.

Without the dashboard interface you could still issue HTTP requests to the renderer and get back CSV, JSON, and also SVG graphics (if the Rpi has access to the internet.)
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 #4 on: February 15, 2015, 11:32:08 am »
I'd like basically to store data outside VeraEdge possibly without installing extra module (CIFS for example) on it.

I like the idea of having VeraEdge managed only with the UI7 and plugins so that to have less problem during upgrade . The Dash and Graph module on the VeraEdge will be fine for me.

tnks

donato


Offline airedale

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +13/-2
Re: DataYours on Raspberry Pi
« Reply #5 on: February 16, 2015, 08:57:26 pm »
Sounds like a great idea - I have a Raspberry PI, so I could imagine taking advantage of this too.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #6 on: February 17, 2015, 03:22:44 am »
Sounds like a great idea - I have a Raspberry PI, so I could imagine taking advantage of this too.

Hi airedale,

I see that in the image of debian for  Raspberry there is lua 5.1 already installed.
Do you know how to install the luasocket  library indicated by akbooer ?


Tnks


Donato


Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #7 on: February 17, 2015, 04:18:08 am »
I haven't tried it, but here http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2 looks like a good start.
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 airedale

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +13/-2
Re: DataYours on Raspberry Pi
« Reply #8 on: February 17, 2015, 11:33:21 am »
Sounds like a great idea - I have a Raspberry PI, so I could imagine taking advantage of this too.

Hi airedale,

I see that in the image of debian for  Raspberry there is lua 5.1 already installed.
Do you know how to install the luasocket  library indicated by akbooer ?


Tnks


Donato

No I haven't.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: DataYours on Raspberry Pi
« Reply #9 on: February 17, 2015, 11:55:25 am »
I haven't tried it, but here http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2 looks like a good start.

Hi akbooer,

I've installed lua 5.1 and luasocket on Raspberry. Can I try to install DataCache on it and storing the data on a storage connected to raspberry ?

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #10 on: March 03, 2015, 06:11:27 pm »
I haven't tried it, but here http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2 looks like a good start.

Hi akbooer,

I've installed lua 5.1 and luasocket on Raspberry. Can I try to install DataCache on it and storing the data on a storage connected to raspberry ?

tnks

donato

So sorry, I must have missed this post.  I'll set up a new thread for Rpi, and we can continue the discussion there!
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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #11 on: March 04, 2015, 03:39:46 am »
I'll set up a new thread for Rpi, and we can continue the discussion there!

So here we are.  What stage are you @d55m14?  If I understand correctly:
  • Lua 5.1 installed
  • LuaSocket library installed
  • next thing to do is install DataCache
There is just one Luup call which needs to be replaced (sets up the HTTP callback handler) so I'll package a replacement and post it here - I'd rather not change the  DataCache module at all.  What this means is that a small module with just a few Luup call emulations should enable the basic Watcher / Cache / Graph combination to run.
« Last Edit: March 04, 2015, 04:55:30 am 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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi
« Reply #12 on: March 07, 2015, 06:33:49 am »
OK, I think I've contrived to make DataCache run on a non-Vera machine without any modification of the existing files:
  • install Lua on target machine
  • install LuaSocket library
  • copy L_DataDaemon7.lua, L_DataCache7.lua, and L_DataWhisper7.lua to target machine
  • modify the parameter LOCAL_DATA_DIR near the start of the attached file to point to your storage directory
  • run the modified file in your Lua environment
  • add the RPi IP address and PORT (xxx.xxx.xxx.xxx:2003) to your existing Vera DataWatcher variable DESTINATIONS
...and you should be up and running.

I've not tested this on a RPi, because I haven't got one, so there may be a bit of debugging needed.  I have run it successfully in a test harness on my development machine (iMac.)  The attached file simply emulates the relevant parts of Luup, although I've not yet included the HTTP callback handler, so the DataYours configuration page will not yet see the cache on the RPi.  But it should receive and store data, creating the relevant files and updating them as time goes by.

Would be grateful of any budding beta testers out there.  Good luck.
« Last Edit: March 08, 2015, 10:33:27 am 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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: DataYours on Raspberry Pi (or BeagleBone Black)
« Reply #13 on: March 08, 2015, 10:44:16 am »
I've not tested this on a RPi, because I haven't got one...

...but I have now tested it on my BeagleBone Black (BBB), and it runs well, taking less than 0.2% of the CPU time.  I have it set up receiving data from my Edge and it has created the relevant Whisper database files correctly.

I will add the HTTP listener code so that it becomes a fully-fledged DataYours-Graphite daemon.

The ease of doing this, and the reliability (so far) of the BBB means that I am wondering just how much of the Luup environment I can/should emulate in order to port more of my plugins to this platform.

Just a snippet of the running log and created files to prove it:
Code: [Select]
Sun Mar  8 14:41:35 2015, call: UDP_listener_2003, cpu = 1.080sec (0.155%)
Sun Mar  8 14:41:36 2015, call: UDP_listener_2003, cpu = 1.090sec (0.157%)
Sun Mar  8 14:41:37 2015, call: UDP_listener_2003, cpu = 1.090sec (0.156%)
^Clua5.1: Test_Cache.lua:76: interrupted!
stack traceback:
[C]: in function 'select'
Test_Cache.lua:76: in main chunk
[C]: ?
root@beaglebone:~# ls -l
total 112
-rwx------ 1 root root  6208 Mar  7 22:29 L_DataCache7.lua
-rwx------ 1 root root 15417 Mar  7 22:29 L_DataDaemon7.lua
-rwx------ 1 root root 27340 Mar  7 22:29 L_DataWhisper7.lua
-rwx------ 1 root root  2544 Mar  8 14:29 Test_Cache.lua
-rw-r--r-- 1 root root  6132 Mar  8 14:40 Vera-45101161.005.urn^akbooer-com^serviceId^EventWatcher1.AppMemoryUsed.wsp
-rw-r--r-- 1 root root  6132 Mar  8 14:40 Vera-45101161.005.urn^akbooer-com^serviceId^EventWatcher1.CpuLoad05.wsp
-rw-r--r-- 1 root root  6132 Mar  8 14:40 Vera-45101161.005.urn^akbooer-com^serviceId^EventWatcher1.MemAvail.wsp
-rw-r--r-- 1 root root  6132 Mar  8 14:40 Vera-45101161.005.urn^akbooer-com^serviceId^EventWatcher1.MemFree.wsp
-rw-r--r-- 1 root root  6132 Mar  8 14:34 Vera-45101161.019.urn^upnp-org^serviceId^TemperatureSensor1.CurrentTemperature.wsp
-rw-r--r-- 1 root root  6132 Mar  8 13:54 Vera-45101161.021.urn^upnp-org^serviceId^TemperatureSensor1.CurrentTemperature.wsp
-rw-r--r-- 1 root root  6132 Mar  8 14:39 Vera-45101161.047.urn^akbooer-com^serviceId^DataYours1.AppMemoryUsed.wsp
« Last Edit: March 08, 2015, 10:50:29 am 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 #14 on: March 08, 2015, 05:46:11 pm »
Hi akbooer,

I've tried Datacache on Rpi and the messages seems ok (I've attached a log).

The only error message is :

sh: 1: GetNetworkState.sh: not found

Have you any idea ?

tnks donato