Switching wifi networks
-
Hi all,
I'm a little bit stumped but pretty sure there's a quick command for this. My wifi is becoming a bit unreliable so I want to switch to another wifi network I already have stored on the DWC. However, I can't figure out the command to switch and stop the control automaticaly connecting to the other wifi network.
Any help appreciated.
thanks
Newbie -
@newbee87 use the
P
arguement in M552 (in config) to tell it which SSID you want to connect to -
@jay_s_uk thank you - I've now connected to the wifi. Doesn't seem to have solved the problem though. I can connect when I USB to the board to DWC but as soon as I disconnect and power the CNC on I lose connection and lose DWC on the browser. Do you think it could be an issue with the wifi on the board?
-
@newbee87 i suggest trying to reflash the wifi module first using M997.
It's also worth checking the status of the LED's etc.
If its still causing problems, post an output of M122 -
thanks again, I reflashed the module using M997 as suggested. LED's semm ok and blue light is active. Same problem occurs: I establish a comnection to DWC on USB first sending commands through YAT but as soon as I disconnect and turn on the CNC I get: "Connection interupted, HTTP request timed out".
I ran the diagnostic on M122 as suggested, here is what I have:
=== Diagnostics ===
RepRapFirmware for Duet 2 WiFi/Ethernet version 3.3 (2021-06-15 21:44:54) running on Duet WiFi 1.02 or later
Board ID: 08DLM-996RU-N8PS4-7J1D8-3S86J-1BAVN
Used output buffers: 1 of 24 (11 max)
=== RTOS ===
Static ram: 23876
Dynamic ram: 74172 of which 0 recycled
Never used RAM 13512, free system stack 193 words
Tasks: NETWORK(ready,8.5%,257) HEAT(delaying,0.0%,391) Move(notifyWait,0.1%,364) MAIN(running,86.2%,520) IDLE(ready,5.2%,29), total 100.0%
Owned mutexes: USB(MAIN)
=== Platform ===
Last reset 00:00:17 ago, cause: power up
Last software reset time unknown, reason: HardFault bfarValid precise, none spinning, available RAM 13512, slot 0
Software reset code 0x0072 HFSR 0x40000000 CFSR 0x00008200 ICSR 0x00400803 BFAR 0x65696d18 SP 0x20003578 Task NETW Freestk 580 ok
Stack: 65696c63 20008a70 004717ca 0043832d a5a5a5a5 00436149 0043612e 61000000 0043832d 0043747f 20008a70 20017718 40090000 00438337 a5a5a5a5 004188b3 a5a5a5a5 0045a0d1 a5a5a5a5 a5a5a5a5 200143b0 00000000 00000000 00000000 00000000 200035d8 00000000
Error status: 0x00
Step timer max interval 0
MCU temperature: min -4.0, current 10.0, max 11.0
Supply voltage: min 0.0, current 0.7, max 0.8, under voltage events: 0, over voltage events: 0, power good: no
Heap OK, handles allocated/used 99/1, heap memory allocated/used/recyclable 2048/24/0, gc cycles 0
Driver 0: position 0, ok, SG min/max not available
Driver 1: position 0, ok, SG min/max not available
Driver 2: position 0, ok, SG min/max not available
Driver 3: position 0, ok, SG min/max not available
Driver 4: position 0, ok, SG min/max not available
Driver 5: position 0
Driver 6: position 0
Driver 7: position 0
Driver 8: position 0
Driver 9: position 0
Driver 10: position 0
Driver 11: position 0
Date/time: 2022-09-23 09:01:15
Cache data hit count 766701907
Slowest loop: 6.04ms; fastest: 0.12ms
I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
=== Storage ===
Free file entries: 10
SD card 0 detected, interface speed: 20.0MBytes/sec
SD card longest read time 3.1ms, write time 0.0ms, max retries 0
=== Move ===
DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000
=== MainDDARing ===
Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
=== AuxDDARing ===
Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
=== Heat ===
Bed heaters = -1 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
=== GCodes ===
Segments left: 0
Movement lock held by null
HTTP is idle in state(s) 0
Telnet is idle in state(s) 0
File is idle in state(s) 0
USB is ready with "M122" in state(s) 0
Aux is idle in state(s) 0
Trigger is idle in state(s) 0
Queue is idle in state(s) 0
LCD is idle in state(s) 0
Daemon is idle in state(s) 0
Autopause is idle in state(s) 0
Code queue is empty.
=== Network ===
Slowest loop: 15.51ms; fastest: 0.00ms
Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
HTTP sessions: 1 of 8- WiFi -
Network state is active
WiFi module is connected to access point
Failed messages: pending 0, notready 0, noresp 0
WiFi firmware version 1.26
WiFi MAC address bc:dd:c2:2d:e1:4a
WiFi Vcc 3.73, reset reason Turned on by main processor
WiFi flash size 4194304, free heap 23760
WiFi IP address 192.168.0.139
WiFi signal strength -68dBm, mode 802.11n, reconnections 0, sleep mode modem
Clock register 00002002
Socket states: 0 0 0 0 0 0 0 0
Cheers
- WiFi -
-
@newbee87 as long as its not too difficult, i would suggest updating to 3.4.2 along with the slightly newer wifi firmware.
Please read the upgrade notes though as there have been a number of changes in the handling of spindles etc -
@newbee87 The commands to set up your networking need to be in config.g, so they run when the board is powered on. Commands sent over USB are lost as soon as you disconnect USB (which is powering it) and then turn on the CNC, which powers the Duet. If they are in your config.g, you don't need to connect via USB to start networking every time.
Post your config.g file, and the commands you are sending over USB.
The 'getting connected' guide explains how to edit your config.g to add the correct commands (step 5, 6 and 7): https://docs.duet3d.com/en/How_to_guides/Getting_connected/Getting_connected_to_your_Duet#h-5-connect-duet-to-network
Also:
WiFi signal strength -68dBm, mode 802.11n, reconnections 0, sleep mode modem
A signal strength of -68dBm is starting to get a bit marginal. This may also give you connection issues.
Ian
-
@newbee87 said in Switching wifi networks:
as soon as I disconnect and power the CNC on I lose connection and lose DWC on the browser.
Please can you explain what you mean by that. What do you disconnect, and what do you power on that wasn't powered before?
-
@dc42 Sorry if that wasn't clear... I power on the power source for the CNC/board... my understanding was you shouldn't have this turned on whilst connected to board via usb?
-
@droftarts thanks, this is all I have in config.g:
; Configuration file for Duet
; executed by the firmware on start-up
; WorkBee Firmware Version 1.1global systemSettingsVersion={1.2}
; Configuration files
M98 P"config-network.g"
M98 P"config-drives.g"
M98 P"config-axes.g"
M98 P"config-axes-limits.g"
M98 P"config-axes-calibration.g"
M98 P"config-axes-endstops.g"
M98 P"config-probe.g"
M98 P"config-spindle.g"
M98 P"config-laser.g"; Other Settings
M453 ; Put the machine into CNC Modes
G90 ; Set absolute coordinates
M140 H-1 ; Disable heated bed
M564 S1 H1 ; Disable jog commands when not homed
M911 S21.0 R23 P"G91 G1 Z3 F1000" ; Configure power loss resume; User Configuration files
M98 P"config-user-settings.g"M501 ; Load Stored Parameters
As for the commands I'm sending over USB/YAT, I'm connecting to my preferred wifi network fine and DWC is working... albeit temporarily!
-
@newbee87 whats in config-network.g?
-
@jay_s_uk In config-network.g we've got:
; Network configuration executed by config.g
; Configure Connection - ENABLE ONLY ONE OF THE BELOW THREE
M552 S1 ; Enable Wifi Network
;M552 S2 ; Enable Access Point Mode
;M552 S1 P192.168.251.2 ; Enable Ethernet - Change IP Address to suit; Network settings
M586 P0 S1 ; Enable HTTP
M586 P1 S0 ; Disable FTP
M586 P2 S0 ; Disable Telnet; Network machine name
M550 P"WorkBee" ; Set machine name -
@newbee87 said in Switching wifi networks:
my understanding was you shouldn't have this turned on whilst connected to board via usb?
You can, but you must be aware of causing a USB ground loop.
https://docs.duet3d.com/en/User_manual/Overview/USB_ground_loops
If you can be sure not to create a ground loop, you can have USB connected when the mainboard is powered from the PSU as well.
This would let you see what is actually happening in normal usage.
The commands in your config-network.g file look correct and should be starting the network and connecting.
Can you also check the LEDs on the board? Particularly can you check that the 5v LED is lit when you are powered from the PSU only.
-
@phaedrux thank you, having looked at the LED's, everything seems to be OK and I have the diagnostic report above. I do however have a flashing red light immediately below the micro USB input... don't know what this is telling me though!
-
@newbee87 said in Switching wifi networks:
I do however have a flashing red light immediately below the micro USB input
Photo? Or can you point it out on the wiring diagram?
You can see a description of the LEDs here: https://docs.duet3d.com/en/User_manual/Troubleshooting/Duet_wont_respond
-
Erm, I can't see any references to the handling of spindles in the upgrade notes!
I have upgraded to 3.4.2 but not run the machine yet. But I am going to do that later today or tomorrow, so I would appreciate it if you could point to where these specific changes are, please?
Thank you
-
@nightowl he was upgrading from 3.3 to 3.4 and there were quite a few changes. 3.4 to 3.4.X there weren't any
-
Awesome, thank you @jay_s_uk
That'll teach me to read things properly!