rszimm / sprinklers_pi

Sprinkling System Control Program for the Raspberry Pi
GNU General Public License v2.0
310 stars 100 forks source link

Remove hard dependency to WiringPi #153

Closed mciupak closed 5 years ago

mciupak commented 5 years ago

Hello,

currently WiringPi is mandatory for sprinklers_pi and cannot be built without it. Since there is an option to select output type as 'None' and use external script to control zones it could be built and run on other platforms (e.g. x86/amd64 docker container in my case, etc. ) where WiringPi is unavailable.

There could be added some define to disable linking of WiringPi library and usage of it in the code when this define is set.

Would you accept such PR if I would provide it?

Thanks, Marcin

nhorvath commented 5 years ago

I would, but FYI you can build and run the project on any x86_64 machine, just the gpio won't do anything. The demo site runs on a standard x86_64 ubuntu server.

mciupak commented 5 years ago

Great! I did not pay much attention to wiringPi and was no aware that it could be built for x86.

Closing.

nhorvath commented 5 years ago

One note about building on x86. When I do it I have to add -lcrypt and -lrt to my LIBS line in the makefile. LIBS := -lsqlite3 -lwiringPi -lcrypt -lrt

mciupak commented 5 years ago

Thanks, however I build for x86_64 and all works fine: https://hub.docker.com/r/mciupak/sprinklers_pi/builds

Marcin