diff --git a/dependencies/CustomPiOS b/dependencies/CustomPiOS index 77119cd..6033d42 160000 --- a/dependencies/CustomPiOS +++ b/dependencies/CustomPiOS @@ -1 +1 @@ -Subproject commit 77119cd4248dc53e0b0352fd79878915802015bf +Subproject commit 6033d42541dce5a2fcb53f25399a9709a82d4393 diff --git a/dependencies/OctoPi b/dependencies/OctoPi index 70f71c1..07bdb86 160000 --- a/dependencies/OctoPi +++ b/dependencies/OctoPi @@ -1 +1 @@ -Subproject commit 70f71c1e60581593f333fa94ad417910e87726be +Subproject commit 07bdb8634a80bfa67e4cf3c7a2b5f3b387e24eb4 diff --git a/doc/index.rst b/doc/index.rst index 22a9924..1c65a5b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -28,7 +28,7 @@ Here are the short instructions: * Edit the v1pi-wpa-supplicant.txt (not with notepad.exe) * Put it in a pi, and go to `http://v1pi.local `_ -The longer instructions, including auto wifi hotspot, and a bunch more detail are here: +The longer instructions, including wifi hotspot, and a bunch more details are here: :doc:`setup` diff --git a/doc/setup.rst b/doc/setup.rst index 5e6464a..4f0718e 100644 --- a/doc/setup.rst +++ b/doc/setup.rst @@ -26,7 +26,6 @@ Step 3: Configure WiFi (Optional) If you don't want to connect this pi to your home WiFi network, then continue to the next step. If you're not sure, or you want to connect to your home WiFi, look at :doc:`wifi-setup`. Then come right back. - Step 4: Start it for the first time =================================== @@ -36,7 +35,7 @@ printer and power it up. The first time the pi boots, it will do some work to expand the filesystem to the full SD card size, and generally setting things up. This takes a few minutes. -If you are using the pi as a hotspot (it's not connected to your WiFi) then the WiFi network may not +If you are using the pi as a hotspot (it's *not* connected to your WiFi) then the WiFi network may not show up on the first boot (I'm not sure why, but in my tests, it wasn't coming up the first time). Wait a few minutes (literally 5 minutes is fine) and cycle power. Then wait a few more minutes and it should show up. @@ -47,11 +46,14 @@ Step 5: Connecting Connect to Hot Spot ------------------- -* The Hot Spot will show up with an ssid of ``v1pi`` and a connection password of ``raspberry``. +* The Hot Spot will show up with an ssid of ``raspap-webgui` and a connection password of + ``ChangeMe``. * Your computer might complain that you don't have an Internet connection. That's normal. The pi doesn't have Internet. -* If you connect with this method, the pi's ip address is ``192.168.50.1`` -* Open `http://192.168.50.1 `_ +* If you connect with this method, the pi's ip address is ``10.3.141.1`` +* Open `http://10.3.141.1 `_ +* The RaspAP UI has a username of "admin" and a password of "secret. +* Change your password! See below. Connect Through Your WiFi ------------------------- @@ -84,6 +86,12 @@ The landing page will give you a few sparse links to information about this imag .. image:: img/cncjs.png +* RaspAP: Administration for the networking on the pi. Be careful, if you're editing this on the + network and you break it, how will you reconnect to fix it? Also, make sure you change the + passwords. + +.. image:: img/raspap.png + Step 7: Change the Passwords ============================ @@ -110,21 +118,22 @@ You'll need to log into the pi to change the password. Changing the Hot Spot Password ------------------------------ -The hot spot *default* password is ``raspberry``. Any device within range can connect, and find your +The hot spot *default* password is ``ChangeMe``. Any device within range can connect, and find your pi, or the web interface, and control your pi, and your CNC machine. It gets worse if you think about an infected device being in range, and not just a panel van with an antenna on it. Changing the password is easy, and will help you sleep at night. OK, maybe not, but writing this will help me sleep at night. -The password is stored on the root file system in ``/etc/hostapd/hostapd.conf``. Log into the pi -through ssh, or you can edit the file on the sd card from your computer (but not in notepad, use -notepad++) +1. Open the webpage: `http://10.3.141.1 `_. + +1. Click on ``Configure Hotspot``. + +1. Click on ``Security``. - ``sudo nano /etc/hostapd/hostapd.conf`` +1. Change the password. -Go down to where it says: ``wpa_passphrase=raspberry`` and change the word raspberry to something -you want. Save the file (in nano, it's [Ctrl+x], y, enter). +Also in RapsAP, there is the webgui password. Change it in ``System``. Set up a Webcam ========= diff --git a/doc/wifi-setup.rst b/doc/wifi-setup.rst index 04dd757..cb508f6 100644 --- a/doc/wifi-setup.rst +++ b/doc/wifi-setup.rst @@ -11,21 +11,20 @@ v1pi has two ways to set up the WiFi: from any device on your WiFi network * Hot Spot: The pi will create an access point which your devices can connect to. +Hot Spot +======== -Auto Hot Spot -============= - -The Auto Hot Spot feature will create a Hot Spot when there is no client connection. +The Hot Spot feature will create a Hot Spot. * You don't have to do anything to set it up. - * The default ssid is ``v1pi`` - * The default passphrase is ``raspberry``. See the setup instructions for how to change it. + * The default ssid is ``raspap-webgui`` + * The default passphrase is ``ChangeMe``. See the setup instructions for how to change it. * If your machine is in a location without WiFi coverage, this is a good option. * The pi will not have any access to the Internet, so updates and installing plugins will not be possible. You will have to connect to the Internet to get updates or plugins. - * The IP Address of the machine will be ``192.168.50.1``. The bonjour hostname ``v1pi.local`` is + * The IP Address of the machine will be ``10.3.141.1``. The bonjour hostname ``v1pi.local`` is also available. * Since there is no Internet connection, it is more protected from attacks. diff --git a/src/config b/src/config index 8b7d3b7..2d9b258 100644 --- a/src/config +++ b/src/config @@ -1,3 +1,4 @@ export DIST_NAME=V1Pi export DIST_VERSION=0.16.0 -export MODULES="base(raspicam, network, nodejs, disable-services(octopi, cncjs, auto-hotspot), password-for-sudo)" +export BASE_IMAGE_ENLARGEROOT=800 +export MODULES="base(raspicam, network, nodejs, disable-services(octopi, cncjs), raspap, password-for-sudo)" diff --git a/src/custompios_path b/src/custompios_path index bdf18d5..e8140ca 100644 --- a/src/custompios_path +++ b/src/custompios_path @@ -1 +1 @@ -/home/jeffe/src/v1pi/dependencies/CustomPiOS/src/ +/home/jeffe/home/projects/v1pi/dependencies/CustomPiOS/src/ diff --git a/src/modules/cncjs/filesystem/home/pi/landingPage/serve.py b/src/modules/cncjs/filesystem/home/pi/landingPage/serve.py index 28871b9..faac3ed 100755 --- a/src/modules/cncjs/filesystem/home/pi/landingPage/serve.py +++ b/src/modules/cncjs/filesystem/home/pi/landingPage/serve.py @@ -22,6 +22,23 @@ def getServiceRunning(service): print("{} is unknown".format(service)) return False +def getServiceInstalled(service): + try: + output = subprocess.check_output(['service', service, 'status']) + except subprocess.CalledProcessError as err: + output = err.output + if 'active (running)' in output: + print("{} is running".format(service)) + return True + if 'active (exited)' in output: + print("{} has exited".format(service)) + return True + if 'inactive (dead)' in output: + print("{} is dead".format(service)) + return True + print("{} is unknown".format(service)) + return False + def callService(service, command): print("Running service {} {}".format(service, command)) subprocess.call(['sudo', '/usr/sbin/service', service, command]) @@ -34,17 +51,23 @@ def root(): service = None if 'octoprint' in request.form: service = 'octoprint' - if 'cncjs' in request.form: + elif 'cncjs' in request.form: service = 'cncjs' + elif 'lighttpd' in request.form: + service = 'lighttpd' + else: + return "Not Logical" if 'Start' == request.form[service]: callService(service, 'start') elif 'Stop' == request.form[service]: callService(service, 'stop') elif 'Restart' == request.form[service]: - callService(service, 'Restart') + callService(service, 'restart') return render_template('landingPage.html', octoprint_running=getServiceRunning("octoprint"), + raspap_installed=getServiceInstalled("lighttpd"), + raspap_running=getServiceRunning("lighttpd"), cncjs_running=getServiceRunning("cncjs")) diff --git a/src/modules/cncjs/filesystem/home/pi/landingPage/templates/landingPage.html b/src/modules/cncjs/filesystem/home/pi/landingPage/templates/landingPage.html index f05b929..65006a5 100644 --- a/src/modules/cncjs/filesystem/home/pi/landingPage/templates/landingPage.html +++ b/src/modules/cncjs/filesystem/home/pi/landingPage/templates/landingPage.html @@ -12,6 +12,7 @@

Serve up Octoprint or CNC.js

@@ -63,6 +64,33 @@

CNC.js Stopped {% endif %} + {% if raspap_installed %} +
+
+ +
+ +
+ RaspAP +
+
+ {% if raspap_running %} +

RaspAP Running +
+ + +
+

+ {% else %} +

RaspAP Stopped +
+ +
+

+ {% endif %} +
+
+ {% endif %}