Comments (21)
This is working for me after rebooting:
auto eth1
iface eth1 inet dhcp
# udhcpc_opts -S -R -n -p -r -i eth1
pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth1.pid -i eth1
Just wanted to add that udhcpc_opts is also a possible way and has some effect (-S -> a bit more output to syslog) but sadly it just does not get me a IPv4 address. pre-up works like a charm..
Side question/fact/bug..?: Am I right that including vim to the image build gets rid of the classic vi ? I sadly noticed that I cannot select a section text and paste it with the middle mouse key i.e. into this browser field.
Problem solved.. Vim just includes/overwrites the link to vim.vim. So I have overwritten it now with a ln to the familiar busybox version of vi. Bug of vim or just a usage error.. I don't know.
Edit:
to get the full DHCP experience we need to get all the option codes manually:
pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth1.pid -i eth1 -O 1 3 4 5 6 12
Seen here: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#DHCP_options
from meta-iot2000.
Just struggled with DHCP as well. Same hardware but new Image (with PCIe Wlan/Bluetooth driver installed but no PCIe hardware installed already)
Maybe it was my fritzbox or a similar issue you are referring to.
I solved it by locating the service in charge for DHCP on this image. The standard busybox dhcp program is udhcp.
With $udhcp -i eth1 -r
I was able to get a new lease from my DHCP server (fritzbox). Restarting the DHCP Server and deleting its entry didn't help here.
Hope this helps you đŠī¸
from meta-iot2000.
Look at https://github.com/siemens/meta-iot2000/blob/master/meta-iot2000-example/recipes-example/busybox/busybox_1.24.1.bbappend, we are already customizing the config. There must be some switch that controls the dhcpc applet, and that just needs to be turned off.
from meta-iot2000.
here is a way to manually choose your preferred dhcpc via the /etc/network/interfaces file @deinok :
https://unix.stackexchange.com/questions/261872/how-is-udhcpc-executed-and-how-to-change-it
And there seems to be a issue with udhcpc:
https://superuser.com/questions/1204231/busybox-udhcpc-can-not-be-killed
I'm experiencing as well a strange behavior of manually started udhcpc not be able to be killed. (but if I think more about it it might be because of the wrong execution of the program (all interfaces) which first broke my static IP address on eth0 and therfore also my ssh pipe on the 192.168.200.1 connection..)
maybe this next link sounds like a promising switch @jan-kiszka is asking for? -n for the configuration but it does not say the exact position where to place it in the config file..
https://unix.stackexchange.com/questions/267733/how-to-get-busybox-udhcpc-to-run-in-background-forever
I can reproduce my failure with udhcpc in the standard configuration. My FritzBox DHCP server is recognizing the MAC address of the IoT in the network but says it is passive and not using the connection. I'm unsure how I should use wireshark in easy way for this. ARP posining without an IP address of the target might not be the best solution and my switch is sadly not capable of packet mirroring (cheapest TP switch from amazon).
Probably should invest in some ninja stars.. https://hakshop.com/products/throwing-star-lan-tap
đ¤
from meta-iot2000.
What exactly do you mean? Is DHCP not working for that 3G link? Or are you trying to use two network links, one over 3G, and the other (wired?) gets no IP via DHCP?
from meta-iot2000.
I would like to use ETH1 with wire and DHCP enabled, and in case of network error fallback to PPP0 (3G).
But seems like if iot2000 detects 3g related hardware, DHCP stops working and no IPv4 is assigned to that interface
from meta-iot2000.
Hmm, the iot2000setup tool should allow you to select multiple interface and also define dhcp for eth1 then. Did you do that?
from meta-iot2000.
yes yes this was the first thing to try.
I also have tryed to start manualy dhcpcd
.
from meta-iot2000.
My cellular test stick currently refuses to work, so I can't reproduce. What is the /etc/network/interfaces file that iot2000setup generates? Or does it report any errors?
As a manual alternative, you should be able to configure dhcp for eth1 in that file above.
from meta-iot2000.
@jan-kiszka Yep, I also have configured that file and put the eth1 up with ifup
.
I will investigate more, cause the strange thing is that this bug only happenz if Cellular is detected (Even if is not generating the ppp0). With a bit of luck, the support of SystemD (and indirectly NetworkD) can fix this issue.
from meta-iot2000.
@mrlowalowa Thanks, I will check it.
from meta-iot2000.
but be careful with it. just issuing udhcpc or uhdcpd was killing the static address on eth0 until the next boot. I worked mainly over the serial debug interface for this.
Oh and I see that the command is wrong. You must use udhcpc (client) and I'm not 100% sure about the -r (new lease). It should not harm but if I remember it right I was just starting the client and it worked.
I try the same image now with an other DHCP server and will see if it was only a temporal solution or a permanent for this image. I sadly think it's just a temporal solution but therefore can be added in the autostart if you wish to have it consistent.
What is @jan-kiszka saying about this? Normally when I do a /etc/init.d/networking reboot I see the output: Sending DHCP request... etc but in this case I saw nothing. Is there any other way to confirm that a DHCP request was sent after reactivating a certain interface configured with dhcp?
from meta-iot2000.
There isn't much black magic involved here, just the plain dhcp client from busybox and the settings in /etc/network/interfaces. Maybe there are servers that do not go well with that client, but I'm not aware of such issues. You may try to trace the traffic between client and server using wireshark (and a third machine attached to the same network, running its interface in promisc mode).
from meta-iot2000.
@jan-kiszka @mrlowalowa I fixed the problem creating my own DHCP Client. Its a workaround, not a true fix.
Seems like the true fix should be move to another DHCP Client daemon.
http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/recipes-connectivity/dhcp/dhcp_4.4.1.bb This should work.
If needed, I can generate a wireshark trace with the ICMP and DHCP traces
from meta-iot2000.
What would be interesting for us (specifically before releasing the next version) is if this is A) a problem of busybox and B) if there is a fix we should apply or a busybox version we should update to. If A) is true but B) does not exist, moving to another client would be the alternative, yes.
from meta-iot2000.
Is there a way that I can deactivate the busybox dhcpd so I can try to enable the dhcpd of poky without other issues?
from meta-iot2000.
@mrlowalowa So, no changes to the pre-built images where needed, just fine-tuning of the interfaces file, right? We could add that to the pre-installed interfaces file, at least in commented-out form ("enable if you see dhcp problems").
Regarding vim / vi:
# ls -l /bin/vi
lrwxrwxrwx 1 root root 19 Aug 24 13:24 /bin/vi -> /bin/busybox.nosuid
It's the same story as with udhcpc. But if real vim does not overwrite anything of that mini vi, you should be fine.
from meta-iot2000.
yes I just fine-tuned the interface and got an IP immediately. The only problem that still persists is that you do not get the other DHCP options without an additional ifup/ifdown on each startup. But this can be added to autostart and works fine this way.
thank you for the additional vi/vim information.
from meta-iot2000.
@mrlowalowa Thanks for the hotfix. Works like a charm.
from meta-iot2000.
I think we have a proper solution with that fix referenced above. Please test and let us know.
from meta-iot2000.
At least I can confirm that it fixed the DHCP issues on our setup. Thx for the fix.
from meta-iot2000.
Related Issues (20)
- Nodejs Error HOT 4
- Question: Communication between Linux and Arduino HOT 2
- Enabling CONFIG_TUN HOT 2
- Installing NodeJS 10 or above HOT 4
- udhcpc can't handle ethernet hotplug HOT 2
- No .wic file generated HOT 6
- swupdate remote HOT 20
- Error while trying to add node-red-contrib-msg-queue to a custom image HOT 4
- building the kas-example image 5 tasks failed, image not created HOT 14
- Replace node-red-contrib-iiot-opcua with node-red-contrib-opcua HOT 3
- Problem with Digital input/outputs iot 2040 HOT 15
- build error HOT 10
- Example Image not Bootable HOT 8
- Writing DQs with node-red-node-intel-gpio causes constant output of 1 HOT 2
- Pre-installed Modbus node is not compatible and leads to crash of Node-Red HOT 4
- build of an image failed with exit code '1' HOT 3
- Not possible to install nodes with V3.1.1 HOT 4
- node-red iot2040 image 3.1.1 node-red-admin not found
- Error compilation with nodejs-native version 8
- Default Siemens security policy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meta-iot2000.