Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octopi as WiFi Hotspot #396

Open
John-Mc opened this issue Aug 5, 2017 · 21 comments
Open

Octopi as WiFi Hotspot #396

John-Mc opened this issue Aug 5, 2017 · 21 comments

Comments

@John-Mc
Copy link

John-Mc commented Aug 5, 2017

@APAeroDan was asking on another issue thread about setting up OctoPi as a WiFi Hotspot. Guysoft suggested he open a separate issue.

Here's a a solution to do that by Kenneth Jiang:
https://medium.com/@kennethjiang/painless-wi-fi-for-octoprint-4e6b68005400
Scroll partway down to get to the WiFi Hotspot section. This set-up will first try to connect to any known networks you have entered in to octopi-wpa-supplicant.txt. If it is not successful in that, it will set up its own WiFi Hotspot.

I used this successfully with OctoPi 0.13 and with one of the release candidates for 0.14. I have not yet tried it with the stable release of OctoPi 0.14. Note that this setup is not dependent on OctoPi. It should work with a regular Raspian installation.

EDIT: the hotspot mentioned above does not work on OctoPi 0.15 and later (or any other Raspian-Stretch based system)

@guysoft
Copy link
Owner

guysoft commented Oct 13, 2017

It might be worth writing a CustomPiOS module for that now

@APAeroDan
Copy link

APAeroDan commented Oct 13, 2017 via email

@John-Mc
Copy link
Author

John-Mc commented Jan 31, 2018

Update: the WiFi Hotspot linked above works fine with the OctoPi 0.14 stable release.

It does not work on OctoPi 0.15 nightly release from 2017-12-23, or any Raspian-Stretch based image that I have tried. There appears to have been a change to /etc/network/interfaces in Raspian-Stretch. Figuring that out is above my pay grade.

@guysoft
Copy link
Owner

guysoft commented Mar 3, 2018

Started writing a wofi hotspot module in my spare time. Its mmoving slowly but I have some code

@John-Mc
Copy link
Author

John-Mc commented Mar 3, 2018

Last I heard, @kennethjiang was thinking of updating the WiFi Hotspot referenced in the first post here to work with Raspian-Stretch and OctoPi 0.15 when he got some time. I'm not sure if he's started on that yet or not.

@guysoft
Copy link
Owner

guysoft commented Mar 5, 2018

Added a wifi module that implements this guide.
See this folder in CustomPiOS. Born on this commit.

You could make this an OctoPi variant easily.

@APAeroDan
Copy link

APAeroDan commented Mar 5, 2018 via email

@guysoft
Copy link
Owner

guysoft commented Mar 5, 2018

@APAeroDan I don't think this will be a default shipping, aat best a variant you could build. So what exactly would you like?
Also would like to hear @foosel if she agrees or not.

@APAeroDan
Copy link

APAeroDan commented Mar 6, 2018 via email

@guysoft
Copy link
Owner

guysoft commented Mar 6, 2018

Actually, after looking at @foosel's work with netconnectd we might ship this. I think the only change should be that the wifi should not go up if the ethernet manages to connect successfully.

@John-Mc
Copy link
Author

John-Mc commented Mar 6, 2018

I think the only change should be that the wifi should not go up if the ethernet manages to connect successfully.

Isn't one of the cases that someone wants to share their Pi's ethernet internet connection via a WiFi Hotspot from the Pi?

@guysoft
Copy link
Owner

guysoft commented Mar 6, 2018

@John-Mc Yes, and thats why it would be an option in the module.

@guysoft
Copy link
Owner

guysoft commented May 3, 2018

@foosel Do you think we should add the hostpost module as nightly and see if its a good move? I can also add scripts that control it, then OctoPrint could let you set ssid and password, and enable/disable

@foosel
Copy link
Collaborator

foosel commented May 3, 2018

@guysoft It's your image ;) But sure, go ahead. Keep in mind that OctoPrint runs (and should continue to keep running) as user, not root, so for any kind of configuration of network stuff from within OctoPrint you'll need a solution to configure that stuff that preferably does not require full blown root access (security). That was the whole point why netconnectd runs with this server/client scheme communicating over a unix domain socket.

@guysoft
Copy link
Owner

guysoft commented May 3, 2018

@foosel we could set at /etc/suders.d/hotspot_permissions

something like this

pi ALL=(root) NOPASSWD: /usr/local/bin/octopi

That should let pi execute a single command as root without password.

Would that help?

@foosel
Copy link
Collaborator

foosel commented May 3, 2018

Yeah, sure.

@guysoft
Copy link
Owner

guysoft commented Feb 11, 2019

Ok, so there other more mature projects out, such as:
https://github.com/jasbur/RaspiWiFi

or

https://github.com/balena-io/wifi-connect (cc @drphil3d ).

I am not as familiar with what might work best, if I push this to nightly, or make an experimental build, is this something anyone around here is willing to test?

@John-Mc
Copy link
Author

John-Mc commented Feb 11, 2019

@guysoft - I'd be happy to poke around with a wifi hotspot setup to see if I can find problems. I'll be no help on the code itself, but I'm pretty good at poking around and findout out what works and what doesn't (I did a fair amount of that when Ken was writing the hotspot mentioned in the first post in this thread). We were able to give it a good workout when I was helping out at a local elementary school. (The school's IT guy was not nuts about our little project being on "his" network.)

My free time tends to run hot & cold, but I will look at whatever you put up as soon as I can.

@drphil3d
Copy link

drphil3d commented Feb 11, 2019 via email

@drphil3d
Copy link

so when wifi-connect is initiated it can be set to use any port number specified, you should also be able to proxy octoprint through as well. If we want to use the captive portal then port 80. I have to look into the config file for wifi-connect. it has an html page that you can just add a link to in order to access octoprint.

@guysoft
Copy link
Owner

guysoft commented Feb 27, 2019

Sorry this keeps getting delayed, my nightly build system is up to no good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants