Page 2 of 2

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Tuesday 05 January 2021 15:19
by erem
@megamarco83

you wrote
EDIT:
a bit of topic: i use windows system daily and on same PC i installed Debian. Inside debian i have domoticz test
Every time i have to switch off windows than run debian to see domoticz test, otherwise it is offline.
there is a way to workaround this?
visualize debian is possible? how?
or other solution?
thanks

why don't you run domoticz test in a virtual linux debian machine (VMWare/Virtualbox) on your windows machine. that works for me.

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Tuesday 05 January 2021 17:48
by megamarco83
erem wrote: Tuesday 05 January 2021 15:19 @megamarco83

you wrote
EDIT:
a bit of topic: i use windows system daily and on same PC i installed Debian. Inside debian i have domoticz test
Every time i have to switch off windows than run debian to see domoticz test, otherwise it is offline.
there is a way to workaround this?
visualize debian is possible? how?
or other solution?
thanks

why don't you run domoticz test in a virtual linux debian machine (VMWare/Virtualbox) on your windows machine. that works for me.
thanks i have a look at virtualbox but not succeed on NUC to emulate debian, but will try to understand better how it works.
thanks for your suggestion.

is it possible to compile on a different system, like debian installed on NUC and make the build compatible with raspberry pi3 ?
thanks

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Tuesday 05 January 2021 19:05
by kiddigital
Look at the Wiki and search Build and Vagrant for more info on building on a virtual machine.

You could make a virtual Debian buster 32-bit and compile there. I would image that the binary could work on the Pi (as RaspOS = debian buster 32-bit based)

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Tuesday 05 January 2021 22:16
by kiddigital
kiddigital wrote:...

You could make a virtual Debian buster 32-bit and compile there. I would image that the binary could work on the Pi (as RaspOS = debian buster 32-bit based)
I have to correct myself; you can NOT copy the binary 1:1 as you build for a different architecture (x86) and not for the Pi (ARMv6-7).

You have to configure the compiler to cross-compile for the correct architecture first.

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Wednesday 06 January 2021 14:54
by erem
The reason i use a virtual machine is that it is way faster than the pi in compiling/debugging.
once i have the result i am looking for, i tar up the source tree and move it to the pi for a final compile.
for large compiles i do need to extend the swap file, but that is easy.

i found that setting up for cross-compiling on the vm was more trouble than i could handle :oops:

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Wednesday 06 January 2021 15:24
by megamarco83
erem wrote: Wednesday 06 January 2021 14:54
once i have the result i am looking for, i tar up the source tree and move it to the pi for a final compile.
can you please explain in detail what steps of compiling you do in virtual machine and what step you use to finish the compile on RPI ?
thanks

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Thursday 07 January 2021 20:17
by Number8
can you please explain in detail what steps of compiling you do in virtual machine
As for compiling with Vagrant/VirtualBox you may have a look here: viewtopic.php?f=47&t=35105
After doing that I was able to install domoticz on the same VM on a dedicated account. Everything is running smoothly. I will try now to get hands on cross compiling now. A bit challenging I guess

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Thursday 07 January 2021 20:47
by megamarco83
hi, thanks for reply, i'm a bit confused about your post.
what i thought to understood from @erem was:
he tar up the source tree and move it to the pi for a final compile
so i thought that he start to compile on a virtual machine and after that at certain step he compress the compiled source, move it to RPI and then "recompile" on RPI (guess that this time RPI will compile faster because major of the job was done by the virtual machine)

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Friday 08 January 2021 8:11
by Number8
Indeed, I thought you would be interested to know how to compile in a VM. Cross compile: I found this article that I haven't experienced yethttps://solarianprogrammer.com/2018/05/ ... pberry-pi/

Re: Build Domoticz from source on Raspberry and other Linux variants

Posted: Friday 08 January 2021 11:30
by erem
@megamarco83

i was talking about general development, not specifically compiling domoticz, as i still do the compile at the pi.
but when i develop, eg in lazarus/delphi, c/c++ or python i develop and test on the VM.
then i tar up the SOURCE and do the final compile on the pi.

to enlarge your swap file
sudo dphys-swapfile swapoff
As root, edit the file /etc/dphys-swapfile and modify the variable CONF_SWAPSIZE: CONF_SWAPSIZE=4096
sudo dphys-swapfile swapon

hope this helps