OctoPi WiFi/network connection troubleshooting megatopic

I have port forwarding over 15 years for security cameras.
I never hear of any of these things.
I know if hackers looking for you it doesn't need port forwarding, it will come to you in every way.

A camera just delivers images and you can change settings.
A raspberry Pi is a computer and you can upload malicious software and execute it.

Well, you might not have heard of any fallout from port-forwarding, but the dark side of the Internet knows about this. There are websites which have databases of people whose computers are available like this to them. In simple cases, they sell the information to make money. In more advanced cases, they themselves try to do anything to make money from your foolishness. The easiest way is to then push code to your computer to turn it into something like a computer-jinni which does their bidding. And then you find that your ISP has turned off your account because it's been responsible for sending out millions of SPAM emails, for example.

Thanks for the explanation!,
You really convince me at the beginning,
I'm checking the link you sent,

it seems complex to those who don't understand PI operating system.
there is another safe and relatively easy way to remotely access Octoprint?

It's complicated, yes. But this is what's necessary. I'd say either add the client certificates as described or remove the port forwarding.

You need to determine why you want to remotely access OctoPrint. Make a list of specific activities you wish to do remotely. Some of the items on the list will have ways to safely access them remotely. Some of the items on the list will be dangerous to allow.

Without some protection you are at risk of having your local network turned into their launching pad. If you have any sensitive data on your local network they will probably have a copy of it.

Here's a how-to that should help with that.

I set up my Raspberry Pi 3B (EDIT: not a 3B+, thanks Amazon) yesterday with OctoPi 0.17.0 (the version advertised on the front page). Using a keyboard and monitor I can see that it works, but the line about accessing it over the network is blank, and the address "octopi.local" is blank on my computer and mobile. I followed the setup guide, uncommenting the WPA2 section and entering my credentials (first for my 5GHz network, then for my 2GHz network), and also tried moving the country code before the network details.
Then, I entered my mobile's hotspot credentials to the wpa supplicant txt file, and success! I could visit octopi.local on my mobile (and on my computer when I moved it over to the hotspot). So, what could possibly make the OctoPi's wifi work with a mobile hotspot but not with a home router?

Additional details:
PC: Windows 10.
Mobile: Pixel 4 on Verizon.
Router: NETGEAR Nighthawk R7000.
Raspberry Pi: 3 Model B v1.2.
OctoPi: 0.17.0.
Country: US.

Troubleshooting steps:
Moved my Pi to within a foot of the router to eliminate signal strength.
Reflashed image (using baelnaEtcher and NotePad++).
Ran "ifconfig wlan0" several times to confirm wlan0 is up. Always reports "ether" not "inet".
Ran "iwlist wlan0 scan" to confirm it can see SSID(s). Sometimes it can see networks (including my 2GHz), sometimes "interface doesn't support scanning : Network is down". Sometimes, if it is down, "sudo ifconfig wlan0 up" followed by scan works to produce a list of SSIDs. In the most recent attempt, my 2.4GHz network is "Cell 02".

I re-flashed it again (that's fresh start #3) and configured the wpa file for my mobile hotspot. Once that was connected, I commanded an update and upgrade. After that, it was able to connect to my home network. Octoprint is now up and running on my printer. If this is a known issue with the dot-zero version, perhaps a dot-one needs to be released...

1 Like

Hi everyone :slight_smile:

Got a strange issue I can't wrap my head arround.
I'm trying to connect my Raspi to a GoPro camera. Which I occationally manage to do.. :stuck_out_tongue:
But I can't get the Pi to disconnect from the first Wifi I connected it to..

I've changed the wifi settings both in octopi-wpa-supplicant.txt and by "sudo raspi-config" several times. I've tried setting it to the GoPro's Wifi details, and it sometimes work. But it only lasts for minutes.

What i found, is that the Pi connects to my router's wifi even if these details are completely removed from octopi-wpa-supplicant.txt. So after configuring octopi-wpa-supplicant.txt or using the raspi-config thing to connect to the GoPro's Wifi, I can still SSH from my Mac with the ethernet cable unplugged.... ?? (and I can see in my routers web interface that the Pi is connected via Wifi.

Some details:
-I'm on a mac.
-I'm as much of a beginner as one can possibly be.
-After using raspi-config to input a text phrase ("doesthiswork") instead of a real SSID, I selected "finish", did a reboot, and octopi-wpa-supplicant.txt does not update with "doesthiswork" as SSID. Where does raspi-config store the Wifi settings that I input?

Most people in here are heaving issues connecting... I can't disconnect :stuck_out_tongue:

If you're attempting to circumvent the /boot/octopi-wpa-supplicant.txt file by using sudo raspi-config, then it's probably a good idea to rename the version on the boot partition.

mv /boot/octopi-wpa-supplicant.txt /boot/octopi-wpa-supplicant.txt.save

You might do this on the Pi after you've successfully logged in. Then visit the raspi-config utility, set the values again and reboot.

What was likely happening is that you were using raspi-config, making changes and those changes were going straight to some file like /etc/wpa_supplicant.conf or similar. Then upon bootup, another routine was seeing the octopi-wpa-supplicant.txt and pushing these values into that same global configuration file (overwriting your attempts).

Thank you for your response :slight_smile:

I've previously set the wifi config to the exact same parameters both in suplicants.txt and in raspi-config, and thereafter booted 2 times, to test exactly the same suspicion you are having.

But I'll of course try your method :slight_smile:.
Thanx

I have trouble getting a connection to my wlan. It worked one time but after a reboot octpi didnt reconnect.

I started from scratch with a new image.

sudo iwlist wlan0 scan shows a good quality (88/100) but still it does not connect to the wifi.

Any suggestions?

P.S: Octopi running on an Raspi 2B with Edimax-WLAN-Adapter

Seems like I got it running:

Booted into GUI and connected it there. Now it is getting a connection even if booted into console. Strange.

I was probably too early: today - after reboot - it does not connect again. :rage:

Go back to basics:

  • Visit your router and find out whether or not the Pi has been issued an IP address and what that is
  • Try connecting with the IP address instead of the hostname
  • Review the DHCP lease duration on your router; it's often by default shorter than the duration of a long-duration print job
  • See if your router's Avahi/Bonjour hostname resolution/broadcasting service is trying to uniquely increment the hostname from "octopi.local" to something like "octopi-2.local" or something stupid like this
  • Try ping octopi.local and see if your local arp cache can resolve it through a promiscuous broadcast (it would then magically work for a while until arp expires that entry)
  • Tell your router to issue a static IP address to the Pi
  • Consider then manually adding a /etc/hosts entry for the Pi in your workstation which matches that IP address and hostname

octoprint-name-resolution-hacks

The Raspberry Pi has no connection:

"sudo iwlist wlan0 scan" lists good signal strength, but the Pi still won't connect.

I have already switched everything to a static IP address. But since the pi is not connected at all, I logically can't reach it via the IP address.

Here, here

Nope :sob:

It isn't disabled. It worked fine with KODI installed, so I think it's not an hardware issue. It came up for an hour or so and then disconnected again. So it seems to loose connection despite having a good signal and enough power (2.5 A power supply).

You might troubleshoot this as a power-saving bug. Possibly here or here.