Duet WiFi and macro to connect
-
Hi,
i have configured Duet 2 wifi to connect to the home network, the drawback is that it changes frequently from IP. Reading the documentation I have seen that with the Gcode M587, you can assign a fixed IP, which I guess would be something like this:
M587 S "Network Name" P "Network Pass" I666.666.666.666
I have also read in the documentation, that this line of code, DO NOT put it in "config.g", it is better to use a macro.
This macro would be fine?
-->In Macros DIR "WiFi Connect.g"
M552 S0 M587 S "Network Name" P "Network Pass" I666.666.666.666 M552 S1 M587 M552
-->In Config.g
(Add this line, at the end or near)M96 WiFi Connect.g
-
@peirof Your home router should have the function that it can assign the same IP address to a specific MAC address every time.
-
@grizewald mmmm..... true
-
@peirof said in Duet WiFi and macro to connect:
-->In Config.g
(Add this line, at the end or near)
M96 WiFi Connect.gthis would have the same effect as if it was in the config.g it would run every time.
the M587 command is to setup the wifi network and should only need to be run once. If you use a fixed IP (and your home network is setup to allow this) then that will work every time you connect (using M552) having run it once with M587. Most "out of the box" home network routers are setup to use DHCP so, as @grizewald suggests its actually easier to set them up to assign the same IP address every time to the Duet it will recognise it by the MAC address). this is normally referred to as a DHCP reservation.