-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port '3837' occupied by another process after a few hours of successful run of eversolar.pl #73
Comments
Just a small update. It seems that the script terminates, when I terminate the terminal I started it from. I'm therefore starting the script from inside the RPI2 now, without shutting it down. I will report back how this goes. Otherwise it might make sense to add functionality in the .ini file, for the script to start on boot, so there is no need to start it through the terminal? |
Update and closing of issue. It seems the issue was, that I should not run the script from the terminal on my mac, but directly from the RPI. So for everyone experiencing this issue. Open the RPI from a virtual machine, such as Microsoft Remote Desktop, open a terminal within the RPI UI, and run the script from here. Remember to kill the PID that occupies the port before you run the script. I also got some suggestions for fixing the issue from ChatGPT, that I will leave below, if you want to try that out. It seems that there is methods to still run the script from your computer terminal and ssh access, but I have not tested it, so please do this on your own risk. Directly copied from ChatGPT: To ensure your script continues to run in the background and doesn't terminate or encounter issues when the terminal is closed, you can use various methods to run it independently of your login session:
bash Run eversolar.pl in the background (& at the end of the command).
Install screen or tmux if not already installed: bash orsudo apt-get install tmux Start a new detached session: bash ortmux new -s eversolar Run your script: bash Detach from the session: To reattach:
Create a systemd service file (/etc/systemd/system/eversolar.service): ini [Unit] [Service] [Install] Enable and start the service: bash
By using one of these methods, you can ensure your script runs continuously in the background and maintains its functionality independently of your terminal session. This should resolve the issue of the script stopping or the port becoming occupied when you terminate the terminal. |
Hi,
I was succesful in installing the newest (legacy) OS for my RPI2, and install all the needed packages one by one, and getting it to work. I had some initial issues with the 3837 port being occupied, because I initiated the eversolar.pl script before I was completely done with editing the eversolar.ini file. I had to kill the process that was occupying the port. Everything was fine. The sensors also appeared in HA (although I get the same error as described in Issue #59 By LeighAS here: #59 (comment)
Where It cannot be used in the Energy tab).
The issue remaining here is, that it seems that I can provoke the "port 3837 occupied" error by checking the localhost:3837 from different browsers. So I tried running the script again after killing the processes occupying it, but without opening the server from localhost:3837, but only looking at the data through HA.
This seemed to work, but it appears, that after a few hours, I will get the same issue, where the port is occupied, thus not giving me any data. I tried to reset everthing 3 times during daylight hours today, but all with the same result.
ChatGPT has ideas on how to fix it ( but that is for now last resort), and I will also go through the script on @nagydavid repository to check if there is any differences there to the one on the main repository.
But some help from here would also be greatly appreciated. Maybe you had this too and know of a fix?
Below is the terminal output:
`YY@XXXXXX:
/eversolar-monitor $ cd/eversolar-monitor $ sudo kill -9 21418/eversolar-monitor/eversolar-monitor $ sudo lsof -i :3837sudo perl eversolar.pl
2024-05-05 19:57:38: Severity 1, Configfile is: eversolar.ini
Update old database version, or print 2 fail messages (part 1) :
DBD::SQLite::db do failed: duplicate column name: vpv2 at eversolar.pl line 882.
DBD::SQLite::db do failed: duplicate column name: ipv2 at eversolar.pl line 883.
Done updating old database version.
Update old daily database version, or print 2 fail messages (part 2) :
DBD::SQLite::db do failed: duplicate column name: pmax_today at eversolar.pl line 926.
DBD::SQLite::db do failed: duplicate column name: pmax_time at eversolar.pl line 927.
Done updating old daily database version.
bind to *:3837: Address already in use at eversolar.pl line 947.
child unresponsive for 5 seconds at /usr/share/perl5/HTTP/Server/Simple.pm line 261.
YY@XXXXXX:
sudo kill -9 [PID]
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
perl 21418 root 8u IPv4 96929 0t0 TCP *:3837 (LISTEN)
kill: failed to parse argument: '[PID]'
YY@XXXXXX:
YY@XXXXXX:~/eversolar-monitor $ cd ~/eversolar-monitor
sudo perl eversolar.pl
2024-05-05 19:58:20: Severity 1, Configfile is: eversolar.ini
Update old database version, or print 2 fail messages (part 1) :
DBD::SQLite::db do failed: duplicate column name: vpv2 at eversolar.pl line 882.
DBD::SQLite::db do failed: duplicate column name: ipv2 at eversolar.pl line 883.
Done updating old database version.
Update old daily database version, or print 2 fail messages (part 2) :
DBD::SQLite::db do failed: duplicate column name: pmax_today at eversolar.pl line 926.
DBD::SQLite::db do failed: duplicate column name: pmax_time at eversolar.pl line 927.
Done updating old daily database version.
SolarWebServer: You can connect to your server at http://localhost:3837/
2024-05-05 19:58:20: Severity 1, Connecting to the serial port
2024-05-05 19:58:38: Severity 1, done registering known inverters
2024-05-05 19:58:40: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ.
2024-05-05 19:58:42: Severity 1, Inverter acknowledged registration
2024-05-05 19:58:44: Severity 1, Connected to inverter: 1 2000E1.00 ZL 2000S ZEVERSolar BS20006ZZZZZZZ
2024-05-05 20:03:56: Severity 1, BS20006ZZZZZZZ lost contact with inverter, forgetting inverter
2024-05-05 20:04:52: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ .
2024-05-05 20:05:07: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ .
2024-05-05 20:05:09: Severity 1, Inverter acknowledged registration
2024-05-05 20:05:23: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ .
2024-05-05 20:12:02: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ.
2024-05-05 20:12:04: Severity 1, Inverter acknowledged registration
2024-05-05 20:12:06: Severity 1, Connected to inverter: 1 2000E1.00 ZL 2000S ZEVERSolar BS20006ZZZZZZZ
2024-05-05 20:16:24: Severity 1, BS20006ZZZZZZZ lost contact with inverter, forgetting inverter
2024-05-05 20:16:44: Severity 1, Cleaned received serial number: BS20006ZZZZZZZ .
2024-05-05 20:16:46: Severity 1, Inverter acknowledged registration
`
The text was updated successfully, but these errors were encountered: