OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) sprinklers_pi – An alternative sprinkler control program Re: Re: sprinklers_pi – An alternative sprinkler control program

#24930

Samer
Keymaster

First of all, awesome work! I am trying to get started with this but unfortunately can’t seem to. Here is what I have done and where I am:

I don’t have a Raspberry Pi so I am just compiling on my MBP. I commented out all the digitWrite calls, OUTPUT and pushpin call. I also commented the reboot call. I removed the -lwiringPi in the Makefile, as well. After all of this it compiled successfully:

$ make
Building target: sprinklers_pi
g++ -o "sprinklers_pi" build/Event.o build/Logging.o build/Weather.o build/core.o build/port.o build/settings.o build/sprinklers_pi.o build/sysreset.o build/web.o -lsqlite3
Finished building target: sprinklers_pi

After that I ran the program and it seems to run fine:

$ ./sprinklers_pi
2013/07/25 19:19:29 Starting v1.0.1..
2013/07/25 19:19:29 Turning Off All Zones
2013/07/25 19:19:29 Listening on Port 8080
2013/07/25 19:19:29 Turning Off All Zones
2013/07/25 19:19:32 Got a client
2013/07/25 19:19:32 Page:
2013/07/25 19:19:32 Serving Page: /web/index.htm
2013/07/25 19:19:32 Got a client
2013/07/25 19:19:32 Page:favicon.ico
2013/07/25 19:19:32 Serving Page: /web/favicon.ico

As you can see, it even sees connections coming in! However, all I get in the browser is: “NOT FOUND”

Any advice? I tried changing permissions and also running as sudo.

Update: I understand this environment is very unique and I have VERY little experience with C and portability. With that said, I am going to try this on Debian instead since that is a closer environment it might work better.

Update 2: Same thing with my Debian 7 box.

Update 3: Figured out it is checking absolute path so I moved /web there and it works now.

Update 4: Haha we went with the same Day/Interval switch 😛

Update 5: In case anyone cares I changed web.cpp so the prefix is web/ not /web/ and changed the appropriate memcpy length.