emonhub hacking - which git?

Hi,

I'd like to do a bit of development on emonhub, which git repository should I use?

I've found:

https://github.com/openenergymonitor/emonhub

... last commit 2 days ago (one branch "emon-pi").

 

https://github.com/TrystanLea/emonhub

... with 6 non-stale branches.

 

https://github.com/pb66/emonhub

... 6 branches (all more than 1 year old - so I assume not these, but they're referenced from the README.md here https://github.com/TrystanLea/emonhub )

 

https://github.com/emonhub/emonhub

... (3 non-stale branches)

 

I also wasn't sure what the relationship/compatability was between these hub versions, and different emoncms versions (hosted or otherwise).

 

BTW, things I'm thinking of doing (in rough order of likelihood of accomplishing):

. Inputs from arbitrary external commands

. Inputs via Unix domain sockets

. Input in pre-formatted JSON

. Readings on-demand (2 way serial)

pb66's picture

Re: emonhub hacking - which git?

Hi Tim, 

pb66/emonhub dates back to the very early emonhub days and is no longer used.(should be deleted)

TrystanLea/emonhub is Trystan's personal repo which he has been developing on until recently forking to openenergymonitor/emonhub.

openenergymonitor/emonhub is the yet unreleased "emon-pi" version from Trystan's repo, it is derived from the "experimental" branch of emonhub/emonhub

emonhub/emonhub is the "official" home, or at least for the standard version it is. Most if not all users are currently running emonhub/emonhub "development" branch.

Currently the emonhub/emonhub/development is the stable and recommended version. "experimental" is a large (but incomplete) step towards the next emonhub, it has substantial differences including threaded interfacers and data routing which provide bidirectional interfacers for control and selective "routes" for data. It is not intended for use, purely POC for several new ideas.

compatibility wise emonhub/emonhub is compatible with emoncms.org and current local, full and low-write versions, it is included on the emonSD image. The emoncms v8.5 "nodes" input and "emon-pi" emonhub are discussed further on the software.md and userguide.md of the emonpi repo

Paul

 

 

TimSmall's picture

Re: emonhub hacking - which git?

Thanks Paul.

I started hacking on the emonpi branch in the meantime, as it looked a bit more flexible, I'll post back here once I've got something done.

Although I find openenergymonitor a useful project, working out what's going on is frequently a challenge.  There is a wiki, but it's very incomplete, and stuff is otherwise scattered over (mainly) the forums, and it's a challenge to find out info.  When I do find information, it's a challenge to work out whether it's outdated or not.

Having administered wikis myself, I know there's an initial effort to get sufficient data into them, but once that's there, it'd hopefully become self-sustaining, and probably save a lot of bandwidth on the forums, and make getting developers into the project a lot easier.

I've spoken to a couple of (competent) users, who said they'd taken a look at it, but it all looked to complex and difficult to work out what was going on (and complex to setup), so they decided to buy something off-the-shelf instead.

Which is a shame!

Tim.

TimSmall's picture

Re: emonhub hacking - which git?

Hi Paul,

I've pushed code which includes code to use external system commands as data sources to here:

https://github.com/tim-seoss/emonhub

Any comments / thoughts welcome...

If it's of interest, would you like me to re-base against a different repo?

pb66's picture

Re: emonhub hacking - which git?

Thanks for sharing, it's a really interesting idea. I am currently revising emonhub and I will try and factor this in. 

It wouldn't easily fit in with the current emonHub version and the experimental branch isn't going to be released without major rework, the concept is good but the structure needs changing to make it more streamline and intuitive to use and develop.

A brief look at the SMA-bluetooth repo gave me the impression that there was other data available. although I like the generic "command and parse" type interfacer, I also wonder if a specific SMAbluetooth interfacer could be useful.

Paul

TimSmall's picture

Re: emonhub hacking - which git?

Let me know if you'd like me to port to another branch.

Regarding, sma-bluetooth, the maintainer was about to push up a significant amount of changes so I just did this execute and parse solution.  I did think instead about getting sma-bluetooth to work with an http submission to emonhub, or possibly a domain socket - might look at that next week if I get a chance!

The sma-bluetooth code would certainly be useful for many people with SMA inverters ("sunnyboy" etc.) with an emonpi I suppose - but I did see one bug report on ARM for it, and I've not tried it on anything other than 32bit Intel myself...

Next on my list will be to port my json hack over to a newer emonhub, and clean it up.  At first glance it looked like it would be easier to do it in a clean way on the experimental branch than with the older stuff (BICBW).

Are there any other threads I should look at regarding getting more metadata (e.g. feed descriptions, units etc.) into emoncms?

Tim.

pb66's picture

Re: emonhub hacking - which git?

I think the direct "execute and parse" method is probably the better way in principle but I' not familiar with the bluetooth protocol or devices.

In theory the "execute and parse" could be factored  in to the core emonhub interfacer or more accurately made more accessible to other interfacers as the existing code effectively already executes a read and parses the results behind the scenes 

Much like the sma-bluetooth repo emonhub is about to under go a transition so I don't think the existing version should be altered at this late stage, it's stable and very much like the "oemgateway" it replaced. You are more than welcome to develop for or from the experimental version as Trystan has done, as although i am changing the structure quite significantly the intention is to make adding interfacers much easier so porting should be quite straightforward.

Regards the 'metadata' I don't think you will find much on this yet. Basically Trystan is currently assuming emoncms and emonhub are co-installed and therefore emoncms is accessing the emonhub.conf directly. I prefer not to go that route so that emoncms can be remote, multiple emonhubs can be linked to  a single emoncms (or vice versa). emonhub also uses alot of checks and verification so altering the conf's contents directly doesn't mean emonhub will use those changes but emoncms won't know that.

My preferred route is for emonhub to provide emoncms with "the latest settings" when any changes are detected (and at startup ?), this way any verification and default values will be imposed universally and passed to emoncms as verified and current.

I'm waiting to see what emoncms v8.5 looks like when the emonpi is released to evaluate how the utilisation of the nodedata (metadata) is implemented with a view to submitting a request for a emoncms api for emonhub to call with updated settings and meanwhile I'm embracing the full functionality of the ConfigObj modules Validator so the [nodes] spec will be defined and managed behind the scenes by emonhub.

Paul

 

 

 

modenet's picture

Re: emonhub hacking - which git?

I can't understand... I have to use packetgen and I find a version of emonhub which support it.

now with dev branch I received stange value istead the int value that I see on packetgen page.

with repo do you suggest me?

thanks

pb66's picture

Re: emonhub hacking - which git?

If you search this forum for "packetgen hack" you will find some discusions on the topic, the "hack" guide is located in the low-write emoncms documentation and should work fine with the standard emonHub no problem but probably not the emon-pi variant without some rework.

Paul

modenet's picture

Re: emonhub hacking - which git?

thanks, I resolved, I was unable to find the second link.

TimSmall's picture

Re: emonhub hacking - which git?

Hi Paul,

Can I help at all getting the changes I made "upstreamed"?

Cheers,

Tim.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.