Using WiFi and Ethernet networking setting in universal config.g
-
I am trying to come up with a universal configuration for the Duet 3 Mini 5+ that our users (bear project) can adopt easily without touching config.g themselves initially.
We are wondering if we can cover both the WiFi and the Ethernet version of the board with a single config.g so we do not need to maintain two configurations separately.
For that purpose we would enable the use of dynamic IPs via DHCP in config.g by default for both versions which will help with updated configurations, as users would not define a static IP that needs adjusting should we issue a new configuration with a firmware update on GitHub.
The recommended way to access the board via DWC would be through http://duettest.local/ which would also ensure users can continue to access their board in case their router issues a new IP via DHCP (of course this can be also easily fixed on router side).
My question is:
Can we define the network settings to use dynamic IPs for both versions of the board (WiFi and Ethernet) within one config or would this cause issues? This was my idea:
; Networking
M552 P0.0.0.0 S1Thanks for helping us out
-
why don't you use the board type from the object model to identify which board is being used and then load the appropriate gcode?
-
I can't see a specific object under board type, it's just stating "Duet 3 Mini 5+" not if it's a WiFi or Ethernet ersion.
But...
if network.interfaces[0].type == ethernet
.....could work.
-
@flobler said in Using WiFi and Ethernet networking setting in universal config.g:
Can we define the network settings to use dynamic IPs for both versions of the board (WiFi and Ethernet) within one config or would this cause issues? This was my idea:
; Networking
M552 P0.0.0.0 S1don't need
P0.0.0.0
justM552 S1
to enable networking with dhcp client. (for both ethernet and wifi)as a one-off, and prior to to M552, you need to run M587 for the wifi board to tell it which network to connect to.
i believe newer firmwares can use run-once.g for this?
https://forum.duet3d.com/topic/20349/setup-question-wifi?_=1615737607211
https://duet3d.dozuki.com/Wiki/Macros#Section_runonce_gedit: duettest.local would imply you've used old config from factory, should be just duet.local and its set by M550
edit2: one option would be to use conditional gcode to run M589 to create an access point and allow user to connect to the duet to input wifi stuff wihtout using the serial console or removing sd card to edit files.
-
Thank you!
The one-off M587 is being covered in our setup guide, so that would be done before uploading the config.g that we supply which includes the network settings.
You are correct about duet.local, thanks for pointing this out, I will adjust this in my notes.
So if I have M552 S1 in the network settings, it should not matter if I use a WiFi or Ethernet board?
That should cover everything we need.
-
@flobler said in Using WiFi and Ethernet networking setting in universal config.g:
So if I have M552 S1 in the network settings, it should not matter if I use a WiFi or Ethernet board?
That should work for any Duet board and DHCP.