Connection Refused when browsing to sitemap

When I am browsing to http://localhost:8082/openhab.app?sitemap=demo
I get the following error (even after clearing my complete history cache and cookies):
Could not connect: Connection Refused.

ls -l shows -rwxrwxrwx root root for demo.sitemap file in the sitemaps folder.

Any help is really appreciated.

Thanks,
Mona Jalal

Did you change the default port to 8082?

If not you have to call in your browser port 8080:

http://localhost:8080/openhab.app?sitemap=demo

So when I do netstat -tulpn | grep 8082 nothing shows but I receive this error:
FAILED SelecyChannelConnector@0.0.0.0:8082:java.net.BindException: Address Already in use.

I have used 8082 anywhere in the whole openhab folder that was using 8080.
Any idea how could this be fixed?

Also “sudo lsof -i :8080” shows the following:

pi@raspberrypi:~ $ sudo lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 756 openhab 128u IPv6 12383 0t0 TCP *:http-alt (LISTEN)

While:
pi@raspberrypi:~ $ sudo lsof -i :8082
pi@raspberrypi:~ $

I am a little confused as I want to run the openHAB on port 8082 rather than port 8080:

I have changed the 8080 to 8082 in the following files. Please let me know if that is wrong?
pi@raspberrypi:/opt/openhab $ grep -irn 8082 *
configurations/openhab_default.cfg:10:myopenhab:localPort=8082
configurations/sitemaps/demo.sitemap:63: Image url=“http://localhost:8082/images/splash-ipad-h.png” label=“openHAB” {
configurations/openhab.cfg:10:myopenhab:localPort=8082
hs_err_pid850.log:210: 0x64cab800 JavaThread “qtp22705751-37 Acceptor1 SelectChannelConnector@0.0.0.0:8082” [_thread_in_native, id=891, stack(0x63080000,0x630d0000)]
hs_err_pid850.log:212: 0x64ca8c00 JavaThread “qtp22705751-35 Acceptor0 SelectChannelConnector@0.0.0.0:8082” [_thread_blocked, id=889, stack(0x63120000,0x63170000)]
hs_err_pid850.log:899:jvm_args: -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djetty.port=8082 -Djetty.port.ssl=8443 -Djetty.home=. -Dlogback.configurationFile=configurations/logback.xml -Dfelix.fileinstall.dir=addons -Dfelix.fileinstall.filter=.*.jar -Djava.library.path=lib -Djava.security.auth.login.config=./etc/login.conf -Dorg.quartz.properties=./etc/quartz.properties -Dequinox.ds.block_timeout=240000 -Dequinox.scr.waitTimeOnBlock=60000 -Dfelix.fileinstall.active.level=4 -Djava.awt.headless=true
logs/openhab.log:57:2016-03-21 00:00:02.501 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:2666:2016-03-21 04:00:02.768 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:5288:2016-03-21 08:00:02.530 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:7893:2016-03-21 12:00:02.422 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:9577:2016-03-21 14:37:10.712 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:9957:2016-03-21 15:12:42.574 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:11910:2016-03-21 18:12:32.480 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:13106:2016-03-21 20:00:02.255 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:14823:2016-03-21 22:38:22.039 [WARN ] [.u.component.AbstractLifeCycle] - FAILED SelectChannelConnector@0.0.0.0:8082: java.net.BindException: Address already in use
logs/openhab.log:17638:2016-03-21 23:31:24.496 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
logs/openhab.log:19789:2016-03-22 00:00:03.276 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 9519133a-991a-49e3-bd0c-829cc285444d, local base URL = http://localhost:8082)
Binary file server/configuration/org.eclipse.osgi/bundles/94/data/store/org.openhab.myopenhab.pid.1 matches
Binary file server/configuration/org.eclipse.osgi/bundles/94/data/store/org.openhab.myopenhab.pid.2 matches
server/eclipse.ini:6:-Dorg.osgi.service.http.port=8082
start_debug.sh:9:HTTP_PORT=8082
start.sh:9:HTTP_PORT=8082

To change the standard port oh is listening to you just need to edit the file

/etc/default/openhab

Change line 10 from
HTTP_PORT=8080 to the port you want to use.
Further information can be found here:

That file isn’t read at all, you have to copy it and rename to openhab.cfg and then put your config to it.

I suggest reading the wiki how to configure openhab:

pi@raspberrypi:/opt/openhab/etc $ ls
db4o jetty.xml keystore login.conf mapdb quartz.properties README rrd4j webdefault.xml

I don’t have my openhab.cfg there. It exists in
pi@raspberrypi:/opt/openhab/configurations $ ls
install items logback_debug.xml logback.xml openhab.cfg openhab_default.cfg persistence rules scripts sitemaps transform users.cfg

and I have changed the following in openhab.cfg, is it correct or how should I modify it?
myopenhab:localPort=8082

Okay, you did a manual install instead of an apt-get install. You need to read the link I gave you and perform the steps for the manual install:

Change the file /etc/default/openhab to HTTP_PORT=8082 (It’s the same procedure for manual and apt-get install). You don’t edit the port in your openhab.cfg!

Hi sihui,
You need a web browser available on the machine that runs openHAB in order to use this option.
I installed OpenHAB on my Raspberry Pi. there is no GUI not web browser available after installation is completed - only shell prompt.
Can you tell me how I can have web browser available on the Pi to be able to access the link that you provided above?
Thanks,
Amit.

which option?

You don’t need a web browser on your rPi.

You wrote the address:

or when using port 8080 it would be
http://localhost:8080/openhab.app?sitemap=demo

So the link you mentioned goes using the address of the self - due to localhost. meaning in order to get there you have to have a browser.

I ask this because I try to access my openHAB management web pages from a different computer in my network and can’t, so I thought that maybe there is a way to access it from the Pi itself.

See also my other post:

Ok… (you are correct in the logic)
Let’s leave this thread and use your new one. The info in here is from openHAB1 and it’s old.