Reset webgui address
If you have configured a fixed IP as address and your PI has changed the IP due to a network change, the TerrariumPI software will not load the web gui. The system is still running, but you are unable to access the webgui.
An error could look like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2023-11-01 10:39:59,000 - INFO - terrariumWebserver - Running webserver at 192.168.1.2:8090
Traceback (most recent call last):
File "terrariumPI.py", line 16, in <module>
terrariumEngine = terrariumEngine(__version__)
File "/home/pi/TerrariumPI/terrariumEngine.py", line 175, in __init__
self.webserver.start()
File "/home/pi/TerrariumPI/terrariumWebserver.py", line 306, in start
quiet=True)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/bottle.py", line 767, in run
run(self, **kwargs)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/bottle.py", line 3175, in run
server.run(app)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/bottle_websocket/server.py", line 17, in run
server.serve_forever()
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/baseserver.py", line 398, in serve_forever
self.start()
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/baseserver.py", line 336, in start
self.init_socket()
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/pywsgi.py", line 1545, in init_socket
StreamServer.init_socket(self)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/server.py", line 180, in init_socket
self.socket = self.get_listener(self.address, self.backlog, self.family)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/server.py", line 192, in get_listener
return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/server.py", line 288, in _tcp_listener
sock.bind(address)
File "/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/gevent/_socketcommon.py", line 563, in bind
return self._sock.bind(address)
OSError: [Errno 99] Cannot assign requested address: ('192.168.1.2', 8090)
The solution for this is to reset the IP address that was entered. Here are the steps to fix it.
- Stop TerrariumPI:
sudo service terrariumpi stop
- Enter the TerrariumPI folder:
cd /home/pi/TerrariumPI/
- Open the database with sqlite:
sqlite3 data/terrariumpi.db
- Run the following query statement:
DELETE FROM Setting WHERE id = 'host';
- Run the following query statement:
DELETE FROM Setting WHERE id = 'port';
- Exit the database by pressing
CTRL+d
- Start TerrariumPI:
sudo service terrariumpi start
The steps 3 - 6 are shown below.
1
2
3
4
5
6
sqlite3 data/terrariumpi.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite> DELETE FROM Setting WHERE id = 'host';
sqlite> DELETE FROM Setting WHERE id = 'port';
sqlite>
When TerrariumPI is started up, you should be able to access the web gui again on the new IP of the Raspberry PI
This post is licensed under CC BY 4.0 by the author.