beep-projects / SystaPi

Adding WiFi and a REST API to Paradigma SystaComfort units
GNU General Public License v3.0
16 stars 3 forks source link

Systemservice Script is executed before connections are established #13

Closed paulrigger closed 1 year ago

paulrigger commented 1 year ago

first of all thank you for the project it is awesome!!

1 issue i face: i have to start it manually because i get the following log when starting with the servie

Oct 02 21:09:11 systapi systemd[1]: Started Systa REST API Server. Oct 02 21:09:13 systapi java[685]: [RESTServer] Reading properties from file: /home/pi/SystaRESTServer/bin/SystaREST.properties Oct 02 21:09:13 systapi java[685]: [RESTServer] Interface wlan0 is not configured Oct 02 21:09:13 systapi java[685]: wlan0 and/or eth0 are not configured properly. Please check your configuration. I am exiting now! Oct 02 21:09:13 systapi java[685]: [RESTServer] Interface for Paradigma RESTAPI: null Oct 02 21:09:13 systapi java[685]: [RESTServer] Interface for connecting to Paradigma SystaComfort II: null Oct 02 21:09:13 systapi systemd[1]: SystaRESTServer.service: Succeeded. Oct 02 21:09:13 systapi systemd[1]: SystaRESTServer.service: Consumed 1.008s CPU time.

and since it exits with "Success" i figure that the the the "Restart=on-failure" does not execute. When i start it manually everything works fine.

beep-projects commented 1 year ago

Hey Paul, thanks for your feedback!

I ran into this issue a while ago and fixed it for the main branch, but I have not created a new release for it, because I thought that it rarely happens. Sorry for the inconvenience, but I am glad you figured out yourself how to work around it.

The problem was that there was a System.exit(0) in case of a failure in SystaRESTServer.java

Is my assumption correct, that you used the zip file of the release for your installation and not a clone of main?

paulrigger commented 1 year ago

Hello,

Yes i downloaded the zip via the installer scripts. I see that there you changed it. But i cannot finde the file on my pi to change it in SystaRESTServer/bin/de/freaklamarsch/systarest there are only *.class files. Where do i find the java file to change it in the code.

Cheers Paul

beep-projects commented 1 year ago

Hi Paul,

you have to make the changes in the src files in SystaRESTServer/src/de/freaklamarsch/systarest/SystaRESTServer.java After that you can call SystaRESTServer/build.sh to rebuild the server. I have also created a simple update script, that you could use to pull the latest version from main. But it is quite stupid and deletes existing folders. So if you made some changes to the config or some other files, you might lose them. Run this on the pi: wget https://github.com/beep-projects/SystaPi/raw/main/helpers/update.sh && chmod 755 update.sh && ./update.sh

Good luck! Beep