schollz / raspberry-pi-turnkey

How to make a Raspberry Pi image that can be deployed anywhere and assigned to a WiFi network without SSH :ok_hand:
MIT License
832 stars 90 forks source link

Renable AP if RPi is moved or SSID changed #9 #8

Closed ilirb closed 6 years ago

ilirb commented 6 years ago

Scan available networks and present them in a dropdown. Disable autocorrect and autocapitalizaion for password input.

schollz commented 6 years ago

@ilirb This is wonderful! I will give it a try!

schollz commented 6 years ago

I'm getting a Exception - are you using python3?

Mar  2 21:04:41 raspberrypi rc.local[506]: [2018-03-02 21:04:41,414] ERROR in app: Exception on / [GET]
Mar  2 21:04:41 raspberrypi rc.local[506]: Traceback (most recent call last):
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1982, in wsgi_app
Mar  2 21:04:41 raspberrypi rc.local[506]:     response = self.full_dispatch_request()
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1614, in full_dispatch_request
Mar  2 21:04:41 raspberrypi rc.local[506]:     rv = self.handle_user_exception(e)
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1517, in handle_user_exception
Mar  2 21:04:41 raspberrypi rc.local[506]:     reraise(exc_type, exc_value, tb)
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise
Mar  2 21:04:41 raspberrypi rc.local[506]:     raise value
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request
Mar  2 21:04:41 raspberrypi rc.local[506]:     rv = self.dispatch_request()
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request
Mar  2 21:04:41 raspberrypi rc.local[506]:     return self.view_functions[rule.endpoint](**req.view_args)
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/home/pi/raspberry-pi-turnkey/startup.py", line 48, in main
Mar  2 21:04:41 raspberrypi rc.local[506]:     return render_template('index.html', ssids=getssid())
Mar  2 21:04:41 raspberrypi rc.local[506]:   File "/home/pi/raspberry-pi-turnkey/startup.py", line 37, in getssid
Mar  2 21:04:41 raspberrypi rc.local[506]:     ssids = get_ssid_list.split('\n')
Mar  2 21:04:41 raspberrypi rc.local[506]: TypeError: a bytes-like object is required, not 'str'
ilirb commented 6 years ago

@schollz Sorry, no. As I mentioned on the issue #9 I'm using python 2.7. However, I pushed a new commit that uses splitlines() instead of split('\n') and it returned the SSID list on python 3 correctly.

schollz commented 6 years ago

Haha, ah the pain of Python2<->3! I have a few more little edits for me, but I'll pull and make them! It works well and I love the idea. Thanks @ilirb