Notifications
Clear all

Wired Network/Pesky IP Address Acquisition  

  RSS
AndrewTerry
(@andrewterry)
Trusted Member
Wired Network/Pesky IP Address Acquisition

I've got my Mini+ plugged into a wired network connection, with IP address assignment set to DCHP (but the address statically assigned on my router).

The problem I'm having is that the Mini "forgets" to request its IP address. I can see a link light on the NIC and on the corresponding switch port, but I have to unplug/plug the cable a couple of times for it to get the address. I'd like to be able to switch the printer on and get working without having to faff about with unplugging/plugging cables... any ideas/suggestions to resolve would be appreciated!

Napsal : 08/06/2023 12:20 pm
Walter Layher
(@walter-layher)
Prominent Member
RE: Wired Network/Pesky IP Address Acquisition

I'll try to answer this from a networking perspective, as I don't have the same printer and I don't use the same method to connect to it.

You can try to use a shorter DHCP lease time on your router or you can enter a static IP in your printer.

Napsal : 08/06/2023 12:52 pm
AndrewTerry
(@andrewterry)
Trusted Member
Topic starter answered:
RE: Wired Network/Pesky IP Address Acquisition

I don't think it's the lease time (I've got a couple of other devices configured the same way, and they behave as expected).

I tried to apply the assigned IP as a static address on the printer itself, but couldn't see the option to save a config file from the printer. After a long session with Prusa support, it turns out the documented method of applying a static IP for a wired connection no longer exists in the firmware! The very helpful rep said she'd pass the details of this problem over to the dev team for further investigation. I guess for now, I'll just have to do the unplug/plug dance...

Napsal : 08/06/2023 4:26 pm
Crab
 Crab
(@crab)
Reputable Member
RE:

It's up to the client, the Mini, to renegotiate the lease at 1/2 the lease time.. Now I've found that Prusa is god-awful at writing firmware for their networking features.. there is a simple Ping bug that has not been fixed in maybe 6 months.. There are a few things you can do but both involve static IP.. 

The 'best' way to assign static IP is to set a static IP pool in your router .. you find the Mac address of the mini and assign it a static IP that is outside your dynamic IP range.. (so set the dynamic IP range to say x.x.x.10 to 100) and then you should have a place in the router where you can assign static IPs based on Mac address. This is the best way to manage static IP devices because all your 'static IP devices' are all listed in one place.. your router.. You replace a device.. you just change its new mac address in the router and use the same static IP..  For this option you keep your Mini on DHCP.. It will receive the IP address from the router and now that address will never change.. so the Mini doesn't need to renegotiate it.. it can.. but even if it doesn't, the router won't give it away..

The other way is to set a static IP on Mini.. old school.. I wouldn't use that method.. I'd set all static IPs you have by managing via router.

Napsal : 08/06/2023 5:52 pm
Tysonsw a AndrewTerry se líbí
towlerg
(@towlerg)
Noble Member
RE: Wired Network/Pesky IP Address Acquisition

+1 re using static address, sooooo much easier.

Napsal : 08/06/2023 5:57 pm
Tysonsw se líbí
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: Wired Network/Pesky IP Address Acquisition

I've seen so many issues due to cabling that it's really astonishing how things can go wrong. The fact that leds blink on one side does not mean the other side gets the packets.

Things to check:

- check plugs - the known issue of almost-broken plug clips makes connection getting lost due to vibrations
- check if cable is not damaged - even jamming it with the doors can damage it in such way it tends to cause weird issues
- if you have cable with shield, make sure to connect the shield to the common mass- try different cables
- check ports - usually each port has leds and their color/status define configured speed and state
- try different switch port
- if you have managed switch then check port status, especially anything related to errors/drops
- check prusa printer link status and speed if it matches the switch speed especially after some time

- if possible, keep switch and printer connected to the same electric wall plug (that may be hard to achieve, actually)
- if you have multiple simple  switches then there is a limit of chain stack, after which it starts to generate weird issues (or not working at all)

Other ideas:

- set DHCP lease with short time (for example I've moved few years ago down to 10 minutes and it really works pretty well, if you have a really good router with DHCP on it)
- as stated before, for specific devices set static IP addresses
- make sure to set up NTP service on the printer (though AFAIR it calls to NTP servers in Czech ;D)

See my GitHub and printables.com for some 3d stuff that you may like.

Napsal : 08/06/2023 9:20 pm
Tysonsw a AndrewTerry se líbí
AndrewTerry
(@andrewterry)
Trusted Member
Topic starter answered:
RE: Wired Network/Pesky IP Address Acquisition

That's interesting.... so, it's not enough to just have the IP address statically allocated to the printer's MAC address from the range already being handled by the router's DHCP service? It's better to create another pool just for statically assigned devices? 

Napsal : 09/06/2023 11:12 am
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

It is enough, it just a matter of preference.

Some people have one pool and then if some computer registers they just make that address static (so there are exceptions in dynamic range).

Other define explicitly pool for static leases (depends on the network size, usually for home 16 is more than enough) and then they just move hosts there, to avoid exceptions in the dynamic address pool.

See my GitHub and printables.com for some 3d stuff that you may like.

Napsal : 09/06/2023 11:27 am
AndrewTerry se líbí
rwillett
(@rwillett)
Trusted Member
RE: Wired Network/Pesky IP Address Acquisition

A DHCP static pool should be (and is) no different to a DHCP dynamic pool. The Mini *should* send out a DHCP request to get an IP address and whatever other information you setup, e.g. gateway, NTP  or whatever.

The DHCP server receives the DHCP request, looks up in the internal tables wherther or not the MAC address is mapped to a static IP and then returns that back in the response. Its been a long time since I wrote network code, but thats the essense.

I run a pfsense firewall and I tend to assign static addressing at the bottom of the IP range and dynamic at the top from .128 onwards. There's no real issue doing it the other way round or having multiple ranges (assuming your router handles it).

dhcp is pretty lightweight and pretty stable and the lifetime of the lease should make no difference, thats part of the standard. Set it to 1min to 1year, is absolutely fine (or should be). It appears that the Mini has had the ability to set a static IP address taken away so DHCP should work. I'd also expect any of the networking code to just work. This is really odd, as nobody writes their own TCP/IP code now as there are so many free libraries easily available. Even on a small Arduino board, this is bog standard and rock solid. A colleague is running RTOS ( https://www.freertos.org/) which is a whole operating system with networking on a Arduino for her guitar pedalboard, we're collaborating on the 3d printing of the shell. If Prusa can't get this right, I'd worry about other more difficult things.

Trying to remember if I have ever had a DHCP request issues like this and am struggling in the last 20 years, DHCP just works now . My initial thinking would be dodgy cable or dodgy power supply thats right on the edge for the Mini. I don't have one so not clear on what they are. I'd also look at my router log files and look for DHCP requests. If you are seeing a lot from the Mini then it might be that they have got a bug, if you aren't seeing DHCP requests but the Mini is dropping off, then it might be a dodgy network cable.

Post the logs here and I'll have a look

Rob

Napsal : 09/06/2023 11:55 am
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: Wired Network/Pesky IP Address Acquisition

1 yeard dhcp lease is rather an overkill 😉
In general it's best to set it few hours lower than the average time between disruptions (like device reboots/power cycles, whatever it is - rourer, switch, printer...).
For home network I recommend from setting it from a range of 8 to 24 hours.
For debug purposes setting it in a range from 10 minutes to 1 hour is usually preferred (faster re-leases and less spam, but easier to test if you need extra automation defined in DHCP lease scripts).

See my GitHub and printables.com for some 3d stuff that you may like.

Napsal : 09/06/2023 12:07 pm
rwillett
(@rwillett)
Trusted Member
RE: Wired Network/Pesky IP Address Acquisition

1 year might be overkill but technically it doesn't matter, thats the point.

Whilst this issue may be poor code, I'd prefer to see a log file to see how many DHCP requests are actually coming in.

A lower lease time is fine for debugging, if so do it every minute, the packet size and network usage is essesntially nil, so lets see what Mini is doing. if Prusa have taken away the static address capability, somebody must have thought that the DHCP capability was adequate to compensate.

Lets look at the things we can see and monitor, log files are a good start,

Rob

 

Napsal : 09/06/2023 12:22 pm
AndrewTerry
(@andrewterry)
Trusted Member
Topic starter answered:
RE: Wired Network/Pesky IP Address Acquisition

hmmm a couple of people have mentioned cabling, and the patch lead in question is one I crimped myself...

That said, I'd expect an iffy cable to not work at all but once the address has been acquired, I can send prints from the slicer and monitor via PrusaLink quite happily (as I'm doing right now). Wouldn't a bad cable throw up other symptoms, rather than only struggle to get an IP address?

I'll do some further testing with it over the next couple of days, but man, I'll be hugely embarrassed if the root cause is my own dodgy cabling.

Napsal : 09/06/2023 1:29 pm
rwillett
(@rwillett)
Trusted Member
RE: Wired Network/Pesky IP Address Acquisition

Crimping your own Cat5/6 cables is possible and the fact that you are sending files back and forth may indicate that it looks OK. However the file transfer has inherent retries built into it. Don't forget that internet is based on ARPANET which was a network designed to self manage the fact that large swathes of it might not exist as a nuclear war may be waging.

It would be better to:

1. Change the DHCP lease to 5 min or so. This is to ensure that you have time to do things before the next DHCPREQUEST packet comes in.

2. Get the log files on your router open and watch it for 10-15 mins to see that DHCPREQUESTS come in and go out with the right information. Don't touch anything just sit and watch.

3. Once you can see the pattern, move the cable around that you self crimped. Specifically gently pull it in and out of the socket in the direction of travel. Sometimes the pins pins in the plug don't seat properly against the core of the cables. There is a reason why decent network crimpers cost a litttle more than cheap ones ( https://www.cef.co.uk/catalogue/products/4306096-lateral-coaxial-multi-connector-compression-crimper vs https://www.ebay.co.uk/itm/334686000748?hash=item4decd7166c:g:xT8AAOSwmR5jsTn6). The main reason is the precision crimping element, ensuring the pressure is just right. I do not own a high end set of crimpers 🙂 Do you have the same pattern of DHCPREQUESTS in the log file or do spurious ones come in?

4. The reason this *may* be a problem is here ( https://forums.tomshardware.com/threads/can-bad-wiring-cause-wrong-ip-dhcp-setup.2508388/). I'm not saying this is the problem, but you've got an issue with DHCP, it could be bad coding (I'm a little dubious), it could be the router not responding properly (we're checking the log files for that), it could be networking (not sure what your LAN looks like, might be perfect or it might be loads of dodgy cabling with overheating network switches all inside a large radar antenna generating pulses every four seconds and creating packet storms).  So lets start with the easy stuff and work from there. If you can see requests and responses in the right order, we can remove one potential issue. Then we work on the next one.

Rob

Napsal : 09/06/2023 2:18 pm
rwillett
(@rwillett)
Trusted Member
RE: Wired Network/Pesky IP Address Acquisition

Oh and everybody cocks up crimping in their life, anybody who doesn't is lying 🙂 Apart from me, I've never, ever cocked up any wiring. I've never broken the plugs or put the cables in wrong or cut the sheath short, nope, must have been somebody else 🙂

Napsal : 09/06/2023 2:20 pm
Crab
 Crab
(@crab)
Reputable Member
RE:

One should only be crimping their own patch cords if you *REALLY* need a custom size.. they are dirt cheap (AliExpress and others), even at Cat6 ..  Maybe against the "maker" credo, but crimping quality depends on both the skill of the user and the quality of the crimping tool; and often one or both of those are not up to par  :).. (and if making your own, use stranded Cat5/6, *NOT* solid.. as the solid is not flexible and can easily break, especially if you are not removing the sheath properly and nick a conductor)

Even  if it is a bad cable.. you still should consider the static pool for devices that need to be discovered by other components (ie: slicer).. and maintain that pool in the router. 

Napsal : 09/06/2023 2:27 pm
Share: