Hello All,
Recent adopter to OSMC and loving it. I have what I believe is a little bit of a unique problem with DHCP lease. Currently using a POE device hardwired to my lan port that does not power up until after the Pi, that I run OSMC on, comes up and activates the port. This results in no internet IP configuration looks borked from MyOSMC. From raspbian I am able to mitigate this with dhclient -r and dhclient - from windows just the ipconfig /release then ipconfig /renew.
I am not familiar with connman and googling/man pages are non specific to the DHCP release and renew process. I tried kicking connman with ‘sudo systemctl restart connman’ but when I drop back into gui (I just use ‘exit’ at the console and wait) then check the ip under MyOSMC - it is still the borked 0.0.0.25X - no joy.
So the specific questions are: how can I release/renew DHCP with connman? As a relative newb to all this (forgive me) - can I add this as a menu item (like a retropi launch menu addition - here execute this command - system.exec stuff)? If manual easy kick from the gui is not possible can I at least script it into the rc file to have it kick the DHCP after like 2mins after boot or something?
Thanks in advance guys and thank you for all the work you have put into this - OSMC is quickly becoming my default media center.
The easiest way is probably something like:
connmanctl disable ethernet
sleep 10
connmanctl enable ethernet
Why not use a static IP?
Sam
Ty for the commands, I will give them a try manually. I have concerns that disabling the port could trigger the POE device shutdown and boot but I will keep you posted with the result.
Why not use a static IP?
That would be my preference 100%. At home it definitely will be static but the current use is on a ‘corp guest’ network and it is their requirement/ask. I could probably get away with using a static but for now I am trying to adhere to the rules as laid out - since they are kind enough to approve my use of the device on the corp guest. Don’t know the reasoning for the DHCP requirement though.
TY again for the fast response!
Razzix
If the lease time is long; you could probably just keep the device up and have a semi-static IP
Since you’re using a Pi, an alternative is to delay the boot:
boot_delay
The boot_delay
command instructs to wait for a given number of seconds in start.elf
before loading the kernel: the default value is 1
. The total delay in milliseconds is calculated as (1000 x boot_delay) + boot_delay_ms
. This can be useful if your SD card needs a while to get ready before Linux is able to boot from it.
Dill, ty very much for the the additional suggestions. I will give it a try as well and report back. Crossing my fingers the port is triggered before the boot completes because this would totally work if so.
Sam, it looks like the down and up is triggering the boot for the POE device. I am assuming the connmanctl enable / disable is a admin down and up on the port.
Will not have immediate access to the device today and will have check the its log to be sure I am right about the boot. Will update as soon as I test further.
Since there does not seem to be an easy way to DHCP release and renew with connman; Also the downing and upping of the port triggers the POE device’s boot/reboot - I have resorted to mitigation at the POE device and a secondary raspbian PI as needed.
POE device will not boot until the port comes up and admin up and downing a port triggers it.
Will keep looking for a solution to keep this on a single OSMC PI. I should note everything works just fine for all else just the corp connection with the POE device that boots slower than the PI.
If anyone finds a way to DHCP release and renew from connman without upping and downing a port let me know!
Please try the following commands:
connmanctl services
connmanctl config ethernet_<MAC address>_cable --ipv4 dhcp
The first command will provide the eth0 MAC address, which you use in the second command.
Curiously, this fails on my Pi, possibly due to a configuration setting, but works on my Vero4K, where it renews the DHCP lease on the router.
dillthedog - Ty so much for the commands. Please accept my apologies for the delayed response - I have been wrapped up in a lot of travel and hadn’t thought to keep monitoring the thread while on the go. I will try to give the commands a test tonight. I have to tear down the current setup and clear the adapter’s config to test properly. Thanks again!
Unfortunately I have not been able to get back to that particular site (changes midflight so to speak) and do not know when I will be there again. Will post again when/if I am able to try those commands in that config. Sorry guys.