1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

How can I set my R2 to a static IP?

Discussion in 'General Questions' started by Leslie, Jul 31, 2017.

  1. Leslie

    Leslie New Member

    Joined:
    Jul 16, 2017
    Messages:
    3
    Likes Received:
    0
    Hi all,

    I'm a good week into printing with my R2. So far I'm quite impressed though quite a newb to the world of 3D printing! Curious, how do I set my R2 to a static IP? I've noticed when I shut everything down in the evening the printer will get it's IP from the DHCP server and of course it's never the same.

    Thanks, in advance,
    Leslie
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    The easiest way is to tell your DHCP server to issue a static lease to your printer. Usually you can look at your router's web configuration and look in the connected devices list. There you will see the MAC address of the Octopi instance You should be able to force that MAC address to always lease the same address. Some routers will even allow you to specify lease times longer than 24 hours. I do that with my media server and printers, issue static leases for 365 days.
     
  3. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Honestly, I don't even know my printer's IP address at all. I just refer to it by its name. In my case, the label on the back of the printer indicates "charming-pascal" so I bring up OctoPrint with:

    http://charming-pascal.local

    Since the printer advertises itself to the local network once per minute in two different protocols, you're bound to see it from either OS X or Windows/Linux kinds of computers.
     
  4. Leslie

    Leslie New Member

    Joined:
    Jul 16, 2017
    Messages:
    3
    Likes Received:
    0
    Thanks! I setup my router and I'll see if it "sticks" :) I'm looking to access the printer from work using a dynamic dns server. We will see!

    thanks again
     
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @OutsourcedGuru the problem for Windows users is that Bonjour for Windows is no longer actively being developed by Apple (latest link to source is seven years old). That is how Windows will see it by name. Also naming it doesn't help if you are trying to put it on the internet outside of your network. Linux and OSX do not have the same issues. Windows does not natively support Bonjour. If you want to, you can either install the old version of Bonjour Print Services for Windows or iTunes on your Windows PC (iTunes automatically installs Bonjour for Windows). Some routers do have name services enabled and you can specify a host name at the router either by MAC address or IP address. That would work without installing Bonjour on a PC.

    @Leslie since the security built into OctoPrint is very weak I would make sure you look at other ways to secure your server, or nearly anyone that figures out the address can exploit it. If you are simply making it directly available via DynDNS that could be a security risk. If you are using a VPN to access your home network then accessing the printer through the VPN tunnel then you need to make sure your VPN is secured appropriately.
     
    mark tomlinson likes this.
  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Frankly the easiest way I have found is to use Chrome Remote Desktop.
    Share the machine attached to the printer and access it from anywhere else using ... Chrome.
    It is secure. The more generic is as @WheresWaldo suggeted -- use a VPN.
     
  7. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
    You don't get full Octoprint functionality, but the Telegram plugin is pretty secure. Tested it the other week with @Geof to see if random internet people could look at it and you have to give specific permission to each individual person when setting it up.

    If all you want is status updates and the ability to remotely initiate prints/upload Gcode files, it's great.

    Like I said, though, you don't get full Octoprint functionality. You can get stills from the camera, but not watch it stream (yet).

    https://github.com/fabianonline/OctoPrint-Telegram
     
    mark tomlinson likes this.
  8. Kilrah

    Kilrah Well-Known Member

    Joined:
    Apr 18, 2017
    Messages:
    498
    Likes Received:
    332
    I VPN into my network then reach the printer. But a fixed IP is still welcome good since Bonjour seems not to be able to cross the VPN boundary, so as mentioned I used my router's address reservation feature so that its DHCP server always hands the same IP to a given MAC address.

    I find that cleaner than setting a static IP on the device anyway.
     
  9. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    In walking the code for OctoPrint, it looks like it broadcasts itself both on Bonjour and using a second mechanism of some sort. And it also uses Samba behind-the-scenes from what I'm seeing. Review the /etc/samba/smb.conf file to look at what's going on there. I have spun up solutions using Raspberry's on Windows-based computers and Samba is the magic ingredient which is capable of broadcasting its NETBIOS name, if that's configured.

    In the GLOBAL section:
    Code:
    netbios name = <your_hostname>
    nameresolve order = bcast
     
    #9 OutsourcedGuru, Aug 1, 2017
    Last edited: Aug 1, 2017
  10. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Netbios is a non-routable protocol so if you are trying to access over your internet connection you will not be able to use the netbios name.
     
    Kilrah likes this.
  11. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    I'd say that the majority of the consumer market for 3D printers would be printing within the confines of their own home or similar.

    Would I expose my printer to the Internet? Probably not. There are a number of IoT-targeted scripts running now, the default password on "Pi" is in use and Guy did some interesting hacks in OctoPi which promote this user perhaps a bit too much.
     
  12. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
    Would either of you guys be interested in trying that Telegram plugin out and seeing how secure it is vs. the functionality trade-off?
     
  13. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @OutsourcedGuru but the OP says they wanted to use it with DynDNS, so it would be outside the network. No need or use for DynDNS within a personal network.

    Please read the opening post and see that it isn't simply about answering a question, none of your posts are incorrect, but they don't directly relate to the OP's question.
     
    mark tomlinson and Kilrah like this.
  14. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @daniel871 Does the creator of Telegram list what functionality works and what doesn't using his/her plugin?
     
  15. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
     
  16. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
    For reference, here are some screenshots where I used it to upload a file and print a test part.

    Telegram1.JPG Telegram2.JPG
     
    mark tomlinson likes this.
  17. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Hmm Telegram seems to be like a BBS for your printer, not realtime but close enough for many people if all they want is occasional status updates.

    I'm pretty sure there are other addons that can message you, I see this lets you control via messaging too.

    But why not use something like LaniLabs, since that is already included with RoboOS. I haven't looked closely at it so I don't know if there is a free option, but it allows remote control outside of your private network. I can't see Lani being viable at $99 per year, so ignore the above sentence. You would really need to do a lot of internet print management to make it worthwhile.

    AstroPrint Cloud supports a free account, don't know just how limited it is and if it can be used with OctoPrint. Requires replacing OctoPrint with AStroPrint
     
    #17 WheresWaldo, Aug 2, 2017
    Last edited: Aug 2, 2017
  18. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
    It's pretty much exactly that.

    I've configured Octopi to do timelapses automatically and I can download/work with them when I'm at home, and this Telegram plugin allows me to periodically check the status of the printer while I'm between things at work and at least send a kill command if a part falls over.

    Or if something like this happens:

    Telegram3.JPG

    The part didn't fall over, but the base came loose from the bed momentarily and then somehow re-attached and continued printing.

    That particular failure was really weird and I haven't been able to re-create it, but I was able to see it while at work and stop it, so :mission accomplished:

    EDIT:

    There are probably other add-ons and methods to get to a similar place, this one was just relatively easy for me to set up and wasn't any particular hassle in said setting up.
     
    #18 daniel871, Aug 2, 2017
    Last edited: Aug 2, 2017
    mark tomlinson likes this.
  19. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Okay, I see the follow-up post mentioning "from work" and with a DDNS server setup (rather than the opening post of course). Rather than mentioning how software/hardware VPNs work, I'll just pass on this one.
     
  20. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Still easiest way :) If you haven't tied it, you should. Now... is that exactly the same? No, but it works for what I want to do with the printers.
     

Share This Page