• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
piScheduler -- A pilight extension for the daily switch plan
I reinstalled. Errors starting the service. Rebooted the pi and the service start errors were gone.
Code:
pi@raspberrypi:~ $ sudo service piSchedule status
● piSchedule.service - LSB: Start|Stop service for piSchedule
   Loaded: loaded (/etc/init.d/piSchedule)
   Active: active (exited) since Wed 2016-05-18 21:42:23 CEST; 1min 19s ago
  Process: 426 ExecStart=/etc/init.d/piSchedule start (code=exited, status=0/SUCCESS)

May 18 21:42:23 raspberrypi piSchedule[426]: status           : 0
May 18 21:42:23 raspberrypi piSchedule[426]: sunrise          : 2016-05-18 0...1
May 18 21:42:23 raspberrypi piSchedule[426]: sunset           : 2016-05-18 2...1
May 18 21:42:23 raspberrypi piSchedule[426]: switchTime       : 0
May 18 21:42:23 raspberrypi piSchedule[426]: version          : 0.7.5
May 18 21:42:23 raspberrypi piSchedule[426]: weekSchedule     : {}
May 18 21:42:23 raspberrypi piSchedule[426]: ** piSchedule  {server}:{port} ...<
May 18 21:42:23 raspberrypi piSchedule[426]: ** piSchedule.prefs  status:0
May 18 21:42:23 raspberrypi systemd[1]: Started LSB: Start|Stop service for ....
May 18 21:42:23 raspberrypi piSchedule[426]: /home/pi/piSchedule75/piSchedul....
Hint: Some lines were ellipsized, use -l to show in full.

Trying to start the gui:

The website at http://192.168.1.251:5005/ seems to be unavailable. The precise error was:
Could not connect: Connection refused

This is my conf file contents:
Code:
{
"piScheduleHome": "/home/pi/piSchedule75",
"pilightVersion": "7.0",
"locale": "EN",
"pilightPort": 5001,
"switchTime": 0,
"news": "dl.dropboxusercontent.com/u/35444930/piSchedule7/news75.txt",
"port": 5005,
"sunrise": "2016-05-18 05:42:21",
"piScheduleDoc": "piSchedule7",
"iniFile": "newDaySchedule.ini",
"version": "0.7.5",
"location": "Eersel",
"latitude": "51.3575",
"pilightExpected": "7.0",
"status": 0,
"newsDate": "",
"geo": "ip",
"longitude": "5.3181",
"server": "192.168.1.251",
"sunset": "2016-05-18 21:28:01",
"weekSchedule": {},
"piDBox": "dl.dropboxusercontent.com/u/35444930/",
"ssdp": "no pilight ssdp connections found"
}

Don't know what to do next.
 
Reply
Sorry, didn't got a mail notification for your new posting ..

From what you post -- please use formatting for
Code:
...
not <code> -- all seems to be OK.

Your piSchedule.json file has
Code:
"ssdp": "no pilight ssdp connections found"
but needs to have "OK".
Did you started pilight?
 
Reply
Yes, pilight is running and working on http://192.168.1.251:5001/. I can switch on/off the lights etc. through the pilight gui
 
Reply
This is what I see in the pilight log:

Code:
[May 20 06:49:35:106122] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51138
[May 20 06:49:35:120445] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51139
[May 20 06:49:35:133297] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51140
[May 20 06:49:35:147277] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51141
[May 20 06:49:35:162453] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51142
[May 20 06:49:35:282476] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51143
[May 20 06:49:35:319603] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51143
[May 20 06:49:35:341538] pilight-daemon: INFO: client connected, ip 192.168.1.12, port 51143
[May 20 20:30:26:360295] pilight-daemon: INFO: removed stale pid_file /var/run/pilight.pid
[May 20 20:30:40:817534] pilight-daemon: INFO: version v7.0
[May 20 20:30:40:912377] pilight-daemon: INFO: no pilight daemon found, daemonizing
[May 20 20:30:40:913582] pilight-daemon: INFO: daemon listening to port: 5000
[ May 20 20:30:41:32873] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 50429
[ May 20 20:30:41:50780] pilight-daemon: NOTICE: php support disabled due to missing php-cgi executable
[May 20 20:30:41:163560] pilight-daemon: INFO: new client, ip: 192.168.1.251, port: 53550
[May 20 20:30:41:193188] pilight-daemon: INFO: new client, ip: 192.168.1.251, port: 53551
[ May 20 20:30:42:62677] pilight-daemon: INFO: datetime #1 5.286956:51.421392 seems to be in timezone: Europe/Berlin
 
Reply
SOLVED!

The current APSchedule module which is used with piSchedule causes an error.
As of today the current piSchedule installation needs an additional step:
Code:
pi@raspberrypi2:~ $ sudo pip install -U --user setuptools
After that please restart the raspberry with
Code:
sudo shutdown -r 0

See also:
https://github.com/agronholm/apscheduler/issues/145
 
Reply
Hello, I was trying piScheduler 7.5 as 7.0 works the web but fails to control pilight devices..., and piScheduler 7.5 fails with:


Code:
pi@rpi1:~/piSchedule75 $ sudo ./piSchedule.py


** piSchedule prefs **


    geo              : ip


    iniFile          : newDaySchedule.ini


    latitude         : 40.4165


    locale           : EN


    location         : Madrid


    longitude        : -3.7026


    news             : dl.dropboxusercontent.com/u/35444930/piSchedule7/news75.txt


    newsDate         :


    piDBox           : dl.dropboxusercontent.com/u/35444930/


    piScheduleDoc    : piSchedule7


    piScheduleHome   : /home/pi/piSchedule75


    pilightExpected  : 7.0


    pilightPort      : 5001


    pilightVersion   : 7.0


    port             : 5005


    server           : 192.168.1.7


    ssdp             : OK


    status           : 0


    sunrise          : 2016-06-22 06:45:09


    sunset           : 2016-06-22 21:48:41


    switchTime       : 0


    version          : 0.7.5


    weekSchedule     : {}





** piSchedule  {server}:{port} 192.168.1.7:5005 >>OK<<


** piSchedule.prefs  status:0


renew Schedule  next Switch Time   2016-06-23 00:00:00


Bottle v0.12.9 server starting up (using WSGIRefServer())...


Listening on http://192.168.1.7:5005/


Hit Ctrl-C to quit.





Exception in thread APScheduler (most likely raised during interpreter shutdown):


Traceback (most recent call last):


 File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner


 File "/usr/lib/python2.7/threading.py", line 763, in run


 File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/blocking.py", line 30, in _main_loop


 File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 918, in _process_jobs


<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'now'


pi@rpi1:~/piSchedule75 $
 
Reply
Hello.

I finally has the piSchedule 7.5 running (web) but I´m not able to control pilight device.

I have read a lot of documentation and forums and I have to complain about API json documentation and versions (pilight, pilight-development and pilight-nighty).
I have pilight v.7 from standar raspbian repository


Code:
sudo pilight-daemon -V


pilight-daemon version v7.0-140-ga2719cf


and I dont want to use another unstable version, due to I want maximum stability.

I suppose piSchedule is working with pilight v.7 stable version. I can see logs controlling devices, an in piSystem.log I can see this:


Code:
#3374 09:36:20 - ESC[1;35mpiSchedule fire_pilight #169ESC[0m url http://192.168.1.7:5001/send?{"action":"control","code"


:{"device":"sw1_filt","state":"on"}}


It is supposed that piSchedule is using web api, but if I see doc wiki api
https://wiki.pilight.org/doku.php/api
it says that
Quote:Webserver
This feature is part of the development version of pilight

The webserver has two special pages.

The config page will present the latest config json object.


The send page can be used to control devices. To use this function call the send page with a send object url encoded like this:


Code:
send?%7B%0A%09%22message%22%3A%20%22send%22%2C%0A%09%22code%22%3A%20%7B%0A%09%09%22location%22%3A%20%22living%22%2C%0A%09%09%22device%22%3A%20%22mainlight%22%2C%0A%09%09%22state%22%3A%20%22on%22%2C%0A%09%09%22values%22%3A%20%7B%0A%09%09%09%22dimlevel%22%3A%20%2210%22%0A%09%09%7D%0A%09%7D%0A%7D


I have tried to directly commandline "curl" with this...


Code:
curl -v -G http://192.168.1.7:5001/send --data-urlencode "{\"action\":\"control\",\"code\":{\"device\":\"sw1_filt\",\"state\":\"on\"}}"

but I allways receive
{"message":"failed"} response

I have tried to change protocol API, as seem that has changed a lot and is changing, but with no success.

Another thing is that the device I want to switch is a GPIO, but I tried with a generic, call by "id", etc. and allways get {"message":"failed"}.

So I am suspecting that webcontrol device is not possible on stable pilight version


Can anybody help me.
Im really desesperated with this.

Thanks
 
Reply
Sorry, been away for a while.

I installed the tools and restarted the pi as instructed. However, piSchedule gui doesn't do anything anymore and service status is shown below. Still looks the same.

Oops! It was not possible to show this website
The website at http://192.168.1.251:5005/home seems to be unavailable. The precise error was:
Could not connect: Connection refused
It could be temporarily switched off or moved to a new address. Don't forget to check that your internet connection is working correctly.


Jul 03 20:39:01 raspberrypi piSchedule[513]: switchTime       : 0
Jul 03 20:39:01 raspberrypi piSchedule[513]: version          : 0.7.5
Jul 03 20:39:01 raspberrypi piSchedule[513]: weekSchedule     : {}
Jul 03 20:39:01 raspberrypi piSchedule[513]: ** piSchedule  {server}:{port} 192.168.1.251 >>no pilight ssdp connections found<<
Jul 03 20:39:01 raspberrypi piSchedule[513]: ** piSchedule.prefs  status:2
Jul 03 20:39:01 raspberrypi piSchedule[513]: ** NO 'ssdp' connection!
Jul 03 20:39:00 raspberrypi systemd[1]: piSchedule.service: control process exited, code=exited status=1
Jul 03 20:39:00 raspberrypi systemd[1]: Failed to start LSB: Start|Stop service for piSchedule.
Jul 03 20:39:00 raspberrypi systemd[1]: Unit piSchedule.service entered failed state.
Jul 03 20:39:01 raspberrypi piSchedule[513]: no pilight ssdp connections found
 
Reply
It clearly says:

Code:
Jul 03 20:39:01 raspberrypi piSchedule[513]: ** piSchedule
 {server}:{port} 192.168.1.251 >>no pilight ssdp connections
found<<

Jul 03 20:39:01 raspberrypi piSchedule[513]: ** piSchedule.prefs  status:2

Jul 03 20:39:01 raspberrypi piSchedule[513]: ** NO 'ssdp' connection!

As long as you don't get connection to pilight, you'll be not able to work with piSchedule
 
Reply
Please, any help with my problem
Im desesperate with this, and I dont know howto make actions work.

I have only a few days to put my project in production, and piScheduler dont work.

Thanks
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Does piSchedule work with pilight 8.1.1-nightly Peter S 0 1,889 06-29-2018, 07:57 PM
Last Post: Peter S
  pilight-console - an LCD / keypad interface for pilight frenchie71 3 1,706 11-21-2017, 11:15 PM
Last Post: curlymo
  Connect pilight to your hue bridge hannemann 3 3,156 01-03-2017, 11:26 PM
Last Post: hannemann
Wink PHP class using pilight socket connection Dan 0 1,726 11-03-2016, 11:41 AM
Last Post: Dan
  Controlling a RGB Led Strip over pilight mightyuhu 2 2,764 08-06-2016, 09:10 PM
Last Post: JohannK
  HomeBridge with pilight on raspbian Jurre 10 13,340 04-06-2016, 07:45 AM
Last Post: tomtom
  pilight voice commands kniazio 11 6,856 01-29-2016, 07:51 PM
Last Post: sral
  Python Ping pilight detect mobilephone Cryptomaster 0 2,387 01-10-2016, 04:17 PM
Last Post: Cryptomaster
  pilight config editor ktams 16 9,254 01-06-2016, 02:42 PM
Last Post: ktams
  command processing between pilight and openhab royhofman1989 3 3,141 07-13-2015, 11:26 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)