First of all your instructions are great I’m a total newbie but have been following along well. I’m stuck at putting a static ip address to my raspberry pie your internet network is different than my att network i went to their website support to assigning an static ip address to a device but can’t understand it here’s a link maybe you can have better luck than me i have the Motorola gateway https://www.att.com/esupport/article.html#!/smb-internet/KM1181996
Every time you remove power from your Pi someone else such as an Ipad can grap this local network IP unless you reserve it solely for your Pi.
IP addressing can be reserved against the unique Pi MAC address.
You need to log into your wireless router and determine your Raspberry Pi IP and MAC address. Routers are different so Google your model and determine its login credentials.
Now find the IP and MAC address for your Pi.
Look for “DHCP reservation” (possibly in advanced menus)
Enter your Pi IP and its MAC into the router and save.
Att routers don’t have ip reservations i have the ip address and Mac but can’t find a place to input it. i put a link to the att router help site it has a different way of inputting
Att router says ip allocate is that the same thing?
Correct …Like a Ford vs a Chev except way more models.
With regards to wireless modems I find it incredible they even work across brands.
There should be some manufacturers documentation on the function of IP Allocate but I would try it out. Sounds like you found it.
Yes and no when i push allocate on it just gives me many address from. 192.168.1.64 to 192.168.1.240
Pretty weird click on the link please it’s setup different can’t figure it out
Take the hostname of your raspberry pi and add .local to the name. For example: If my pi’s hostname was “openhabianpi” then I could access my pi by typing openhabianpi.local
You should be able to select one IP from the range displayed and associate it to the MAC of the Raspberry PI. Doing this will require you to change any reference in Matt’s setup to the Openhabian IP which is now different.
To avoid setup changes turn off your Pi to free up the IP the Pi was using.
Reboot the router (to free up the IP) and then try again to see if the desired IP is in the list. If the Ip appears in the list select it with the Pi MAC.
Turn on the Pi and you should be http://pi address:8080
Dude that makes so much sense I’ll try that thank you finally a plan. I appreciate your help I’ll post results
Seems to be a bit of confusion here to what static and dhcp reserved addresses are. Let me help clear up some things.
Static addresses is where the client (your pi) basically says to the router; “Hello, this is my address and i don’t care what you say about it”. This is even true if the said address is in use. For instance if a computer already has that address.
DHCP reserved (IP allocated) addresses are basically; “Hey network, give me an address”. The routers DHCP server then looks up the MAC address of the PI, and if it matches a reservation, it hands out the same IP to the PI. Thus this reserves a spot for the PI on the network, without causing IP conflicts (where two clients have the same IP address)
Both theese setups have their own pros and cons, but i suggest going with static addresses. Both because its easier to set up, and you don’t have to depend on the router to do the job.
Recently there has been a bit of a change in how you set static IP addresses on Rasberry Pi. Now you have to edit the dhcpd.conf file instead of the interface file. This recent change has made a lot of older tutorials obselete, or atleast confusing to a beginner. You can read more about it here. https://raspberrypi.stackexchange.com/questions/39785/dhcpcd-vs-etc-network-interfaces#41187
As for setting a static IP address on your PI, i would suggest following this guide. http://www.circuitbasics.com/how-to-set-up-a-static-ip-on-the-raspberry-pi/ Most routers have a DNS (Dynamic Name Server) built in, so you don’t have to check the resolv.conf file. Just input your routers IP address, and you could add google’s official DNS IP. (18.104.22.168) Those two should be enough in the ‘domain_name_servers’ field.
If you need further assistance feel free to give a reply!
Thanks for you input and I will try this method. I agree that DHCP Reservation is not a static IP however in the past 5 years my ISP WAN IP (which is DHCP) has not changed and I can assign a local network IP against a MAC very fast and with Openhabian have no problems using it remotely.
If you can easily move the Ra Pi Openhabian server to different networks independent of the local router, I see huge benefits.
update: So I logged back in to Att router and went to networks then press IP ALLOCATION looked for openhabian and pressed allocate then it gave me bunch of addresses I chose the first one and pressed saved after that keep goin with tutorial and use that address you chose and IT WORKED!!! hopefully this helps someone else in the future. THANKS GUYS thanks opteria
Ok I ran into some more trouble… I got my servo motor working on mqtt when I give it a number it moves but when I try to make it work on openHAb nothing Im sure I wrote all commands right on the ssh or putty and the ip address is same as home network any ideas as to what im doing wrong?
This method to create a static IP works very well.
I simply added the following lines to /etc/dhcpcd.conf using my RaPi IP and gateway.
I am using ethernet only however wifi can be done too.
Very Slick indeed:star_struck:
static domain_name_servers=192.168.2.1 22.214.171.124 fd51:42f8:caae:d92e::1
I cant get open hab to control my blinds
How so? Do you have any logs or somehting that could help?
Refer to this link and insure your bindings are selected correctly.
Im thinking my openhab does not work and mqtt does is maybe because I need to upgrade mqtt but everytime i try i get this message
ITS WORKING NOW!! openhab works pretty awesome so i was messing up in matts set up
- The only thing we are going to change is the server or url to our broker so delete the line #.url=tcp://:1883 and replace it with broker.url=tcp://192.168.0.4:1883 but change the IP address to match your raspberry pi
I messed up there I left the #< on there and thats why it didnt work amazing right be sure to follow exactly like is written thanks everyone