Change/Add Port the Heater Meter is listening on....


 

RalphTrimble

TVWBB Diamond Member
I decided to make this post because recently Bryan shared with us how to make the HM listen to a port other than Port 80, which may be locked down on some routers.

It's rather simple to do, the code to get it done is:
Code:
# To add port 8080
uci add_list lucid.http.address=8080
uci commit lucid
reboot

# To remove port 8080
uci del_list lucid.http.address=8080
uci commit lucid
reboot

So that code is to add/remove port 8080, you can substitute whatever port you decide to use. The HM will listen to Port 80 AND the port you add unless you use the second command to remove Port 80 (not necessary)

The easiest way to execute this command is to go to CONFIG/SYSTEM/STARTUP, and in the LOCAL STARTUP window add in the code.

Code:
uci add_list lucid.http.address=8080
uci commit lucid

I put in the code WITHOUT the reboot line (because you do not want to use startup code that will REBOOT the HM and cause a reboot loop), then hit the commit button, then restart the HM. It will actually take TWO reboot before your HM starts listening to the new port because the code will be executed after the first reboot but will not take effect until the HM reboots again. After you have reboot twice the HM should respond to the new port, at this point you need to go back into CONFIG/SYSTEM/STARTUP and REMOVE those lines you added from the Local Startup section. Reason being, once this change has been committed it is permanent, so you don't want the HM to try and commit this change over and over at every boot...

I'm sure this info will come in handy from time to time and hope this thread can be found easier than the original location which was in a thread just titled "New Build".

EDIT: 5-27-17
Recently some of the HM software has changed and the above code no longer works for adding listening ports, the code needs to be changed slightly to work on the newer HM releases. The code for the new releases is below, the good news is you don't need to know which version you have, you can put both codes in and the appropriate one will take hold. (Make sure you remember to remove or comment out the entire code (using # before each line) after the port has been added)
Here is the code for both versions:
Code:
# To add port 8080

uci add_list lucid.http.address=8080
uci commit lucid
exit 0

uci add_list uhttpd.main.listen_http=0.0.0.0:8080
uci commit uhttpd
/etc/init.d/uhttpd restart
 
Last edited:
Ralph,

I'd like to change the https port from 443 to something else, can I do that using this command set?

Thanks!

Jeremy
 
Last edited:
Hmm, good question, I assume there may be a similar command to change/add the HTTPS port but I could only guess, Bryan would have to answer that question for sure...
 
Hi guys, forgot to post back here as a follow up to my post. Steve is correct, if you simply follow Ralph's instructions in the first post and add an S at the end of http, it works the same way.

That said, Ralph, I believe there is an error in your first code section. I believe it should be as follows:

Code:
# To add port 8080
uci add_list lucid.http.address=8080
uci commit lucid
reboot
 
If you're doing this via the web interface, do not put the reboot line in. If you do, your HeaterMeter will end up in a reboot loop.
 
If you're doing this via the web interface, do not put the reboot line in. If you do, your HeaterMeter will end up in a reboot loop.

Yes, that is why I did not include the REBOOT, cause a REBOOT command in the STARTUP section would put the HM into a reboot loop....
 
Just to confirm, you do not want to leave the "add_list" command in your "LOCAL STARTUP" after the first boot. It adds it every time it boots (doesn't check if it is already there) so you could potentially overflow something in the config file if you leave it in.
 
Would this be something that can be incorporated into the main web UI? Somewhere to enter in an alternate http and https port?
 
Just to confirm, you do not want to leave the "add_list" command in your "LOCAL STARTUP" after the first boot. It adds it every time it boots (doesn't check if it is already there) so you could potentially overflow something in the config file if you leave it in.

I'm not sure I understand this. When I edited my port settings I used Terminal and accessed the HM via SSH entering the code referenced in the first post. Is there something I need to go back and fix?

Thanks!
 
I looked to see if there was a module for it but there wasn't. I also looked for a generic "run this command" module and there was one but you have to save the command in a "library" then execute it as many times as you like, which is way more work.
 
I'm not sure I understand this. When I edited my port settings I used Terminal and accessed the HM via SSH entering the code referenced in the first post. Is there something I need to go back and fix?
No if you ran it from the command line you're good to go. I was referring to people who put it in their startup should definitely remove it after the first boot.
 
I'm trying to get this set, but I am far from a networking genius.

Can I set the HM to use any port? Reason being, my router (Netgear WNDR3700v1) won't let me forward port 80, and my music server is set to 8080. I tried 8081 for the HM, but it didn't work.

Thanks.
 
I think it should have worked, are you sure you followed ALL the instructions, including the two reboots and then removing the code?
 
Well, did a little more reading... tried "my dynamic site name":8081 and it worked like a charm.

So the answer to my question is yes, other ports work besides 80 and 8080, just make sure you include the port number when typing in the address.
 
Well, did a little more reading... tried "my dynamic site name":8081 and it worked like a charm.

So the answer to my question is yes, other ports work besides 80 and 8080, just make sure you include the port number when typing in the address.

Just to add here. My ISP also blocks inbound traffic on port 80. However, you do not need to change the port your HM is listening on to get around this. All you need to do is go into your router settings and setup a single port forwarding rule.

I have setup a dynamic DNS hostname called livebbq.duckdns.org to point to my IP address assigned by my ISP to me. I then went into my router and setup a fort forward saying to foward any inbound traffic on port 1024 to my internal ip on port 80.

Bottom line is you do not need to change the default port that the HM is listening on.

Edit: If you do not see single port forwarding within your router settings, you can update the firmware on your router. There maybe a software update for it.
 
Steve, some routers do not allow you to forward port "A" to port "B", they will only allow you to forward to the same port. My router is running Tomato firmware which allows me to do exactly as you suggest, but I have mentioned this to others who have reported their router wont allow this. In that case the only option is to change/add the desired destination port on your HM...
 
Hi--new member, joined for after purchasing a Heatermeter.

I apologize for resurrecting an old thread; however, for some reason the instructions in the first post did not work.

I was abel to change my ports by using Winscp (SSH) and editing the uttpd file in the etc/config folder.

The first portion under "config uttpd 'main' contains code for ports 80 and 443.
list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'



I was able to add my custom ports by updating to look something like this.

list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_http '0.0.0.0:XXXX'
list listen_http '[::]:XXXX'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
list listen_https '0.0.0.0:XXXX'
list listen_https '[::]:XXXX'

XXXX represents the respective new HTTP and HTTPS ports that I added.


If anyone has any insight as to what I might be doing wrong editing my Ports using the method recommended in this thread I'd appreciate it.
 

 

Back
Top