Can't connect to OctoPrint UI via Wifi

What is the problem?
I can connect to the Octoprint UI via wired LAN but not Wifi.

What did you already try to solve it?
I followed OutSourceGuru's helpful notes https://github.com/OutsourcedGuru/octopi-install#next-edit-the-wi-fi-configuration
I added
LAN connection fine, I can ping name and IP address and can connect with OctoPrint UI
Wifi connection also seemingly fine, I can ping octopi.local and IP address but can't connect - I get "Unable to connect"

With LAN disconnected Pi console tells me that I may use the following address to access OctoPrint
htty://192.168.178.20
http://octopi.local

ifconfig for wlan0 flags 4163<UP,BROADCAST,RUNNING,MULTICAST> MTU 1500

I can login using Putty ssh port 22 192.168.178.25 (the LAN ip) to the pi console and login
I can't login using Putty ssh port 22 192.168.178.20 (the Wifi ip), Putty says Network Error:Connection refused

If I use octopi.local in Putty ssh it connects to 192.168.178.25 (LAN ip)

With both LAN and Wifi connected my router shows two instances of octopi 192.168.178.20 and .25 (both fixed in router)

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)
I think I must have done something wrong. When I look at the SD card on a PC I have only one subdirectory, "overlays" and no .log files
Only error on pi console relates to a cam that I don't have.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
Pi 3B+, Octopi 0.17.0 installed with octopi-buster-lite-0.17.0.zip updated to OctoPrint 1.4.0 via wired LAN.
Not connected to printer
Waterfox 2020.02.1, Win7 SP1 x64 Ult

That's the way it would look on some workstations/laptops:

  • macOS can't see the second ext4 partition
  • Windows can't see the second ext4 partition
  • Linux (Ubuntu, Debian, Raspian) can see it and mount it

From your workstation: ping octopi.local

The first step of that command is a DNS lookup. If that indicates the 192.168.178.25 address, then your DHCP router has bound the Ethernet-attached Raspberry network adapter FIRST in its list of DNS records. If the .20 address shows up instead, then the reverse situation happened: the Raspberry's wifi network adapter is first.

Since you're using PuTTY (rather than ssh), I'll assume that you're on Windows. The Raspberry's /boot partition likely has a file in it called ssh which is a flag which says "turn on the SSH server" and it's obvious that it's working. So the reasons why it wouldn't work over the wifi network would be:

  • Maybe the router has a configuration problem of some kind
  • Maybe you have two wifi zones (5Ghz and 2.4Ghz) with the same SSID, the 3B+ has connected to the 5Ghz side of things and that's not 100% setup in your router's configuration
  • Maybe your /boot/octopi-wpa-supplicant.txt either doesn't have the right country code, you have two country codes uncommented or something like that

You might try disconnecting the Ethernet cable. If that now works by just using the octopi.local then you could continue to troubleshoot it to see why.

Router config - quite possibly
Different SSID's for two Wifi zones.
Country code - althought I'm in Ireland I'm using GB (also for keyboard). I believe Irish code is IE and I'll try that.
With LAN disconnected I can still ping octopi.local and not Putty SSH connect.

My octopi-wpa-supplicant.txt

# Use this file to configure your wifi connection(s).
#
# Just uncomment the lines prefixed with a single # of the configuration
# that matches your wifi setup and fill in SSID and passphrase.
#
# You can configure multiple wifi connections by adding more 'network'
# blocks.
#
# See https://linux.die.net/man/5/wpa_supplicant.conf
# (or 'man -s 5 wpa_supplicant.conf') for advanced options going beyond
# the examples provided below (e.g. various WPA Enterprise setups).
#
# !!!!! HEADS-UP WINDOWS USERS !!!!!
#
# Do not use Wordpad for editing this file, it will mangle it and your
# configuration won't work. Use a proper text editor instead.
# Recommended: Notepad++, VSCode, Atom, SublimeText.
#
# !!!!! HEADS-UP MACOSX USERS !!!!!
#
# If you use Textedit to edit this file make sure to use "plain text format"
# and "disable smart quotes" in "Textedit > Preferences", otherwise Textedit
# will use none-compatible characters and your network configuration won't
# work!

## WPA/WPA2 secured
network={
  ssid="11716-Lightnet-WiFi"
  psk="*********"
}

## Open/unsecured
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#}

## WEP "secured"
##
## WEP can be cracked within minutes. If your network is still relying on this
## encryption scheme you should seriously consider to update your network ASAP.
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#  wep_key0="put password here"
#  wep_tx_keyidx=0
#}

# Uncomment the country your Pi is in to activate Wifi in RaspberryPi 3 B+ and above
# For full list see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
#country=GB # United Kingdom
#country=CA # Canada
#country=DE # Germany
#country=FR # France
#country=US # United States
country=GB
### You should not have to change the lines below #####################

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

My OctoPrint.log

2020-03-11 16:05:29,744 - octoprint.startup - INFO - ******************************************************************************
2020-03-11 16:05:29,747 - octoprint.startup - INFO - Starting OctoPrint 1.4.0
2020-03-11 16:05:29,748 - octoprint.startup - INFO - ******************************************************************************
2020-03-11 16:05:30,457 - octoprint.startup - INFO - Unable to fetch plugin blacklist from https://plugins.octoprint.org/blacklist.json, proceeding without it: HTTPSConnectionPool(host='plugins.octoprint.org', port=443): Max retries exceeded with url: /blacklist.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x74658990>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2020-03-11 16:05:30,458 - octoprint.startup - INFO - Blacklist processing done
2020-03-11 16:05:30,532 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2020-03-11 16:05:32,157 - octoprint.plugin.core - INFO - Found 15 plugin(s) providing 15 mixin implementations, 27 hook handlers
2020-03-11 16:05:32,381 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2020-03-11 16:05:32,427 - octoprint.server - INFO - Intermediary server started
2020-03-11 16:05:32,429 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2020-03-11 16:05:32,550 - octoprint.plugin.core - INFO - Found 15 plugin(s) providing 15 mixin implementations, 27 hook handlers
2020-03-11 16:05:32,582 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi/.octoprint/uploads...
2020-03-11 16:05:32,584 - octoprint.filemanager.storage - INFO - ... file metadata for /home/pi/.octoprint/uploads initialized successfully.
2020-03-11 16:05:32,588 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: u"Need(method='role', value=u'plugin_action_command_prompt_interact')")
2020-03-11 16:05:32,590 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: u"Need(method='role', value=u'plugin_announcements_read')")
2020-03-11 16:05:32,591 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: u"Need(method='role', value=u'plugin_announcements_manage'), Need(method='role', value=u'plugin_announcements_read')")
2020-03-11 16:05:32,592 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: u"Need(method='role', value=u'plugin_appkeys_admin')")
2020-03-11 16:05:32,594 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: u"Need(method='role', value=u'plugin_backup_access')")
2020-03-11 16:05:32,595 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: u"Need(method='role', value=u'plugin_logging_manage')")
2020-03-11 16:05:32,597 - octoprint.server - INFO - Added new permission from plugin pi_support: PLUGIN_PI_SUPPORT_STATUS (needs: u"Need(method='role', value=u'plugin_pi_support_check')")
2020-03-11 16:05:32,597 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: u"Need(method='role', value=u'plugin_pluginmanager_manage')")
2020-03-11 16:05:32,600 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: u"Need(method='role', value=u'plugin_pluginmanager_install'), Need(method='role', value=u'plugin_pluginmanager_manage')")
2020-03-11 16:05:32,601 - octoprint.server - INFO - Added new permission from plugin printer_safety_check: PLUGIN_PRINTER_SAFETY_CHECK_DISPLAY (needs: u"Need(method='role', value=u'plugin_printer_safety_check_display')")
2020-03-11 16:05:32,602 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: u"Need(method='role', value=u'plugin_softwareupdate_check')")
2020-03-11 16:05:32,603 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: u"Need(method='role', value=u'plugin_softwareupdate_update')")
2020-03-11 16:05:32,658 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2020-03-11 16:05:33,988 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python2 -m pip" as command to invoke pip
2020-03-11 16:05:34,953 - octoprint.util.pip - INFO - Version of pip is 19.3.1
2020-03-11 16:05:34,955 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2020-03-11 16:05:34,956 - octoprint.util.pip - INFO - ==> pip ok -> yes
2020-03-11 16:05:34,961 - octoprint.plugin.core - INFO - Initialized 15 plugin implementation(s)
2020-03-11 16:05:34,971 - octoprint.plugin.core - INFO - 15 plugin(s) registered with the system:
|  Action Command Prompt Support (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/action_command_prompt
|  Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/announcements
|  Anonymous Usage Tracking (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/tracking
|  Application Keys Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/appkeys
|  Backup & Restore (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/backup
|  Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/corewizard
|  Discovery (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/discovery
|  Error Tracking (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/errortracking
|  Logging (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/logging
|  Login UI (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/loginui
|  Pi Support Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pi_support
|  Plugin Manager (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager
|  Printer Safety Check (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/printer_safety_check
|  Software Update (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/softwareupdate
|  Virtual Printer (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer
Prefix legend: ! = disabled, # = blacklisted, * = incompatible
2020-03-11 16:05:34,989 - octoprint.environment - INFO - Detected environment is Python 2.7.16 under Linux (linux2). Details:
|  hardware:
|      cores: 4
|      freq: 1400.0
|      ram: 917016576
|  os:
|      id: linux
|      platform: linux2
|  plugins:
|      pi_support:
|          model: Raspberry Pi 3 Model B Plus Rev 1.3
|          octopi_version: 0.17.0
|  python:
|      pip: 19.3.1
|      version: 2.7.16
|      virtualenv: /home/pi/oprint
2020-03-11 16:05:34,999 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets...
2020-03-11 16:05:35,018 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache...
2020-03-11 16:05:35,950 - octoprint.server - INFO - Shutting down intermediary server...
2020-03-11 16:05:35,994 - octoprint.server - INFO - Intermediary server shut down
2020-03-11 16:05:35,997 - octoprint.events - INFO - Processing startup event, this is our first event
2020-03-11 16:05:35,999 - octoprint.events - INFO - Adding 0 events to queue that were held back before startup event
2020-03-11 16:05:36,001 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2020-03-11 16:05:36,004 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...
2020-03-11 16:05:36,006 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2020-03-11 16:05:36,007 - octoprint.server.util.watchdog - INFO - ... initial scan done.
2020-03-11 16:05:36,021 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi' for _http._tcp
2020-03-11 16:05:36,033 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi' for _octoprint._tcp
2020-03-11 16:05:36,043 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for SSDP
2020-03-11 16:05:36,060 - octoprint.server - INFO - Listening on http://127.0.0.1:5000
2020-03-11 16:05:36,147 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2020-03-11 16:05:37,141 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python2 -m pip" as command to invoke pip
2020-03-11 16:05:37,149 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2020-03-11 16:05:37,152 - octoprint.util.pip - INFO - ==> pip ok -> yes
2020-03-11 16:05:37,162 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.178.21
2020-03-11 16:05:37,527 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.178.21
2020-03-11 16:05:37,691 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2020-03-11 16:05:37,738 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=en', 'path': '/', 'base_url': 'http://192.168.178.25/'}
2020-03-11 16:05:37,772 - octoprint.server.util.flask - INFO - Passively logging in user towlerg from ::ffff:192.168.178.21
2020-03-11 16:05:37,775 - octoprint.access.users - INFO - Logged in user: towlerg
2020-03-11 16:05:37,803 - octoprint.server.util.flask - INFO - Passively logging in user towlerg from ::ffff:192.168.178.21
2020-03-11 16:05:37,805 - octoprint.access.users - INFO - Logged in user: towlerg
2020-03-11 16:05:37,825 - octoprint.server.util.sockjs - INFO - User towlerg logged in on the socket from client ::ffff:192.168.178.21
2020-03-11 16:05:38,307 - octoprint.server.util.sockjs - INFO - User towlerg logged in on the socket from client ::ffff:192.168.178.21
2020-03-11 16:05:45,477 - octoprint.server.preemptive_cache - INFO - ... done in 7.74s
2020-03-11 16:05:45,478 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=en', 'path': '/', 'base_url': 'http://octopi.local/'}
2020-03-11 16:05:47,266 - octoprint.server.preemptive_cache - INFO - ... done in 1.79s
2020-03-11 16:06:13,795 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.178.21

My router has two WPA modes, WPA(CCMP) and WPA+WPA2. Anybody know which to select for Pi?

You didn't exactly follow the instructions...

  • All : Erase all the file's original contents and replace with this as a starting point...

I've found that users will get confused by all the comments. When it's just a small amount of stuff then it's easier to spot duplications. Note that my version includes one additional attribute that yours is missing (which could possibly be significant).

Also, one user's setup wasn't working. I had them just reorder the commands so that the country code was above the network paragraph and then suddenly it started working. I don't know if that is significant, a bug or what.

Also, boot the pi with the Ethernet cable disconnected so it only has WiFi. My guess is everything is binding to the wired port since it is up first, and the router sees the wifi as a second device using the same hostname as the Ethernet. A DNS lookup by name will fail since 2 different ip's on the same subnet are the same hostname.

Thanks for that, I'll do as you suggest. BTW I forgot to say that did run "sudo raspi-config".

Thanks. That makes a lot of sense but it doesn't work. I can pink octopi.local and the ip address but can not run the OctoPrint UI or login via SSH.

Okay, so if you can ping octopi.local and that session indicates the wifi adapter's IP address then you know that it's connected to your wifi network and has a RUNNING flag in that ifconfig paragraph.

The next step would be to try to determine if OctoPrint is attached to port 5000 of localhost and that haproxy is attached to port 80 of the IP address you discovered earlier.

sudo netstat -a |grep LISTEN

Note that 0.0.0.0 means all running network adapters to include localhost.

after upgrading to v.1.4 of Octoprint, my raspberry Pi on which it runs,no longer connects to my router via WiFi.

I will do more troubleshooting and post details later.
I will attempt to connect with a hard wired connection.

Seems like I stuffed up keyboard selection in "sudo raspi-config". I'm going to do an Octopi install from scratch.
Any thought's re. WPA(CCMP) vs WPA+WPA2

The second should be fine, but include the attribute I mentioned from my tutorial.

Seems like the trick is to initially run Octopi without a LAN connection. Of course it may have been a mistake I made in the process first time round.

Thank you OutSouceGuru for taking so much trouble and for your notes.

Thank you 5ft24 for your help.

1 Like

Oh dear, seems like I posted to early.

My I preface the following by saying that I fully acknowledge the likelihood of my problems to be operator error.

After I preened myself for getting Wifi working without a LAN connection, I shut it down disconnected video, mouse and keyboard, put it in a box and bugger Wifi stopped working (if connected, LAN still OK). So I connected video , mouse and keyboard to see what was going on, fired it up worked without a LAN connection.

Later I'll try an Octopi install with just video connected.

This all seem quite bizarre but if I do a fresh Octopi install without LAN, keyboard and mouse, Wifi works just fine. Maybe it's just my Router/Pi 3B+ but ............

Also if I connect HDMI after Pi has booted, display is blank. Again, maybe just my monitor.

Upgrade to OctoPrint, 1.4 Wifi still working. Installed plugin, Wifi still working. Shutdown and cycle power, Wfi still working.

BTW to anybody trying this, fast SD cards are worth every penny. Using WinDiskImager, 2 minutes for SanDisk Extreme, 10 minutes for Kingston CANVAS Select Plus. (both supposedly class 10)

I will note that if you are doubly-connected (wifi + Eth) then your Pi's routing table will include one default route which is either one or the other. Another name for this is the "gateway". In other words, by default, how does the Pi reach out to the rest of the world?

My suspicion is that this has something to do with your router and its configuration.

I had similar problems, no matter what I did, no connection with a fresh install of octoprint. Until i did the sudo iwlist wlan0 scan and then noticed that there is a space at the end of my SSID name, that I didn’t know of and that, when you use a GUI is invisible.... once that space was added in the wpa/wpa2 section, all is fine! It can be such a tiny silly thing.....

1 Like

Although I'm sure your post is helpful info, it is not applicable to my situation.

My problem was not that Wifi wouldn't work but that if I installed Octopi with a LAN cable connected, Wifi wouldn't work when the LAN cable was removed. ditto keyboard.

If you have a Wifi AP, the simple solution is to install Octopi without LAN or keyboard. This gives you the option of using either LAN or Wifi.

Wait... instead of removing the extra space from your router's setup you added it to the Pi's? I'm pretty sure I would fix this at the source.

You are right.... however there are another 10 (at least) devices connected to this SSID that then all have to be reset....