M552
Back to the Gcode Dictionary
M552: Set IP address, enable/disable network interface
Parameters
- Innn (Optional) Number of the network interface to manage (defaults to 0).
Parameters for Ethernet interfaces (Duet 2/3 Ethernet and 06/085)
- Pnnn IP address, 0.0.0.0 means acquire an IP address using DHCP
- Snnn 0 = disable networking, 1 = enable networking
- Rnnn (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80
Parameters for WiFi interfaces (Duet 2/3 WiFi)
- P"ssid" (optional, RepRapFirmware 1.20 and later) SSID of network to connect to. The SSID and password must already have been registered using M587. If this parameter is not present, the Duet 2 WiFi will try to connect to the strongest network that is broadcasting its SSID and whose SSID has been registered using M587.
- Snnn 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point , -1 = disable WiFi module
Example (Duet 2 Ethernet)
- M552 S1 P192.168.1.14
Sets the IP address of the machine to (in this case) 192.168.1.14. If the S parameter is not present then the enable/disable state of the network interface is not changed.
Example (Duet 2 WiFi)
- M552 S1 P"MyNetwork"
Example (Duet 3 in SBC mode)
- M552 I1 S1 P0.0.0.0 ; set the second interface on the SBC to use DHCP and enable it.
The I1 setting here specifies the second network interface on the SBC. This uses the DuetPi Management Plugin (installed by default from RRF 3.3 onwards) to set the address on the SBC. To determine which interface is which on the SBC the object model explorer can be used to see the current settings of each interface.
M552 with no parameters reports the current network state and IP address.
In firmware 1.18 and later the HTTP port address is set using the M586 command, so the R parameter of this command is no longer supported.
On the Duet 2 WiFi running firmware 1.19 and later, the IP address is set in the M587 command when you configure the access point details.
0 Comments