Converting the Duet WiFi to use an external antenna


  • administrators

    The recent release of the ESP-07S WiFi module has provided an easier route to adding an external antenna to the Duet WiFi, by replacing the ESP-12F module on the Duet by the ESP-07S. The 'S' is important, because the older ESP-07 device had insufficient flash memory.

    Please note, modifying your Duet Wifi in this way will void the warranty. The tricky bit is removing the ESP-12F, which requires hot air desoldering equipment (remember to remove the SD card from its socket first). Or you could use Chip Quik or similar low melting point solder to desolder it. After that you just need to clean up the pads using solder wick, apply some no-clean flux to them and to the ESP-07S, and solder the new device in place using a fine-tipped soldering iron, with the antenna connector end near the board edge. The ESP-07S doesn't have pads along the back as the ESP-12F did, but that doesn't matter because they were not used on the Duet.

    Use M997 S1 to do the initial firmware upload to the new WiFi module. I used the 1.20alpha build of DuetWiFiServer along with DuetWiFiFirmware 1.20beta1. No firmware or configuration changes were needed.



  • I want one… badly 🙂
    I'm having ajax disconnects again.

    Will you make a step by step guide of this? That would be sweet.
    Some of us are a bit underskilled around electronics.


  • administrators

    Before concluding that an external antenna will solve the problem, check the RSSI and the other items at https://duet3d.com/wiki/WiFi_disconnections_and_AJAX_timeout_errors.



  • For anyone interested in replacing the WiFi module, link to ESP-07S data sheet below:

    https://www.rfsolutions.co.uk/downloads/1494602250ESP-07S_Datasheet.pdf

    Depending upon your location and your preferred supplier, the module will cost between £3.00 and <£2.00, e.g. http://www.electrodragon.com/product/esp-07s-esp8266-serial-wifi-module/

    You will also need a IPEX/u.FL to SMA adaptor coax lead, similar to:

    http://www.ebay.co.uk/itm/IPX-u-fl-to-SMA-Jack-Female-Bulkhead-Pigtail-Cable-Mini-PCI-RF-Assemblies-15cm-/282614159063?hash=item41cd1dd6d7:

    and a

    2.4GHz antenna, similar to:

    https://www.wifi-antennas.co.uk/2db-sma-male-omni-directional-antenna-2-4ghz.html

    I would guess that most hobbyists will have a spare 2.4GHz antenna somewhere in the house (i.e. supplied with that old WiFi router you previously upgraded) however if you do need to purchase, make sure you get one with a SMA to match the coax lead (or if you already have a RP-SMA antenna, make sure you purchase a Coax with a RP-SMA connector to suit! - you cannot mix RP-SMA and SMA connectors.



  • I did the modification on one of my Duet's and it did improve my signal strength but there are easier ways to do that than possibly ruining the control board. I would not recommend this mod for the novice or faint of heart. It can go really well or really bad in the space of a few seconds. But if you still want to do it one thing that wasn't mentioned is that you will have to load the wifiserver bin on to the new wifi module once you solder it on via USB and SD card using an M997 S1 command or at least thats how I got mine to work.




  • administrators

    Yes, the ESP-07S is OK.



  • thanks.



  • Ok, I just changed my wifi module, but I can't set ssid/password (get "Bad or missing parameter"). Here are the logs:

    >>> M997 S1
    SENDING:M997 S1
    Trying to connect at 460800 baud:
     success
    Erasing 302928 bytes...
    Uploading file...
    5% complete
    10% complete
    15% complete
    20% complete
    25% complete
    30% complete
    35% complete
    40% complete
    45% complete
    50% complete
    55% complete
    60% complete
    65% complete
    70% complete
    75% complete
    80% complete
    85% complete
    90% complete
    95% complete
    Upload successful
    >>> M552 S0
    SENDING:M552 S0
    WiFi module started
    >>> M587 Sxxx Pxyyy
    SENDING:M587 Sxxx Pyyy
    M587: Bad or missing parameter
    >>> M122
    SENDING:M122
    === Diagnostics ===
    Used output buffers: 1 of 32 (9 max)
    === Platform ===
    RepRapFirmware for Duet WiFi version 1.20beta8 running on Duet WiFi 1.0
    Board ID: 08DDM-9FAM2-LW4S8-6JTDG-3SD6Q-13YRX
    Static ram used: 15488
    Dynamic ram used: 99136
    Recycled dynamic ram: 64
    Stack ram used: 4328 current, 5532 maximum
    Never used ram: 10852
    Last reset 00:19:36 ago, cause: reset button or watchdog
    Last software reset reason: User, spinning module GCodes, available RAM 11504 bytes (slot 4)
    Software reset code 0x0003, HFSR 0x00000000, CFSR 0x00000000, ICSR 0x00400000, BFAR 0xe000ed38, SP 0xffffffff
    Error status: 0
    [ERROR] Error status: 0
    
    Free file entries: 10
    SD card 0 detected, interface speed: 20.0MBytes/sec
    SD card longest block write time: 0.0ms
    MCU temperature: min 26.4, current 27.2, max 27.4
    Supply voltage: min 1.7, current 1.7, max 1.7, under voltage events: 0, over voltage events: 0
    Driver 0: ok
    Driver 1: ok
    Driver 2: ok
    Driver 3: ok
    Driver 4: ok
    Date/time: 1970-01-01 00:00:00
    Cache data hit count 1442288766
    Slowest main loop (seconds): 3.074205; fastest: 0.000033
    === Move ===
    MaxReps: 0, StepErrors: 0, FreeDm: 240, MinFreeDm 240, MaxWait: 0ms, Underruns: 0, 0
    Scheduled moves: 0, completed moves: 0
    Bed compensation in use: none
    Bed probe heights: 0.000 0.000 0.000 0.000 0.000
    === Heat ===
    Bed heater = 0, chamber heater = -1
    === GCodes ===
    Segments left: 0
    Stack records: 1 allocated, 0 in use
    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
    serial is ready with "M122" in state(s) 0
    aux is idle in state(s) 0
    daemon is idle in state(s) 0
    queue is idle in state(s) 0
    autopause is idle in state(s) 0
    Code queue is empty.
    Network state is running
    WiFi module is idle
    Failed messages: pending 0, notready 0, noresp 0
    WiFi firmware version 1.20b9
    WiFi MAC address 5c:cf:7f:61:99:c5
    WiFi Vcc 3.35, reset reason Turned on by main processor
    WiFi flash size 4194304, free heap 32376
    HTTP sessions: 0 of 8
    Socket states:  0 0 0 0 0 0 0 0
    Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)
    
    

    Any idea?


  • administrators

    Are you putting the ssid and password inside double quote characters?



  • Yes. I tried with Pronterface (using single quote to prefix each lower case char), and with minicom. Same error each time.

    Whatever I use as S/P values, I get the error.

    Did I fry the esp module? I don't think, as the firmware was successfully updated, but…



  • I just upgraded to lastest stable firmwares (1.20), and all is now working fine!



  • I have a question… M122 returns:

    WiFi signal strength -73dBm
    
    

    But my router says:

    Signal    Noise     RX Rate       TX Rate
    -59 dBm   -89 dBm   54.0 Mbit/s   65.0 Mbit/s
    
    

    Why is there such difference in signal level? In fact, while I'm now using the ESP-07 with a +6dB gain antenna, the signal level returned by M122 didn't changes that much (I think I was around -75dB before)…



  • Large differences is wifi signal strength are normal for differing wifi devices. Each one "hears" the other differently. This can be due so many different factors it's impractical to enumerate. Usually, it's different radio power, different antennas, or different propagation paths.

    In your case, it appears the router has "bigger ears" (better antenna.)



  • Ok, I see.

    But why switching from the default ESP (no antenna) to the new one (6dB gain antenna) didn't change that much the signal strength returned by the Duet?

    I don't have signal values given by the router with the default ESP (didn't think to read it at the time); so I don't know if it really changed. But the thing is I know have a much better connection: transfers are very fast and I don't get any disconnection anymore.


  • administrators

    If M122 is telling you that the signal strength is -73dBm now, that is already very low. If it was even lower before, that would explain the disconnections you had.

    Which wifi channel is your router set to? Does the reported signal strength vary if you switch between channels 1, 6 and 11?



  • Yes, it is low. But, as said, real transmissions work much better and faster, now. And no more disconnection.

    I will make tests with different channels (I think I'm on channel 1 - the router is in auto and chose this one).



  • Hi!

    I have WiFi signal strength -61dBm in three meters from the router. The ESP-07 has a very very weak antenna ((
    I will change to ESP-07S or connect external to ESP-07.
    Laptop, iPhone, Nokia etc. - everything works fine.



  • I used a wifi analyser on my phone, and noticed that there where 3 other AP on channel 1. In fact, it depends where I am in the house, and on the AP side, they are not detected. So the AP chose this channel. But on the printer side, they where as powerfull as my AP!

    I moved to channel 3, unused by other wifi AP, and I now have -66dB strength…



  • Will this be available as a build option?


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.