Beta on Linux ?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
ashygan
Posts: 5
Joined: Wednesday 16 September 2015 22:55
Target OS: Linux
Domoticz version:
Contact:

Beta on Linux ?

Post by ashygan »

Hi,

I'm having some quircks between Domoticz and MySensors, so I'd like to give the beta version a shot.
I'm usign a Linux Mint VM for my tesing environment and Debian for my production. How can I switch to beta on these systems ? I thought I could checkout another branch on github, but I couldn't find something relevant. When I switch the update channel on the settings page to beta, Domoticz tells me there are no updates.

How can I switch to beta ?

Thx
User avatar
gizmocuz
Posts: 2486
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Beta on Linux ?

Post by gizmocuz »

If you are on Linux,I think you build from source correct? Then in your source folder you can issue
git pull

And then make again


Sent from my iPhone using Tapatalk
Quality outlives Quantity!
DaaNMaGeDDoN
Posts: 55
Joined: Thursday 23 October 2014 19:01
Target OS: Linux
Domoticz version: beta
Location: Eindhoven, the Netherlands
Contact:

Re: Beta on Linux ?

Post by DaaNMaGeDDoN »

If you create a second folder and pull the sources there you can keep the stable and beta next to eachother.
https://www.domoticz.com/wiki/Linux outlines the procedure, just use a different folder when you 'clone' like

Code: Select all

 git clone https://github.com/domoticz/domoticz.git <folder>
That will clone the latest code (beta). If you need a different version, go into the folder and issue a

Code: Select all

 git checkout <hash> 
where the hash corresponds with the version.
Accept the warning and continue like normal and yes, it looks like it happens instantaneously ;)
e.g.
Previous stable: 85d7b702da84537d962156607ae45ecc56ca0c59
Last stable: 9eef8726fa85b2b79b44a65ee2d18bc19116e98f
These should both have a 'release tag' here: https://github.com/domoticz/domoticz/releases but currently only the new stable is tagged, probably because domoticz moved from svn to git in the meantime.

Other versions correspond with the hashes you see in the right column here: https://github.com/domoticz/domoticz/commits/master
Indeed we could expect new code (beta) is first staged in a branch, however in the current setup domoticz has only one 'master' (the default) branch, which holds all the development. I see there is another branch 'MyDomoticz', which i think is the branch where the mobile app is developped (https://play.google.com/store/apps/deta ... ticz&hl=en), but im not sure.
Disclaimer: im not sure on any of this, just got into the workings of git a couple of days ago, i thought i'd save you some time, wait for Gizmocus to confirm.

I have been playing with a vm myself the last couple of days, maybe there is a way to keep those builds intact and keep everything in one place, i dont know, there is probably a way to install the build to another location anyway, looks like an export DESTDIR=/opt/domoticz/domoticz_beta before a 'make install' would do the trick, have not tested this, i am just running from the build dir.

@ ashygan: question: in your experience how is the load on the host when you "forward" the rfxtrx to your guest? I see the load went up so i decided the vm isnt a permanent solution. I use VirtualBox, does your vm also use kvm? What increase to the load do you see on the host when the rfxtrx is forwarded?
Also: does the current domoticz.sh work for you? I recently found we can pass the PID location to domoticz so i have been looking at, and changing the file to comply with LSB 3.1 and allow for domoticz to run under different credentials. The current version does not return proper values and isn't working for me. I have a version that works, but not a 100%. Of course i will share when i am confident...LSB and systemd are quite cryptic (sysvinit/Slackware veteran).

@Gizmocus: if my thinking on git is correct, can you please tag that last stable?
ben92
Posts: 57
Joined: Thursday 14 August 2014 17:41
Target OS: Linux
Domoticz version: beta
Location: France
Contact:

Re: Beta on Linux ?

Post by ben92 »

i use the script updatedomo in the domoticz folder !!
ashygan
Posts: 5
Joined: Wednesday 16 September 2015 22:55
Target OS: Linux
Domoticz version:
Contact:

Re: Beta on Linux ?

Post by ashygan »

Hi,

@DaaNMaGeDDoN, I'm using git. I pulled the repository again today and compiled with the master branch. I've still got a stable release (2.3 something). I couldn't find a commit that made me think "this is a beta release". I also thought about fiddeling with the make options (like in the mysensors branch with the files makebeta and makerelease), but outside the destination path, there wasn't any difference. I definitely think the beta source are somewhere, but I don't know why

@ben92 : It's ok if you're using a RPi (same for the beta channel in the settings page). I'm using Linux x64, so using this command downloaded an arm binary that won't run on my machine. I just had to rerun a make to correct ;)

@DaaNMaGeDDoN, I don't use rfxtrx, so I couldn't tell. I'm using MySensors, but even with this, I'm using an ethernet gateway, so I couldn't even tell for the USB part. On a Windows Host, I saw a huge perfomance difference between a Linux Mint VM and a latest Ubuntu VM, but I have no idea why.
For the script, in production (debian), I'm using the standard domoticz.sh. I just linked it to /etc/init.d/domoticz and everything works (at least for what I'm asking him) :)
DaaNMaGeDDoN
Posts: 55
Joined: Thursday 23 October 2014 19:01
Target OS: Linux
Domoticz version: beta
Location: Eindhoven, the Netherlands
Contact:

Re: Beta on Linux ?

Post by DaaNMaGeDDoN »

The last master commit should be the latest beta, what if you repeat the steps and pull it somewhere in a different directory, following those linux wiki steps?
With the pull & build from last night i see at the log and top left in the webpage:
domo_build.PNG
domo_build.PNG (11.73 KiB) Viewed 2586 times
What is the output of

Code: Select all

git rev-parse HEAD
When you run that in the source folder you think should be the latest beta?
Thanks for answering my questions :)
ben92
Posts: 57
Joined: Thursday 14 August 2014 17:41
Target OS: Linux
Domoticz version: beta
Location: France
Contact:

Re: Beta on Linux ?

Post by ben92 »

No, i also have ubuntu x64 and the script updatedomo compile..... Im'sure.....

Look at : https://github.com/domoticz/domoticz/bl ... updatedomo
DaaNMaGeDDoN
Posts: 55
Joined: Thursday 23 October 2014 19:01
Target OS: Linux
Domoticz version: beta
Location: Eindhoven, the Netherlands
Contact:

Re: Beta on Linux ?

Post by DaaNMaGeDDoN »

ben92 wrote:No, i also have ubuntu x64 and the script updatedomo compile..... Im'sure.....

Look at : https://github.com/domoticz/domoticz/bl ... updatedomo
Thanks, yes the script seems to be better at handling little changes. I wrote an update script myself, which is a little more safe imho (backups the whole previous installation, data and binaries):

Code: Select all

root@serverddlin2:~# cd ~domoticz/
root@serverddlin2:/home/domoticz# cat ./update.sh
#!/bin/bash
die() { echo >&2 -e "\nERROR: $@\n"; exit 1; }
run() { "$@"; code=$?; [ $code -ne 0 ] && die "command [$*] failed with error code $code"; }
echo "attempting update, run this script interactively as root!"
run read -p "Press any key to continue... "
[ "$(id -u)" == "0" ] || { echo "You are not root you dummy!"; exit 1; }
TIMESTAMP=$(date +'%m-%d-%y-%T')
run cd ~domoticz/domoticz_source
LOCALVERSION=$(git rev-parse HEAD)
echo "Local version: $LOCALVERSION"
git fetch --all
git reset --hard origin/master
REMOTEVERSION=$(git rev-parse HEAD)
echo "Remote version: $REMOTEVERSION"
[ "$REMOTEVERSION" == "$LOCALVERSION" ] && { echo "Already up to date, exiting"; exit 0; }
run mkdir -p -v ~domoticz/backup/backup-$TIMESTAMP
echo "backing up _bin, _data and _source to ~domoticz/backup/backup-$TIMESTAMP"
run cp -r ~domoticz/domoticz_bin ~domoticz/domoticz_data ~domoticz/domoticz_source ~domoticz/backup/backup-$TIMESTAMP
echo "compressing backup...please be patient"
run tar -zcf ~domoticz/backup/backup-$TIMESTAMP.tar.gz ~domoticz/backup/backup-$TIMESTAMP
run read -p "Press any key to continue... "
run cmake -DCMAKE_BUILD_TYPE=Release .
run make -j4
run read -p "Press any key to continue, will stop domoticz, update the binaries and start domoticz"
run service domoticz stop
run sleep 5
run sync
run env DESTDIR=~domoticz/domoticz_bin make install
run service domoticz start
run service domoticz status
echo "All done, domoticz updated from $LOCALVERSION to $REMOTEVERSION"
Of course, change to your own setup, mine is pretty non-standard (different credentials, separate data dir, 4-core proc so -j4 and what not), also it's not finished; the backup copy of the dirs aren't removed after they get compressed, pretty trivial to add.
The top 2 lines define a function i stole here: http://stackoverflow.com/questions/6109 ... ommand-run which makes any such script pretty safe for use. Also it displays nicely what went wrong. Keep in mind not to use it for echo lines.
I just ran it and before i was able to finish this reply i updated domoticz (minimum downtime) :) :

Code: Select all

All done, domoticz updated from f7b3adf44e2ac9d8c32a29f5743abc215d09385c to 95def9ca614a92b5f1e4cad7e698a9032fb5ef3f
Maybe if you run the commands in updatedomo manually we can find out what goes wrong at your end?
ashygan
Posts: 5
Joined: Wednesday 16 September 2015 22:55
Target OS: Linux
Domoticz version:
Contact:

Re: Beta on Linux ?

Post by ashygan »

@ben92 : Yes, the updatedomo does compile, but it seems it compiles to the latest master. I used it yesterday and here's what I have on the about page :
Version: 2.3603
Build Hash: 95def9c
Compile Date: 2015-11-16 18:45:30

This is a stable release version number, right ? Beta should be > 3.x
I also ran the updatebeta, but as I said, it downloads an arm version of Domoticz from sourceforge and fails to run on my x64.

I'm getting a bit confused :)
DaaNMaGeDDoN
Posts: 55
Joined: Thursday 23 October 2014 19:01
Target OS: Linux
Domoticz version: beta
Location: Eindhoven, the Netherlands
Contact:

Re: Beta on Linux ?

Post by DaaNMaGeDDoN »

Thats the same one i'm running, the beta from last evening, see the output i copy-pasted in the post from yesterday? Same hash ;)
The master branch holds the beta, stables should be tagged in the releases, but currently only the last stable is there. Seems you are doing fine.
ben92
Posts: 57
Joined: Thursday 14 August 2014 17:41
Target OS: Linux
Domoticz version: beta
Location: France
Contact:

Re: Beta on Linux ?

Post by ben92 »

Its the beta version, its on Master, its good.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest