First-Time Setup - Problem with Connecting to Network



  • Hi,

    As the title states, I'm in the process of setting up my new DuetWifi controller for the first time, however I'm stuck at a particular point and would appreciate help in sorting it out.

    I'm using a Mac to connect to the DuetWifi (I don't have access to a Windows PC).

    For guidance, I've been following the 'Getting Connected to your Duet' which can be found here: https://duet3d.dozuki.com/Guide/1.%29+Getting+Connected+to+your+Duet/7#s11.

    These are the steps I've preformed so far:

    (1) I connected the DuetWifi to my Mac using the supplied USB cable (note that the controller isn't connected to anything else at the moment).

    (2) Next, I opened terminal and run: ls /dev/tty.*

    To which I got the response: /dev/tty.usbmodem1411

    I then run: screen /dev/tty.usbmodem1411 115200

    And got a message about an error, but also an 'ok' after hitting Enter so moved on to the next step.

    The complete message I got can be seen here:

    https://drive.google.com/open?id=1IXkTN8O6jYjpEc27KgUN82BMqA61NZNL

    (3) As I'm using a Mac, I don't have access to the YAT software for running the subsequent installation steps.

    Instead I downloaded and run Printrun (which can be found here: https://github.com/kliment/Printrun)

    (I suspect my core problem described below derives from using this software, but more on that later).

    (4) In Printrun, I sent the command: "M115", and got back the DuetWifi firmware version number: 1.19.2

    (5) I then run the command: "M552", and got the response that the DuetWifi module is 'disabled'

    I therefore run the subsequent command: "M552 S0", and successfully put the module into 'idle' mode.

    (6) Next up, I tried to run the command: M587 S"your-network-ssid" P"your-network-password" (replacing the placeholders with my network name and password).

    But this is where things stop working and I'm stuck.

    As you can see in the following screenshot: https://drive.google.com/open?id=10Cx8gwgi23vvjp6vzdBmQbROWE5XrP1w, I am not getting anything back.

    I've blacked-out part of my network's SSID name and the password for security sake, but note that I don't have an apostrophe in either.

    Upon closer examination I noticed that Printrun seems to be converting my network SSID name and password into all Uppercase which I think might be the source of the problem, but I couldn't find a way around it (i.e. a way to have Printrun send the info in the appropriate upper- and lower-case configuration).

    The problem is confirmed when I sent the command: "M552 S1", to which I got the response: "Wifi reported error: no known networks were found".

    Lastly, I also noticed the fact noted in the guide that: "The WiFi module only support 2.4Ghz not 5 Ghz Wifi bands." I'm located in the UK and have a BT router, but I'm not sure which band widths it supports or even how to find out what they are.

    That's about it.

    Any help with how to solve this out would be very much appreciated!

    SnowCrash


  • Moderator

    Place an apostrophe in front of the characters you want to be lowercase when you send the command through printrun.

    So for "password" you would send 'p'a's's'w'o'r'd

    If your SSID or password has an apostrophe, use two. Jim'sWifi would become J'i'm'''sW'i'f'i

    Another way around it is to create a macro file with the command and place it on the SD card and then run the macro to add the network.



  • @Phaedrux:

    Place an apostrophe in front of the characters you want to be lowercase when you send the command through printrun.

    So for "password" you would send 'p'a's's'w'o'r'd

    If your SSID or password has an apostrophe, use two. Jim'sWifi would become J'i'm'''sW'i'f'i

    Another way around it is to create a macro file with the command and place it on the SD card and then run the macro to add the network.

    Thanks, Phaedrux!

    I've tried the first method (adding apostrophes) and it didn't work, returning the response: "Failed to add SSID to remembered list"

    It looks like Printrun just added the apostrophes to the content instead of changing the following character to lowercase.

    The strange thing is that if I just send the command: "M587", I get also an error message saying: "Failed to retrieve network list"

    And even stranger is that I tried to re-send the original command - M587 S"your-network-ssid" P"your-network-password" (with the placeholders replaced but without apostrophes - and now this one also returns the error message "Failed to add SSID to remembered list"…

    Could it be that the SSD card is actually the source of the problem? (note the error message about this I mentioned in my original post and detailed in the first screenshot).

    Lastly, I don't know how to create a macro file so I'd be grateful for a more detailed guidance on that if possible.

    Thanks again,
    SnowCrash


  • Moderator

    If you put the SD card into your computer what do you see on it?

    There used to be some instructions on how to add the macro to add the network. That's what I used on my mac.

    Ah yes, here it is: https://duet3d.dozuki.com/Wiki/Installing_and_Updating_Firmware#Section_Upgrading_to_DuetWiFiFirmware_1_Num_19

    Create a text file named SetNetwork with the following:
    [c]M552 S0
    G4 P1000
    M587 S"SSIDNAME" P"SSIDPASSWORD"[/c]
    Place it in the Macros folder on the SD card.
    Put it back in the Duet and then from the console send M98 P/macros/SetNetwork
    Send M587 and check that your network is listed
    Send M552 S1. After a few seconds you should see a message that it has connected to your access point.



  • Hi again,

    (Edit: Phaedrux, it looks like we cross-posted. I'm not ignoring your reply in my update below, only sent it before I saw your recent post. If I can't make headway with the present issue - no webpage found - I will certainly try out your suggestion. Thanks!)

    Made some progress since my last post, but not there yet!

    These are the steps I followed since the last time:

    (1) Disconnected the DuetWifi from the Mac and went to have some coffee 🙂

    (2) Came back and re-connected the Duet and Mac over USB

    (3) In Printrun, I clicked the 'connect' button and got confirmation of a successful connection in the console.

    (4) Then, I run the same sequence of commands like the last time, but this time it worked (don't ask me why), specifically:

    M552 -> got response that module is disabled.

    M552 S0 -> got response that wifi module started

    M552 -> got response that module is idle

    M587 S"BTH'u'b5-…" P"'...." (with apostrophes as per Phaedrux suggestion) -> No response, but...

    M587 -> returned a list of 'remembered networks' including the one I just added.

    M552 S1 -> got response "Wifi module is connected to access point BTHub5-****, IP address *******" ( represent the IP address I got)

    (5) Encouraged by this inexplicable success, I entered the provided IP address in Chrome but unfortunately got a "this page can't be found" error message.

    I also tried "duettest.local/" as suggested in the guide, but with the same result.

    Trying both in Mozila and Safari just gave a blank page.

    Help please?


  • Moderator

    Which IP address were you provided? Did you specify one for the duet? Can you log into your router and see if the duet has connected?



  • Hi Phaedrux,

    Thank you very much for taking the time to help me with this!

    Answers to your questions below:

    @Phaedrux:

    Which IP address were you provided?

    This one: 192.168.1.108

    @Phaedrux:

    Did you specify one for the duet?

    Nope, the full message I got after sending ""M552 S1" was:

    Wifi module is connected to access point BTHub5-****, IP address 192.168.1.108

    The guide mentions nothing about specifying an IP address and I have no idea how to go about it if it's needed.

    Could you please tell me how to go about it?

    @Phaedrux:

    Can you log into your router and see if the duet has connected?

    To be honest, I don't know. How do I do that?


  • Moderator

    The IP it gave should be fine.

    If you reboot the board and wait for the blue light to stop flashing you should be able to connect to that IP address.


  • administrators

    So if you enter http://192.168.1.108 into your browser address bar (assuming that is the IP address that M552 reports every time), it should connect.



  • @Phaedrux:

    The IP it gave should be fine.

    If you reboot the board and wait for the blue light to stop flashing you should be able to connect to that IP address.

    I assume that by reboot you mean 'reset', right? (sorry, not meaning to be pedantic, just not familiar with this controller and wanted to make sure we're talking about the same thing).

    If we are, I tried it and it didn't work either :-@

    I've tried rebooting the controller both by clicking the 'reset' button in Printrun, and in a separate attempt, by clicking the physical 'reset' button on the DuetWifi.

    I should note that in both cases, I didn't see any blue light blinking. There was a red light next to the USB connector on the controller that turned on for a few seconds and then turned off.

    Not sure how to proceed with this?

    (edit: sorry, forgot to mention that in my response to dc42 in the following post, I include 2 screenshots: one of Printrun indicating that the connection has been established ok, and on of the Chrome webpage with the IP address that can't be found - perhaps this would help make sense of things?)



  • @dc42:

    So if you enter http://192.168.1.108 into your browser address bar (assuming that is the IP address that M552 reports every time), it should connect.

    Hi dc42 & thanks for joining the conversation!

    I tried your suggestion, but still no go.

    In a bit more detail, I repeated the whole procedure once again, that is, connecting the DuetWifi to the Mac over USB, starting up the wifi module, and making sure I got confirmation about the connection being established.

    Here is a screenshot of Printrun and the information in the console: https://drive.google.com/open?id=1LzulArSIj3sFN6ReQ7uKg1I_oJbO-2Gb

    Despite that, when I go to Chrome and enter the exact address you gave, I get an error message about the page not being found.

    Here's a screenshot of the result I get in Chrome: https://drive.google.com/open?id=1sleWbq0t-RCWi841cxvONJ03VNB71wpM

    Btw, you might notice the 'http://' missing from the address bar, but that's just Chrome removing it automatically (I typed the address exactly as you did) - if you look at the content of the message on the error page, it shows the full address with the 'http://'.

    Help please?


  • administrators

    The blue light on the wifi module will blink when the M552 S1 command to connect to your WiFi network is processed; except that if that command is in your config.g file, it will be deferred until config.g has finished running.



  • @dc42:

    The blue light on the wifi module will blink when the M552 S1 command to connect to your WiFi network is processed; except that if that command is in your config.g file, it will be deferred until config.g has finished running.

    Thanks for the quick response dc42!

    Ok, but I'm unclear as to how does that help me solve the current problem of not being able to see the web interface.

    Could you please explain more? (preferably, in a step-to-step total noobie style 🙂



  • @dc42:

    The blue light on the wifi module will blink when the M552 S1 command to connect to your WiFi network is processed; except that if that command is in your config.g file, it will be deferred until config.g has finished running.

    Just out of curiosity, I reset* the controller again and run the 'M552 S0' & 'M552 S1' commands, while looking at the wifi module on the controller the whole time, and saw no blue light anywhere (although the Printrun console confirmed that a connection was established like before).

    Could it be that the wifi module on the controller isn't working as it should and that's the source of the problem?

    • by 'reset' I mean a hard-reset, i.e. pressing the physical 'reset' button on the controller.

  • Moderator

    I meant to power cycle the board. I'm not exactly sure if the reset button has the same effect.

    As far as I can tell, if you are getting an IP address from the duet connect message then you should be able to use that IP to connect to the DWC.


  • administrators

    Which firmware version are you using? Older versions of the WiFi module firmware don't flash the blue LED.



  • @Phaedrux:

    I meant to power cycle the board. I'm not exactly sure if the reset button has the same effect.

    As far as I can tell, if you are getting an IP address from the duet connect message then you should be able to use that IP to connect to the DWC.

    Thanks for the clarification, Phaedrux!

    I've done the power cycle too, and still no go.

    dc42 said it should work as well, but unfortunately so far it doesn't…

    btw, I've check the browser side to see that there's nothing blocking the content, but couldn't find anything there either.



  • @dc42:

    Which firmware version are you using? Older versions of the WiFi module firmware don't flash the blue LED.

    As noted in my original post, firmware version number: 1.19.2

    Here is what I got in the Printrun console:

    M115
    SENDING:M115
    FIRMWARE_NAME: RepRapFirmware for Duet WiFi FIRMWARE_VERSION: 1.19.2 ELECTRONICS: Duet WiFi 1.0 FIRMWARE_DATE: 2017-09-01

    Btw, any idea why I'm constantly getting automatically unsubscribed every time I post on this thread?


  • administrators

    Ok, that explains why the blue led doesn't flash.


  • Moderator

    With the Duet powered on, if you open a terminal window and use the command [c]Ping 192.168.1.108[/c] What do you get?

    If you remove the SD card from the Duet and put it in your computer do you see files listed? Can you post the contents of config.g if it exists?



  • @dc42:

    Ok, that explains why the blue led doesn't flash.

    Cool, and…?



  • @Phaedrux:

    With the Duet powered on, if you open a terminal window and use the command [c]Ping 192.168.1.108[/c] What do you get?

    Looks like there's something working there.

    Here's a screenshot of what I get when I ping the address from terminal: https://drive.google.com/open?id=1oe_3Y65EfZliX55R7QwzH_N8s8GVv1sL

    Does this tell you anything?

    @Phaedrux:

    If you remove the SD card from the Duet and put it in your computer do you see files listed? Can you post the contents of config.g if it exists?

    I don't have an SD card reader on hand atm, but will get one tomorrow so I can find out and post the results.

    Thanks again, Phaedrux!



  • Another update & it's not a particularly happy one:

    Got my hands on a Windows 7 PC and I can now confirm that the exact same problem I've been experiencing on my Mac also occurs in the Windows setup.

    In more detail, I've installed the Duet drivers without a hitch, downloaded and run YAT, and repeated the by now familiar procedure of starting the wifi module, getting confirmation of a connection and finally, the error message that the page can't be found in Chrome.

    For comparison, here's a screenshot of YAT showing the above procedure:

    https://drive.google.com/open?id=10JMymyqviY-IiLkknzm9QSrbHp-5lTUg

    And here's a screenshot of the terminal window (or whatever it's called in Windows) running the ping command:

    https://drive.google.com/open?id=1JmmGHdT2f3HJK68FZTcR8MrYII7DPhDk

    Like I said, the result is unchanged, i.e. page not found in Chrome.

    Another small detail I noticed is that in my 'remembered list' of wifi routers there are 2 slightly different entries - one is the correct router name and the other is incorrect as it's all uppercase.

    However, in the connection confirmation message in YAT, the correct router name appears so I'm guessing that's not the problem (but do correct me if I'm wrong on this).

    Lastly, in the Windows setup, I also changed the baud-rate value from 9600 to 115200 as I seem to remember seeing that speed setting on the Mac, but it made no difference.

    From all this it's starting to look to me like this boils down to a hardware problem either in the wifi module or somewhere else in the controller.

    With that said, I still need to check the content of the SD card and report the results in the hope that the problem is actually there and can be manually fixed. I'll hopefully get this done tomorrow when I get the SD card reader.

    In the meantime, if anyone has any insight about the information above or the problem in general, please do let me know.


  • Moderator

    Well I don't think there is a hardware issue just yet. You are able to ping the board and it is replying, so that's good. You're on the network.

    The duplicate wifi network with all caps is just a dud entry. It will do no harm. You can tell it to forget that network later.

    There might be something wrong with the files on the SD card preventing a webpage from showing, so until we can verify what's on the card I'm not sure how best to proceed.

    We could try setting up the Duet to run in access point mode where it creates it's own network and you connect to it that way, but if there is something wrong with the files on the card it would lead to the same result.

    Just a shot in the dark, but have you tried power cycling your wifi router?

    Also, how far away is the Duet from the router?

    Have you ever logged into your router web interface?

    It would be nice to verify at the router end that the Duet is actually getting a proper IP address.


  • Moderator

    @SnowCrash:

    @dc42:

    Ok, that explains why the blue led doesn't flash.

    Cool, and…?

    And now we know which firmware is installed. In 1.21 the wifi LED blinks 3 times and then goes solid when it's ready to go and is turned off when the wifi module is off.


Log in to reply