+
+## Setup
+Everything is managed by [botfather](https://telegram.me/BotFather). Follow the next steps:
+
+Request a new bot: send the command `/newbot`. The response to that command will be:
+```
+Alright, a new bot. How are we going to call it? Please choose a name for your bot.
+```
+Now you name your bot whtever you like. This is how you will identify your bot in your telegram user list from now on.
+After choosing the name you willget that response:
+
+```
+Done! Congratulations on your new bot. You will find it at t.me/openscan_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
+
+Use this token to access the HTTP API:
+4815162342:N334AA-covfefeskibidi
+Keep your token secure and store it safely, it can be used by anyone to control your bot.
+
+For a description of the Bot API, see this page: https://core.telegram.org/bots/api
+```
+
+This is a really important part: store that token safely as its the way you will securely talk with your bot.
+
+Now you have 2 ways to fint your "client_id":
+
+The first is open a chat with [@userinfo](https://t.me/userinfobot). If you type ```/start```there you will get an ```Id```response and you can complete the process.
+
+Another way is opening an url in your browser to get your id:
+
+```
+https://api.telegram.org/bot
\ No newline at end of file
diff --git a/docs/changelog.md b/docs/changelog.md
new file mode 100644
index 0000000..c9ff705
--- /dev/null
+++ b/docs/changelog.md
@@ -0,0 +1,52 @@
+# Changelog
+
+### 2024-11S
+* fixed: shutdown and reboot button in the UI
+* Added Swagger UI to help build, design and document the API
+* Fixed the FKMSGate
+* New update mechanism: Releases have their own version with their own stable, beta and meanwhile flavours.
+
+### 2024-02-26
+* Fixed: Without telegram configured it was impossible to finish a scan (hanged on finish). But who in their sanity would not use telegram if available right?
+* After a reboot/shutdown, if you forgot to close that tab it will not trigger a disaster when you are scanning in the future
+
+### 2024-02-23 Meanwhile (23F)
+
+This is the beginning of a fork. After several attempts to add a feature and get silence as response I have decided to create my own OpenScan fork.
+* added: When doing a focus stack session you can store the contents inside the zip with all the photos sorted in their own folder. Some focus stacking applications will benefit from this.
+* added: [You can now get alerts on Telegram](Telegram.md) when the session starts and the session ends
+* fixed: The "delete all files" operation no longer prevents the refresh of the file list
+
+### 2022-05-19 documentation
+* changed: overall structure --> the OpenScan2 repository will serve as a central hub for all informations concerning OpenScan (i.e. firmware, hardware, tutorials ...)
+### 2022-05-11 beta
+* added: changelog and version (finally ;)
+* added: create an update using the node-red-backend inject node ("create beta" and "prepare image creation" in "update" tab)
+* fixed: Error handling in flask (when no preview is taken)
+* fixed: Error when upload failed + node red restarted (multiple instances of curl)
+* fixed: When closing the browser session/missing the popup after the routine, the data set got lost (if this happens, just restart the device and it will be moved to the right location)
+### 2022-04-26 beta
+* added: donation button ;)
+* fixed: the wonderful camera position algorithm was faulty and a bit inefficient
+* fixed: downscaling the preview image caused the preview to disappear (when crop value was to high)
+* fixed: delay_before and delay_after are now properly applied, so that you can set a delay before/after taking a photo
+* fixed: updates might crash the selected camera --> it is now necessary to re-select the camera after certain updates
+### 2022-04-21 beta
+* added: timer (ETA) until a routine is done
+* added: showing progress, while files are being split (before uploading to OpenScanCloud)
+* added: infotexts (FINALLY :)
+* added: several stats/device information
+* fixed: combining two sets did not delete the smaller set
+### 2022-04-20 beta & main
+* !fixed: pi cameras (v1.3, v2.1 and HQ) finally work and can be simply selected in the settings menu
+* !fixed: Raspberry Pi 3B+ and 4 work! (the main limiting factor now is the RAM, where at least 1GB RAM is needed)
+* fixed: live preview sometimes did not work. This has been a network speed issue and has been solved by downscaling the image (resolution can be set)
+* fixed: it is now possible to delete individual sets.
+* fixed: it is now possible to use all LEDs.
+* added: Turntable mode (disable the second axis)
+* added: Pause scan. You can pause and un-pause the scan by simply pressing the button
+* added: second scan pass. When one scan is done, you can immediately run a second pass. This is especially useful, if you want to re-orient the object
+* added: auto-timeout. Turn off the ringlight (todo: and motors) after 300 seconds (value can be set)
+* added: diskspace warning. When free diskspace drops below a given threshold (4GB by default), a warning message will appear
+* changed: new background image, minor design changes
+* changed: log file can be easily generated and downloaded by clicking a button (update&info tab)
\ No newline at end of file
diff --git a/docs/img/Openscan Api Camera.png b/docs/img/Openscan Api Camera.png
new file mode 100644
index 0000000..6fb9af2
Binary files /dev/null and b/docs/img/Openscan Api Camera.png differ
diff --git a/docs/img/Openscan Api Motor.png b/docs/img/Openscan Api Motor.png
new file mode 100644
index 0000000..b8cbc15
Binary files /dev/null and b/docs/img/Openscan Api Motor.png differ
diff --git a/docs/img/Openscan Api System.png b/docs/img/Openscan Api System.png
new file mode 100644
index 0000000..c290c1c
Binary files /dev/null and b/docs/img/Openscan Api System.png differ
diff --git a/docs/img/telegram_bot_watch.jpg b/docs/img/telegram_bot_watch.jpg
new file mode 100644
index 0000000..e0728d8
Binary files /dev/null and b/docs/img/telegram_bot_watch.jpg differ
diff --git a/docs/img/telegram_configuration.png b/docs/img/telegram_configuration.png
new file mode 100644
index 0000000..d16de23
Binary files /dev/null and b/docs/img/telegram_configuration.png differ
diff --git a/update/betaArdu/OpenScan.py b/update/2024-11S/beta/OpenScan.py
similarity index 97%
rename from update/betaArdu/OpenScan.py
rename to update/2024-11S/beta/OpenScan.py
index e0edd35..e634511 100644
--- a/update/betaArdu/OpenScan.py
+++ b/update/2024-11S/beta/OpenScan.py
@@ -78,10 +78,8 @@ def add_wifi_network(ssid, password, country):
with open(conf_file, "w") as f:
f.write(updated_content)
os.system("sudo systemctl restart wpa_supplicant@wlan0")
-
return True
-
def load_str(name):
filename = basepath+'settings/'+name
if not isfile(filename):
@@ -165,7 +163,14 @@ def motorrun(motor,angle,ES_enable=False,ES_start_state = True):
step_count=-step_count
for x in range(step_count):
if ES_enable == True and GPIO.input(ES_pin) != ES_start_state:
- break
+ i = 0
+ while i <= 10:
+ if GPIO.input(ES_pin) == ES_start_state:
+ i = 11
+ if i == 10:
+ return
+ i = i + 1
+
GPIO.output(steppin, GPIO.HIGH)
if x<=ramp and x<=step_count/2:
delay = delay_init * (1 + -1/acc*cos(1*(ramp-x)/ramp)+1/acc)
@@ -194,8 +199,6 @@ def take_photo(file):
model=load_str('model')
-
-
shutter = str(load_int('cam_shutter'))
saturation = load_str('cam_saturation')
contrast = load_str('cam_contrast')
diff --git a/update/2024-11S/beta/OpenScanStatistics.py b/update/2024-11S/beta/OpenScanStatistics.py
new file mode 100755
index 0000000..68005af
--- /dev/null
+++ b/update/2024-11S/beta/OpenScanStatistics.py
@@ -0,0 +1,18 @@
+import csv
+
+class ScanStatistics:
+ def __init__(self, filename="/home/pi/OpenScan/statistics/statistics.csv"):
+ self.filename = filename
+ self.header = ["arch", "shield", "date_init", "date_end", "num_photos", "done-photos", "camera", "aborted"]
+
+ def write_statistics(self, arch, shield, date_init, date_end, num_photos, done_photos, camera, aborted):
+ data = [arch, shield, date_init, date_end, num_photos, done_photos, camera, aborted]
+
+ with open(self.filename, "a", newline='') as csv_file:
+ csv_writer = csv.writer(csv_file, delimiter=';')
+
+ # Write header if file is empty
+ if csv_file.tell() == 0:
+ csv_writer.writerow(self.header)
+
+ csv_writer.writerow(data)
diff --git a/update/2024-11S/beta/config.txt b/update/2024-11S/beta/config.txt
new file mode 100755
index 0000000..3bb8fef
--- /dev/null
+++ b/update/2024-11S/beta/config.txt
@@ -0,0 +1,34 @@
+# For more options and information see
+# http://rpf.io/configtxt
+# Some settings may impact device functionality. See link above for details
+
+# Additional overlays and parameters are documented /boot/overlays/README
+
+# Automatically load overlays for detected cameras
+camera_auto_detect=1
+
+# Automatically load overlays for detected DSI displays
+display_auto_detect=1
+
+# Enable DRM VC4 V3D driver
+dtoverlay=vc4-kms-v3d
+max_framebuffers=1
+
+# Disable compensation for displays with overscan
+disable_overscan=1
+
+[cm4]
+# Enable host mode on the 2711 built-in XHCI USB controller.
+# This line should be removed if the legacy DWC2 controller is required
+# (e.g. for USB device mode) or if USB support is not required.
+otg_mode=1
+
+[pi4]
+# Run as fast as firmware / board allows
+arm_boost=1
+dtoverlay=imx519,cma-512
+
+[all]
+camera_auto_detect=0
+gpu_mem=256
+dtoverlay=imx519
\ No newline at end of file
diff --git a/update/2024-11S/beta/expand_root.sh b/update/2024-11S/beta/expand_root.sh
new file mode 100755
index 0000000..f4f7148
--- /dev/null
+++ b/update/2024-11S/beta/expand_root.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+if test -f "/boot/expand_root"; then
+ echo "expanding root partition"
+ raspi-config --expand-rootfs
+ rm -fr /boot/expand_root
+ shutdown -r now
+fi
diff --git a/update/2024-11S/beta/fla.py b/update/2024-11S/beta/fla.py
new file mode 100644
index 0000000..026867e
--- /dev/null
+++ b/update/2024-11S/beta/fla.py
@@ -0,0 +1,519 @@
+from flask import Flask, request, redirect, send_file, send_from_directory
+from flask_restx import Resource, Api, Namespace
+from picamera2 import Picamera2
+from PIL import Image, ImageDraw, ImageOps, ImageFilter, ImageEnhance, ImageChops, ImageFont
+from time import sleep, time
+from OpenScan import load_int, load_float, load_bool, ringlight, motorrun
+import RPi.GPIO as GPIO
+from math import sqrt
+import os
+import math
+from skimage import feature, color, transform
+import numpy as np
+from scipy import ndimage
+import socket
+
+GPIO.setwarnings(False)
+GPIO.setmode(GPIO.BCM)
+
+app = Flask(__name__)
+api = Api(app, version='1.0', title='OpenScan API', description='API for OpenScan')
+
+v1 = Namespace('v1', description='API v1')
+# Create a namespace for system operations
+system_ns = Namespace('system', description='System operations')
+camera_ns = Namespace('camera', description='Camera operations')
+motor_ns = Namespace('motor', description='Motor operations')
+
+api.add_namespace(v1, path='/v1')
+api.add_namespace(system_ns, path='/v1/system')
+api.add_namespace(camera_ns, path='/v1/camera')
+api.add_namespace(motor_ns, path='/v1/motor')
+
+basedir = '/home/pi/OpenScan/'
+timer = time()
+cam_mode = 0
+hostname = socket.gethostname().split(":")
+
+def overlay_mask(image, mask_image):
+ # Ensure image is in RGB mode
+ image_rgb = image.convert('RGB')
+ # Create an empty image with RGBA channels
+ overlay = Image.new('RGBA', image_rgb.size)
+
+ # Prepare a red image of the same size
+ red_image = Image.new('RGB', image_rgb.size, (255, 0, 0))
+ # Prepare a mask where the condition is met (mask_image pixels == 255)
+ mask_condition = np.array(mask_image) > 0
+ overlay_mask = Image.fromarray(np.uint8(mask_condition) * 255)
+ # Paste the red image onto the overlay using the condition mask
+ overlay.paste(red_image, mask=overlay_mask)
+ # Combine the original image with the overlay
+ combined = Image.alpha_composite(image_rgb.convert('RGBA'), overlay)
+ # Convert the final image to RGB
+ combined_rgb = combined.convert('RGB')
+ return combined_rgb
+
+
+def highlight_sharpest_areas(image, threshold=load_int('cam_sharpness'), dilation_size=5):
+
+ # Convert PIL image to grayscale
+ image_gray = image.convert('L')
+
+ # Convert grayscale image to numpy array
+ image_array = np.array(image_gray)
+
+ # Calculate the gradient using a Sobel filter
+ dx = ndimage.sobel(image_array, 0) # horizontal derivative
+ dy = ndimage.sobel(image_array, 1) # vertical derivative
+ mag = np.hypot(dx, dy) # magnitude
+
+ # Threshold the gradient to create a mask of the sharpest areas
+ mask = np.where(mag > threshold, 255, 0).astype(np.uint8)
+
+ dilated_mask = ndimage.binary_dilation(mask, structure=np.ones((dilation_size,dilation_size)))
+ # Create a PIL image from the mask
+ mask_image = Image.fromarray(dilated_mask)
+
+ return mask_image
+
+
+
+
+###################################################################################################################
+
+
+@system_ns.route('/status')
+class Status(Resource):
+ def get(self):
+ '''
+ Get system status
+ '''
+ import os
+ import json
+ from time import time
+
+ if os.path.exists('/tmp/status.json'):
+ try:
+ with open('/tmp/status.json', 'r') as status_file:
+ status = json.load(status_file)
+
+ elapsed_time = time() - status['start_time']
+ estimated_total_time = (elapsed_time / status['current_photo']) * status['total_photos']
+ time_remaining = max(0, estimated_total_time - elapsed_time)
+
+ status.update({
+ "status": "running",
+ "elapsed_time": int(elapsed_time),
+ "estimated_total_time": int(estimated_total_time),
+ "time_remaining": int(time_remaining)
+ })
+
+ return status, 200
+ except Exception as e:
+ return {"error": f"Error reading status file: {str(e)}"}, 500
+ else:
+ return {"status": "idle"}, 200
+
+@system_ns.route('/shutdown')
+class Shutdown(Resource):
+ @system_ns.doc(params={'token': 'Shutdown token for authentication'})
+ def get(self):
+ '''Shutdown the Raspberry Pi'''
+ shutdown_token = request.args.get('token')
+ hostname = request.host.split(":")[0]
+ with open("/home/pi/OpenScan/settings/session_token", "r") as f:
+ session_token = f.readline()[:20]
+
+ if shutdown_token == session_token or True:
+ delay = 0.1
+ ringlight(2, False)
+
+ for _ in range(5):
+ ringlight(1, True)
+ sleep(delay)
+ ringlight(1, False)
+ sleep(delay)
+
+ os.system('shutdown -h now')
+ return {'message': 'Shutting down'}, 200
+ else:
+ return redirect("http://" + hostname, code=302)
+
+@system_ns.route('/reboot')
+class Reboot(Resource):
+ @system_ns.doc(params={'token': 'Reboot token for authentication'})
+ def get(self):
+ '''Reboot the Raspberry Pi'''
+ shutdown_token = request.args.get('token')
+ hostname = request.host.split(":")[0]
+ with open("/home/pi/OpenScan/settings/session_token", "r") as f:
+ session_token = f.readline()[:20]
+
+ if shutdown_token == session_token or True:
+ delay = 0.1
+ ringlight(2, False)
+
+ for _ in range(5):
+ ringlight(1, True)
+ sleep(delay)
+ ringlight(1, False)
+ sleep(delay)
+
+ os.system('reboot -h')
+ return {'message': 'Rebooting'}, 200
+ else:
+ return redirect("http://" + hostname, code=302)
+
+@system_ns.route('/ringlight')
+class Ringlight(Resource):
+ @system_ns.doc(params={'state': 'Ringlight state (0 or 1)'})
+ def get(self):
+ '''Set ringlight state'''
+ state = int(request.args.get('state'))
+ if state == 0:
+ ringlight(1, False)
+ ringlight(2, False)
+ else:
+ ringlight(1, True)
+ ringlight(2, True)
+ return {'message': f'Ringlight set to {state}'}, 200
+
+def plot_orb_keypoints(pil_image):
+ downscale = 2
+ # Read the image from the given image path
+ image = np.array(pil_image)
+ #image = io.imread(image_path)
+ image = transform.resize(image, (image.shape[0] // downscale, image.shape[1] // downscale), anti_aliasing=True)
+
+ # Convert the image to grayscale
+ gray_image = color.rgb2gray(image)
+
+ try:
+ orb = feature.ORB(n_keypoints=10000, downscale=1.2, fast_n=2, fast_threshold=0.2 , n_scales=3, harris_k=0.001)
+ orb.detect_and_extract(gray_image)
+ keypoints = orb.keypoints
+ except:
+ return pil_image
+
+ # Convert the image back to the range [0, 255]
+ display_image = (image * 255).astype(np.uint8)
+
+ # Draw the keypoints on the image
+ draw = ImageDraw.Draw(pil_image)
+ size = max(2,int(image.shape[0]*downscale*0.005))
+ for i, (y, x) in enumerate(keypoints):
+ draw.ellipse([(downscale*x-size, downscale*y-size), (downscale*x+size, downscale*y+size)], fill = (0,255,0))
+ # Save the image with keypoints to the given output path
+ return pil_image
+
+def add_histo(img):
+ histo_size = 241
+
+ img_gray = ImageOps.grayscale(img)
+ histogram = img_gray.histogram()
+ histogram_log = [math.log10(h + 1) for h in histogram]
+ histogram_max = max(histogram_log)
+ histogram_normalized = [float(h) / histogram_max for h in histogram_log]
+ hist_image = Image.new("RGBA", (histo_size, histo_size), (255, 255, 255, 0))
+ draw = ImageDraw.Draw(hist_image)
+
+ for i in range(0, 256):
+ x = i
+ y = 256 - int(histogram_normalized[i] * 256)
+ draw.line((x, 256, x, y), fill=(0, 0, 0, 255))
+
+ text = ""
+ if min(histogram[235:238])>0:
+ text = "overexposed"
+ if sum(histogram[190:192])<8:
+ text = "underexposed"
+ font = ImageFont.truetype("DejaVuSans.ttf", 30)
+
+ bbox = draw.textbbox((0, 0), text, font=font)
+
+ text_width = bbox[2] - bbox[0]
+ text_height = bbox[3] - bbox[1]
+
+
+ x = (hist_image.width - text_width )/2
+ y = hist_image.height - text_height - 10
+ draw.text((x, y), text, font=font, fill=(255,0,0))
+
+ scale = 0.25
+ width1, height1 = hist_image.size
+ width2 = img.size[0]
+ new_width1 = int(width2 * scale)
+ new_height1 = int((height1 / width1) * new_width1)
+ hist_image = hist_image.convert('RGB')
+
+ hist_image = hist_image.resize((new_width1, new_height1))
+ x = hist_image.width - text_width - 10
+ y = hist_image.height - text_height - 10
+
+
+ img.paste(hist_image, (img.size[0]-new_width1-int(0.01*img.size[0]),img.size[1]-new_height1-int(0.01*img.size[0])))
+
+ return img
+
+def create_mask(image: Image, scale: float = 0.1, threshold: int = 45) -> Image:
+ threshold = load_int("cam_mask_threshold")
+ if threshold <= 1:
+ return image
+ orig = image
+ image = image.resize((int(image.width*scale),int(image.height*scale)))
+ image = image.convert("L")
+ reduced = image
+ image = image.filter(ImageFilter.EDGE_ENHANCE)
+ image = image.filter(ImageFilter.BLUR)
+ reduced = reduced.filter(ImageFilter.EDGE_ENHANCE_MORE)
+ mask = ImageChops.difference(image, reduced)
+ mask = ImageEnhance.Brightness(mask).enhance(2.5)
+ mask = mask.filter(ImageFilter.MaxFilter(9))
+ mask = mask.filter(ImageFilter.MinFilter(5))
+ mask = mask.point(lambda x: 255 if x Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2500, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 2960, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2100, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 30, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2340, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2140, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2180, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2060, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor Accramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2140, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_Steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2180, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2100, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2060, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 26, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2300, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 32, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2380, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 34, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2420, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 28, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2300, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 33, + "width": 3, + "height": 1, + "name": "ttAccramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2420, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 27, + "width": 3, + "height": 1, + "name": "tt_steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2300, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 31, + "width": 3, + "height": 1, + "name": "tt Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 750, + "y": 2380, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 29, + "width": 3, + "height": 1, + "name": "tt_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2340, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2220, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2220, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 36, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2460, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 35, + "width": 3, + "height": 1, + "name": "tt_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2460, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 38, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2500, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2260, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 37, + "width": 3, + "height": 1, + "name": "tt_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2500, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2260, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 430, + "y": 2600, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 400, + "y": 2640, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2760, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2800, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2840, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2600, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2640, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2760, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2800, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2840, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3000, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3000, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3040, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3040, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3080, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3080, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3120, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3120, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3160, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3160, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3200, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3200, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3240, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3240, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3280, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3280, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3320, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3320, + "wires": [] + }, + { + "id": "74e455136b5ca5dd", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 21, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3360, + "wires": [ + [ + "a4a89668ce4c9f05" + ] + ] + }, + { + "id": "3a74f653800eb831", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 20, + "width": 4, + "height": 1, + "name": "endstop2", + "label": "Endstop Turntable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3360, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2880, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2880, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2180, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2180, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2220, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2220, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2260, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2260, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2100, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2100, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2140, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2140, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 4, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2300, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2420, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2460, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2500, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2340, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2380, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2300, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2420, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2460, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2500, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2340, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2380, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2600, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2600, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2640, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2760, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2800, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2800, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2840, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2840, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2880, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2880, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3000, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3000, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3320, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3320, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3040, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3040, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3080, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3080, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3120, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3120, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3160, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3160, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3200, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3200, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3240, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3280, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3240, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3280, + "wires": [ + [] + ] + }, + { + "id": "21dc963d967d9c99", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3360, + "wires": [ + [ + "74e455136b5ca5dd" + ] + ] + }, + { + "id": "a4a89668ce4c9f05", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3360, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 7, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2720, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2560, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 560, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 800, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 410, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "e98c1b83744bb863", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Delete Aborted", + "tooltip": "Delete aborted photosets", + "group": "d324f0b852c2df0a", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 420, + "y": 520, + "wires": [ + [ + "7438a5bf5fcddec4" + ] + ] + }, + { + "id": "7438a5bf5fcddec4", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "delete_aborted", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('delete_aborted'):\n save('delete_aborted', state)\n", + "outputs": 1, + "x": 600, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "53681e53353db898", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'delete_aborted'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 520, + "wires": [ + [ + "e98c1b83744bb863" + ] + ] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "38cbf7965d1c1834", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 480, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 340, + "y": 480, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 470, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 4, + "width": 4, + "height": 1, + "name": "", + "label": "Updatetype: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 610, + "y": 480, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 410, + "y": 440, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "38cbf7965d1c1834", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 440, + "wires": [ + [ + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 610, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 7, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 520, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2500, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 2960, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2100, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 30, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2340, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2140, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2180, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2060, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor Accramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2140, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_Steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2180, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2100, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2060, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 26, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2300, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 32, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2380, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 34, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2420, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 28, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2300, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 33, + "width": 3, + "height": 1, + "name": "ttAccramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2420, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 27, + "width": 3, + "height": 1, + "name": "tt_steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2300, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 31, + "width": 3, + "height": 1, + "name": "tt Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 750, + "y": 2380, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 29, + "width": 3, + "height": 1, + "name": "tt_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2340, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2220, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2220, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 36, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2460, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 35, + "width": 3, + "height": 1, + "name": "tt_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2460, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 38, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2500, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2260, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 37, + "width": 3, + "height": 1, + "name": "tt_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2500, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2260, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 430, + "y": 2600, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 400, + "y": 2640, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2760, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2800, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2840, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2600, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2640, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2760, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2800, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2840, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3000, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3000, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3040, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3040, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3080, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3080, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3120, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3120, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3160, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3160, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3200, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3200, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3240, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3240, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3280, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3280, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3320, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3320, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2880, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2880, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2180, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2180, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2220, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2220, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2260, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2260, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2100, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2100, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2140, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2140, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 4, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2300, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2420, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2460, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2500, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2340, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2380, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2300, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2420, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2460, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2500, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2340, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2380, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2600, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2600, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2640, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2760, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2800, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2800, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2840, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2840, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2880, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2880, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3000, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3000, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3320, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3320, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3040, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3040, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3080, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3080, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3120, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3120, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3160, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3160, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3200, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3200, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3240, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3280, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3240, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3280, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 7, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2720, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2560, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 560, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 800, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 450, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 540, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "e98c1b83744bb863", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Delete Aborted", + "tooltip": "Delete aborted photosets", + "group": "d324f0b852c2df0a", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 420, + "y": 520, + "wires": [ + [ + "7438a5bf5fcddec4" + ] + ] + }, + { + "id": "7438a5bf5fcddec4", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "delete_aborted", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('delete_aborted'):\n save('delete_aborted', state)\n", + "outputs": 1, + "x": 600, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "53681e53353db898", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'delete_aborted'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 520, + "wires": [ + [ + "e98c1b83744bb863" + ] + ] + }, + { + "id": "48386fdb54980ec7", + "type": "comment", + "z": "e43a27722b508115", + "name": "Shield", + "info": "", + "x": 90, + "y": 3760, + "wires": [] + }, + { + "id": "fbc5fc2e65311f8b", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3840, + "wires": [ + [ + "5618e266f6966ae6" + ] + ] + }, + { + "id": "5618e266f6966ae6", + "type": "function", + "z": "e43a27722b508115", + "name": "loadl", + "func": "var file = 'shield_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath + file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 170, + "y": 3840, + "wires": [ + [ + "c97113d841391e40" + ] + ] + }, + { + "id": "c97113d841391e40", + "type": "ui_dropdown", + "z": "e43a27722b508115", + "name": "", + "label": "Shield Type", + "tooltip": "", + "place": "Select option", + "group": "0b244f698c7ac9a2", + "order": 0, + "width": 0, + "height": 0, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "Green", + "value": "green", + "type": "str" + }, + { + "label": "Black", + "value": "black", + "type": "str" + } + ], + "payload": "", + "topic": "payload", + "topicType": "msg", + "className": "", + "x": 310, + "y": 3840, + "wires": [ + [ + "2b639346c1b56578" + ] + ] + }, + { + "id": "2b639346c1b56578", + "type": "function", + "z": "e43a27722b508115", + "name": "function 2", + "func": "let fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar file = 'shield_type';\nconst current_shield = fs.readFileSync(filepath + file, 'utf8');\n\nvar current_choice = msg.payload\n\nif (current_choice != current_shield) {\n \n switch (current_choice) {\n case \"green\":\n fs.writeFile(filepath + 'pin_external', String(10), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(17), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(9), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(11), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(14), err => {\n if (err) {\n return\n }\n });\n break;\n case \"black\":\n fs.writeFile(filepath + 'pin_external', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(24), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(22), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(17), err => {\n if (err) {\n return\n }\n });\n break;\n case \"custom\":\n break;\n }\n\n fs.writeFile(filepath + file, current_choice, err => {\n if (err) {\n return\n }\n });\n}\n\nmsg.status = 'The new ' + current_choice + ' shield has been configured'\nmsg.topic = msg.status\nmsg.payload = 'Do you want to reboot now to apply the changes?'\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 460, + "y": 3840, + "wires": [ + [ + "137f032887544d74" + ] + ] + }, + { + "id": "137f032887544d74", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": false, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "Reboot", + "x": 600, + "y": 3840, + "wires": [ + [ + "d2db49796fe0da79", + "d0d6820224b0ab0f" + ] + ] + }, + { + "id": "d2db49796fe0da79", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "print(msg['payload'])\nreturn msg", + "outputs": 1, + "x": 790, + "y": 3840, + "wires": [ + [] + ] + }, + { + "id": "d0d6820224b0ab0f", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 6", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 780, + "y": 3720, + "wires": [] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "38cbf7965d1c1834", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 480, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 340, + "y": 480, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 470, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 4, + "width": 4, + "height": 1, + "name": "", + "label": "Updatetype: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 610, + "y": 480, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 410, + "y": 440, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "38cbf7965d1c1834", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 440, + "wires": [ + [ + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 610, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 7, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 520, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2500, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 2960, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2100, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 30, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2340, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2140, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2180, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2060, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor Accramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2140, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_Steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2180, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2100, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2060, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 26, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2300, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 32, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2380, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 34, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2420, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 28, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2300, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 33, + "width": 3, + "height": 1, + "name": "ttAccramp", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2420, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 27, + "width": 3, + "height": 1, + "name": "tt_steps per Rotation", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2300, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 31, + "width": 3, + "height": 1, + "name": "tt Acc", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 750, + "y": 2380, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 29, + "width": 3, + "height": 1, + "name": "tt_delay", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 760, + "y": 2340, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2220, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2220, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 36, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2460, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 35, + "width": 3, + "height": 1, + "name": "tt_angle", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2460, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 38, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2500, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2260, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 37, + "width": 3, + "height": 1, + "name": "tt_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2500, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_dir", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2260, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 430, + "y": 2600, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 400, + "y": 2640, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2760, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2800, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2840, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2600, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2640, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2760, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2800, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2840, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3000, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3000, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3040, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3040, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3080, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3080, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3120, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3120, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3160, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3160, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3200, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3200, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3240, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3240, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3280, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3280, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3320, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3320, + "wires": [] + }, + { + "id": "74e455136b5ca5dd", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 21, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3360, + "wires": [ + [ + "a4a89668ce4c9f05" + ] + ] + }, + { + "id": "3a74f653800eb831", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 20, + "width": 4, + "height": 1, + "name": "endstop2", + "label": "Endstop Turntable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3360, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2880, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2880, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2180, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2180, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2220, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2220, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2260, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2260, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2100, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2100, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2140, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2140, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 4, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2300, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2420, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2460, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2500, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2340, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2380, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2300, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2420, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2460, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2500, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2340, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2380, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2600, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2600, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2640, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2760, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2800, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2800, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2840, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2840, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2880, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2880, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3000, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3000, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3320, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3320, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3040, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3040, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3080, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3080, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3120, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3120, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3160, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3160, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3200, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3200, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3240, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3280, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3240, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3280, + "wires": [ + [] + ] + }, + { + "id": "21dc963d967d9c99", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3360, + "wires": [ + [ + "74e455136b5ca5dd" + ] + ] + }, + { + "id": "a4a89668ce4c9f05", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3360, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2720, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2560, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 520, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 800, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 410, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "38cbf7965d1c1834", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 480, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 340, + "y": 480, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 470, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 4, + "width": 4, + "height": 1, + "name": "", + "label": "Updatetype: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 610, + "y": 480, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 410, + "y": 440, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "38cbf7965d1c1834", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 440, + "wires": [ + [ + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 610, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 7, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 520, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2500, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 2960, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2100, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2340, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2140, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2180, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2060, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor_acc_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2140, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor_accramp_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2180, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_delay_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 2100, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_steps_rotation_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 810, + "y": 2060, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 1, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2300, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2380, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2420, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2300, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 10, + "width": 3, + "height": 1, + "name": "tt_accramp_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2420, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 4, + "width": 3, + "height": 1, + "name": "tt_stepsperrotation_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2300, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 8, + "width": 3, + "height": 1, + "name": "tt_acc_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2380, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 6, + "width": 3, + "height": 1, + "name": "tt_delay_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2340, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2220, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 790, + "y": 2220, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2460, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 12, + "width": 3, + "height": 1, + "name": "tt_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2460, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2500, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2260, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 14, + "width": 3, + "height": 1, + "name": "tt_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2500, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2260, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 450, + "y": 2600, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 420, + "y": 2640, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2760, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2800, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2840, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2600, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2640, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2760, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2800, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2840, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3000, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3000, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3040, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3040, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3080, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3080, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3120, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3120, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3160, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3160, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3200, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3200, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3240, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3240, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3280, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3280, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3320, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3320, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2880, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2880, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2180, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2180, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2220, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2220, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2260, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2260, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2100, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2100, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2140, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2140, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nvar steps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2300, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2420, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2460, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2500, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2340, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2380, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2300, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2420, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2460, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2500, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2340, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2380, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2600, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2600, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2640, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2760, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2800, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2800, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2840, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2840, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2880, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2880, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3000, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3000, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3320, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3320, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3040, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3040, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3080, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3080, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3120, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3120, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3160, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3160, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3200, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3200, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3240, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3280, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3240, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3280, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2720, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2560, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 560, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "rotor_endstop_angle_label", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop_label", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 450, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 540, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "e98c1b83744bb863", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Delete Aborted", + "tooltip": "Delete aborted photosets", + "group": "d324f0b852c2df0a", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 420, + "y": 520, + "wires": [ + [ + "7438a5bf5fcddec4" + ] + ] + }, + { + "id": "7438a5bf5fcddec4", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "delete_aborted", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('delete_aborted'):\n save('delete_aborted', state)\n", + "outputs": 1, + "x": 600, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "53681e53353db898", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'delete_aborted'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 520, + "wires": [ + [ + "e98c1b83744bb863" + ] + ] + }, + { + "id": "48386fdb54980ec7", + "type": "comment", + "z": "e43a27722b508115", + "name": "Shield", + "info": "", + "x": 90, + "y": 3760, + "wires": [] + }, + { + "id": "fbc5fc2e65311f8b", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3840, + "wires": [ + [ + "5618e266f6966ae6" + ] + ] + }, + { + "id": "5618e266f6966ae6", + "type": "function", + "z": "e43a27722b508115", + "name": "loadl", + "func": "var file = 'shield_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath + file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 170, + "y": 3840, + "wires": [ + [ + "c97113d841391e40" + ] + ] + }, + { + "id": "c97113d841391e40", + "type": "ui_dropdown", + "z": "e43a27722b508115", + "name": "", + "label": "Shield Type", + "tooltip": "", + "place": "Select option", + "group": "0b244f698c7ac9a2", + "order": 0, + "width": 0, + "height": 0, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "Green", + "value": "green", + "type": "str" + }, + { + "label": "Black", + "value": "black", + "type": "str" + } + ], + "payload": "", + "topic": "payload", + "topicType": "msg", + "className": "", + "x": 310, + "y": 3840, + "wires": [ + [ + "2b639346c1b56578" + ] + ] + }, + { + "id": "2b639346c1b56578", + "type": "function", + "z": "e43a27722b508115", + "name": "function 2", + "func": "let fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar file = 'shield_type';\nconst current_shield = fs.readFileSync(filepath + file, 'utf8');\n\nvar current_choice = msg.payload\n\nif (current_choice != current_shield) {\n \n switch (current_choice) {\n case \"green\":\n fs.writeFile(filepath + 'pin_external', String(10), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(17), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(9), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(11), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(14), err => {\n if (err) {\n return\n }\n });\n break;\n case \"black\":\n fs.writeFile(filepath + 'pin_external', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(24), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(22), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(17), err => {\n if (err) {\n return\n }\n });\n break;\n case \"custom\":\n break;\n }\n\n fs.writeFile(filepath + file, current_choice, err => {\n if (err) {\n return\n }\n });\n}\n\nmsg.status = 'The new ' + current_choice + ' shield has been configured'\nmsg.topic = msg.status\nmsg.payload = 'Do you want to reboot now to apply the changes?'\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 460, + "y": 3840, + "wires": [ + [ + "137f032887544d74" + ] + ] + }, + { + "id": "137f032887544d74", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": false, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "Reboot", + "x": 600, + "y": 3840, + "wires": [ + [ + "d2db49796fe0da79", + "d0d6820224b0ab0f" + ] + ] + }, + { + "id": "d2db49796fe0da79", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "print(msg['payload'])\nreturn msg", + "outputs": 1, + "x": 790, + "y": 3840, + "wires": [ + [] + ] + }, + { + "id": "d0d6820224b0ab0f", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 6", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 780, + "y": 3720, + "wires": [] + }, + { + "id": "a74d78a1d186a833", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1760, + "wires": [ + [ + "4e1b38e60f4179b0" + ] + ] + }, + { + "id": "4e1b38e60f4179b0", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotate_tt_first", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 3, + "width": "3", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 430, + "y": 1760, + "wires": [ + [ + "0e14711b77c43c23" + ] + ] + }, + { + "id": "0e14711b77c43c23", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1760, + "wires": [ + [] + ] + }, + { + "id": "b1d13cc1ebec82d7", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 2, + "width": 3, + "height": 1, + "name": "rotate_tt_first_label", + "label": "Rotate turntable first", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 1760, + "wires": [] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nopenscan_version = load_str('openscan_version')\nopenscan_branch = load_str('openscan_branch')\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/' + openscan_version + '/update/' + openscan_version\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + '/update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\nmsg['url'] = url\nmsg['openscan_branch'] = openscan_branch\nmsg['openscan_version'] = openscan_version\n\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4", + "44573d9223b2a75d" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nopenscan_version = msg['openscan_version']\nopenscan_branch = msg['openscan_branch']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = msg['url']\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[openscan_branch]:\n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[openscan_branch][i]['filesize2'] = filesize\n if filesize == msg[openscan_branch][i]['filesize']:\n msg[openscan_branch][i]['update'] = False\n continue\n msg[openscan_branch][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 440, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 4, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 390, + "y": 440, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 520, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 4, + "height": 1, + "name": "", + "label": "Branch: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 650, + "y": 440, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 449, + "y": 491, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 649, + "y": 491, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\nopenscan_version = msg['openscan_version']\nopenscan_branch = msg['openscan_branch']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = msg['url']\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[openscan_branch]:\n if msg[openscan_branch][i]['update'] == False:\n continue\n \n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + '/' + msg[openscan_branch][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[openscan_branch][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[openscan_branch][i]['dst'])\n \n if msg[openscan_branch][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 480, + "wires": [ + [ + "b0629875a30ae1d7", + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 760, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2560, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 3020, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2160, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2400, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2200, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2240, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2120, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor_acc_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2200, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_accramp_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2240, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor_delay_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 2160, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_steps_rotation_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 810, + "y": 2120, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 1, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2360, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2440, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2480, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2360, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 10, + "width": 3, + "height": 1, + "name": "tt_accramp_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2480, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 4, + "width": 3, + "height": 1, + "name": "tt_stepsperrotation_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2360, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 8, + "width": 3, + "height": 1, + "name": "tt_acc_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2440, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 6, + "width": 3, + "height": 1, + "name": "tt_delay_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2400, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2280, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 790, + "y": 2280, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2520, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 12, + "width": 3, + "height": 1, + "name": "tt_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2520, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2560, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 26, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2320, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 14, + "width": 3, + "height": 1, + "name": "tt_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2560, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 25, + "width": 3, + "height": 1, + "name": "rotor_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2320, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 450, + "y": 2660, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 420, + "y": 2700, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2820, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2860, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2900, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2660, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2700, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2820, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2860, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2900, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3060, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3060, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3100, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3100, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3140, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3140, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3180, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3180, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3220, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3220, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3260, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3260, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3300, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3300, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3340, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3340, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3380, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3380, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2940, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2940, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2120, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2120, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2240, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2240, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2280, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2280, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2320, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2320, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2160, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2160, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2200, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2200, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nvar steps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2360, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2480, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2520, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2560, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2400, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2440, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2360, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2480, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2520, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2400, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2440, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2660, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2660, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2700, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2700, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2820, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2820, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2860, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2860, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2900, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2900, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2940, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2940, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3060, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3060, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3380, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3380, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3100, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3100, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3140, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3140, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3180, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3180, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3220, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3220, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3260, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3260, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3300, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3340, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3300, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3340, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2780, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2740, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2620, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2620, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2620, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2620, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 560, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_endstop_enable", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_endstop_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_endstop_enable_label", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 450, + "y": 1980, + "wires": [ + [ + "f036424d79645761", + "c7a41014cbbff864", + "69516440e3997111", + "e9a307a44d9f29f1" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 540, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "e98c1b83744bb863", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Delete Aborted", + "tooltip": "Delete aborted photosets", + "group": "d324f0b852c2df0a", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 420, + "y": 520, + "wires": [ + [ + "7438a5bf5fcddec4" + ] + ] + }, + { + "id": "7438a5bf5fcddec4", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "delete_aborted", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('delete_aborted'):\n save('delete_aborted', state)\n", + "outputs": 1, + "x": 600, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "53681e53353db898", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'delete_aborted'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 520, + "wires": [ + [ + "e98c1b83744bb863" + ] + ] + }, + { + "id": "48386fdb54980ec7", + "type": "comment", + "z": "e43a27722b508115", + "name": "Shield", + "info": "", + "x": 90, + "y": 3760, + "wires": [] + }, + { + "id": "fbc5fc2e65311f8b", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3840, + "wires": [ + [ + "5618e266f6966ae6" + ] + ] + }, + { + "id": "5618e266f6966ae6", + "type": "function", + "z": "e43a27722b508115", + "name": "loadl", + "func": "var file = 'shield_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath + file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 170, + "y": 3840, + "wires": [ + [ + "c97113d841391e40" + ] + ] + }, + { + "id": "c97113d841391e40", + "type": "ui_dropdown", + "z": "e43a27722b508115", + "name": "", + "label": "Shield Type", + "tooltip": "", + "place": "Select option", + "group": "0b244f698c7ac9a2", + "order": 0, + "width": 0, + "height": 0, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "Green", + "value": "green", + "type": "str" + }, + { + "label": "Black", + "value": "black", + "type": "str" + } + ], + "payload": "", + "topic": "payload", + "topicType": "msg", + "className": "", + "x": 310, + "y": 3840, + "wires": [ + [ + "2b639346c1b56578" + ] + ] + }, + { + "id": "2b639346c1b56578", + "type": "function", + "z": "e43a27722b508115", + "name": "function 2", + "func": "let fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar file = 'shield_type';\nconst current_shield = fs.readFileSync(filepath + file, 'utf8');\n\nvar current_choice = msg.payload\n\nif (current_choice != current_shield) {\n \n switch (current_choice) {\n case \"green\":\n fs.writeFile(filepath + 'pin_external', String(10), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(17), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(9), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(11), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(14), err => {\n if (err) {\n return\n }\n });\n break;\n case \"black\":\n fs.writeFile(filepath + 'pin_external', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(24), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(22), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(17), err => {\n if (err) {\n return\n }\n });\n break;\n case \"custom\":\n break;\n }\n\n fs.writeFile(filepath + file, current_choice, err => {\n if (err) {\n return\n }\n });\n}\n\nmsg.status = 'The new ' + current_choice + ' shield has been configured'\nmsg.topic = msg.status\nmsg.payload = 'Do you want to reboot now to apply the changes?'\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 460, + "y": 3840, + "wires": [ + [ + "137f032887544d74" + ] + ] + }, + { + "id": "137f032887544d74", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": false, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "Reboot", + "x": 600, + "y": 3840, + "wires": [ + [ + "d2db49796fe0da79", + "d0d6820224b0ab0f" + ] + ] + }, + { + "id": "d2db49796fe0da79", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "print(msg['payload'])\nreturn msg", + "outputs": 1, + "x": 790, + "y": 3840, + "wires": [ + [] + ] + }, + { + "id": "d0d6820224b0ab0f", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 6", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 780, + "y": 3720, + "wires": [] + }, + { + "id": "a74d78a1d186a833", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1760, + "wires": [ + [ + "4e1b38e60f4179b0" + ] + ] + }, + { + "id": "4e1b38e60f4179b0", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotate_tt_first", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 3, + "width": "3", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 430, + "y": 1760, + "wires": [ + [ + "0e14711b77c43c23" + ] + ] + }, + { + "id": "0e14711b77c43c23", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1760, + "wires": [ + [] + ] + }, + { + "id": "b1d13cc1ebec82d7", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 2, + "width": 3, + "height": 1, + "name": "rotate_tt_first_label", + "label": "Rotate turntable first", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 1760, + "wires": [] + }, + { + "id": "d9d7acf381c002cf", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "restart interface", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('service flask restart')\nos.system('service nodered restart')\n", + "outputs": 1, + "x": 300, + "y": 600, + "wires": [ + [] + ] + }, + { + "id": "acfcc56da7ec7880", + "type": "link in", + "z": "e43a27722b508115", + "name": "restart interface", + "links": [ + "fe3a855fee9e28c6" + ], + "x": 155, + "y": 600, + "wires": [ + [ + "d9d7acf381c002cf" + ] + ] + }, + { + "id": "c7a41014cbbff864", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_pushed'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "5712cdb7d571f18c" + ] + ] + }, + { + "id": "5712cdb7d571f18c", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_endstop_pushed", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 2060, + "wires": [ + [ + "168334311f605afd" + ] + ] + }, + { + "id": "168334311f605afd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_pushed'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_endstop_angle_label", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 2020, + "wires": [] + }, + { + "id": "e9a307a44d9f29f1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "rotor_endstop_pushed_label", + "label": "Endstop reverse", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 2060, + "wires": [] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nopenscan_version = load_str('openscan_version')\nopenscan_branch = load_str('openscan_branch')\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/' + openscan_version + '/update/' + openscan_version\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + '/update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\nmsg['url'] = url\nmsg['openscan_branch'] = openscan_branch\nmsg['openscan_version'] = openscan_version\n\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4", + "44573d9223b2a75d" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nopenscan_version = msg['openscan_version']\nopenscan_branch = msg['openscan_branch']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = msg['url']\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[openscan_branch]:\n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[openscan_branch][i]['filesize2'] = filesize\n if filesize == msg[openscan_branch][i]['filesize']:\n msg[openscan_branch][i]['update'] = False\n continue\n msg[openscan_branch][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 440, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 4, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 390, + "y": 440, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 520, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 4, + "height": 1, + "name": "", + "label": "Branch: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 650, + "y": 440, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 449, + "y": 491, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 649, + "y": 491, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\nopenscan_version = msg['openscan_version']\nopenscan_branch = msg['openscan_branch']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = msg['url']\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[openscan_branch]:\n if msg[openscan_branch][i]['update'] == False:\n continue\n \n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + '/' + msg[openscan_branch][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[openscan_branch][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[openscan_branch][i]['dst'])\n \n if msg[openscan_branch][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 480, + "wires": [ + [ + "b0629875a30ae1d7", + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c", + "acfcc56da7ec7880" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Terms Of Use
In order to use the OpenScanCloud, please read the terms of use as files will be transmitted from your device to the OpenScan Servers.
SSH
SSH can be used to access the Raspberry Pi and modify core files of the operating system. Please deactivate, if you do not want to use this feature.
If you want to use it, the default user is pi, password: raspberry. Please change the password immediately.
Samba
Samba s a network local file sharing server, which allows accessing the Raspberry Pi's file system through the explorer (and other programs like FileZilla). You can use it to transfer custom photo sets to the device in order to use the OpenScanCloud. Therefore, you need to transfer the zip file containing your photos to the following folder /OpenScan/scans/
You can access the Raspberry Pis file system by inserting the following line into your Windows explorer:
\\\\OpenScan/PiShare/OpenScan/scans/
username: pi, password: raspberry
Please deactivate the local file sharing if you do not intend to use it
Advanced Settings
Enable a ton of additional settings, which should be changed only if you know what you are doing ;)
Model
Device model you are using: OpenScan Mini or OpenScan Classic. Setting the device affects the settings of the motor (gear ratio, acceleration, speed). You can change those values manually in the advanced settings.
Camera
A wide range of camera modules is supported (Pi camera v1.3, v2.1, HQ, Arducam IMX519, IMX290, IMX378, OV9281). If you encounter any issues with those models, please check the orientation of the camera ribbon cable and its connectors.
DSLR (gphoto) - connect a wide range of DSLR cameras to the device through USB. See GPhoto for a full list of supported devices.
External camera - triggering any camera through an isolated GPIO signal on the front side of the pi shield.
Shutdown/Reboot
Always use the shutdown button before you power off your Raspberry Pi.
Restore Default Settings
In case you want to restore the default settings
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 220, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "b2b6bf23c9989133", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Pinout", + "group": "70d0be671bf03ca7", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "ONLY CHANGE THE PINOUT IF YOU ARE ABSOLUTELY SURE! CHANGES CAN DAMAGE THE RASPBERRY PI AND ANY PERIPHERALS!
Turntable Mode
Activate turntable mode in order to deactivate the rotor. The routine will only move the turntable and take a given number of photos.
Rotor - Start Angle, Min and Max Angle
Since this version of OpenScan does not have an endstop (yet), it is necessary to tell the device its position when the routine is being started. 0° corresponds to the horizontal (natural) orientation.
After that, the device will equally space the image positions between angle min and angle max.
Rotor/Turntable
Steps per rotation - defines the number of steps it takes to move the axis 360°. It is defined by A*B*C, where A is the number of steps for one revolution of the given stepper motor (normally 200), B is the microstepping used (normally 16), and C the gear ratio (1 for the turntable and 15 or 5,33 for the OpenScan Mini and Classic respectively)
Delay - time in microseconds between each step of the motor. Lower this value if the movement is too fast
Acceleration - a factor defining how fast the delay time between each step is being changed during acceleration and deceleration phases. Lower this value in order to make the movement smoother.
Acceleration ramp - the number of steps allowed for the acceleration processes. Increase this value, if you want smoother movement.
Manual Angle - Defines the degree value for the manual movement through the arrow buttons in the scan menu
Direction - If needed, reverse the movement (in case the arrow buttons and movement do not correspond). Alternatively, you can flip the motor cable 180° (BUT MAKE SURE TO POWER OFF THE DEVICE!)
Jpeg quality
Value in percent, which usually does not need to be changed.
Downscale Preview
The preview image has to be scaled down depending on your network speed. If you want to have a higher quality preview image, you can increase this value, which defines the maximal width/height value. If the value is too high, the preview window might not update
Image Rotation
Change the image rotation, if needed.
Timeout
Defines the time in seconds, when the libcamera command (used for the camera modules) will timeout. Increase this value, if the camera does not get triggered in each position.
Delay Before/After
A fixed delay in seconds before and/or after a photo is taken. Increase this value when the photos have visual motion blur.
AWBG, Gain, Contrast, Saturation
Under most circumstances, you do not need to touch these values.
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 420, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "edac7dd292e7e486", + "type": "comment", + "z": "e43a27722b508115", + "name": "General Settings", + "info": "", + "x": 120, + "y": 280, + "wires": [] + }, + { + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "more sets", + "label": "Advanced Settings", + "tooltip": "", + "group": "4390b2ebcbbe104c", + "order": 5, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 400, + "y": 480, + "wires": [ + [ + "f06a7bcad524e9f9" + ] + ] + }, + { + "id": "29745a36fc157f3f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "more sets", + "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", + "outputs": 2, + "x": 820, + "y": 480, + "wires": [ + [ + "8750ad979e9ea246" + ], + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "bf23328f9fb11b22", + "type": "ui_ui_control", + "z": "e43a27722b508115", + "name": "change visibility", + "events": "all", + "x": 600, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "b37be1d222bc70c9", + "type": "inject", + "z": "e43a27722b508115", + "name": "1s_repeater", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": true, + "onceDelay": "2", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 60, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "89eedf29b404f750", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "load advanced", + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, + "wires": [ + [ + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" + ] + ] + }, + { + "id": "2050de5d9e02f69f", + "type": "comment", + "z": "e43a27722b508115", + "name": "Info Texts", + "info": "", + "x": 100, + "y": 140, + "wires": [] + }, + { + "id": "ded3086945a6d4b5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "check ip address", + "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", + "outputs": 1, + "x": 250, + "y": 940, + "wires": [ + [ + "3cfe464506f46ecd" + ] + ] + }, + { + "id": "3cfe464506f46ecd", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Your local IP:", + "format": "{{msg.ip}}", + "layout": "row-spread", + "className": "", + "x": 430, + "y": 940, + "wires": [] + }, + { + "id": "bd206ad109831e6a", + "type": "comment", + "z": "e43a27722b508115", + "name": "OpenScanCloud", + "info": "", + "x": 120, + "y": 1260, + "wires": [] + }, + { + "id": "b70a9a665c1e4d36", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Cloud-settings", + "group": "12b719cba49817c9", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 740, + "y": 260, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "c9f0566601a3e130", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 4, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Number of Photos:", + "format": "{{msg.limit_photos}}", + "layout": "row-spread", + "className": "", + "x": 410, + "y": 1400, + "wires": [] + }, + { + "id": "9bd86d27ea499a2a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "Max. Filesize (GB):", + "format": "{{msg.limit_filesize}}", + "layout": "row-spread", + "className": "", + "x": 390, + "y": 1440, + "wires": [] + }, + { + "id": "2c37f7030810d234", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Credit (GB):", + "format": "{{msg.credit}}", + "layout": "row-spread", + "className": "", + "x": 370, + "y": 1480, + "wires": [] + }, + { + "id": "f40286c18afd4501", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "save", + "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", + "outputs": 2, + "x": 750, + "y": 1340, + "wires": [ + [ + "455a5266017ea121", + "50f73cee213ec05c" + ], + [ + "264eece408043021" + ] + ] + }, + { + "id": "455a5266017ea121", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 890, + "y": 1300, + "wires": [ + [] + ] + }, + { + "id": "c368df68593bc2bf", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Token", + "tooltip": "", + "group": "12b719cba49817c9", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 350, + "y": 1360, + "wires": [ + [ + "18fd1afa768187b3" + ] + ] + }, + { + "id": "18fd1afa768187b3", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "Save?", + "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", + "outputs": 2, + "x": 470, + "y": 1360, + "wires": [ + [ + "418aea2ec65573a0" + ], + [ + "9792c89c5f4429f9" + ] + ] + }, + { + "id": "f90a98899b7a71d0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "text", + "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", + "outputs": 1, + "x": 230, + "y": 1360, + "wires": [ + [ + "c368df68593bc2bf" + ] + ] + }, + { + "id": "b4c843620c251c43", + "type": "link in", + "z": "e43a27722b508115", + "name": "token", + "links": [ + "960912e90ba5b5bc", + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1360, + "wires": [ + [ + "f90a98899b7a71d0" + ] + ] + }, + { + "id": "418aea2ec65573a0", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "No", + "cancel": "Yes", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 610, + "y": 1340, + "wires": [ + [ + "f40286c18afd4501" + ] + ] + }, + { + "id": "9792c89c5f4429f9", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "b4c843620c251c43" + ], + "x": 555, + "y": 1380, + "wires": [] + }, + { + "id": "264eece408043021", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "5d267acc10020091", + "3876d5cbd248592b" + ], + "x": 835, + "y": 1380, + "wires": [] + }, + { + "id": "3876d5cbd248592b", + "type": "link in", + "z": "e43a27722b508115", + "name": "OSCparameters", + "links": [ + "960912e90ba5b5bc", + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" + ], + "x": 75, + "y": 1400, + "wires": [ + [ + "5daca3ec47f8e7fc" + ] + ] + }, + { + "id": "50f73cee213ec05c", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "links": [ + "b4c843620c251c43", + "5d267acc10020091" + ], + "x": 835, + "y": 1340, + "wires": [] + }, + { + "id": "95578e54a9b61cba", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 250, + "y": 1540, + "wires": [ + [ + "d7a5693da7855da8" + ] + ] + }, + { + "id": "d7a5693da7855da8", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", + "outputs": 2, + "x": 390, + "y": 1540, + "wires": [ + [ + "2b02b97dd1614e52" + ], + [ + "183a629accb417b1" + ] + ] + }, + { + "id": "183a629accb417b1", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1580, + "wires": [ + [] + ] + }, + { + "id": "2b02b97dd1614e52", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 530, + "y": 1540, + "wires": [ + [ + "3e4c15d7b538f816" + ] + ] + }, + { + "id": "3bf622f344172721", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "SUBMIT", + "cancel": "Cancel", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 810, + "y": 1540, + "wires": [ + [ + "e431cb2b8d217cee" + ] + ] + }, + { + "id": "e431cb2b8d217cee", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", + "outputs": 1, + "x": 950, + "y": 1540, + "wires": [ + [ + "106874534890f229" + ] + ] + }, + { + "id": "a38d7fde5c73210f", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Register", + "group": "12b719cba49817c9", + "order": 6, + "width": 2, + "height": 1, + "passthru": false, + "label": "Register", + "tooltip": "testtesttest", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "Please enter your email address:", + "payloadType": "str", + "topic": "Requesting an OpenScanCloud Token", + "topicType": "str", + "x": 100, + "y": 1540, + "wires": [ + [ + "95578e54a9b61cba" + ] + ] + }, + { + "id": "106874534890f229", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 1090, + "y": 1540, + "wires": [ + [] + ] + }, + { + "id": "5daca3ec47f8e7fc", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", + "outputs": 1, + "x": 230, + "y": 1400, + "wires": [ + [ + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" + ] + ] + }, + { + "id": "f34de19d4cf810a9", + "type": "comment", + "z": "e43a27722b508115", + "name": "Motor", + "info": "", + "x": 90, + "y": 1740, + "wires": [] + }, + { + "id": "26c2b58e21f97475", + "type": "comment", + "z": "e43a27722b508115", + "name": "Camera", + "info": "", + "x": 90, + "y": 2500, + "wires": [] + }, + { + "id": "a8ec972bad47a9a8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Pinout", + "info": "", + "x": 90, + "y": 2960, + "wires": [] + }, + { + "id": "b03e8b51187e88eb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "Rotor_delay (ms)", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 16, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 450, + "y": 2100, + "wires": [ + [ + "11fd3363416433f9" + ] + ] + }, + { + "id": "6aae9d4fddf08cc0", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt delay", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.01", + "max": "0.2", + "step": "0.005", + "className": "", + "x": 420, + "y": 2340, + "wires": [ + [ + "e50492d1e18f43c6" + ] + ] + }, + { + "id": "543e1690693acbeb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_acc", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 18, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 420, + "y": 2140, + "wires": [ + [ + "e8b24efb0f30288e" + ] + ] + }, + { + "id": "9a56c087d941f1da", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_accramp", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 20, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "100", + "max": "5000", + "step": "100", + "className": "", + "x": 440, + "y": 2180, + "wires": [ + [ + "29f576be9e292232" + ] + ] + }, + { + "id": "dfdebe10dbf0e198", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotor_stepsperrotation", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 14, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 460, + "y": 2060, + "wires": [ + [ + "78e256083f59f66f" + ] + ] + }, + { + "id": "af8dfe78cbd0c301", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, + "width": 3, + "height": 1, + "name": "rotor_acc_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2140, + "wires": [] + }, + { + "id": "ee4b8908a5b83880", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, + "width": 3, + "height": 1, + "name": "rotor_accramp_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 800, + "y": 2180, + "wires": [] + }, + { + "id": "c4deaa38c1b0adbf", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, + "width": 3, + "height": 1, + "name": "rotor_delay_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 2100, + "wires": [] + }, + { + "id": "baec873a95fff48a", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, + "width": 3, + "height": 1, + "name": "rotor_steps_rotation_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 810, + "y": 2060, + "wires": [] + }, + { + "id": "355e89ab4e5484e4", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 1, + "width": 6, + "height": 1, + "name": "tt", + "label": "TURNTABLE", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 2300, + "wires": [] + }, + { + "id": "10687d331a732790", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_acc", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0.1", + "max": "2", + "step": "0.1", + "className": "", + "x": 410, + "y": 2380, + "wires": [ + [ + "af88b9da72917d62" + ] + ] + }, + { + "id": "721b9680a3fa460e", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_accramp", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "500", + "step": "1", + "className": "", + "x": 430, + "y": 2420, + "wires": [ + [ + "b1b4678827d3a6dd" + ] + ] + }, + { + "id": "c6642c7470d3820c", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "tt_stepsperrotation", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 450, + "y": 2300, + "wires": [ + [ + "eef89545ec0f6aa8" + ] + ] + }, + { + "id": "18e5918748660109", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 10, + "width": 3, + "height": 1, + "name": "tt_accramp_label", + "label": "Acceleration ramp", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2420, + "wires": [] + }, + { + "id": "8e805244dc1899e8", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 4, + "width": 3, + "height": 1, + "name": "tt_stepsperrotation_label", + "label": "Steps per Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 810, + "y": 2300, + "wires": [] + }, + { + "id": "a09e5fbea861bfb1", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 8, + "width": 3, + "height": 1, + "name": "tt_acc_label", + "label": "Acceleration", + "format": "", + "layout": "row-left", + "className": "", + "x": 770, + "y": 2380, + "wires": [] + }, + { + "id": "7b06448b3b222011", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 6, + "width": 3, + "height": 1, + "name": "tt_delay_label", + "label": "Delay", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2340, + "wires": [] + }, + { + "id": "0dfc86d90258f9bb", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 22, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 430, + "y": 2220, + "wires": [ + [ + "c4b5a38c5c1df3d2" + ] + ] + }, + { + "id": "9319d7d4f34c6d22", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, + "width": 3, + "height": 1, + "name": "rotor_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 790, + "y": 2220, + "wires": [] + }, + { + "id": "1610895f430b9aca", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_angle", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "180", + "step": "1", + "className": "", + "x": 420, + "y": 2460, + "wires": [ + [ + "0f3367983bb8e159" + ] + ] + }, + { + "id": "96a9febc0928b6f0", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 12, + "width": 3, + "height": 1, + "name": "tt_angle_label", + "label": "Manual angle", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2460, + "wires": [] + }, + { + "id": "e2c5ea8c16a5ea32", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, + "width": 6, + "height": 1, + "name": "rotor", + "label": "ROTOR", + "format": "", + "layout": "row-center", + "className": "", + "x": 90, + "y": 1820, + "wires": [] + }, + { + "id": "277037c4716d85bf", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "tt_dir", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 410, + "y": 2500, + "wires": [ + [ + "c9d2e31514def4fc" + ] + ] + }, + { + "id": "1361134e9847f003", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "rotor_dir", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 24, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "1", + "className": "", + "x": 420, + "y": 2260, + "wires": [ + [ + "523717b0f218a5fd" + ] + ] + }, + { + "id": "6b0d58943ecb8bb2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 14, + "width": 3, + "height": 1, + "name": "tt_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 770, + "y": 2500, + "wires": [] + }, + { + "id": "08f93dd2aeedb391", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, + "width": 3, + "height": 1, + "name": "rotor_dir_label", + "label": "Direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 780, + "y": 2260, + "wires": [] + }, + { + "id": "46b91bef44714366", + "type": "link in", + "z": "e43a27722b508115", + "name": "advanced settings", + "links": [ + "8750ad979e9ea246" + ], + "x": 95, + "y": 100, + "wires": [ + [ + "89eedf29b404f750" + ] + ] + }, + { + "id": "8750ad979e9ea246", + "type": "link out", + "z": "e43a27722b508115", + "name": "", + "mode": "link", + "links": [ + "46b91bef44714366" + ], + "x": 955, + "y": 480, + "wires": [] + }, + { + "id": "2522f888dc58972f", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_before", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 7, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 450, + "y": 2600, + "wires": [ + [ + "5c752757090c49d2" + ] + ] + }, + { + "id": "30e8df3d616512d8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_gain", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 11, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "10", + "step": "0.1", + "className": "", + "x": 420, + "y": 2640, + "wires": [ + [ + "a1769f0277834f6d" + ] + ] + }, + { + "id": "d855d926df89d65b", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_contrast", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 13, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2760, + "wires": [ + [ + "1a8b0ba21b4f3005", + "654bc70a18820828" + ] + ] + }, + { + "id": "7617517dc8ba2859", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_saturation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 15, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "5", + "step": "0.1", + "className": "", + "x": 420, + "y": 2800, + "wires": [ + [ + "dc8fc962ff7d594b", + "e64feb03a791ca33" + ] + ] + }, + { + "id": "cbaa23c34e10fae1", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_jpeg_q", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 3, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "1", + "max": "100", + "step": "1", + "className": "", + "x": 410, + "y": 2840, + "wires": [ + [ + "00e7836ccb3c4d0c" + ] + ] + }, + { + "id": "bbe443b039a14e21", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, + "width": 3, + "height": 1, + "name": "delay_before", + "label": "Delay before", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2600, + "wires": [] + }, + { + "id": "d320ed3d701e6cc2", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, + "width": 3, + "height": 1, + "name": "gain", + "label": "Gain", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2640, + "wires": [] + }, + { + "id": "f5834dd4646c8af9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, + "width": 3, + "height": 1, + "name": "contrast", + "label": "Contrast", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2760, + "wires": [] + }, + { + "id": "ae9a4e19469813ef", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, + "width": 3, + "height": 1, + "name": "saturation", + "label": "Saturation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2800, + "wires": [] + }, + { + "id": "bd629d0d31233c8b", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 2, + "width": 3, + "height": 1, + "name": "jpegQ", + "label": "Jpeg Quality", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 2840, + "wires": [] + }, + { + "id": "e89f61dbe6a6cffe", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ext", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 3, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3000, + "wires": [ + [ + "885bc559fafec5f2" + ] + ] + }, + { + "id": "ece38cb172a12d75", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 2, + "width": 4, + "height": 1, + "name": "ext", + "label": "External Camera", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3000, + "wires": [] + }, + { + "id": "70014da0b6ab6698", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3040, + "wires": [ + [ + "f70321c96bf81360" + ] + ] + }, + { + "id": "29634ea5f6d666df", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 4, + "width": 4, + "height": 1, + "name": "light1", + "label": "Light 1", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3040, + "wires": [] + }, + { + "id": "2544963852c6881a", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "light2", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 7, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3080, + "wires": [ + [ + "95e1603bbd06a69d" + ] + ] + }, + { + "id": "27903533cd85a59e", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 6, + "width": 4, + "height": 1, + "name": "light2", + "label": "Light 2", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3080, + "wires": [] + }, + { + "id": "a1394401246eb735", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotordir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 9, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3120, + "wires": [ + [ + "a8f92ea6bf394640" + ] + ] + }, + { + "id": "bc0aa4bacdfa94ea", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 8, + "width": 4, + "height": 1, + "name": "rotordir", + "label": "Rotor direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3120, + "wires": [] + }, + { + "id": "f15ca4518b5f223e", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotorstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 11, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3160, + "wires": [ + [ + "06397bb46b3bb541" + ] + ] + }, + { + "id": "0d2924b160e7e383", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 10, + "width": 4, + "height": 1, + "name": "rotorstep", + "label": "Rotor step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3160, + "wires": [] + }, + { + "id": "49900bb9047dd965", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "rotoren", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 13, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3200, + "wires": [ + [ + "687dcdc1ede11700" + ] + ] + }, + { + "id": "a4d743ca73ee1622", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 12, + "width": 4, + "height": 1, + "name": "rotoren", + "label": "Rotor enable", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3200, + "wires": [] + }, + { + "id": "5a90224dc998b417", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttdir", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 15, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3240, + "wires": [ + [ + "e220740c0d38ccb0" + ] + ] + }, + { + "id": "67dc1b544c4ddf9f", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 14, + "width": 4, + "height": 1, + "name": "ttdir", + "label": "Turntable direction", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3240, + "wires": [] + }, + { + "id": "d2364ab09627fe94", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "ttstep", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 17, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 390, + "y": 3280, + "wires": [ + [ + "79d7e5a705ab813a" + ] + ] + }, + { + "id": "145b67ac40721ba6", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 16, + "width": 4, + "height": 1, + "name": "ttstep", + "label": "Turntable step", + "format": "", + "layout": "row-spread", + "className": "", + "x": 730, + "y": 3280, + "wires": [] + }, + { + "id": "eef25405472acfee", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "endstop1", + "label": "", + "tooltip": "", + "group": "70d0be671bf03ca7", + "order": 19, + "width": 2, + "height": 1, + "passthru": false, + "mode": "number", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 400, + "y": 3320, + "wires": [ + [ + "12d20f2274bcc511" + ] + ] + }, + { + "id": "35eb252a41413531", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, + "width": 4, + "height": 1, + "name": "endstop1", + "label": "Endstop Rotor", + "format": "", + "layout": "row-spread", + "className": "", + "x": 740, + "y": 3320, + "wires": [] + }, + { + "id": "5fcef1cb2e9e4788", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "confirm", + "x": 680, + "y": 480, + "wires": [ + [ + "29745a36fc157f3f" + ] + ] + }, + { + "id": "f06a7bcad524e9f9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "msg", + "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", + "outputs": 1, + "x": 530, + "y": 480, + "wires": [ + [ + "5fcef1cb2e9e4788" + ] + ] + }, + { + "id": "f455fb39039617ae", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_rotation", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 5, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "270", + "step": "90", + "className": "", + "x": 410, + "y": 2880, + "wires": [ + [ + "3019576de193d9d6" + ] + ] + }, + { + "id": "fdfbc900fe424eb9", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, + "width": 3, + "height": 1, + "name": "cam_rot", + "label": "Image Rotation", + "format": "", + "layout": "row-spread", + "className": "", + "x": 750, + "y": 2880, + "wires": [] + }, + { + "id": "c3699d6b9664ccca", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2060, + "wires": [ + [ + "dfdebe10dbf0e198" + ] + ] + }, + { + "id": "78e256083f59f66f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2060, + "wires": [ + [] + ] + }, + { + "id": "0f9141b401322374", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2180, + "wires": [ + [ + "9a56c087d941f1da" + ] + ] + }, + { + "id": "29f576be9e292232", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2180, + "wires": [ + [] + ] + }, + { + "id": "23e3099b34c4e475", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2220, + "wires": [ + [ + "0dfc86d90258f9bb" + ] + ] + }, + { + "id": "c4b5a38c5c1df3d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2220, + "wires": [ + [] + ] + }, + { + "id": "79a14162ac805fac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2260, + "wires": [ + [ + "1361134e9847f003" + ] + ] + }, + { + "id": "523717b0f218a5fd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2260, + "wires": [ + [] + ] + }, + { + "id": "f5cf780f3fa8997e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2100, + "wires": [ + [ + "b03e8b51187e88eb" + ] + ] + }, + { + "id": "11fd3363416433f9", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2100, + "wires": [ + [] + ] + }, + { + "id": "02060b3f3b294563", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2140, + "wires": [ + [ + "543e1690693acbeb" + ] + ] + }, + { + "id": "e8b24efb0f30288e", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2140, + "wires": [ + [] + ] + }, + { + "id": "de1ad8b27b72a5ac", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nvar steps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2300, + "wires": [ + [ + "c6642c7470d3820c" + ] + ] + }, + { + "id": "ed4d587cb4feb064", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2420, + "wires": [ + [ + "721b9680a3fa460e" + ] + ] + }, + { + "id": "5b02160c33605ae7", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2460, + "wires": [ + [ + "1610895f430b9aca" + ] + ] + }, + { + "id": "304c135ec09801e3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2500, + "wires": [ + [ + "277037c4716d85bf" + ] + ] + }, + { + "id": "a91dcbe0f9a2416a", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2340, + "wires": [ + [ + "6aae9d4fddf08cc0" + ] + ] + }, + { + "id": "6b2eb1cb95e573f9", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2380, + "wires": [ + [ + "10687d331a732790" + ] + ] + }, + { + "id": "eef89545ec0f6aa8", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2300, + "wires": [ + [] + ] + }, + { + "id": "b1b4678827d3a6dd", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2420, + "wires": [ + [] + ] + }, + { + "id": "0f3367983bb8e159", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2460, + "wires": [ + [] + ] + }, + { + "id": "c9d2e31514def4fc", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2500, + "wires": [ + [] + ] + }, + { + "id": "e50492d1e18f43c6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2340, + "wires": [ + [] + ] + }, + { + "id": "af88b9da72917d62", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2380, + "wires": [ + [] + ] + }, + { + "id": "43fe948b3e7234e2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2600, + "wires": [ + [ + "2522f888dc58972f" + ] + ] + }, + { + "id": "5c752757090c49d2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2600, + "wires": [ + [] + ] + }, + { + "id": "435681b3f7625a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "30e8df3d616512d8" + ] + ] + }, + { + "id": "a1769f0277834f6d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2640, + "wires": [ + [] + ] + }, + { + "id": "1de07c7d285cbaf3", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2760, + "wires": [ + [ + "d855d926df89d65b" + ] + ] + }, + { + "id": "1a8b0ba21b4f3005", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "ebc9e283468eda31", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2800, + "wires": [ + [ + "7617517dc8ba2859" + ] + ] + }, + { + "id": "dc8fc962ff7d594b", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2800, + "wires": [ + [] + ] + }, + { + "id": "60d641613527c736", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2840, + "wires": [ + [ + "cbaa23c34e10fae1" + ] + ] + }, + { + "id": "00e7836ccb3c4d0c", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2840, + "wires": [ + [] + ] + }, + { + "id": "7f24c0c34a88ba04", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2880, + "wires": [ + [ + "f455fb39039617ae" + ] + ] + }, + { + "id": "3019576de193d9d6", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2880, + "wires": [ + [] + ] + }, + { + "id": "77bb7dc529d63a7e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3000, + "wires": [ + [ + "e89f61dbe6a6cffe" + ] + ] + }, + { + "id": "885bc559fafec5f2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3000, + "wires": [ + [] + ] + }, + { + "id": "cc6dabe017a9c8a8", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3320, + "wires": [ + [ + "eef25405472acfee" + ] + ] + }, + { + "id": "12d20f2274bcc511", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3320, + "wires": [ + [] + ] + }, + { + "id": "dcb9fed8122759fd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3040, + "wires": [ + [ + "70014da0b6ab6698" + ] + ] + }, + { + "id": "f70321c96bf81360", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3040, + "wires": [ + [] + ] + }, + { + "id": "013d2057c2347a62", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3080, + "wires": [ + [ + "2544963852c6881a" + ] + ] + }, + { + "id": "95e1603bbd06a69d", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3080, + "wires": [ + [] + ] + }, + { + "id": "f88bbf11d5aa9a14", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3120, + "wires": [ + [ + "a1394401246eb735" + ] + ] + }, + { + "id": "a8f92ea6bf394640", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3120, + "wires": [ + [] + ] + }, + { + "id": "301af70731e096e5", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3160, + "wires": [ + [ + "f15ca4518b5f223e" + ] + ] + }, + { + "id": "06397bb46b3bb541", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3160, + "wires": [ + [] + ] + }, + { + "id": "0456a9ec4c236c9e", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3200, + "wires": [ + [ + "49900bb9047dd965" + ] + ] + }, + { + "id": "687dcdc1ede11700", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3200, + "wires": [ + [] + ] + }, + { + "id": "09d37ba08ec0f163", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3240, + "wires": [ + [ + "5a90224dc998b417" + ] + ] + }, + { + "id": "37d954a4cf7e87ea", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 3280, + "wires": [ + [ + "d2364ab09627fe94" + ] + ] + }, + { + "id": "e220740c0d38ccb0", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3240, + "wires": [ + [] + ] + }, + { + "id": "79d7e5a705ab813a", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 590, + "y": 3280, + "wires": [ + [] + ] + }, + { + "id": "22ef66b0e2058be2", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 360, + "wires": [ + [ + "cb3437ec113e1b6f" + ] + ] + }, + { + "id": "9ce01c8ba97932c1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 400, + "wires": [ + [ + "60fd0adce1cfeb82" + ] + ] + }, + { + "id": "81356177176eebcf", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 480, + "wires": [ + [ + "f6d6cc35679ede63" + ] + ] + }, + { + "id": "b78346ca3ce70c68", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 750, + "y": 180, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "654bc70a18820828", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_contrast?contrast=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2720, + "wires": [ + [] + ] + }, + { + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/v1/camera/picam2_saturation?saturation=\" + str(msg['payload']))", + "outputs": 1, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, + "wires": [ + [ + "e612073aded01a8f" + ] + ] + }, + { + "id": "0d92559980944ae3", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, + "width": 3, + "height": 1, + "name": "delay_after", + "label": "Delay after", + "format": "", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 2560, + "wires": [] + }, + { + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 2560, + "wires": [ + [] + ] + }, + { + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 560, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 210, + "y": 980, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 220, + "y": 1020, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 6, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", + "type": "function", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 980, + "wires": [ + [ + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" + ] + ] + }, + { + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, + "wires": [ + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] + ] + }, + { + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", + "outputs": 1, + "x": 670, + "y": 980, + "wires": [ + [ + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" + ] + ] + }, + { + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, + "wires": [ + [] + ] + }, + { + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, + "wires": [ + [ + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] + ] + }, + { + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] + }, + { + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", + "name": "", + "x": 670, + "y": 1020, + "wires": [] + }, + { + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, + "wires": [] + }, + { + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] + }, + { + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "rotor_endstop_angle_label", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, + "wires": [ + [] + ] + }, + { + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop_label", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 820, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 450, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 540, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, + { + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, + { + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "e98c1b83744bb863", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Delete Aborted", + "tooltip": "Delete aborted photosets", + "group": "d324f0b852c2df0a", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 420, + "y": 520, + "wires": [ + [ + "7438a5bf5fcddec4" + ] + ] + }, + { + "id": "7438a5bf5fcddec4", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "delete_aborted", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('delete_aborted'):\n save('delete_aborted', state)\n", + "outputs": 1, + "x": 600, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "53681e53353db898", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'delete_aborted'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 520, + "wires": [ + [ + "e98c1b83744bb863" + ] + ] + }, + { + "id": "48386fdb54980ec7", + "type": "comment", + "z": "e43a27722b508115", + "name": "Shield", + "info": "", + "x": 90, + "y": 3760, + "wires": [] + }, + { + "id": "fbc5fc2e65311f8b", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3840, + "wires": [ + [ + "5618e266f6966ae6" + ] + ] + }, + { + "id": "5618e266f6966ae6", + "type": "function", + "z": "e43a27722b508115", + "name": "loadl", + "func": "var file = 'shield_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath + file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 170, + "y": 3840, + "wires": [ + [ + "c97113d841391e40" + ] + ] + }, + { + "id": "c97113d841391e40", + "type": "ui_dropdown", + "z": "e43a27722b508115", + "name": "", + "label": "Shield Type", + "tooltip": "", + "place": "Select option", + "group": "0b244f698c7ac9a2", + "order": 0, + "width": 0, + "height": 0, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "Green", + "value": "green", + "type": "str" + }, + { + "label": "Black", + "value": "black", + "type": "str" + } + ], + "payload": "", + "topic": "payload", + "topicType": "msg", + "className": "", + "x": 310, + "y": 3840, + "wires": [ + [ + "2b639346c1b56578" + ] + ] + }, + { + "id": "2b639346c1b56578", + "type": "function", + "z": "e43a27722b508115", + "name": "function 2", + "func": "let fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar file = 'shield_type';\nconst current_shield = fs.readFileSync(filepath + file, 'utf8');\n\nvar current_choice = msg.payload\n\nif (current_choice != current_shield) {\n \n switch (current_choice) {\n case \"green\":\n fs.writeFile(filepath + 'pin_external', String(10), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(17), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(9), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(11), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(14), err => {\n if (err) {\n return\n }\n });\n break;\n case \"black\":\n fs.writeFile(filepath + 'pin_external', String(5), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight1', String(24), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_ringlight2', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_dir', String(23), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_step', String(27), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_enable', String(22), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_dir', String(6), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_tt_step', String(26), err => {\n if (err) {\n return\n }\n });\n fs.writeFile(filepath + 'pin_rotor_endstop', String(17), err => {\n if (err) {\n return\n }\n });\n break;\n case \"custom\":\n break;\n }\n\n fs.writeFile(filepath + file, current_choice, err => {\n if (err) {\n return\n }\n });\n}\n\nmsg.status = 'The new ' + current_choice + ' shield has been configured'\nmsg.topic = msg.status\nmsg.payload = 'Do you want to reboot now to apply the changes?'\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 460, + "y": 3840, + "wires": [ + [ + "137f032887544d74" + ] + ] + }, + { + "id": "137f032887544d74", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "prompt", + "displayTime": "3", + "highlight": "", + "sendall": false, + "outputs": 1, + "ok": "OK", + "cancel": "Cancel", + "raw": true, + "className": "", + "topic": "", + "name": "Reboot", + "x": 600, + "y": 3840, + "wires": [ + [ + "d2db49796fe0da79", + "d0d6820224b0ab0f" + ] + ] + }, + { + "id": "d2db49796fe0da79", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "print(msg['payload'])\nreturn msg", + "outputs": 1, + "x": 790, + "y": 3840, + "wires": [ + [] + ] + }, + { + "id": "d0d6820224b0ab0f", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 6", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 780, + "y": 3720, + "wires": [] + }, + { + "id": "a74d78a1d186a833", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1760, + "wires": [ + [ + "4e1b38e60f4179b0" + ] + ] + }, + { + "id": "4e1b38e60f4179b0", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotate_tt_first", + "label": "", + "tooltip": "", + "group": "38d121ea5b2bd77d", + "order": 3, + "width": "3", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 430, + "y": 1760, + "wires": [ + [ + "0e14711b77c43c23" + ] + ] + }, + { + "id": "0e14711b77c43c23", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotate_tt_first'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1760, + "wires": [ + [] + ] + }, + { + "id": "b1d13cc1ebec82d7", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "38d121ea5b2bd77d", + "order": 2, + "width": 3, + "height": 1, + "name": "rotate_tt_first_label", + "label": "Rotate turntable first", + "format": "", + "layout": "row-left", + "className": "", + "x": 790, + "y": 1760, + "wires": [] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/2024-11S/update/2024-11S'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", + "outputs": 1, + "x": 290, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "beacc3dc5398fa79", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "38783aea9cc317a6" + ], + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "b0629875a30ae1d7", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "get update", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nopenscan_version = load_str('openscan_version')\nopenscan_branch = load_str('openscan_branch')\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/' + openscan_version + '/update/' + openscan_version\n\nupdatepath = '/home/pi/OpenScan/updates/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + '/update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\nmsg['openscan_version'] = openscan_version\nmsg['openscan_branch'] = openscan_branch\nmsg['url'] = url\nreturn msg, msg", + "outputs": 2, + "x": 390, + "y": 540, + "wires": [ + [ + "1bbe2d769f42c313" + ], + [ + "fefe45404bdb19c4" + ] + ] + }, + { + "id": "c7b6d05a62172432", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 3, + "width": 0, + "height": 0, + "name": "", + "label": "Status:", + "format": "{{msg.status}}", + "layout": "row-spread", + "className": "", + "x": 210, + "y": 400, + "wires": [] + }, + { + "id": "fefe45404bdb19c4", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "check files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nopenscan_branch = msg['openscan_branch']\nopenscan_version = msg['openscan_version']\nurl = msg['url']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[openscan_branch]:\n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[openscan_branch][i]['filesize2'] = filesize\n if filesize == msg[openscan_branch][i]['filesize']:\n msg[openscan_branch][i]['update'] = False\n continue\n msg[openscan_branch][i]['update'] = True\n\n counter += 1\n\nmsg['openscan_branch'] = openscan_branch\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "outputs": 1, + "x": 550, + "y": 560, + "wires": [ + [ + "1bbe2d769f42c313", + "ae92a328af306ebb" + ] + ] + }, + { + "id": "d0104e0163745993", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "960912e90ba5b5bc", + "50eeb3e362f9027f" + ], + "x": 115, + "y": 440, + "wires": [ + [ + "ec30638407332e43", + "49f1ecb29a3f84f4" + ] + ] + }, + { + "id": "ec30638407332e43", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadS", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 370, + "y": 420, + "wires": [ + [ + "2852023f3aa8db10" + ] + ] + }, + { + "id": "2852023f3aa8db10", + "type": "ui_dropdown", + "z": "a5557543ccff5889", + "name": "", + "label": "", + "tooltip": "", + "place": "Select option", + "group": "ddbd496e.93a288", + "order": 5, + "width": 2, + "height": 1, + "passthru": false, + "multiple": false, + "options": [ + { + "label": "stable", + "value": "stable", + "type": "str" + }, + { + "label": "beta", + "value": "beta", + "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } + ], + "payload": "", + "topic": "topic", + "topicType": "msg", + "className": "", + "x": 500, + "y": 420, + "wires": [ + [ + "1e10b387ee30c486" + ] + ] + }, + { + "id": "1e10b387ee30c486", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'openscan_branch'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 420, + "wires": [ + [] + ] + }, + { + "id": "274129c51b0b87ef", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "ddbd496e.93a288", + "order": 4, + "width": 4, + "height": 1, + "name": "", + "label": "Branch: ", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "x": 760, + "y": 420, + "wires": [] + }, + { + "id": "51cd8c8643e6b46a", + "type": "ui_switch", + "z": "a5557543ccff5889", + "name": "", + "label": "Auto-check update availability", + "tooltip": "", + "group": "ddbd496e.93a288", + "order": 6, + "width": 6, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "", + "topicType": "str", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 450, + "y": 480, + "wires": [ + [ + "1ab4c6b4b232a022" + ] + ] + }, + { + "id": "1ab4c6b4b232a022", + "type": "function", + "z": "a5557543ccff5889", + "name": "write", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 650, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "ae92a328af306ebb", + "type": "ui_toast", + "z": "a5557543ccff5889", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "NO", + "cancel": "YES", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 710, + "y": 560, + "wires": [ + [ + "2de63e8e3ae5fb0c", + "929281fef53e09f8" + ] + ] + }, + { + "id": "cbd0afc4aa7b302a", + "type": "link in", + "z": "a5557543ccff5889", + "name": "update status", + "links": [ + "1bbe2d769f42c313", + "42061b28cff81f99" + ], + "x": 115, + "y": 400, + "wires": [ + [ + "c7b6d05a62172432", + "c94623ddd9d95f78" + ] + ] + }, + { + "id": "1bbe2d769f42c313", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 665, + "y": 520, + "wires": [] + }, + { + "id": "7cf60615d93e696b", + "type": "ui_button", + "z": "a5557543ccff5889", + "name": "", + "group": "ddbd496e.93a288", + "order": 7, + "width": 6, + "height": 1, + "passthru": false, + "label": "Check Updates", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 180, + "y": 560, + "wires": [ + [ + "b0629875a30ae1d7" + ] + ] + }, + { + "id": "2de63e8e3ae5fb0c", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "download files", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\nopenscan_version = load_str('openscan_version')\n\nopenscan_branch = msg['openscan_branch']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = msg['url']\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[openscan_branch]:\n if msg[openscan_branch][i]['update'] == False:\n continue\n \n filepath = msg[openscan_branch][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + '/' + msg[openscan_branch][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[openscan_branch][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[openscan_branch][i]['dst'])\n \n if msg[openscan_branch][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "outputs": 1, + "x": 880, + "y": 560, + "wires": [ + [ + "42061b28cff81f99", + "fe3a855fee9e28c6" + ] + ] + }, + { + "id": "929281fef53e09f8", + "type": "function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 850, + "y": 520, + "wires": [ + [ + "42061b28cff81f99" + ] + ] + }, + { + "id": "42061b28cff81f99", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "cbd0afc4aa7b302a" + ], + "x": 995, + "y": 520, + "wires": [] + }, + { + "id": "49f1ecb29a3f84f4", + "type": "function", + "z": "a5557543ccff5889", + "name": "loadB", + "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 217, + "y": 508, + "wires": [ + [ + "b0629875a30ae1d7", + "51cd8c8643e6b46a" + ] + ] + }, + { + "id": "fe3a855fee9e28c6", + "type": "link out", + "z": "a5557543ccff5889", + "name": "", + "mode": "link", + "links": [ + "9bb0adbd716ce347", + "01c882fcc51b349c" + ], + "x": 995, + "y": 560, + "wires": [] + }, + { + "id": "5e7d5e4335d37794", + "type": "link in", + "z": "a5557543ccff5889", + "name": "", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 95, + "y": 700, + "wires": [ + [ + "2bb5fe78e09fec8a" + ] + ] + }, + { + "id": "2bb5fe78e09fec8a", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "msg", + "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", + "outputs": 1, + "x": 210, + "y": 700, + "wires": [ + [ + "dbc77052ac950624", + "d97c3068ef5fef96", + "73a3b828f862312b", + "901e31453b2bdff8", + "f983854748ee4763", + "5347c7c517f5e8c7", + "3a5016f7003cd72c", + "6d720c4a4ecd9475", + "6438b7d060a70d81" + ] + ] + }, + { + "id": "d97c3068ef5fef96", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "OS:", + "format": "{{msg.os}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 740, + "wires": [] + }, + { + "id": "73a3b828f862312b", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 8, + "width": 0, + "height": 0, + "name": "", + "label": "Flask:", + "format": "{{msg.flask}}", + "layout": "row-spread", + "className": "", + "x": 490, + "y": 780, + "wires": [] + }, + { + "id": "dbc77052ac950624", + "type": "ui_text", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Device:", + "format": "{{msg.device}}", + "layout": "row-spread", + "className": "", + "x": 500, + "y": 700, + "wires": [] + }, + { + "id": "3f42560297fe6978", + "type": "ui_template", + "z": "a5557543ccff5889", + "group": "3ce32450.e0cffc", + "name": "Download LOG", + "order": 9, + "width": 6, + "height": 1, + "format": "Note, that you can always adjust these and other settings in the settings menu, which will appear after this setup stage.
\nModel
\nPlease select the OpenScan Version - this will only affect the motor settings (acceleration, gear ratio, speed).
\nCamera
\n- Pi Camera v1, v2, HQ, Arducam IMX519, IMX290, IMX378, OV9281 are connected through the ribbon cable. If you encounter any issues, please check the cable's orientation
\n- DSLR (gphoto) - can be used with a wide range of cameras, which can be connected and controlled via USB. Check GPhoto if your camera is supported
\n- External Camera - Can be used to connect your camera trigger to the GPIO pins on the front of the pi shield. This can be used with any (modified) remote shutter release, and thus it is possible to use Smartphones, DSLR and compact cameras
", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": true, - "templateScope": "local", + "id": "e7306ef2.3b4df", + "type": "ui_button", + "z": "e6f4d02efb300ea9", + "name": "", + "group": "729f9ea6e3513c9b", + "order": 4, + "width": 3, + "height": 2, + "passthru": false, + "label": "Update&Info", + "tooltip": "", + "color": "", + "bgcolor": "", "className": "", - "x": 280, - "y": 40, + "icon": "", + "payload": "4", + "payloadType": "num", + "topic": "", + "topicType": "str", + "x": 110, + "y": 660, "wires": [ - [] + [ + "62cd5288.2805fc" + ] ] }, { "id": "8955d11554f55e63", "type": "ui_button", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "", "group": "5b3e5aca21140e9a", "order": 1, @@ -968,7 +1022,7 @@ "topic": "", "topicType": "str", "x": 120, - "y": 280, + "y": 720, "wires": [ [ "1e7457ea9c2c5e09" @@ -978,961 +1032,410 @@ { "id": "1e7457ea9c2c5e09", "type": "link out", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "update", "mode": "link", "links": [ "39a502b38837273d" ], "x": 245, - "y": 280, - "wires": [] - }, - { - "id": "bb84b9e5c7d8e21f", - "type": "python3-function", - "z": "829d803b6033a693", - "name": "rescue incomplete project", - "func": "#if project has not been done properly, this is a way to rescue the file\n\nfrom os import system\nfrom os.path import isfile\nfrom time import strftime\nfrom OpenScan import load_str\n\nbasepath = '/home/pi/OpenScan/'\nzippath = basepath + 'tmp/tmp.zip'\nprojectname=load_str(\"routine_projectname\")\nprojectcode = strftime('20%y-%m-%d_%H.%M.%S-') + projectname\n\nif isfile(zippath):\n system('mv '+ zippath + ' ' + basepath + 'scans/' + projectcode + '.zip')", - "outputs": 1, - "x": 290, - "y": 600, - "wires": [ - [] - ] - }, - { - "id": "a291fc98e4269c1b", - "type": "ui_text", - "z": "829d803b6033a693", - "group": "729f9ea6e3513c9b", - "order": 7, - "width": 4, - "height": 1, - "name": "version", - "label": "Version:", - "format": "{{msg.firmware}}", - "layout": "row-center", - "className": "", - "x": 460, - "y": 360, + "y": 720, "wires": [] }, { - "id": "7113d7b25a851151", + "id": "245e4341d4fb611c", "type": "function", - "z": "829d803b6033a693", - "name": "FIRMWARE VERSION", - "func": "msg.firmware = '2022-08-02'\nreturn msg", + "z": "e6f4d02efb300ea9", + "name": "pinmap_v2", + "func": "msg = { \n'overwrite':true,\n'settings':{\n 'pin_rotor_endstop':27,\n 'pin_tt_endstop':5,\n 'pin_extra_endstop':26,\n 'pin_external':25,\n 'pin_ringlight1':24,\n 'pin_ringlight2':24,\n 'pin_rotor_dir':23,\n 'pin_rotor_enable':19,\n 'pin_rotor_step':22,\n 'pin_tt_dir':6,\n 'pin_tt_enable':19,\n 'pin_tt_step':16,\n 'pin_extra_dir':21,\n 'pin_extra_step':20,\n 'pin_extra_enable':19,\n 'extra_acc':1,\n 'extra_accramp':200,\n 'extra_angle':10,\n 'extra_delay':0.0001,\n 'extra_dir':1,\n 'extra_stepsperrotation':3200,\n}}\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 280, - "y": 360, + "x": 790, + "y": 540, "wires": [ [ - "a291fc98e4269c1b", - "ec5cefa70ff535f7" + "627406f3611511dc" ] ] }, { - "id": "ec5cefa70ff535f7", - "type": "ui_text", - "z": "829d803b6033a693", - "group": "ddbd496e.93a288", - "order": 2, - "width": 6, - "height": 1, - "name": "current version", - "label": "Current version:", - "format": "{{msg.firmware}}", - "layout": "row-spread", - "className": "", - "x": 480, - "y": 320, - "wires": [] - }, - { - "id": "c4c1580c289fc7bd", + "id": "627406f3611511dc", "type": "python3-function", - "z": "829d803b6033a693", - "name": "create path", - "func": "import os\n\npaths = ['/home/pi/OpenScan/scans/preview/']\n\n\nfor i in paths:\n if not os.path.isdir(i):\n os.mkdir(i)", + "z": "e6f4d02efb300ea9", + "name": "write", + "func": "from os import listdir\n\nbasedir = '/home/pi/OpenScan/settings/'\n\nmsg['payload'] = ''\n\nfiles = listdir(basedir)\n\nfor i in msg['settings']:\n if msg['overwrite'] != True:\n if i not in files:\n with open(basedir + i, 'w+') as file:\n file.write(str(msg['settings'][i])) \n else:\n with open(basedir + i, 'w+') as file:\n file.write(str(msg['settings'][i])) \n\nmsg['payload'] = True\n\nreturn msg", "outputs": 1, - "x": 250, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "06d33bb8951ce668", - "type": "ui_template", - "z": "829d803b6033a693", - "group": "", - "name": "donate", - "order": 2, - "width": "0", - "height": "0", - "format": "\n\n", - "storeOutMessages": false, - "fwdInMessages": false, - "resendOnRefresh": false, - "templateScope": "global", - "className": "", - "x": 450, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "828e5298.d2192", - "type": "ui_button", - "z": "1613373abaf77a2c", - "name": "", - "group": "7aaf184330605300", - "order": 9, - "width": 2, - "height": 1, - "passthru": false, - "label": "⇐", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "", - "payloadType": "num", - "topic": "", - "topicType": "str", - "x": 90, - "y": 400, - "wires": [ - [ - "b12e54fb.3141b8" - ] - ] - }, - { - "id": "96c7e241.458e6", - "type": "ui_button", - "z": "1613373abaf77a2c", - "name": "", - "group": "7aaf184330605300", - "order": 10, - "width": 2, - "height": 1, - "passthru": false, - "label": "⇒", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "", - "payloadType": "num", - "topic": "", - "topicType": "str", - "x": 90, - "y": 440, - "wires": [ - [ - "37f52dd4.bd7572" - ] - ] - }, - { - "id": "2e854876.6b6008", - "type": "ui_button", - "z": "1613373abaf77a2c", - "name": "", - "group": "7aaf184330605300", - "order": 6, - "width": 2, - "height": 1, - "passthru": true, - "label": "⇑", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "", - "payloadType": "num", - "topic": "", - "topicType": "str", - "x": 90, - "y": 280, - "wires": [ - [ - "555aea34.b3b5e4" - ] - ] - }, - { - "id": "753817f.1b9b3e8", - "type": "ui_button", - "z": "1613373abaf77a2c", - "name": "", - "group": "7aaf184330605300", - "order": 7, - "width": 2, - "height": 1, - "passthru": true, - "label": "⇓", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "", - "payloadType": "num", - "topic": "", - "topicType": "str", - "x": 90, - "y": 320, + "x": 930, + "y": 540, "wires": [ [ - "9905e0c9.dddcd" + "50eeb3e362f9027f" ] ] }, { - "id": "8775044.3aa3ef8", - "type": "ui_text", - "z": "1613373abaf77a2c", - "group": "7aaf184330605300", - "order": 8, - "width": 2, - "height": 1, - "name": "", - "label": "Turntable", - "format": "", - "layout": "row-left", - "className": "", - "x": 100, - "y": 360, - "wires": [] - }, - { - "id": "9e8a2d23.bf6ce", - "type": "ui_text", - "z": "1613373abaf77a2c", - "group": "7aaf184330605300", - "order": 5, - "width": 2, - "height": 1, + "id": "88b1bddde110298a", + "type": "inject", + "z": "e6f4d02efb300ea9", "name": "", - "label": "Rotor", - "format": "", - "layout": "row-left", - "className": "", - "x": 90, - "y": 240, - "wires": [] - }, - { - "id": "555aea34.b3b5e4", - "type": "delay", - "z": "1613373abaf77a2c", - "name": "lmt 0.2/s", - "pauseType": "rate", - "timeout": "0.1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "0.2", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": true, - "outputs": 1, - "x": 220, - "y": 280, - "wires": [ - [ - "46e00b45.c24ca4" - ] - ] - }, - { - "id": "9905e0c9.dddcd", - "type": "delay", - "z": "1613373abaf77a2c", - "name": "lmt 0.2/s", - "pauseType": "rate", - "timeout": "0.1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "0.2", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": true, - "outputs": 1, - "x": 220, - "y": 320, - "wires": [ - [ - "6ee089cb343a35ef" - ] - ] - }, - { - "id": "b12e54fb.3141b8", - "type": "delay", - "z": "1613373abaf77a2c", - "name": "lmt 0.2/s", - "pauseType": "rate", - "timeout": "0.1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "0.2", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": true, - "outputs": 1, - "x": 220, - "y": 400, - "wires": [ - [ - "c1871a2b9af5419a" - ] - ] - }, - { - "id": "37f52dd4.bd7572", - "type": "delay", - "z": "1613373abaf77a2c", - "name": "lmt 0.2/s", - "pauseType": "rate", - "timeout": "0.1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "0.2", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": true, - "outputs": 1, - "x": 220, - "y": 440, - "wires": [ - [ - "42b9f1fc49e69f54" - ] - ] - }, - { - "id": "46e00b45.c24ca4", - "type": "python3-function", - "z": "1613373abaf77a2c", - "name": "Rotor left", - "func": "from OpenScan import motorrun, load_int\n\nmotorrun('rotor',load_int('rotor_angle'))", - "outputs": 1, - "x": 360, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "6ee089cb343a35ef", - "type": "python3-function", - "z": "1613373abaf77a2c", - "name": "Rotor right", - "func": "from OpenScan import motorrun, load_int\n\nmotorrun('rotor',-load_int('rotor_angle'))", - "outputs": 1, - "x": 370, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "42b9f1fc49e69f54", - "type": "python3-function", - "z": "1613373abaf77a2c", - "name": "TT right", - "func": "from OpenScan import motorrun, load_int\n\nmotorrun('tt',-load_int('tt_angle'))", - "outputs": 1, - "x": 360, - "y": 440, - "wires": [ - [] - ] - }, - { - "id": "c1871a2b9af5419a", - "type": "python3-function", - "z": "1613373abaf77a2c", - "name": "TT left", - "func": "from OpenScan import motorrun, load_int\n\nmotorrun('tt',load_int('tt_angle'))", - "outputs": 1, - "x": 350, - "y": 400, - "wires": [ - [] - ] - }, - { - "id": "aebad788761dce4a", - "type": "ui_slider", - "z": "1613373abaf77a2c", - "name": "routine_photocount", - "label": "", - "tooltip": "", - "group": "7aaf184330605300", - "order": 14, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", + "props": [ + { + "p": "overwrite", + "v": "false", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": "0.1", "topic": "", - "topicType": "str", - "min": "10", - "max": "300", - "step": "10", - "className": "", - "x": 350, - "y": 540, - "wires": [ - [ - "ce28a0b5bfb0d5a1" - ] - ] - }, - { - "id": "107a030938cbfea9", - "type": "function", - "z": "1613373abaf77a2c", - "name": "loadI", - "func": "var file = 'routine_photocount'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 190, + "x": 650, "y": 540, "wires": [ [ - "aebad788761dce4a" + "245e4341d4fb611c" ] ] }, { - "id": "ce28a0b5bfb0d5a1", - "type": "function", - "z": "1613373abaf77a2c", - "name": "write", - "func": "var file = 'routine_photocount'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 510, + "id": "50eeb3e362f9027f", + "type": "link out", + "z": "e6f4d02efb300ea9", + "name": "started1s", + "mode": "link", + "links": [ + "2f4c0f98.dee2", + "397ab7f44b893c89", + "65145c939b6647e2", + "65b38bfeb3fee710", + "6d1e12f51f9af0b6", + "788fabff98c7973c", + "9b2bc9849aee310b", + "a1e14624058e74cd", + "a67c18aaca2f5fa5", + "bd80ec228fb9a86d", + "cc9c4092edeb43cc", + "d3fc91d87d5d5f62", + "d7c1fb4c028b21a5", + "e5f38b4a07a5e278", + "f0b355967b33dfee", + "d0104e0163745993", + "5e7d5e4335d37794", + "b4c843620c251c43", + "3876d5cbd248592b", + "a4c81754c148b86f", + "2e9b29c70969cf01", + "2477f81cddc8fa31", + "29036b35dfd672c6", + "592ec13d8f8923a9", + "cb40b9341bd22a28", + "d1efcd5fa9d25785", + "da61581182b7299e", + "2afb6a45c73fa244" + ], + "x": 1015, "y": 540, - "wires": [ - [] - ] - }, - { - "id": "84d6b96c8ebaac96", - "type": "function", - "z": "1613373abaf77a2c", - "name": "loadF", - "func": "var file = 'cam_shutter'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) / 1000;\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 190, - "y": 580, - "wires": [ - [ - "470b10726d298834" - ] - ] - }, - { - "id": "470b10726d298834", - "type": "ui_slider", - "z": "1613373abaf77a2c", - "name": "shutter ", - "label": " ", - "tooltip": "", - "group": "7aaf184330605300", - "order": 16, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "1", - "max": "700", - "step": "1", - "className": "", - "x": 310, - "y": 580, - "wires": [ - [ - "44c3947a9b92d32d" - ] - ] + "wires": [] }, { - "id": "44c3947a9b92d32d", - "type": "function", - "z": "1613373abaf77a2c", - "name": "write", - "func": "var file = 'cam_shutter'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload * 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "id": "4f3121f158f06a61", + "type": "python3-function", + "z": "e6f4d02efb300ea9", + "name": "motor run", + "func": "from OpenScan import motorrun, load_int\nfrom time import sleep\n\nmotorrun('rotor',300,True,False)\n\n", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 510, + "x": 860, "y": 580, "wires": [ [] ] }, { - "id": "069bcf58b1fe44cd", - "type": "ui_text", - "z": "1613373abaf77a2c", - "group": "7aaf184330605300", - "order": 13, - "width": 3, - "height": 1, - "name": "photocount", - "label": "Photos", - "format": "", - "layout": "row-left", - "className": "", - "x": 670, - "y": 540, - "wires": [] - }, - { - "id": "8dc7df1de59cb03a", - "type": "ui_text", - "z": "1613373abaf77a2c", - "group": "7aaf184330605300", - "order": 15, - "width": 3, - "height": 1, - "name": "shutter", - "label": "Shutter (ms)", - "format": "", - "layout": "row-left", - "className": "", - "x": 650, - "y": 580, - "wires": [] - }, - { - "id": "cc69dba8d54a29dd", - "type": "ui_slider", - "z": "1613373abaf77a2c", - "name": "Crop X", - "label": " ", - "tooltip": "", - "group": "7aaf184330605300", - "order": 18, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", + "id": "4a8a04b1e5dca8fe", + "type": "inject", + "z": "e6f4d02efb300ea9", + "name": "run rotor till endstop", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, "topic": "", - "topicType": "str", - "min": "0", - "max": "99", - "step": "1", - "className": "", - "x": 320, - "y": 620, + "payload": "", + "payloadType": "date", + "x": 690, + "y": 580, "wires": [ [ - "c2b2ab5524271123" + "4f3121f158f06a61" ] ] }, { - "id": "e3a90602605fb9e9", - "type": "ui_slider", - "z": "1613373abaf77a2c", - "name": "Crop Y", - "label": " ", - "tooltip": "", - "group": "7aaf184330605300", - "order": 20, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0", - "max": "99", - "step": "1", + "id": "c8167775e3401fad", + "type": "ui_template", + "z": "e6f4d02efb300ea9", + "group": "729f9ea6e3513c9b", + "name": "infotext", + "order": 4, + "width": 0, + "height": 0, + "format": "Hostname
The device can be accessed through any browser in the same network. Therefore, you can either enter the device's IP address or the given hostname. The standard name is 'openscan' but it is highly recommended to change the name, when using multiple devices (e.g. 'openscan1', 'openscan2' ...)
Select Wifi
After booting, the device will automatically search for available wireless networks and create a list. You can connect to a given network by entering the wifi password and country code. To find the right two-character country code, see the following list: ISO 3166 Country Code on Wikipedia
Search Wifi
You can manually refresh the list of available networks by pressing this button.
Reset Wifi
Delete the list of known wireless networks (and passwords) and reset the default. After this step, you will either need to use Ethernet or a modified wpa_supplicant.conf file. (see glennklockwood.com for more details about the wpa_supplicant.conf file, which has to be manually created and placed into the /boot/ directory of the sd-card)
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 590, - "y": 120, + "y": 320, "wires": [ [ - "f304680180a23479" + "b78346ca3ce70c68" ] ] }, { - "id": "7dc39bd847d16ded", + "id": "f0d8dbcca76a1926", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -4646,19 +3867,19 @@ "topic": "", "name": "", "x": 410, - "y": 300, + "y": 320, "wires": [ [ - "5f849178998d9082" + "e95b86cbac1b03b9" ] ] }, { - "id": "02858034e17b827f", + "id": "34374044c0030625", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "General", - "group": "4fe6b4c0ade0938a", + "group": "4390b2ebcbbe104c", "order": 1, "width": 6, "height": 1, @@ -4674,19 +3895,19 @@ "topic": "topic", "topicType": "msg", "x": 740, - "y": 240, + "y": 220, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "675d4933a44ae6b5", + "id": "b2b6bf23c9989133", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Pinout", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 1, "width": 6, "height": 1, @@ -4702,219 +3923,32 @@ "topic": "topic", "topicType": "msg", "x": 430, - "y": 200, + "y": 220, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "b0aa8ffae5a3578a", + "id": "441d3ef525e901da", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "smb", "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('smb'):\n save('smb', state)\nif state == True:\n os.system('/etc/init.d/smbd start')\nelse:\n os.system('/etc/init.d/smbd stop')\n\n\n", "outputs": 1, "x": 530, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "cc3cb10f2ea3f8b8", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "blink Light1", - "func": "import RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nfrom OpenScan import ringlight\nfrom time import sleep\n\ndelay = 0.1\nringlight(2,False)\n\nfor i in range (5):\n ringlight(1,True)\n sleep(delay)\n ringlight(1,False)\n sleep(delay)", - "outputs": 1, - "x": 290, - "y": 760, - "wires": [ - [] - ] - }, - { - "id": "d114f4d4d7f31981", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "reboot", - "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", - "outputs": 1, - "x": 270, - "y": 720, + "y": 400, "wires": [ [] ] }, { - "id": "79181ad3b56d5c62", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "4fe6b4c0ade0938a", - "order": 7, - "width": 2, - "height": 1, - "name": "", - "label": "Model", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 730, - "y": 620, - "wires": [] - }, - { - "id": "4d81bd138733c410", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "4fe6b4c0ade0938a", - "order": 9, - "width": 2, - "height": 1, - "name": "", - "label": "Camera", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 840, - "y": 420, - "wires": [] - }, - { - "id": "80b579a4220e5c23", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "model", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "4fe6b4c0ade0938a", - "order": 8, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Please Select", - "value": "None", - "type": "str" - }, - { - "label": "OpenScan Mini", - "value": "OSMini", - "type": "str" - }, - { - "label": "OpenScan Classic", - "value": "OSClassic", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 390, - "y": 620, - "wires": [ - [ - "896242c5a7e50fa7" - ] - ] - }, - { - "id": "a2c1dba3e67be015", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "Camera", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "4fe6b4c0ade0938a", - "order": 10, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Pi Cam v1 - 5mp", - "value": "ov5647", - "type": "str" - }, - { - "label": "Pi Cam v2 - 8mp", - "value": "imx219", - "type": "str" - }, - { - "label": "Pi Cam HQ - 12.3mp", - "value": "imx477", - "type": "str" - }, - { - "label": "Arducam IMX519 - 16mp", - "value": "imx519", - "type": "str" - }, - { - "label": "IMX290 a", - "value": "imx290a", - "type": "str" - }, - { - "label": "IMX290 b", - "value": "imx290b", - "type": "str" - }, - { - "label": "IMX378", - "value": "imx378", - "type": "str" - }, - { - "label": "OV9281", - "value": "ov9281", - "type": "str" - }, - { - "label": "DSLR (gphoto)", - "value": "gphoto", - "type": "str" - }, - { - "label": "USB Webcam", - "value": "usb_webcam", - "type": "str" - }, - { - "label": "External Camera", - "value": "external", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 400, - "y": 420, - "wires": [ - [ - "4058a31e942e8f95", - "6d68cccec646e0a0" - ] - ] - }, - { - "id": "9cf5d56263caada7", + "id": "3256bab150113a48", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Motor", - "group": "d49a6dfd7fb17096", + "group": "7a3279eea439bcdd", "order": 1, "width": 6, "height": 1, @@ -4930,19 +3964,19 @@ "topic": "topic", "topicType": "msg", "x": 430, - "y": 120, + "y": 140, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "72238e6a01d1152c", + "id": "7a186669a17daa71", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "camera", - "group": "93aadb71dee6d977", + "group": "d324f0b852c2df0a", "order": 1, "width": 6, "height": 1, @@ -4958,71 +3992,41 @@ "topic": "topic", "topicType": "msg", "x": 420, - "y": 160, + "y": 180, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "15a0a2f431ce55c3", + "id": "edac7dd292e7e486", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "General Settings", "info": "", "x": 120, - "y": 260, - "wires": [] - }, - { - "id": "87a403b9a09aa38d", - "type": "comment", - "z": "017bd4e4a428bee5", - "name": "Network", - "info": "", - "x": 100, - "y": 880, + "y": 280, "wires": [] }, { - "id": "896242c5a7e50fa7", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "model", - "func": "from OpenScan import load_str, save\n\nstate = msg['payload']\nmsg['state'] = state\n\nif state != load_str('model'):\n save('model', state)\n if state == 'OSMini':\n save('rotor_stepsperrotation',48000)\n save('cam_rotation',90)\n save('rotor_anglemin',-70)\n save('rotor_anglemax',20)\n \n\n if state == 'OSClassic':\n save('rotor_stepsperrotation',17067)\n save('cam_rotation',0)\n save('rotor_anglemin',-30)\n save('rotor_anglemax',30)\n\nif state == \"OSMini\":\n msg['crop2'] = 'Crop X (%)'\n msg['crop1'] = 'Crop Y (%)'\nelif state == \"OSClassic\":\n msg['crop1'] = 'Crop X (%)'\n msg['crop2'] = 'Crop Y (%)'\n\nreturn msg", - "outputs": 1, - "x": 530, - "y": 620, - "wires": [ - [ - "f358de1e64b491bb" - ] - ] - }, - { - "id": "4058a31e942e8f95", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "camera", - "func": "from OpenScan import load_str, save\nfrom json import load\nstate = msg['payload']\nstate_old = load_str('camera')\n\nif state_old != state:\n save('camera',state)\n return msg", - "outputs": 1, - "x": 540, - "y": 500, - "wires": [ - [ - "34b685aff2080d31" - ] - ] - }, - { - "id": "c833f6243a059d83", + "id": "161b52034e578ee2", + "type": "comment", + "z": "e43a27722b508115", + "name": "Network", + "info": "", + "x": 100, + "y": 720, + "wires": [] + }, + { + "id": "f6d6cc35679ede63", "type": "ui_switch", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "more sets", "label": "Advanced Settings", "tooltip": "", - "group": "4fe6b4c0ade0938a", + "group": "4390b2ebcbbe104c", "order": 5, "width": 6, "height": 1, @@ -5042,71 +4046,47 @@ "animate": false, "className": "", "x": 400, - "y": 660, + "y": 480, "wires": [ [ - "8be8015931c663cc" + "f06a7bcad524e9f9" ] ] }, { - "id": "15fd1c9e5610cb85", + "id": "29745a36fc157f3f", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "more sets", "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", "outputs": 2, "x": 820, - "y": 660, - "wires": [ - [ - "62cd775a1c02dac8" - ], - [ - "c833f6243a059d83" - ] - ] - }, - { - "id": "74c5c7cd2681045b", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "load camera&model", - "func": "from OpenScan import load_str, load_bool\n\nmodel = load_str('model')\ncamera = load_str('camera')\nupdate = load_bool('updateable')\nmsg['model'] = model\nmsg['camera'] = camera\nmsg2 = {}\nmsg3 = {}\nmsg4 = {}\n\nif camera in ('imx219','ov5647','imx477','imx290a','imx290b','imx378','ov9281','gphoto'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Arducam\"],\"show\":[\"Scan_Settings\",\"Scan_Picamera\"]}}\nelif camera in ('imx519'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Picamera\"],\"show\":[\"Scan_Settings\",\"Scan_Arducam\"]}}\nelif camera in ('external'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Arducam\",\"Scan_Picamera\"],\"show\":[\"Scan_Settings\"]}}\n\n\nif model == 'None' or model == '' or camera == 'None' or camera == '':\n msg2['payload']={\"tabs\": {\"hide\": [\"Scan\", \"Files&Cloud\",\"Settings\",\"Update & Info\"]}}\n msg3['payload'] = {\"group\":{\"hide\":[\"OpenScan_Home\"],\"show\":[\"OpenScan_Initialize\"]}}\nelse:\n msg2['payload']={\"tabs\": {\"show\": [\"Scan\", \"Files&Cloud\",\"Settings\",\"Update & Info\"]},\"hide\":{}}\n msg3['payload'] = {\"group\":{\"show\":[\"OpenScan_Home\"],\"hide\":[\"OpenScan_Initialize\"]}}\n\nif update == True:\n msg4['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg4['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\nreturn msg,msg2,msg3,msg4", - "outputs": 4, - "x": 340, - "y": 40, + "y": 480, "wires": [ [ - "b4db790aad28ba39" - ], - [ - "b4db790aad28ba39" - ], - [ - "b4db790aad28ba39" + "8750ad979e9ea246" ], [ - "b4db790aad28ba39" + "f6d6cc35679ede63" ] ] }, { - "id": "b4db790aad28ba39", + "id": "bf23328f9fb11b22", "type": "ui_ui_control", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "change visibility", "events": "all", "x": 600, - "y": 40, + "y": 60, "wires": [ [] ] }, { - "id": "eb8ccf2786ea3d63", + "id": "b37be1d222bc70c9", "type": "inject", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "1s_repeater", "props": [ { @@ -5125,60 +4105,62 @@ "payload": "", "payloadType": "date", "x": 150, - "y": 40, + "y": 60, "wires": [ [ - "74c5c7cd2681045b", - "9b756a1f9b0e7317" + "89eedf29b404f750" ] ] }, { - "id": "9b756a1f9b0e7317", + "id": "89eedf29b404f750", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "load advanced", - "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\nreturn msg", - "outputs": 1, - "x": 320, - "y": 80, + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, "wires": [ [ - "b4db790aad28ba39" + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" ] ] }, { - "id": "ca4afadb5b21751f", + "id": "2050de5d9e02f69f", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Info Texts", "info": "", "x": 100, - "y": 120, + "y": 140, "wires": [] }, { - "id": "f393400.d87dcc", + "id": "ded3086945a6d4b5", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "check ip address", "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", "outputs": 1, - "x": 410, - "y": 1060, + "x": 250, + "y": 940, "wires": [ [ - "bb789eed.9f73c" + "3cfe464506f46ecd" ] ] }, { - "id": "bb789eed.9f73c", + "id": "3cfe464506f46ecd", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "0fe66c9190b8a87c", - "order": 2, + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, "width": 0, "height": 0, "name": "", @@ -5186,299 +4168,26 @@ "format": "{{msg.ip}}", "layout": "row-spread", "className": "", - "x": 590, - "y": 1060, + "x": 430, + "y": 940, "wires": [] }, { - "id": "2a0f9919.4c9a86", + "id": "bd206ad109831e6a", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "OpenScanCloud", "info": "", "x": 120, - "y": 1240, + "y": 1260, "wires": [] }, { - "id": "27c6b221c90ed9e1", - "type": "exec", - "z": "017bd4e4a428bee5", - "command": "iwlist wlan0 scan | grep ESSID | sed 's/ESSID://g;s/\"//g;s/^ *//;s/ *$//'", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "winHide": false, - "oldrc": false, - "name": "scan", - "x": 250, - "y": 1040, - "wires": [ - [ - "b05cf92302a5c112", - "f393400.d87dcc" - ], - [ - "e9677b85856b5873" - ], - [] - ] - }, - { - "id": "b05cf92302a5c112", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "WIFI", - "func": "msg['options']=[]\n\nfor i in msg['payload'].split('\\n'):\n if i not in msg['options'] and i!=\"\":\n msg['options'].append(i)\n \nif len(msg['options']) != 0:\n msg['enabled']=True\n\nreturn msg", - "outputs": 1, - "x": 370, - "y": 1020, - "wires": [ - [ - "59c9f67283ba1709" - ] - ] - }, - { - "id": "da5ddaf4cc25b8c8", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "search", - "group": "0fe66c9190b8a87c", - "order": 4, - "width": 3, - "height": 1, - "passthru": false, - "label": "Search Wifi", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "true", - "payloadType": "bool", - "topic": "", - "topicType": "str", - "x": 90, - "y": 980, - "wires": [ - [ - "27c6b221c90ed9e1", - "51521bc6eb44cde5" - ] - ] - }, - { - "id": "59c9f67283ba1709", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "", - "label": "", - "tooltip": "", - "place": "Select Wifi", - "group": "0fe66c9190b8a87c", - "order": 3, - "width": 6, - "height": 1, - "passthru": true, - "multiple": false, - "options": [], - "payload": "", - "topic": "", - "topicType": "str", - "className": "", - "x": 520, - "y": 980, - "wires": [ - [ - "2bb52656f9554dab" - ] - ] - }, - { - "id": "b2d7d6a730f7dca6", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Reset Wifi", - "group": "0fe66c9190b8a87c", - "order": 5, - "width": 3, - "height": 1, - "passthru": false, - "label": "Reset Wifi", - "tooltip": "", - "color": "red", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "Delete all prior wifi connections? (You will need to reconnect to the OpenScan device by Ethernet or manually modify the wpa_supplicant.conf)", - "payloadType": "str", - "topic": "", - "topicType": "str", - "x": 110, - "y": 1140, - "wires": [ - [ - "78985ac6d3bcdf60" - ] - ] - }, - { - "id": "c3b8faac9ebb2c80", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "Reset Wifi", - "func": "from time import sleep\n\nif msg['payload']!=\"Yes\":\n return\n\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\nsleep(3)\nos.system('systemctl restart nodered')\nreturn msg", - "outputs": 1, - "x": 440, - "y": 1140, - "wires": [ - [] - ] - }, - { - "id": "78985ac6d3bcdf60", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "No", - "cancel": "Yes", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 270, - "y": 1140, - "wires": [ - [ - "c3b8faac9ebb2c80" - ] - ] - }, - { - "id": "4f7f49b12c2d2572", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "add Wifi", - "func": "from time import sleep\nsleep(0.1)\n\nos.system('wpa_cli -i wlan0 reconfigure')\n\nreturn msg", - "outputs": 1, - "x": 1320, - "y": 1000, - "wires": [ - [] - ] - }, - { - "id": "ebcc98685059b9d4", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "password", - "x": 780, - "y": 980, - "wires": [ - [ - "68204a14528ab842" - ] - ] - }, - { - "id": "68204a14528ab842", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "if msg['payload'] == 'Cancel':\n return\n\nmsg['password'] = msg['payload']\nmsg['payload']='Enter country code (ISO 3166-1 alpha-2, see: Wikipedia)'\n\n\nreturn msg", - "outputs": 1, - "x": 910, - "y": 980, - "wires": [ - [ - "852edf901bdec9c5" - ] - ] - }, - { - "id": "852edf901bdec9c5", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "Save", - "cancel": "Cancel", - "raw": true, - "className": "", - "topic": "", - "name": "country", - "x": 1040, - "y": 980, - "wires": [ - [ - "1b09d634e3d9357b" - ] - ] - }, - { - "id": "1b09d634e3d9357b", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "modWPA", - "func": "if msg['payload'] == 'Cancel':\n return\n\nif len(msg['payload'])!=2:\n msg['payload'] = 'invalid country code'\n return msg,None\n\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\ntemp_dir = '/home/pi/OpenScan/tmp/wpa'\n\ncode = msg['payload'].upper()\nssid = msg['ssid']\npassword = msg['password']\n\nif len(code) != 2:\n msg['topic'] = 'ERROR'\n msg['payload'] = 'invalid country code (see ISO 3166-1 alpha-2)'\n return msg\n\nwith open(wpa_dir, 'r') as file:\n for i in file.readlines():\n if 'country=' in i:\n code_old=i.split('country=')[1][0:2]\n break\n\nwith open(wpa_dir, 'r') as file:\n wpa = file.read()\n if ssid in wpa:\n msg['topic'] = 'ERROR'\n msg['payload'] = 'Network already exists! If you have trouble connecting, please consider resetting the saved Wifi connections.'\n return msg\n wpa=wpa.replace('country=' + code_old, 'country=' + code)\n wpa=wpa + '\\nnetwork={\\n priority=10\\n ssid=\"'+ssid+'\"\\n psk=\"'+password+'\"\\n}\\n'\n\nwith open(temp_dir,'w+') as file:\n file.write(wpa)\nos.system('mv '+temp_dir + ' ' + wpa_dir)\n\nmsg['topic'] = 'Updating Wifi'\nmsg['payload'] = 'reconnecting might take a moment'\nreturn msg,msg\n", - "outputs": 2, - "x": 1180, - "y": 980, - "wires": [ - [ - "03732a7d3b0c95aa" - ], - [ - "4f7f49b12c2d2572" - ] - ] - }, - { - "id": "03732a7d3b0c95aa", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 1330, - "y": 960, - "wires": [ - [] - ] - }, - { - "id": "e97d17c6590138e2", + "id": "b70a9a665c1e4d36", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Cloud-settings", - "group": "3b4bd36726be16d5", + "group": "12b719cba49817c9", "order": 1, "width": 6, "height": 1, @@ -5493,19 +4202,19 @@ "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 620, - "y": 160, + "x": 740, + "y": 260, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "f7bf47e3eec6d736", + "id": "c9f0566601a3e130", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 4, "width": 0, "height": 0, @@ -5515,14 +4224,14 @@ "layout": "row-spread", "className": "", "x": 410, - "y": 1380, + "y": 1400, "wires": [] }, { - "id": "b52d91c628b151a4", + "id": "9bd86d27ea499a2a", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 5, "width": 0, "height": 0, @@ -5532,14 +4241,14 @@ "layout": "row-spread", "className": "", "x": 390, - "y": 1420, + "y": 1440, "wires": [] }, { - "id": "1969c709ef2fd1d5", + "id": "2c37f7030810d234", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 3, "width": 0, "height": 0, @@ -5549,32 +4258,32 @@ "layout": "row-spread", "className": "", "x": 370, - "y": 1460, + "y": 1480, "wires": [] }, { - "id": "88e92b621d2a3394", + "id": "f40286c18afd4501", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "save", "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", "outputs": 2, "x": 750, - "y": 1320, + "y": 1340, "wires": [ [ - "76acd48a511a5e3e", - "b01581296b94dfcd" + "455a5266017ea121", + "50f73cee213ec05c" ], [ - "9c51aa678f16980f" + "264eece408043021" ] ] }, { - "id": "76acd48a511a5e3e", + "id": "455a5266017ea121", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5586,19 +4295,19 @@ "topic": "", "name": "", "x": 890, - "y": 1280, + "y": 1300, "wires": [ [] ] }, { - "id": "5f50ed3f6ba37cef", + "id": "c368df68593bc2bf", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "label": "Token", "tooltip": "", - "group": "3b4bd36726be16d5", + "group": "12b719cba49817c9", "order": 2, "width": 6, "height": 1, @@ -5610,68 +4319,69 @@ "className": "", "topicType": "str", "x": 350, - "y": 1340, + "y": 1360, "wires": [ [ - "cb62d30728af2968" + "18fd1afa768187b3" ] ] }, { - "id": "cb62d30728af2968", + "id": "18fd1afa768187b3", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Save?", "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", "outputs": 2, "x": 470, - "y": 1340, + "y": 1360, "wires": [ [ - "94e503dd2e64d903" + "418aea2ec65573a0" ], [ - "d859bb39914d4999" + "9792c89c5f4429f9" ] ] }, { - "id": "0dd01eef6e70059e", + "id": "f90a98899b7a71d0", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "text", "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", "outputs": 1, "x": 230, - "y": 1340, + "y": 1360, "wires": [ [ - "5f50ed3f6ba37cef" + "c368df68593bc2bf" ] ] }, { - "id": "788fabff98c7973c", + "id": "b4c843620c251c43", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "token", "links": [ "960912e90ba5b5bc", - "b01581296b94dfcd", - "d859bb39914d4999" + "50f73cee213ec05c", + "9792c89c5f4429f9", + "50eeb3e362f9027f" ], "x": 75, - "y": 1340, + "y": 1360, "wires": [ [ - "0dd01eef6e70059e" + "f90a98899b7a71d0" ] ] }, { - "id": "94e503dd2e64d903", + "id": "418aea2ec65573a0", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5684,74 +4394,75 @@ "topic": "", "name": "", "x": 610, - "y": 1320, + "y": 1340, "wires": [ [ - "88e92b621d2a3394" + "f40286c18afd4501" ] ] }, { - "id": "d859bb39914d4999", + "id": "9792c89c5f4429f9", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "mode": "link", "links": [ - "788fabff98c7973c" + "b4c843620c251c43" ], "x": 555, - "y": 1360, + "y": 1380, "wires": [] }, { - "id": "9c51aa678f16980f", + "id": "264eece408043021", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "links": [ "5d267acc10020091", - "397ab7f44b893c89" + "3876d5cbd248592b" ], "x": 835, - "y": 1360, + "y": 1380, "wires": [] }, { - "id": "397ab7f44b893c89", + "id": "3876d5cbd248592b", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "OSCparameters", "links": [ "960912e90ba5b5bc", - "9c51aa678f16980f", - "b42e061fb1f1f3d7" + "264eece408043021", + "b42e061fb1f1f3d7", + "50eeb3e362f9027f" ], "x": 75, - "y": 1380, + "y": 1400, "wires": [ [ - "a7fd00943edc380b" + "5daca3ec47f8e7fc" ] ] }, { - "id": "b01581296b94dfcd", + "id": "50f73cee213ec05c", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "links": [ - "788fabff98c7973c", + "b4c843620c251c43", "5d267acc10020091" ], "x": 835, - "y": 1320, + "y": 1340, "wires": [] }, { - "id": "bf6d941ad307ce22", + "id": "95578e54a9b61cba", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -5764,35 +4475,35 @@ "topic": "", "name": "", "x": 250, - "y": 1520, + "y": 1540, "wires": [ [ - "f22dfef37d5de773" + "d7a5693da7855da8" ] ] }, { - "id": "f22dfef37d5de773", + "id": "d7a5693da7855da8", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", "outputs": 2, "x": 390, - "y": 1520, + "y": 1540, "wires": [ [ - "54602ee49ca022e7" + "2b02b97dd1614e52" ], [ - "1505f3e72f971081" + "183a629accb417b1" ] ] }, { - "id": "1505f3e72f971081", + "id": "183a629accb417b1", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5805,15 +4516,15 @@ "topic": "", "name": "", "x": 530, - "y": 1560, + "y": 1580, "wires": [ [] ] }, { - "id": "54602ee49ca022e7", + "id": "2b02b97dd1614e52", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -5826,17 +4537,17 @@ "topic": "", "name": "", "x": 530, - "y": 1520, + "y": 1540, "wires": [ [ - "f9efcb87b74abbd4" + "3e4c15d7b538f816" ] ] }, { - "id": "510dbe4d76253bd6", + "id": "3bf622f344172721", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -5849,35 +4560,35 @@ "topic": "", "name": "", "x": 810, - "y": 1520, + "y": 1540, "wires": [ [ - "600b2306caed1640" + "e431cb2b8d217cee" ] ] }, { - "id": "600b2306caed1640", + "id": "e431cb2b8d217cee", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", "outputs": 1, "x": 950, - "y": 1520, + "y": 1540, "wires": [ [ - "bbad1ab5f8f63fb7" + "106874534890f229" ] ] }, { - "id": "d34cd203725bac15", + "id": "a38d7fde5c73210f", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Register", - "group": "3b4bd36726be16d5", - "order": 7, + "group": "12b719cba49817c9", + "order": 6, "width": 2, "height": 1, "passthru": false, @@ -5892,17 +4603,17 @@ "topic": "Requesting an OpenScanCloud Token", "topicType": "str", "x": 100, - "y": 1520, + "y": 1540, "wires": [ [ - "bf6d941ad307ce22" + "95578e54a9b61cba" ] ] }, { - "id": "bbad1ab5f8f63fb7", + "id": "106874534890f229", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5915,67 +4626,67 @@ "topic": "", "name": "", "x": 1090, - "y": 1520, + "y": 1540, "wires": [ [] ] }, { - "id": "a7fd00943edc380b", + "id": "5daca3ec47f8e7fc", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", "outputs": 1, "x": 230, - "y": 1380, + "y": 1400, "wires": [ [ - "f7bf47e3eec6d736", - "b52d91c628b151a4", - "1969c709ef2fd1d5" + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" ] ] }, { - "id": "124459147143ec6a", + "id": "f34de19d4cf810a9", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Motor", "info": "", "x": 90, - "y": 1600, + "y": 1740, "wires": [] }, { - "id": "dbd62b91a6c9c412", + "id": "26c2b58e21f97475", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Camera", "info": "", "x": 90, - "y": 2240, + "y": 2500, "wires": [] }, { - "id": "842b6fe016087ce3", + "id": "a8ec972bad47a9a8", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Pinout", "info": "", - "x": 110, - "y": 2860, + "x": 90, + "y": 2960, "wires": [] }, { - "id": "8c1a92f2dcc976c7", + "id": "b03e8b51187e88eb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Rotor_delay (ms)", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 14, + "group": "7a3279eea439bcdd", + "order": 16, "width": 3, "height": 1, "passthru": false, @@ -5987,22 +4698,22 @@ "step": "0.005", "className": "", "x": 450, - "y": 1840, + "y": 2100, "wires": [ [ - "bb54bbdae6690576" + "11fd3363416433f9" ] ] }, { - "id": "2647111c06f2055d", + "id": "6aae9d4fddf08cc0", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt delay", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 27, + "group": "7a3279eea439bcdd", + "order": 30, "width": 3, "height": 1, "passthru": false, @@ -6014,22 +4725,22 @@ "step": "0.005", "className": "", "x": 420, - "y": 2080, + "y": 2340, "wires": [ [ - "fb8145a9f8d4f7b2" + "e50492d1e18f43c6" ] ] }, { - "id": "f9b51424edb0491c", + "id": "543e1690693acbeb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_acc", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 16, + "group": "7a3279eea439bcdd", + "order": 18, "width": 3, "height": 1, "passthru": false, @@ -6041,22 +4752,22 @@ "step": "0.1", "className": "", "x": 420, - "y": 1880, + "y": 2140, "wires": [ [ - "ea87ecfd2af3cc7f" + "e8b24efb0f30288e" ] ] }, { - "id": "1ab34b0a78b2c577", + "id": "9a56c087d941f1da", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_accramp", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 18, + "group": "7a3279eea439bcdd", + "order": 20, "width": 3, "height": 1, "passthru": false, @@ -6068,22 +4779,22 @@ "step": "100", "className": "", "x": 440, - "y": 1920, + "y": 2180, "wires": [ [ - "249f44c3a87793ba" + "29f576be9e292232" ] ] }, { - "id": "1d4230b3d9b93f63", + "id": "dfdebe10dbf0e198", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_stepsperrotation", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 12, + "group": "7a3279eea439bcdd", + "order": 14, "width": 3, "height": 1, "passthru": false, @@ -6094,19 +4805,19 @@ "className": "", "topicType": "msg", "x": 460, - "y": 1800, + "y": 2060, "wires": [ [ - "0bb56b1edb12c2cf" + "78e256083f59f66f" ] ] }, { - "id": "2e3222f0aba88040", + "id": "af8dfe78cbd0c301", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 17, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, "width": 3, "height": 1, "name": "rotor Accramp", @@ -6115,15 +4826,15 @@ "layout": "row-left", "className": "", "x": 780, - "y": 1880, + "y": 2140, "wires": [] }, { - "id": "9d50311679acf215", + "id": "ee4b8908a5b83880", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 11, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, "width": 3, "height": 1, "name": "rotor_Steps per Rotation", @@ -6132,15 +4843,15 @@ "layout": "row-spread", "className": "", "x": 810, - "y": 1920, + "y": 2180, "wires": [] }, { - "id": "25d7b4dd2aab8f05", + "id": "c4deaa38c1b0adbf", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 15, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, "width": 3, "height": 1, "name": "rotor Acc", @@ -6149,15 +4860,15 @@ "layout": "row-left", "className": "", "x": 760, - "y": 1840, + "y": 2100, "wires": [] }, { - "id": "15682cca9622831f", + "id": "baec873a95fff48a", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 13, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, "width": 3, "height": 1, "name": "rotor_delay", @@ -6166,15 +4877,15 @@ "layout": "row-left", "className": "", "x": 770, - "y": 1800, + "y": 2060, "wires": [] }, { - "id": "8e2d22042bfcb4e8", + "id": "355e89ab4e5484e4", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 23, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 26, "width": 6, "height": 1, "name": "tt", @@ -6183,18 +4894,18 @@ "layout": "row-center", "className": "", "x": 90, - "y": 2040, + "y": 2300, "wires": [] }, { - "id": "56bc3b93af2ebe16", + "id": "10687d331a732790", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_acc", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 29, + "group": "7a3279eea439bcdd", + "order": 32, "width": 3, "height": 1, "passthru": false, @@ -6206,22 +4917,22 @@ "step": "0.1", "className": "", "x": 410, - "y": 2120, + "y": 2380, "wires": [ [ - "35422077b53da9bf" + "af88b9da72917d62" ] ] }, { - "id": "6ef996f8a36f94c2", + "id": "721b9680a3fa460e", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_accramp", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 31, + "group": "7a3279eea439bcdd", + "order": 34, "width": 3, "height": 1, "passthru": false, @@ -6233,22 +4944,22 @@ "step": "1", "className": "", "x": 430, - "y": 2160, + "y": 2420, "wires": [ [ - "2c000bd53cdb98ca" + "b1b4678827d3a6dd" ] ] }, { - "id": "0c50fdbb5ac3c373", + "id": "c6642c7470d3820c", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_stepsperrotation", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 25, + "group": "7a3279eea439bcdd", + "order": 28, "width": 3, "height": 1, "passthru": false, @@ -6259,19 +4970,19 @@ "className": "", "topicType": "msg", "x": 450, - "y": 2040, + "y": 2300, "wires": [ [ - "485a4bed5a6bea23" + "eef89545ec0f6aa8" ] ] }, { - "id": "213ccfb441a42890", + "id": "18e5918748660109", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 30, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 33, "width": 3, "height": 1, "name": "ttAccramp", @@ -6280,15 +4991,15 @@ "layout": "row-left", "className": "", "x": 760, - "y": 2160, + "y": 2420, "wires": [] }, { - "id": "73c9b4d09dc25e54", + "id": "8e805244dc1899e8", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 24, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 27, "width": 3, "height": 1, "name": "tt_steps per Rotation", @@ -6297,15 +5008,15 @@ "layout": "row-spread", "className": "", "x": 800, - "y": 2040, + "y": 2300, "wires": [] }, { - "id": "a81824c92f22487d", + "id": "a09e5fbea861bfb1", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 28, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 31, "width": 3, "height": 1, "name": "tt Acc", @@ -6314,15 +5025,15 @@ "layout": "row-left", "className": "", "x": 750, - "y": 2120, + "y": 2380, "wires": [] }, { - "id": "9715161858f69649", + "id": "7b06448b3b222011", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 26, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 29, "width": 3, "height": 1, "name": "tt_delay", @@ -6331,18 +5042,18 @@ "layout": "row-left", "className": "", "x": 760, - "y": 2080, + "y": 2340, "wires": [] }, { - "id": "1b3ac50d2c6600c6", + "id": "0dfc86d90258f9bb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_angle", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 20, + "group": "7a3279eea439bcdd", + "order": 22, "width": 3, "height": 1, "passthru": false, @@ -6354,19 +5065,19 @@ "step": "1", "className": "", "x": 430, - "y": 1960, + "y": 2220, "wires": [ [ - "e0d7c36daa42b3f3" + "c4b5a38c5c1df3d2" ] ] }, { - "id": "6dcd1f0ccb01a299", + "id": "9319d7d4f34c6d22", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 19, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, "width": 3, "height": 1, "name": "rotor_angle", @@ -6375,18 +5086,18 @@ "layout": "row-spread", "className": "", "x": 770, - "y": 1960, + "y": 2220, "wires": [] }, { - "id": "16e9a3a71c4bb916", + "id": "1610895f430b9aca", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_angle", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 33, + "group": "7a3279eea439bcdd", + "order": 36, "width": 3, "height": 1, "passthru": false, @@ -6398,19 +5109,19 @@ "step": "1", "className": "", "x": 420, - "y": 2200, + "y": 2460, "wires": [ [ - "c34111aaec734dd9" + "0f3367983bb8e159" ] ] }, { - "id": "888161059eb9c71c", + "id": "96a9febc0928b6f0", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 32, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 35, "width": 3, "height": 1, "name": "tt_angle", @@ -6419,15 +5130,15 @@ "layout": "row-spread", "className": "", "x": 760, - "y": 2200, + "y": 2460, "wires": [] }, { - "id": "f4fc72297074c7ae", + "id": "e2c5ea8c16a5ea32", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 4, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, "width": 6, "height": 1, "name": "rotor", @@ -6436,18 +5147,18 @@ "layout": "row-center", "className": "", "x": 90, - "y": 1680, + "y": 1820, "wires": [] }, { - "id": "9b1d8f9e21b34102", + "id": "277037c4716d85bf", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_dir", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 35, + "group": "7a3279eea439bcdd", + "order": 38, "width": 3, "height": 1, "passthru": false, @@ -6459,22 +5170,22 @@ "step": "1", "className": "", "x": 410, - "y": 2240, + "y": 2500, "wires": [ [ - "89dbbe7d99ddbbaf" + "c9d2e31514def4fc" ] ] }, { - "id": "b2e839fe47a32b5f", + "id": "1361134e9847f003", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_dir", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 22, + "group": "7a3279eea439bcdd", + "order": 24, "width": 3, "height": 1, "passthru": false, @@ -6486,19 +5197,19 @@ "step": "1", "className": "", "x": 420, - "y": 2000, + "y": 2260, "wires": [ [ - "204b0a5c8629d78a" + "523717b0f218a5fd" ] ] }, { - "id": "4519daf0b4b28aef", + "id": "6b0d58943ecb8bb2", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 34, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 37, "width": 3, "height": 1, "name": "tt_dir", @@ -6507,15 +5218,15 @@ "layout": "row-spread", "className": "", "x": 750, - "y": 2240, + "y": 2500, "wires": [] }, { - "id": "5f269ea2c8a53f6c", + "id": "08f93dd2aeedb391", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 21, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, "width": 3, "height": 1, "name": "rotor_dir", @@ -6524,74 +5235,47 @@ "layout": "row-spread", "className": "", "x": 760, - "y": 2000, + "y": 2260, "wires": [] }, { - "id": "b67dfacfc9a23aa5", + "id": "46b91bef44714366", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "advanced settings", "links": [ - "62cd775a1c02dac8" + "8750ad979e9ea246" ], "x": 95, - "y": 80, + "y": 100, "wires": [ [ - "9b756a1f9b0e7317" + "89eedf29b404f750" ] ] }, { - "id": "62cd775a1c02dac8", + "id": "8750ad979e9ea246", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "mode": "link", "links": [ - "b67dfacfc9a23aa5" + "46b91bef44714366" ], "x": 955, - "y": 660, + "y": 480, "wires": [] }, { - "id": "9d94dbc523d989a3", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_delay_after", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 16, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0", - "max": "5", - "step": "0.1", - "className": "", - "x": 450, - "y": 2460, - "wires": [ - [ - "b81e238ccd0a04fe" - ] - ] - }, - { - "id": "0558d6eb9a01862e", + "id": "2522f888dc58972f", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_delay_before", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 14, + "group": "d324f0b852c2df0a", + "order": 7, "width": 3, "height": 1, "passthru": false, @@ -6599,53 +5283,26 @@ "topic": "", "topicType": "str", "min": "0", - "max": "5", - "step": "0.1", - "className": "", - "x": 440, - "y": 2500, - "wires": [ - [ - "a0048747e7300bdc" - ] - ] - }, - { - "id": "d47515c9b208bfb7", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_timeout", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 12, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0.01", "max": "1", - "step": "0.01", + "step": "0.02", "className": "", - "x": 420, - "y": 2420, + "x": 430, + "y": 2600, "wires": [ [ - "9b0d5c521a7822cc" + "5c752757090c49d2" ] ] }, { - "id": "89c76766c7552b57", + "id": "30e8df3d616512d8", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_gain", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 22, + "group": "d324f0b852c2df0a", + "order": 11, "width": 3, "height": 1, "passthru": false, @@ -6656,77 +5313,23 @@ "max": "10", "step": "0.1", "className": "", - "x": 410, - "y": 2540, - "wires": [ - [ - "9b26ed02296d27c9" - ] - ] - }, - { - "id": "c385518eb65a1b27", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_awbg_red", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 18, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-10", - "max": "10", - "step": "0.1", - "className": "", - "x": 430, - "y": 2580, - "wires": [ - [ - "b0ac7e9a7c713b84" - ] - ] - }, - { - "id": "5c80833b718d9bf6", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_awbg_blue", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 20, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-10", - "max": "10", - "step": "0.1", - "className": "", - "x": 430, - "y": 2620, + "x": 400, + "y": 2640, "wires": [ [ - "827b1a671a77037d" + "a1769f0277834f6d" ] ] }, { - "id": "5a3826e112fb24e6", + "id": "d855d926df89d65b", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_contrast", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 24, + "group": "d324f0b852c2df0a", + "order": 13, "width": 3, "height": 1, "passthru": false, @@ -6737,23 +5340,24 @@ "max": "5", "step": "0.1", "className": "", - "x": 430, - "y": 2660, + "x": 420, + "y": 2760, "wires": [ [ - "78a1536c167da741" + "1a8b0ba21b4f3005", + "654bc70a18820828" ] ] }, { - "id": "3182ed7ac02b1509", + "id": "7617517dc8ba2859", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_saturation", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 26, + "group": "d324f0b852c2df0a", + "order": 15, "width": 3, "height": 1, "passthru": false, @@ -6764,22 +5368,23 @@ "max": "5", "step": "0.1", "className": "", - "x": 430, - "y": 2700, + "x": 420, + "y": 2800, "wires": [ [ - "fe9a5b68fc8c2077" + "dc8fc962ff7d594b", + "e64feb03a791ca33" ] ] }, { - "id": "7fa6337cdf0a0bc8", + "id": "cbaa23c34e10fae1", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_jpeg_q", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", + "group": "d324f0b852c2df0a", "order": 3, "width": 3, "height": 1, @@ -6791,54 +5396,20 @@ "max": "100", "step": "1", "className": "", - "x": 420, - "y": 2740, + "x": 410, + "y": 2840, "wires": [ [ - "e27d2613e942f344" + "00e7836ccb3c4d0c" ] ] }, { - "id": "08275bf96f87b8ef", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 11, - "width": 3, - "height": 1, - "name": "timeout", - "label": "Timeout", - "format": "", - "layout": "row-spread", - "className": "", - "x": 760, - "y": 2420, - "wires": [] - }, - { - "id": "d2d028df4a139f41", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 15, - "width": 3, - "height": 1, - "name": "delay_after", - "label": "Delay after", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2460, - "wires": [] - }, - { - "id": "c6a65762aa4ffb7b", + "id": "bbe443b039a14e21", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 13, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, "width": 3, "height": 1, "name": "delay_before", @@ -6846,16 +5417,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 770, - "y": 2500, + "x": 760, + "y": 2600, "wires": [] }, { - "id": "780323fd4504b855", + "id": "d320ed3d701e6cc2", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 21, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, "width": 3, "height": 1, "name": "gain", @@ -6863,50 +5434,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2540, - "wires": [] - }, - { - "id": "780bf08b41202135", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 17, - "width": 3, - "height": 1, - "name": "awbg red", - "label": "AWBG red", - "format": "", - "layout": "row-spread", - "className": "", - "x": 760, - "y": 2580, - "wires": [] - }, - { - "id": "c0faf441fc918538", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 19, - "width": 3, - "height": 1, - "name": "awbg blue", - "label": "AWBG blue", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2620, + "x": 740, + "y": 2640, "wires": [] }, { - "id": "93d12b447a39c5bb", + "id": "f5834dd4646c8af9", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 23, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, "width": 3, "height": 1, "name": "contrast", @@ -6914,16 +5451,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2660, + "x": 750, + "y": 2760, "wires": [] }, { - "id": "e77e6dcd285d3062", + "id": "ae9a4e19469813ef", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 25, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, "width": 3, "height": 1, "name": "saturation", @@ -6931,15 +5468,15 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2700, + "x": 750, + "y": 2800, "wires": [] }, { - "id": "a7075bc8d5ee1138", + "id": "bd629d0d31233c8b", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", "order": 2, "width": 3, "height": 1, @@ -6948,18 +5485,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2740, + "x": 740, + "y": 2840, "wires": [] }, { - "id": "282681e7c4351f74", + "id": "e89f61dbe6a6cffe", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ext", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 3, "width": 2, "height": 1, @@ -6970,19 +5507,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2900, + "x": 390, + "y": 3000, "wires": [ [ - "b17e82651407d8e0" + "885bc559fafec5f2" ] ] }, { - "id": "da43c58979737fec", + "id": "ece38cb172a12d75", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 2, "width": 4, "height": 1, @@ -6991,18 +5528,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2900, + "x": 730, + "y": 3000, "wires": [] }, { - "id": "ef70d61678fe1f11", + "id": "70014da0b6ab6698", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "light1", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 5, "width": 2, "height": 1, @@ -7013,19 +5550,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2940, + "x": 390, + "y": 3040, "wires": [ [ - "2c812acffdb330c5" + "f70321c96bf81360" ] ] }, { - "id": "fec56a7e913b21d6", + "id": "29634ea5f6d666df", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 4, "width": 4, "height": 1, @@ -7034,18 +5571,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2940, + "x": 730, + "y": 3040, "wires": [] }, { - "id": "24929b4629f22070", + "id": "2544963852c6881a", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "light2", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 7, "width": 2, "height": 1, @@ -7056,19 +5593,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2980, + "x": 390, + "y": 3080, "wires": [ [ - "ae0654af69446942" + "95e1603bbd06a69d" ] ] }, { - "id": "7c6bdc0504aa4cc7", + "id": "27903533cd85a59e", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 6, "width": 4, "height": 1, @@ -7077,18 +5614,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2980, + "x": 730, + "y": 3080, "wires": [] }, { - "id": "8c396b060f3d2646", + "id": "a1394401246eb735", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotordir", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 9, "width": 2, "height": 1, @@ -7099,19 +5636,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3020, + "x": 400, + "y": 3120, "wires": [ [ - "58cf48cfacc979fb" + "a8f92ea6bf394640" ] ] }, { - "id": "97568610daccf74a", + "id": "bc0aa4bacdfa94ea", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 8, "width": 4, "height": 1, @@ -7120,18 +5657,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3020, + "x": 740, + "y": 3120, "wires": [] }, { - "id": "a3c58ea48c388215", + "id": "f15ca4518b5f223e", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotorstep", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 11, "width": 2, "height": 1, @@ -7142,19 +5679,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3060, + "x": 400, + "y": 3160, "wires": [ [ - "c7ae206f2fff6810" + "06397bb46b3bb541" ] ] }, { - "id": "6da92aeaeffd95e0", + "id": "0d2924b160e7e383", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 10, "width": 4, "height": 1, @@ -7163,18 +5700,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3060, + "x": 740, + "y": 3160, "wires": [] }, { - "id": "9b5da90eaf6ac562", + "id": "49900bb9047dd965", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotoren", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 13, "width": 2, "height": 1, @@ -7185,19 +5722,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3100, + "x": 400, + "y": 3200, "wires": [ [ - "cfebd4a47a68b319" + "687dcdc1ede11700" ] ] }, { - "id": "12623e4addfa2c22", + "id": "a4d743ca73ee1622", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 12, "width": 4, "height": 1, @@ -7206,18 +5743,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3100, + "x": 740, + "y": 3200, "wires": [] }, { - "id": "f24cb404d7d09f8a", + "id": "5a90224dc998b417", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ttdir", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 15, "width": 2, "height": 1, @@ -7228,19 +5765,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 3140, + "x": 390, + "y": 3240, "wires": [ [ - "90f4d220928e4727" + "e220740c0d38ccb0" ] ] }, { - "id": "542bfb9d92935c2c", + "id": "67dc1b544c4ddf9f", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 14, "width": 4, "height": 1, @@ -7249,18 +5786,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 3140, + "x": 730, + "y": 3240, "wires": [] }, { - "id": "1f79467df98ce894", + "id": "d2364ab09627fe94", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ttstep", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 17, "width": 2, "height": 1, @@ -7271,19 +5808,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 3180, + "x": 390, + "y": 3280, "wires": [ [ - "b05e1e612887f9c2" + "79d7e5a705ab813a" ] ] }, { - "id": "170d3b925f7745cc", + "id": "145b67ac40721ba6", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 16, "width": 4, "height": 1, @@ -7292,18 +5829,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 3180, + "x": 730, + "y": 3280, "wires": [] }, { - "id": "65b0130e390c2e67", + "id": "eef25405472acfee", "type": "ui_text_input", - "z": "017bd4e4a428bee5", - "name": "tten", + "z": "e43a27722b508115", + "name": "endstop1", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 19, "width": 2, "height": 1, @@ -7314,39 +5851,39 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 3220, + "x": 400, + "y": 3320, "wires": [ [ - "fe22723ce5a3495f" + "12d20f2274bcc511" ] ] }, { - "id": "10ac340984418a58", + "id": "35eb252a41413531", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 18, "width": 4, "height": 1, - "name": "tten", - "label": "Turntable enable", + "name": "endstop1", + "label": "Endstop Rotor", "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 3220, + "x": 740, + "y": 3320, "wires": [] }, { - "id": "661614f5bd2c71d6", + "id": "74e455136b5ca5dd", "type": "ui_text_input", - "z": "017bd4e4a428bee5", - "name": "endstop1", + "z": "e43a27722b508115", + "name": "endstop2", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 21, "width": 2, "height": 1, @@ -7357,78 +5894,35 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3260, + "x": 400, + "y": 3360, "wires": [ [ - "2af447a6905b83bc" + "a4a89668ce4c9f05" ] ] }, { - "id": "c18b55859dae5f85", + "id": "3a74f653800eb831", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 20, "width": 4, "height": 1, - "name": "endstop1", - "label": "Endstop 1", - "format": "", - "layout": "row-spread", - "className": "", - "x": 760, - "y": 3260, - "wires": [] - }, - { - "id": "e23a396162026618", - "type": "ui_text_input", - "z": "017bd4e4a428bee5", "name": "endstop2", - "label": "", - "tooltip": "", - "group": "644b3bcc903d46ca", - "order": 23, - "width": 2, - "height": 1, - "passthru": false, - "mode": "number", - "delay": "0", - "topic": "topic", - "sendOnBlur": true, - "className": "", - "topicType": "msg", - "x": 420, - "y": 3300, - "wires": [ - [ - "787a128f84f747c0" - ] - ] - }, - { - "id": "82c1a33014d003e9", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", - "order": 22, - "width": 4, - "height": 1, - "name": "endstop1", - "label": "Endstop 2", + "label": "Endstop Turntable", "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3300, + "x": 740, + "y": 3360, "wires": [] }, { - "id": "5255759a7c5b2a74", + "id": "5fcef1cb2e9e4788", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -7441,37 +5935,37 @@ "topic": "", "name": "confirm", "x": 680, - "y": 660, + "y": 480, "wires": [ [ - "15fd1c9e5610cb85" + "29745a36fc157f3f" ] ] }, { - "id": "8be8015931c663cc", + "id": "f06a7bcad524e9f9", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", "outputs": 1, "x": 530, - "y": 660, + "y": 480, "wires": [ [ - "5255759a7c5b2a74" + "5fcef1cb2e9e4788" ] ] }, { - "id": "9d464b2ba1edaf48", + "id": "f455fb39039617ae", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_rotation", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 10, + "group": "d324f0b852c2df0a", + "order": 5, "width": 3, "height": 1, "passthru": false, @@ -7482,20 +5976,20 @@ "max": "270", "step": "90", "className": "", - "x": 420, - "y": 2780, + "x": 410, + "y": 2880, "wires": [ [ - "b7d3fe0c0b40b3e1" + "3019576de193d9d6" ] ] }, { - "id": "db98b95693ebce63", + "id": "fdfbc900fe424eb9", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 9, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, "width": 3, "height": 1, "name": "cam_rot", @@ -7503,14 +5997,14 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2780, + "x": 750, + "y": 2880, "wires": [] }, { - "id": "6659121906897a1f", + "id": "c3699d6b9664ccca", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7519,17 +6013,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1800, + "y": 2060, "wires": [ [ - "1d4230b3d9b93f63" + "dfdebe10dbf0e198" ] ] }, { - "id": "0bb56b1edb12c2cf", + "id": "78e256083f59f66f", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7538,15 +6032,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1800, + "y": 2060, "wires": [ [] ] }, { - "id": "569829eeff715c33", + "id": "0f9141b401322374", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7555,17 +6049,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1920, + "y": 2180, "wires": [ [ - "1ab34b0a78b2c577" + "9a56c087d941f1da" ] ] }, { - "id": "249f44c3a87793ba", + "id": "29f576be9e292232", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7574,15 +6068,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1920, + "y": 2180, "wires": [ [] ] }, { - "id": "c997e60519341afd", + "id": "23e3099b34c4e475", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7591,17 +6085,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1960, + "y": 2220, "wires": [ [ - "1b3ac50d2c6600c6" + "0dfc86d90258f9bb" ] ] }, { - "id": "e0d7c36daa42b3f3", + "id": "c4b5a38c5c1df3d2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7610,15 +6104,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1960, + "y": 2220, "wires": [ [] ] }, { - "id": "59ecf3a22cd3a669", + "id": "79a14162ac805fac", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7627,17 +6121,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2000, + "y": 2260, "wires": [ [ - "b2e839fe47a32b5f" + "1361134e9847f003" ] ] }, { - "id": "204b0a5c8629d78a", + "id": "523717b0f218a5fd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7646,15 +6140,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2000, + "y": 2260, "wires": [ [] ] }, { - "id": "15f02421b30a9ab6", + "id": "f5cf780f3fa8997e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", "outputs": 1, @@ -7663,17 +6157,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1840, + "y": 2100, "wires": [ [ - "8c1a92f2dcc976c7" + "b03e8b51187e88eb" ] ] }, { - "id": "bb54bbdae6690576", + "id": "11fd3363416433f9", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7682,15 +6176,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1840, + "y": 2100, "wires": [ [] ] }, { - "id": "58928befcc61b1f7", + "id": "02060b3f3b294563", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, @@ -7699,17 +6193,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1880, + "y": 2140, "wires": [ [ - "f9b51424edb0491c" + "543e1690693acbeb" ] ] }, { - "id": "ea87ecfd2af3cc7f", + "id": "e8b24efb0f30288e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7718,34 +6212,34 @@ "finalize": "", "libs": [], "x": 630, - "y": 1880, + "y": 2140, "wires": [ [] ] }, { - "id": "27bc56f273360ac7", + "id": "de1ad8b27b72a5ac", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", "outputs": 1, - "noerr": 0, + "noerr": 4, "initialize": "", "finalize": "", "libs": [], "x": 290, - "y": 2040, + "y": 2300, "wires": [ [ - "0c50fdbb5ac3c373" + "c6642c7470d3820c" ] ] }, { - "id": "f46ced86106306c8", + "id": "ed4d587cb4feb064", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7754,17 +6248,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2160, + "y": 2420, "wires": [ [ - "6ef996f8a36f94c2" + "721b9680a3fa460e" ] ] }, { - "id": "4339704cd8552eb3", + "id": "5b02160c33605ae7", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7773,17 +6267,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2200, + "y": 2460, "wires": [ [ - "16e9a3a71c4bb916" + "1610895f430b9aca" ] ] }, { - "id": "1ac53bb6150645fe", + "id": "304c135ec09801e3", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7792,17 +6286,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2240, + "y": 2500, "wires": [ [ - "9b1d8f9e21b34102" + "277037c4716d85bf" ] ] }, { - "id": "9b89eb1eaf333c10", + "id": "a91dcbe0f9a2416a", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", "outputs": 1, @@ -7811,17 +6305,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2080, + "y": 2340, "wires": [ [ - "2647111c06f2055d" + "6aae9d4fddf08cc0" ] ] }, { - "id": "2e8927be0e235fa1", + "id": "6b2eb1cb95e573f9", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, @@ -7830,17 +6324,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2120, + "y": 2380, "wires": [ [ - "56bc3b93af2ebe16" + "10687d331a732790" ] ] }, { - "id": "485a4bed5a6bea23", + "id": "eef89545ec0f6aa8", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7849,15 +6343,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2040, + "y": 2300, "wires": [ [] ] }, { - "id": "2c000bd53cdb98ca", + "id": "b1b4678827d3a6dd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7866,15 +6360,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2160, + "y": 2420, "wires": [ [] ] }, { - "id": "c34111aaec734dd9", + "id": "0f3367983bb8e159", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7883,15 +6377,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2200, + "y": 2460, "wires": [ [] ] }, { - "id": "89dbbe7d99ddbbaf", + "id": "c9d2e31514def4fc", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7900,15 +6394,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2240, + "y": 2500, "wires": [ [] ] }, { - "id": "fb8145a9f8d4f7b2", + "id": "e50492d1e18f43c6", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7917,15 +6411,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2080, + "y": 2340, "wires": [ [] ] }, { - "id": "35422077b53da9bf", + "id": "af88b9da72917d62", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7934,1119 +6428,1171 @@ "finalize": "", "libs": [], "x": 630, - "y": 2120, + "y": 2380, "wires": [ [] ] }, { - "id": "d5308090f2b7971a", + "id": "43fe948b3e7234e2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_timeout'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) / 1000;\nreturn msg", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2420, + "x": 280, + "y": 2600, "wires": [ [ - "d47515c9b208bfb7" + "2522f888dc58972f" ] ] }, { - "id": "9b0d5c521a7822cc", + "id": "5c752757090c49d2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_timeout'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload * 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2420, + "x": 620, + "y": 2600, "wires": [ [] ] }, { - "id": "694d1068bea15171", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 2460, - "wires": [ - [ - "9d94dbc523d989a3" - ] - ] - }, - { - "id": "cec3e5e78a40476b", + "id": "435681b3f7625a7e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2500, + "x": 280, + "y": 2640, "wires": [ [ - "0558d6eb9a01862e" + "30e8df3d616512d8" ] ] }, { - "id": "b81e238ccd0a04fe", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 2460, - "wires": [ - [] - ] - }, - { - "id": "a0048747e7300bdc", + "id": "a1769f0277834f6d", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2500, + "x": 620, + "y": 2640, "wires": [ [] ] }, { - "id": "6f524f9370a18482", + "id": "1de07c7d285cbaf3", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2540, + "x": 280, + "y": 2760, "wires": [ [ - "89c76766c7552b57" + "d855d926df89d65b" ] ] }, { - "id": "9b26ed02296d27c9", + "id": "1a8b0ba21b4f3005", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2540, + "x": 620, + "y": 2760, "wires": [ [] ] }, { - "id": "1f87f473e327c3cc", + "id": "ebc9e283468eda31", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_awbg_red'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2580, + "x": 280, + "y": 2800, "wires": [ [ - "c385518eb65a1b27" + "7617517dc8ba2859" ] ] }, { - "id": "b0ac7e9a7c713b84", + "id": "dc8fc962ff7d594b", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_awbg_red'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2580, + "x": 620, + "y": 2800, "wires": [ [] ] }, { - "id": "cff7ac5f1e061855", + "id": "60d641613527c736", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_awbg_blue'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2620, + "x": 280, + "y": 2840, "wires": [ [ - "5c80833b718d9bf6" + "cbaa23c34e10fae1" ] ] }, { - "id": "827b1a671a77037d", + "id": "00e7836ccb3c4d0c", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_awbg_blue'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2620, + "x": 620, + "y": 2840, "wires": [ [] ] }, { - "id": "cf854461c37ca54f", + "id": "7f24c0c34a88ba04", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2660, + "x": 280, + "y": 2880, "wires": [ [ - "5a3826e112fb24e6" + "f455fb39039617ae" ] ] }, { - "id": "78a1536c167da741", + "id": "3019576de193d9d6", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2660, + "x": 620, + "y": 2880, "wires": [ [] ] }, { - "id": "ba10e04dd1761692", + "id": "77bb7dc529d63a7e", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2700, + "x": 270, + "y": 3000, "wires": [ [ - "3182ed7ac02b1509" + "e89f61dbe6a6cffe" ] ] }, { - "id": "fe9a5b68fc8c2077", + "id": "885bc559fafec5f2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2700, + "x": 590, + "y": 3000, "wires": [ [] ] }, { - "id": "a69d216114f908a5", + "id": "cc6dabe017a9c8a8", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2740, + "x": 270, + "y": 3320, "wires": [ [ - "7fa6337cdf0a0bc8" + "eef25405472acfee" ] ] }, { - "id": "e27d2613e942f344", + "id": "12d20f2274bcc511", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2740, + "x": 590, + "y": 3320, "wires": [ [] ] }, { - "id": "f02d4a036a225e87", + "id": "dcb9fed8122759fd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2780, + "x": 270, + "y": 3040, "wires": [ [ - "9d464b2ba1edaf48" + "70014da0b6ab6698" ] ] }, { - "id": "b7d3fe0c0b40b3e1", + "id": "f70321c96bf81360", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2780, + "x": 590, + "y": 3040, "wires": [ [] ] }, { - "id": "612cccacda1a65aa", + "id": "013d2057c2347a62", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2900, + "x": 270, + "y": 3080, "wires": [ [ - "282681e7c4351f74" + "2544963852c6881a" ] ] }, { - "id": "b17e82651407d8e0", + "id": "95e1603bbd06a69d", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2900, + "x": 590, + "y": 3080, "wires": [ [] ] }, { - "id": "3b126549c03a872e", + "id": "f88bbf11d5aa9a14", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_endstop1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3260, + "x": 270, + "y": 3120, "wires": [ [ - "661614f5bd2c71d6" + "a1394401246eb735" ] ] }, { - "id": "2af447a6905b83bc", + "id": "a8f92ea6bf394640", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_endstop1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3260, + "x": 590, + "y": 3120, "wires": [ [] ] }, { - "id": "954db931f87894ee", + "id": "301af70731e096e5", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2940, + "x": 270, + "y": 3160, "wires": [ [ - "ef70d61678fe1f11" + "f15ca4518b5f223e" ] ] }, { - "id": "2c812acffdb330c5", + "id": "06397bb46b3bb541", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2940, + "x": 590, + "y": 3160, "wires": [ [] ] }, { - "id": "6682c8057e89d087", + "id": "0456a9ec4c236c9e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2980, + "x": 270, + "y": 3200, "wires": [ [ - "24929b4629f22070" + "49900bb9047dd965" ] ] }, { - "id": "ae0654af69446942", + "id": "687dcdc1ede11700", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2980, + "x": 590, + "y": 3200, "wires": [ [] ] }, { - "id": "015be401d08047d2", + "id": "09d37ba08ec0f163", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3020, + "x": 270, + "y": 3240, "wires": [ [ - "8c396b060f3d2646" + "5a90224dc998b417" ] ] }, { - "id": "58cf48cfacc979fb", + "id": "37d954a4cf7e87ea", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3020, + "x": 270, + "y": 3280, "wires": [ - [] + [ + "d2364ab09627fe94" + ] ] }, { - "id": "1c6c0f8b9ac95659", + "id": "e220740c0d38ccb0", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3060, + "x": 590, + "y": 3240, "wires": [ - [ - "a3c58ea48c388215" - ] + [] ] }, { - "id": "c7ae206f2fff6810", + "id": "79d7e5a705ab813a", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3060, + "x": 590, + "y": 3280, "wires": [ [] ] }, { - "id": "dcee66c0d56c6934", + "id": "21dc963d967d9c99", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3100, + "x": 270, + "y": 3360, "wires": [ [ - "9b5da90eaf6ac562" + "74e455136b5ca5dd" ] ] }, { - "id": "cfebd4a47a68b319", + "id": "a4a89668ce4c9f05", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3100, + "x": 590, + "y": 3360, "wires": [ [] ] }, { - "id": "6ec7d85bb17eb159", + "id": "22ef66b0e2058be2", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3140, + "x": 270, + "y": 360, "wires": [ [ - "f24cb404d7d09f8a" + "cb3437ec113e1b6f" ] ] }, { - "id": "4f42d02a3776a006", + "id": "9ce01c8ba97932c1", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3180, + "x": 270, + "y": 400, "wires": [ [ - "1f79467df98ce894" + "60fd0adce1cfeb82" ] ] }, { - "id": "5d70f4715c9a5ae1", + "id": "81356177176eebcf", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_tt_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3220, + "x": 270, + "y": 480, "wires": [ [ - "65b0130e390c2e67" + "f6d6cc35679ede63" ] ] }, { - "id": "90f4d220928e4727", + "id": "b78346ca3ce70c68", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Refresh
You can refresh the status of the processing of your files in the OpenScanCloud. Make sure to read and agree the terms of use (in settings menu) before using the OpenScanCloud. Do not spam this button, as this might lead to temporary/permanent suspension of your IP address.
The status (in the table) of the individual sets in the file list will be updated to one of the following:
Created - you started the upload of your image set. If you are stuck on this status, please try to restart the upload.
Initialized - all files have been uploaded and processing will start as soon as possible
File approved - the server received and verified your files
Processing started - your files are currently being processed
Processing failed - there are various reasons why processing might fail. Please check the email for more details or contact me at cloud@openscan.eu
processing done - check your email, where you should find a link to the 3d model :)
Status (on the right column)
Indicates, what the device is currently up to.
Refreshing - updating all image set's status
Uploading - while transferring the image set to the OpenScanCloud servers. If the upload freezes, be patient. If nothing happens, reboot the device and restart the upload.
Project started - when the upload of a set was successful
Zipping - files larger then 200mb have to be split and re-zipped before uploading to the OpenScanCloud, the process might take a while depending on the filesize.
Combining - two sets into one might take up to a minute.
Set
select a set from the file list by clicking on a row in the table
Download
Download the selected set from the OpenScan device to your computer/mobile/tablet
Upload
Upload the selected file to the OpenScanCloud
Combine
In order to combine two sets, select one set. Click the combine button and select the second set. A pop-up will appear, and you can confirm the operation. All images from the two sets will be merged into one set. The original image sets will be deleted!
Delete Set/All
Please keep in mind, that the memory of the SD card is relatively small, and thus you will have to delete individual or all photo sets from time to time.
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 590, - "y": 200, + "topic": "", + "name": "Info", + "x": 1010, + "y": 140, "wires": [ - [ - "f304680180a23479" - ] + [] ] }, { - "id": "45df91cae421e8e1", + "id": "cca3300a8f0daf4d", "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Scan_settings", - "group": "7aaf184330605300", + "z": "e43a27722b508115", + "name": "Update&Info", + "group": "ddbd496e.93a288", "order": 1, "width": 6, "height": 1, @@ -9057,726 +7603,778 @@ "bgcolor": "transparent", "className": "", "icon": "fa-question-circle", - "payload": "Current Status
--READY-- - everything is okay and ready to go :)
Routine-preparing - before starting the routine some time might pass depending on the number of photos
Routine-stopping - manually ending the routine by pressing the stop button
Routine-Photo X/Y - Showing the progress of the routine
No Camera Found - please check the camera ribbon cable
Error: XXX - Please contact info@openscan.eu or post an issue on Github.com
Projectname
Each photo set will be saved using the following pattern YYYY-MM-DD_hh-mm-ss_projectname.zip (e.g. 2022-04-05_12.12.12_toysoldier.zip). Keep your files organized by giving each set a new projectname. If not specified 'default' will be used.
Rotor
Moving the rotor by increments of 5°. Please make sure to start the routine with the camera in the horizontal position.
Turntable
Moving the turntable by increments of 15°.
Ringlight
Use the ring light for shadow-free illumination. It is highly recommended to use the polarizer in order to avoid reflections. Note, that the polarizer will absorb 75% of the light, so you might need to use both ring lights.
Photos
Set the number of photos for the current set. 60-120 photos should be more than enough for most objects. If the reconstruction fails or is very bad with 60 photos, increasing the number of photos will not help!
Shutter
Again: Less is more! If the value is too high, some areas might get overexposed and thus, the software will not be able to recognize the surface feature of the object. Here are some reference values:
- no polarizer: 5-20ms
- mostly white object, with polarizer + one ringlight: 50-200ms
Crop X/Y
Make sure to use the right object holder to place the object in the middle of the screen. Try to crop as many unnecessary areas as possible. This will greatly lower the file size and resulting transfer and reconstruction times!
Start/Stop
Use the buttons to start/stop the routine
Reboot/Shutdown
In case of an error, try to restart the device. Always use the shutdown button before powering-off the device!
", + "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 760, - "y": 120, + "x": 750, + "y": 180, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "e9677b85856b5873", + "id": "654bc70a18820828", "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "Reset rfkill", - "func": "from os import system\nif \"Interface doesn't support scanning\" in msg['payload']:\n system('rfkill unblock all')\n system('ifconfig wlan0 up')\n return msg", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/picam2_contrast?contrast=\" + str(msg['payload']))", "outputs": 1, - "x": 390, - "y": 1100, + "x": 660, + "y": 2720, "wires": [ [] ] }, { - "id": "91fe20cb16f54293", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglemin'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/picam2_saturation?saturation=\" + str(msg['payload']))", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 1680, + "x": 660, + "y": 2680, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2560, "wires": [ [ - "327c8bdde31033a4" + "e612073aded01a8f" ] ] }, { - "id": "add3e998b097c54f", + "id": "0d92559980944ae3", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 7, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, "width": 3, "height": 1, - "name": "rotor_anglemin", - "label": "Min Angle", + "name": "delay_after", + "label": "Delay after", "format": "", - "layout": "row-left", + "layout": "row-spread", "className": "", - "x": 780, - "y": 1680, + "x": 760, + "y": 2560, "wires": [] }, { - "id": "da286366433c83a0", + "id": "6281b2e6e081104d", + "type": "function", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2560, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'rotor_anglemin'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1680, + "x": 620, + "y": 2560, "wires": [ [] ] }, { - "id": "327c8bdde31033a4", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglemin", - "label": "", + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 520, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 8, - "width": 3, + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, "className": "", - "x": 440, - "y": 1680, + "topicType": "str", + "x": 210, + "y": 980, "wires": [ [ - "da286366433c83a0" + "a7d233f984009e2e" ] ] }, { - "id": "94288df4c6756197", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglemax", - "label": "", - "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 10, - "width": 3, + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", + "tooltip": "", + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, "className": "", - "x": 440, - "y": 1720, + "topicType": "str", + "x": 220, + "y": 1020, "wires": [ [ - "e531ffe3dcf34eb4" + "a7d233f984009e2e" ] ] }, { - "id": "4702a4a09124e27d", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglestart", - "label": "", + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", "tooltip": "", - "group": "d49a6dfd7fb17096", + "group": "8ab79a98e536e0d6", "order": 6, - "width": 3, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, "className": "", - "x": 440, - "y": 1760, + "topicType": "str", + "x": 240, + "y": 1060, "wires": [ [ - "9ce407cb16f0419a" + "a7d233f984009e2e" ] ] }, { - "id": "2cf946c7aab2cbb4", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglemax'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 1720, + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, "wires": [ [ - "94288df4c6756197" + "a7d233f984009e2e" ] ] }, { - "id": "e531ffe3dcf34eb4", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'rotor_anglemax'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 1720, - "wires": [ - [] - ] + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] }, { - "id": "4da5f650d3845baa", + "id": "a7d233f984009e2e", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglestart'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1760, + "x": 440, + "y": 980, "wires": [ [ - "4702a4a09124e27d" + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" ] ] }, { - "id": "9ce407cb16f0419a", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'rotor_anglestart'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 1760, - "wires": [ - [] - ] - }, - { - "id": "fda776c5aa642867", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 9, - "width": 3, - "height": 1, - "name": "rotor_anglemax", - "label": "Max Angle", - "format": "", - "layout": "row-left", - "className": "", - "x": 780, - "y": 1720, - "wires": [] - }, - { - "id": "6e9af48a1c4c58c6", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 5, - "width": 3, - "height": 1, - "name": "rotor_anglestart", - "label": "Start Angle", - "format": "", - "layout": "row-left", - "className": "", - "x": 780, - "y": 1760, - "wires": [] - }, - { - "id": "9b2bc9849aee310b", + "id": "65518f3d4e3095e5", "type": "link in", - "z": "017bd4e4a428bee5", - "name": "changeHostname", + "z": "e43a27722b508115", + "name": "link in 1", "links": [ - "ec2db55a99bbe3ee", - "d5175561293ef490", - "960912e90ba5b5bc" + "200d4b9951b6e066" ], - "x": 835, - "y": 900, + "x": 85, + "y": 980, "wires": [ [ - "8b9e3781511e9231" + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" ] ] }, { - "id": "8b9e3781511e9231", + "id": "9b851aa999e86fd7", "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "chk", - "func": "with open('/etc/hostname', 'r') as file:\n old_hostname = file.read().replace('\\n','')\nif old_hostname == 'raspberrypi':\n msg['hostname'] = 'openscan'\n msg['payload'] = 'OK'\n return msg", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", "outputs": 1, - "x": 930, - "y": 900, + "x": 670, + "y": 980, "wires": [ [ - "ebce67b739d1891f" + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" ] ] }, { - "id": "3fcbd9fe3acc3fb7", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "scan_arducam", - "group": "90223f7ddc082321", - "order": 1, - "width": 2, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "transparent", + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, "className": "", - "icon": "fa-question-circle", - "payload": "MF - Manual Focus
By default, the switch is 'off', which means that autofocus is active. For small objects, it might be necessary to use manual focus: activate the switch and set the focus by pressing + and - accordingly. The distance is measured between the camera lens and the focal plane (which should be in the center or slightly in front of the center of the object). Be aware, that the distance value is only a rough estimate (mm)
ST - Stacking
Stacking is disabled by default. Once activated, you will be able to set the following:
Stacksize - defines the number of photos between the minimal and the maximal focal distance
SET press this button to set the maximal/minimal focal distance. Pressing the button a third time will re-set the values.
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 760, - "y": 160, + "topic": "", + "name": "", + "x": 870, + "y": 980, "wires": [ - [ - "f304680180a23479" - ] + [] ] }, { - "id": "6d68cccec646e0a0", + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, + "wires": [] + }, + { + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", + "links": [ + "592ec13d8f8923a9" + ], + "x": 815, + "y": 1020, + "wires": [] + }, + { + "id": "1eef47e0074545a9", "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "enable routine", - "func": "msg_enable = {}\nmsg_disable = {}\n\nmsg_enable['enabled'] = True\nmsg_disable['enabled'] = False\n\nif msg['payload'] == 'external':\n return msg_enable, msg_disable\nif msg['payload'] == 'gphoto':\n return msg_enable, msg_enable, msg_disable\n\nreturn msg_enable", - "outputs": 3, - "x": 560, - "y": 440, + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, "wires": [ [ - "a0ba1aa77c5c8b7c" - ], - [ - "a42c12e94f65fa01" + "c994c779e4bad800", + "36890eb99a2ca1cf" ], - [ - "2d76e5617f13cd6c" - ] + [] ] }, { - "id": "a0ba1aa77c5c8b7c", - "type": "link out", - "z": "017bd4e4a428bee5", + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", "name": "", - "mode": "link", - "links": [ - "2aea1727dbea76ce", - "4f212b44aa487945", - "65cef204b16f8741", - "917a194be245384a" + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } ], - "x": 675, - "y": 420, - "wires": [] + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, + "wires": [ + [ + "1eef47e0074545a9" + ] + ] }, { - "id": "a42c12e94f65fa01", - "type": "link out", - "z": "017bd4e4a428bee5", + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", "name": "", - "mode": "link", - "links": [ - "2aea1727dbea76ce", - "4f212b44aa487945", - "65cef204b16f8741", - "917a194be245384a" - ], - "x": 715, - "y": 440, + "x": 670, + "y": 1020, "wires": [] }, { - "id": "2d76e5617f13cd6c", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "65cef204b16f8741" - ], - "x": 675, - "y": 460, + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, "wires": [] }, { - "id": "bd80ec228fb9a86d", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 135, - "y": 340, + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, "wires": [ [ - "78351089ee9ebeaf", - "5fba78ae65eaaf5d", - "3492754252645e62", - "d16525a31223bc42", - "67206663b3881868" + "85ad07b8f973bbe2" ] ] }, { - "id": "65b38bfeb3fee710", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 155, - "y": 760, - "wires": [ - [ - "cc3cb10f2ea3f8b8" - ] - ] + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] }, { - "id": "d3fc91d87d5d5f62", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 135, - "y": 940, + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, "wires": [ - [ - "725fd0cab0bddc0e" - ] + [] ] }, { - "id": "cc9c4092edeb43cc", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 135, - "y": 1020, + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, "wires": [ [ - "27c6b221c90ed9e1", - "f393400.d87dcc" + "6b7245c3dcb694c8" ] ] }, { - "id": "f0b355967b33dfee", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 175, - "y": 1600, + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, "wires": [ [ - "91fe20cb16f54293", - "2cf946c7aab2cbb4", - "4da5f650d3845baa", - "6659121906897a1f", - "15f02421b30a9ab6", - "58928befcc61b1f7", - "569829eeff715c33", - "c997e60519341afd", - "59ecf3a22cd3a669", - "27bc56f273360ac7", - "9b89eb1eaf333c10", - "2e8927be0e235fa1", - "f46ced86106306c8", - "4339704cd8552eb3", - "1ac53bb6150645fe", - "0d48bb415c584420", - "b6e420121e6466e7" + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" ] ] }, { - "id": "d7c1fb4c028b21a5", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 155, - "y": 2280, + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, "wires": [ [ - "d5308090f2b7971a", - "694d1068bea15171", - "cec3e5e78a40476b", - "6f524f9370a18482", - "1f87f473e327c3cc", - "cff7ac5f1e061855", - "cf854461c37ca54f", - "ba10e04dd1761692", - "a69d216114f908a5", - "f02d4a036a225e87", - "1efd4a05aee0b86c", - "6841e5a392f0fb4f" + "253feafa5a2f8b1d" ] ] }, { - "id": "a67c18aaca2f5fa5", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 155, - "y": 2900, + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, "wires": [ - [ - "612cccacda1a65aa", - "954db931f87894ee", - "6682c8057e89d087", - "015be401d08047d2", - "1c6c0f8b9ac95659", - "dcee66c0d56c6934", - "6ec7d85bb17eb159", - "4f42d02a3776a006", - "5d70f4715c9a5ae1", - "3b126549c03a872e", - "58bbe9fc41e0d7b9" - ] + [] ] }, { - "id": "c6d3821bc7f43f8e", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Reset default", - "group": "4fe6b4c0ade0938a", - "order": 14, - "width": 6, + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, "height": 1, - "passthru": false, - "label": "Restore default settings", - "tooltip": "", - "color": "red", - "bgcolor": "", + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", "className": "", - "icon": "", - "payload": "This can not be undone!", - "payloadType": "str", - "topic": "Restore default settings?", - "topicType": "str", - "x": 930, - "y": 300, - "wires": [ - [ - "e4be21c38b57f560" - ] - ] + "x": 800, + "y": 1940, + "wires": [] }, { - "id": "e4be21c38b57f560", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", "outputs": 1, - "ok": "No", - "cancel": "Yes", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 1090, - "y": 300, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 410, + "y": 1980, "wires": [ [ - "9f30de04ced693d3" + "69516440e3997111", + "f036424d79645761" ] ] }, { - "id": "9f30de04ced693d3", + "id": "d54b85891248ba88", "type": "function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "msg.overwrite = true\nif(msg.payload == \"Yes\"){\n return msg}", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 1230, - "y": 300, + "x": 270, + "y": 440, "wires": [ [ - "80bccc884b0be297" + "eefed04c25e3e4d6" ] ] }, { - "id": "80bccc884b0be297", - "type": "link out", - "z": "017bd4e4a428bee5", + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", "name": "", - "mode": "link", - "links": [ - "38783aea9cc317a6" - ], - "x": 1325, - "y": 300, - "wires": [] - }, - { - "id": "34b685aff2080d31", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "boot-cam", - "func": "from OpenScan import load_str\n\ncamera_modules = ('imx519', 'imx219', 'ov5647', 'imx477', 'imx378', 'ov9281', 'imx290a', 'imx290b')\n\npt1 = \"[all]\\n\\ncamera_auto_detect=0\\ngpu_mem=256\\ndtoverlay=vc4-fkms-v3d\\ndtoverlay=\"\npt3 = \",media-controller=1\\n\"\n\nwith open('/boot/config.txt', 'r') as file:\n config = file.read()\n\ncamera = load_str('camera')\nif camera not in camera_modules:\n msg['payload'] = 'no changes'\n return\n\nif camera == 'imx290a':\n camera = 'imx290,clock-frequency=37125000'\nelif camera == 'imx290b':\n camera = 'imx290,clock-frequency=74250000'\n\nconfig_keep = config.split('[all]\\n')[0]\nconfig_new = config_keep + pt1 + camera + pt3\n\nwith open('/boot/config.txt', 'w') as file:\n file.write(config_new)\n\nmsg['topic'] = 'Camera configuration changed'\nmsg['payload'] = 'Please restart the device'\n\nreturn msg", - "outputs": 1, - "x": 680, - "y": 500, + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, "wires": [ [ - "68cba0c530c6def6" + "2aaf7c7f0f0c146f" ] ] }, { - "id": "68cba0c530c6def6", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 830, - "y": 500, + "x": 660, + "y": 440, "wires": [ [] ] }, { - "id": "f304680180a23479", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": true, - "className": "", - "topic": "", - "name": "Info", - "x": 1010, - "y": 120, - "wires": [ - [] - ] + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] }, { - "id": "0d48bb415c584420", + "id": "a12ead9ccf239c19", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1640, + "x": 190, + "y": 3560, "wires": [ [ - "ce215e159ce7267f" + "d0a1a4947a1137ca" ] ] }, { - "id": "ce215e159ce7267f", + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Turntable Mode", - "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 2, - "width": 6, - "height": 1, + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", "passthru": true, "decouple": "false", - "topic": "", - "topicType": "str", + "topic": "topic", + "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", @@ -9788,179 +8386,286 @@ "offcolor": "", "animate": false, "className": "", - "x": 440, - "y": 1640, + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, "wires": [ [ - "f95f528dec31425c" + "1c08a329bd2a669c" ] ] }, { - "id": "f95f528dec31425c", + "id": "bf8e971a52cddab1", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1640, + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, "wires": [ [] ] }, { - "id": "4ebe5baece5ce9f2", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "preview_resolution", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", "order": 5, - "width": 3, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0.5", - "max": "10", - "step": "0.5", + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, "className": "", - "x": 450, - "y": 2280, + "topicType": "msg", + "x": 350, + "y": 3640, "wires": [ [ - "60a415fff23cb55e" + "b5aba11033c5f952" ] ] }, { - "id": "9ed0498cceceedde", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 4, - "width": 3, - "height": 1, - "name": "preview_res", - "label": "Preview Resolution (Mpx)", - "format": "", - "layout": "row-spread", + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, +{ + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", "x": 770, - "y": 2280, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, +{ + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, +{ + "id": "69885a9ce218eb71", + "type": "comment", + "z": "e43a27722b508115", + "name": "Coloritos", + "info": "", + "x": 100, + "y": 3740, "wires": [] }, { - "id": "1efd4a05aee0b86c", + "id": "dc1cde67c3022e6b", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_preview_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data)/1000000;\nreturn msg", + "func": "var file = 'interface_color'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2280, + "x": 190, + "y": 3800, "wires": [ [ - "4ebe5baece5ce9f2" + "0dccca85770c7936" ] ] }, { - "id": "60a415fff23cb55e", + "id": "b63e8246ad14ad9d", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_preview_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload*1000000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "interface-color", + "func": "var file = 'interface_color'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2280, + "x": 540, + "y": 3800, "wires": [ [] ] }, { - "id": "6f3d403e157163e4", + "id": "b7044aa75196b521", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3800, + "wires": [ + [ + "dc1cde67c3022e6b" + ] + ] + }, + { + "id": "0dccca85770c7936", "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "Camera", + "z": "e43a27722b508115", + "name": "interface_color", "label": "", "tooltip": "", "place": "Select option", - "group": "1f7f7e1e24f5ad9b", - "order": 5, - "width": 4, - "height": 1, + "group": "15edc2ce885dddb3", + "order": 1, + "width": 0, + "height": 0, "passthru": true, "multiple": false, "options": [ { - "label": "Pi Cam v1 - 5mp", - "value": "ov5647", + "label": "Aburrido", + "value": "#097479", "type": "str" }, { - "label": "Pi Cam v2 - 8mp", - "value": "imx219", + "label": "Morado", + "value": "#790974", "type": "str" }, { - "label": "Pi Cam HQ - 12.3mp", - "value": "imx477", + "label": "Berenjena", + "value": "#79093c", "type": "str" }, { - "label": "Arducam IMX519 - 16mp", - "value": "imx519", + "label": "Azul", + "value": "#093c79 ", "type": "str" }, { - "label": "IMX290 a", - "value": "imx290a", - "type": "str" - }, - { - "label": "IMX290 b", - "value": "imx290b", - "type": "str" - }, - { - "label": "IMX378", - "value": "imx378", - "type": "str" - }, - { - "label": "OV9281", - "value": "ov9281", - "type": "str" - }, - { - "label": "DSLR (gphoto)", - "value": "gphoto", - "type": "str" - }, - { - "label": "USB Webcam", - "value": "usb_webcam", - "type": "str" - }, - { - "label": "External Camera", - "value": "external", + "label": "Oliva", + "value": "#747909", "type": "str" } ], @@ -9968,154 +8673,133 @@ "topic": "topic", "topicType": "msg", "className": "", - "x": 400, - "y": 460, + "x": 360, + "y": 3800, "wires": [ [ - "6d68cccec646e0a0", - "4058a31e942e8f95" + "b63e8246ad14ad9d" ] ] }, - { - "id": "c6138801b30f091d", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "model", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "1f7f7e1e24f5ad9b", - "order": 3, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Please Select", - "value": "None", - "type": "str" - }, - { - "label": "OpenScan Mini", - "value": "OSMini", - "type": "str" - }, - { - "label": "OpenScan Classic", - "value": "OSClassic", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 390, - "y": 580, +{ + "id": "667950f6671bd1a0", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'hostname'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 840, "wires": [ [ - "896242c5a7e50fa7" + "b82a1cbefad51cd8" ] ] }, { - "id": "4da67c23c7a543a0", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "1f7f7e1e24f5ad9b", - "order": 4, - "width": 2, - "height": 1, - "name": "", - "label": "Camera", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 840, - "y": 460, - "wires": [] - }, - { - "id": "1fed8676078ea9a7", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "1f7f7e1e24f5ad9b", - "order": 2, - "width": 2, - "height": 1, - "name": "", - "label": "Model", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 730, - "y": 580, - "wires": [] - }, - { - "id": "a4b7eea9a9736b0a", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Update&Info", - "group": "ddbd496e.93a288", - "order": 1, - "width": 6, - "height": 1, - "passthru": false, - "label": "", + "id": "5f32d7e78e368454", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'hostname'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 510, + "y": 840, + "wires": [ + [] + ] + }, + { + "id": "b82a1cbefad51cd8", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "hostname", + "label": "Hostname", "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", - "payloadType": "str", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, "topic": "topic", + "sendOnBlur": true, + "className": "", "topicType": "msg", - "x": 750, - "y": 200, + "x": 360, + "y": 840, "wires": [ [ - "f304680180a23479" + "5f32d7e78e368454" ] ] }, +{ + "id": "5fd155711e29b1b8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Monitoring", + "info": "", + "x": 100, + "y": 3860, + "wires": [] + }, { - "id": "b6e420121e6466e7", + "id": "815702499384f118", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'routine_secondpass'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'datadog_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1600, + "x": 190, + "y": 3920, "wires": [ [ - "ab8d5cfe9190bb5f" + "bfdbdae28bf42ed4" ] ] }, { - "id": "ab8d5cfe9190bb5f", + "id": "464c8495f86daaa7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "datadog_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('datadog_enable'):\n save('datadog_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3920, + "wires": [ + [] + ] + }, + { + "id": "bfdbdae28bf42ed4", "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Second pass", - "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 3, - "width": 6, - "height": 1, + "z": "e43a27722b508115", + "name": "datadog_enable", + "label": "Enable Datadog", + "tooltip": "Enable Datadog monitoring", + "group": "33aff36289823faa", + "order": 1, + "width": "6", + "height": "1", "passthru": true, "decouple": "false", - "topic": "", - "topicType": "str", + "topic": "topic", + "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", @@ -10127,206 +8811,261 @@ "offcolor": "", "animate": false, "className": "", - "x": 430, - "y": 1600, + "x": 340, + "y": 3920, + "wires": [ + [ + "464c8495f86daaa7" + ] + ] + }, + { + "id": "f93ce2d26953341f", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "datadog_api_token", + "label": "Datadog Api Token", + "tooltip": "Datadog Api Token", + "group": "33aff36289823faa", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3960, "wires": [ [ - "fa51327f0140b045" + "647641e79884eb87" ] ] }, { - "id": "fa51327f0140b045", + "id": "ee668e39d213070b", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'routine_secondpass'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'datadog_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1600, + "x": 190, + "y": 3960, "wires": [ - [] + [ + "f93ce2d26953341f" + ] ] }, { - "id": "6841e5a392f0fb4f", + "id": "647641e79884eb87", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadB", - "func": "var file = 'cam_output_downscale'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "z": "e43a27722b508115", + "name": "datadog_api_token", + "func": "var file = 'datadog_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2320, + "x": 550, + "y": 3960, + "wires": [ + [] + ] + }, + { + "id": "ff2dea1ab9cb7776", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 4", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3960, "wires": [ [ - "110216d678fad14f" + "815702499384f118", + "ee668e39d213070b" ] ] }, - { - "id": "110216d678fad14f", - "type": "ui_switch", - "z": "017bd4e4a428bee5", +{ + "id": "a1b81e7fe94ad4e5", + "type": "python3-function", + "z": "e43a27722b508115", "name": "", - "label": "Downscale output", + "func": "import subprocess\nsubprocess.run([\"systemctl\",\"restart\",\"nodered\"])\nreturn msg", + "outputs": 1, + "x": 530, + "y": 3740, + "wires": [ + [] + ] + }, + { + "id": "2f3a3c0e682ae862", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "restart_interface", + "group": "15edc2ce885dddb3", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Restart Interface", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 6, - "width": 6, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "topicType": "str", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "animate": false, + "color": "", + "bgcolor": "", "className": "", - "x": 450, - "y": 2320, + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 340, + "y": 3740, "wires": [ [ - "214d548d564f8ba2" + "a1b81e7fe94ad4e5" ] ] }, { - "id": "214d548d564f8ba2", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_output_downscale'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });\n \nmsg.enabled = msg.payload\nreturn msg", + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'meanwhile'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 2320, + "x": 260, + "y": 140, "wires": [ [ - "1becbff4884b8c1a" + "e23c514008cad1a1" ] ] }, { - "id": "8be1ca844a6caa54", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "output_resolution", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 8, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, "topic": "", - "topicType": "str", - "min": "0.5", - "max": "20", - "step": "0.5", - "className": "", - "x": 450, - "y": 2360, + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, "wires": [ [ - "a6b2c0a0604ccf14" + "4c7fa5b5b27b83a5" ] ] }, { - "id": "9ac09d89d791e953", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 7, - "width": 3, - "height": 1, - "name": "image_res", - "label": "Output Resolution (Mpx)", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2360, - "wires": [] - }, - { - "id": "1becbff4884b8c1a", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'cam_output_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data)/1000000;\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 2360, + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, "wires": [ [ - "8be1ca844a6caa54" + "4ce127c61c3c5966", + "beacc3dc5398fa79" ] ] }, { - "id": "a6b2c0a0604ccf14", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_output_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload*1000000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 2360, + "x": 290, + "y": 220, "wires": [ [] ] }, { - "id": "f358de1e64b491bb", + "id": "beacc3dc5398fa79", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ - "b30d918661392ab3", - "44c598049cd533fd" + "38783aea9cc317a6" ], - "x": 635, - "y": 620, + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, "wires": [] }, { "id": "b0629875a30ae1d7", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "get update", - "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", "outputs": 2, - "x": 350, - "y": 240, + "x": 390, + "y": 540, "wires": [ [ "1bbe2d769f42c313" @@ -10339,7 +9078,7 @@ { "id": "c7b6d05a62172432", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "ddbd496e.93a288", "order": 3, "width": 0, @@ -10349,19 +9088,19 @@ "format": "{{msg.status}}", "layout": "row-spread", "className": "", - "x": 170, - "y": 100, + "x": 210, + "y": 400, "wires": [] }, { "id": "fefe45404bdb19c4", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "check files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", "outputs": 1, - "x": 510, - "y": 260, + "x": 550, + "y": 560, "wires": [ [ "1bbe2d769f42c313", @@ -10372,13 +9111,14 @@ { "id": "d0104e0163745993", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "links": [ - "960912e90ba5b5bc" + "960912e90ba5b5bc", + "50eeb3e362f9027f" ], - "x": 75, - "y": 140, + "x": 115, + "y": 440, "wires": [ [ "ec30638407332e43", @@ -10390,7 +9130,7 @@ { "id": "ec30638407332e43", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadS", "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", "outputs": 1, @@ -10398,8 +9138,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 180, + "x": 210, + "y": 480, "wires": [ [ "2852023f3aa8db10" @@ -10409,7 +9149,7 @@ { "id": "2852023f3aa8db10", "type": "ui_dropdown", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "label": "", "tooltip": "", @@ -10423,21 +9163,26 @@ "options": [ { "label": "stable", - "value": "main", + "value": "stable", "type": "str" }, { "label": "beta", "value": "beta", "type": "str" - } + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" + } ], "payload": "", "topic": "topic", "topicType": "msg", "className": "", - "x": 300, - "y": 180, + "x": 340, + "y": 480, "wires": [ [ "1e10b387ee30c486" @@ -10447,7 +9192,7 @@ { "id": "1e10b387ee30c486", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "write", "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -10455,8 +9200,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 430, - "y": 180, + "x": 470, + "y": 480, "wires": [ [] ] @@ -10464,7 +9209,7 @@ { "id": "274129c51b0b87ef", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "ddbd496e.93a288", "order": 4, "width": 4, @@ -10474,14 +9219,14 @@ "format": "{{msg.payload}}", "layout": "row-spread", "className": "", - "x": 570, - "y": 180, + "x": 610, + "y": 480, "wires": [] }, { "id": "51cd8c8643e6b46a", "type": "ui_switch", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "label": "Auto-check update availability", "tooltip": "", @@ -10504,8 +9249,8 @@ "offcolor": "", "animate": false, "className": "", - "x": 370, - "y": 140, + "x": 410, + "y": 440, "wires": [ [ "1ab4c6b4b232a022" @@ -10515,7 +9260,7 @@ { "id": "38cbf7965d1c1834", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadB", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, @@ -10523,8 +9268,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 140, + "x": 210, + "y": 440, "wires": [ [ "51cd8c8643e6b46a" @@ -10534,7 +9279,7 @@ { "id": "1ab4c6b4b232a022", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "write", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -10542,8 +9287,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 570, - "y": 140, + "x": 610, + "y": 440, "wires": [ [] ] @@ -10551,7 +9296,7 @@ { "id": "ae92a328af306ebb", "type": "ui_toast", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "position": "dialog", "displayTime": "3", "highlight": "", @@ -10563,8 +9308,8 @@ "className": "", "topic": "", "name": "", - "x": 670, - "y": 260, + "x": 710, + "y": 560, "wires": [ [ "2de63e8e3ae5fb0c", @@ -10575,14 +9320,14 @@ { "id": "cbd0afc4aa7b302a", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "update status", "links": [ "1bbe2d769f42c313", "42061b28cff81f99" ], - "x": 75, - "y": 100, + "x": 115, + "y": 400, "wires": [ [ "c7b6d05a62172432", @@ -10593,20 +9338,20 @@ { "id": "1bbe2d769f42c313", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ "cbd0afc4aa7b302a" ], - "x": 625, - "y": 220, + "x": 665, + "y": 520, "wires": [] }, { "id": "7cf60615d93e696b", "type": "ui_button", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "group": "ddbd496e.93a288", "order": 7, @@ -10623,8 +9368,8 @@ "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 140, - "y": 260, + "x": 180, + "y": 560, "wires": [ [ "b0629875a30ae1d7" @@ -10634,12 +9379,12 @@ { "id": "2de63e8e3ae5fb0c", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "download files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", "outputs": 1, - "x": 840, - "y": 260, + "x": 880, + "y": 560, "wires": [ [ "42061b28cff81f99", @@ -10650,7 +9395,7 @@ { "id": "929281fef53e09f8", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "msg", "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", "outputs": 1, @@ -10658,8 +9403,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 810, - "y": 220, + "x": 850, + "y": 520, "wires": [ [ "42061b28cff81f99" @@ -10669,20 +9414,20 @@ { "id": "42061b28cff81f99", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ "cbd0afc4aa7b302a" ], - "x": 955, - "y": 220, + "x": 995, + "y": 520, "wires": [] }, { "id": "49f1ecb29a3f84f4", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadB", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", "outputs": 1, @@ -10690,8 +9435,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 220, + "x": 210, + "y": 520, "wires": [ [ "b0629875a30ae1d7" @@ -10701,26 +9446,28 @@ { "id": "fe3a855fee9e28c6", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ - "9bb0adbd716ce347" + "9bb0adbd716ce347", + "01c882fcc51b349c" ], - "x": 955, - "y": 260, + "x": 995, + "y": 560, "wires": [] }, { "id": "5e7d5e4335d37794", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "links": [ - "960912e90ba5b5bc" + "960912e90ba5b5bc", + "50eeb3e362f9027f" ], - "x": 55, - "y": 400, + "x": 95, + "y": 700, "wires": [ [ "2bb5fe78e09fec8a" @@ -10730,12 +9477,12 @@ { "id": "2bb5fe78e09fec8a", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "msg", "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", "outputs": 1, - "x": 170, - "y": 400, + "x": 210, + "y": 700, "wires": [ [ "dbc77052ac950624", @@ -10753,7 +9500,7 @@ { "id": "d97c3068ef5fef96", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 2, "width": 0, @@ -10763,14 +9510,14 @@ "format": "{{msg.os}}", "layout": "row-spread", "className": "", - "x": 450, - "y": 440, + "x": 490, + "y": 740, "wires": [] }, { "id": "73a3b828f862312b", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 8, "width": 0, @@ -10780,14 +9527,14 @@ "format": "{{msg.flask}}", "layout": "row-spread", "className": "", - "x": 450, - "y": 480, + "x": 490, + "y": 780, "wires": [] }, { "id": "dbc77052ac950624", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 1, "width": 0, @@ -10797,61 +9544,17 @@ "format": "{{msg.device}}", "layout": "row-spread", "className": "", - "x": 460, - "y": 400, + "x": 500, + "y": 700, "wires": [] }, - { - "id": "4c7fa5b5b27b83a5", - "type": "python3-function", - "z": "c8e7ecb5849edb9a", - "name": "create beta new", - "func": "import json\nimport requests\nimport shutil\n\nscope = 'main'\n#scope = 'beta'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\ndel msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/Arducam.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/Arducam.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/OpenScan.py'\nmsg[scope]['3']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/config.txt'\nmsg[scope]['4']['dst'] = '/boot/config.txt'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/flows.json'\nmsg[scope]['5']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['6'] = {}\nmsg[scope]['6']['src'] = scope + '/settings.js'\nmsg[scope]['6']['dst'] = '/root/.node-red/settings.js'\n\nmsg[scope]['7'] = {}\nmsg[scope]['7']['src'] = 'files/logo.jpg'\nmsg[scope]['7']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", - "outputs": 1, - "x": 300, - "y": 820, - "wires": [ - [ - "50f6fb8adf0249d7" - ] - ] - }, - { - "id": "80175eb8dc6ad009", - "type": "inject", - "z": "c8e7ecb5849edb9a", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "", - "payloadType": "date", - "x": 140, - "y": 820, - "wires": [ - [ - "4c7fa5b5b27b83a5" - ] - ] - }, { "id": "3f42560297fe6978", "type": "ui_template", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "name": "Download LOG", - "order": 9, + "order": 10, "width": 6, "height": 1, "format": "Note, that you can always adjust these and other settings in the settings menu, which will appear after this setup stage.
\nModel
\nPlease select the OpenScan Version - this will only affect the motor settings (acceleration, gear ratio, speed).
\nCamera
\n- Pi Camera v1, v2, HQ, Arducam IMX519, IMX290, IMX378, OV9281 are connected through the ribbon cable. If you encounter any issues, please check the cable's orientation
\n- DSLR (gphoto) - can be used with a wide range of cameras, which can be connected and controlled via USB. Check GPhoto if your camera is supported
\n- External Camera - Can be used to connect your camera trigger to the GPIO pins on the front of the pi shield. This can be used with any (modified) remote shutter release, and thus it is possible to use Smartphones, DSLR and compact cameras
", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": true, - "templateScope": "local", + "id": "e7306ef2.3b4df", + "type": "ui_button", + "z": "e6f4d02efb300ea9", + "name": "", + "group": "729f9ea6e3513c9b", + "order": 4, + "width": 3, + "height": 2, + "passthru": false, + "label": "Update&Info", + "tooltip": "", + "color": "", + "bgcolor": "", "className": "", - "x": 280, - "y": 40, + "icon": "", + "payload": "4", + "payloadType": "num", + "topic": "", + "topicType": "str", + "x": 110, + "y": 660, "wires": [ - [] + [ + "62cd5288.2805fc" + ] ] }, { "id": "8955d11554f55e63", "type": "ui_button", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "", "group": "5b3e5aca21140e9a", "order": 1, @@ -969,7 +1022,7 @@ "topic": "", "topicType": "str", "x": 120, - "y": 280, + "y": 720, "wires": [ [ "1e7457ea9c2c5e09" @@ -979,145 +1032,44 @@ { "id": "1e7457ea9c2c5e09", "type": "link out", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "update", "mode": "link", "links": [ "39a502b38837273d" ], "x": 245, - "y": 280, - "wires": [] - }, - { - "id": "bb84b9e5c7d8e21f", - "type": "python3-function", - "z": "829d803b6033a693", - "name": "rescue incomplete project", - "func": "#if project has not been done properly, this is a way to rescue the file\n\nfrom os import system\nfrom os.path import isfile\nfrom time import strftime\nfrom OpenScan import load_str\n\nbasepath = '/home/pi/OpenScan/'\nzippath = basepath + 'tmp/tmp.zip'\nprojectname=load_str(\"routine_projectname\")\nprojectcode = strftime('20%y-%m-%d_%H.%M.%S-') + projectname\n\nif isfile(zippath):\n system('mv '+ zippath + ' ' + basepath + 'scans/' + projectcode + '.zip')", - "outputs": 1, - "x": 290, - "y": 600, - "wires": [ - [] - ] - }, - { - "id": "a291fc98e4269c1b", - "type": "ui_text", - "z": "829d803b6033a693", - "group": "729f9ea6e3513c9b", - "order": 7, - "width": 4, - "height": 1, - "name": "version", - "label": "Version:", - "format": "{{msg.firmware}}", - "layout": "row-center", - "className": "", - "x": 460, - "y": 360, + "y": 720, "wires": [] }, { - "id": "7113d7b25a851151", + "id": "245e4341d4fb611c", "type": "function", - "z": "829d803b6033a693", - "name": "FIRMWARE VERSION", - "func": "msg.firmware = '2022-08-16'\nreturn msg", + "z": "e6f4d02efb300ea9", + "name": "pinmap_v2", + "func": "msg = { \n'overwrite':true,\n'settings':{\n 'pin_rotor_endstop':27,\n 'pin_tt_endstop':5,\n 'pin_extra_endstop':26,\n 'pin_external':25,\n 'pin_ringlight1':24,\n 'pin_ringlight2':24,\n 'pin_rotor_dir':23,\n 'pin_rotor_enable':19,\n 'pin_rotor_step':22,\n 'pin_tt_dir':6,\n 'pin_tt_enable':19,\n 'pin_tt_step':16,\n 'pin_extra_dir':21,\n 'pin_extra_step':20,\n 'pin_extra_enable':19,\n 'extra_acc':1,\n 'extra_accramp':200,\n 'extra_angle':10,\n 'extra_delay':0.0001,\n 'extra_dir':1,\n 'extra_stepsperrotation':3200,\n}}\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 280, - "y": 360, + "x": 790, + "y": 540, "wires": [ [ - "a291fc98e4269c1b", - "ec5cefa70ff535f7" - ] - ] - }, - { - "id": "ec5cefa70ff535f7", - "type": "ui_text", - "z": "829d803b6033a693", - "group": "ddbd496e.93a288", - "order": 2, - "width": 6, - "height": 1, - "name": "current version", - "label": "Current version:", - "format": "{{msg.firmware}}", - "layout": "row-spread", - "className": "", - "x": 480, - "y": 320, - "wires": [] - }, - { - "id": "c4c1580c289fc7bd", - "type": "python3-function", - "z": "829d803b6033a693", - "name": "create path", - "func": "import os\n\npaths = ['/home/pi/OpenScan/scans/preview/']\n\n\nfor i in paths:\n if not os.path.isdir(i):\n os.mkdir(i)", - "outputs": 1, - "x": 250, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "06d33bb8951ce668", - "type": "ui_template", - "z": "829d803b6033a693", - "group": "", - "name": "donate", - "order": 2, - "width": "0", - "height": "0", - "format": "\n\n", - "storeOutMessages": false, - "fwdInMessages": false, - "resendOnRefresh": false, - "templateScope": "global", - "className": "", - "x": 450, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "245e4341d4fb611c", - "type": "function", - "z": "829d803b6033a693", - "name": "pinmap_v2", - "func": "msg = { \n'overwrite':true,\n'settings':{\n 'pin_rotor_endstop':27,\n 'pin_tt_endstop':5,\n 'pin_extra_endstop':26,\n 'pin_external':25,\n 'pin_ringlight1':24,\n 'pin_ringlight2':24,\n 'pin_rotor_dir':23,\n 'pin_rotor_enable':19,\n 'pin_rotor_step':22,\n 'pin_tt_dir':6,\n 'pin_tt_enable':19,\n 'pin_tt_step':16,\n 'pin_extra_dir':21,\n 'pin_extra_step':20,\n 'pin_extra_enable':19,\n 'extra_acc':1,\n 'extra_accramp':200,\n 'extra_angle':10,\n 'extra_delay':0.0001,\n 'extra_dir':1,\n 'extra_stepsperrotation':3200,\n}}\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 870, - "y": 40, - "wires": [ - [ - "627406f3611511dc" + "627406f3611511dc" ] ] }, { "id": "627406f3611511dc", "type": "python3-function", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "write", "func": "from os import listdir\n\nbasedir = '/home/pi/OpenScan/settings/'\n\nmsg['payload'] = ''\n\nfiles = listdir(basedir)\n\nfor i in msg['settings']:\n if msg['overwrite'] != True:\n if i not in files:\n with open(basedir + i, 'w+') as file:\n file.write(str(msg['settings'][i])) \n else:\n with open(basedir + i, 'w+') as file:\n file.write(str(msg['settings'][i])) \n\nmsg['payload'] = True\n\nreturn msg", "outputs": 1, - "x": 1010, - "y": 40, + "x": 930, + "y": 540, "wires": [ [ "50eeb3e362f9027f" @@ -1127,7 +1079,7 @@ { "id": "88b1bddde110298a", "type": "inject", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "", "props": [ { @@ -1145,8 +1097,8 @@ "once": false, "onceDelay": "0.1", "topic": "", - "x": 730, - "y": 40, + "x": 650, + "y": 540, "wires": [ [ "245e4341d4fb611c" @@ -1156,7 +1108,7 @@ { "id": "50eeb3e362f9027f", "type": "link out", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "started1s", "mode": "link", "links": [ @@ -1176,37 +1128,32 @@ "e5f38b4a07a5e278", "f0b355967b33dfee", "d0104e0163745993", - "5e7d5e4335d37794" + "5e7d5e4335d37794", + "b4c843620c251c43", + "3876d5cbd248592b", + "a4c81754c148b86f", + "2e9b29c70969cf01", + "2477f81cddc8fa31", + "29036b35dfd672c6", + "592ec13d8f8923a9", + "cb40b9341bd22a28", + "d1efcd5fa9d25785", + "da61581182b7299e", + "2afb6a45c73fa244" ], - "x": 1095, - "y": 40, - "wires": [] - }, - { - "id": "ea0e57d83f291e23", - "type": "debug", - "z": "829d803b6033a693", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "statusVal": "", - "statusType": "auto", - "x": 610, - "y": 860, + "x": 1015, + "y": 540, "wires": [] }, { "id": "4f3121f158f06a61", "type": "python3-function", - "z": "829d803b6033a693", - "name": "Rotor left", - "func": "from OpenScan import motorrun, load_int\nfrom time import sleep\n\nmotorrun('rotor',100,True)\n\nmotorrun('tt',360,True)\nmotorrun('extra',360,True)", + "z": "e6f4d02efb300ea9", + "name": "motor run", + "func": "from OpenScan import motorrun, load_int\nfrom time import sleep\n\nmotorrun('rotor',300,True,False)\n\n", "outputs": 1, - "x": 940, - "y": 80, + "x": 860, + "y": 580, "wires": [ [] ] @@ -1214,7 +1161,7 @@ { "id": "4a8a04b1e5dca8fe", "type": "inject", - "z": "829d803b6033a693", + "z": "e6f4d02efb300ea9", "name": "run rotor till endstop", "props": [ { @@ -1232,8 +1179,8 @@ "topic": "", "payload": "", "payloadType": "date", - "x": 770, - "y": 80, + "x": 690, + "y": 580, "wires": [ [ "4f3121f158f06a61" @@ -1241,747 +1188,756 @@ ] }, { - "id": "828e5298.d2192", - "type": "ui_button", - "z": "1613373abaf77a2c", - "name": "", - "group": "7aaf184330605300", - "order": 9, - "width": 2, - "height": 1, - "passthru": false, - "label": "⇐", - "tooltip": "", - "color": "", - "bgcolor": "", + "id": "c8167775e3401fad", + "type": "ui_template", + "z": "e6f4d02efb300ea9", + "group": "729f9ea6e3513c9b", + "name": "infotext", + "order": 4, + "width": 0, + "height": 0, + "format": "Hostname
The device can be accessed through any browser in the same network. Therefore, you can either enter the device's IP address or the given hostname. The standard name is 'openscan' but it is highly recommended to change the name, when using multiple devices (e.g. 'openscan1', 'openscan2' ...)
Select Wifi
After booting, the device will automatically search for available wireless networks and create a list. You can connect to a given network by entering the wifi password and country code. To find the right two-character country code, see the following list: ISO 3166 Country Code on Wikipedia
Search Wifi
You can manually refresh the list of available networks by pressing this button.
Reset Wifi
Delete the list of known wireless networks (and passwords) and reset the default. After this step, you will either need to use Ethernet or a modified wpa_supplicant.conf file. (see glennklockwood.com for more details about the wpa_supplicant.conf file, which has to be manually created and placed into the /boot/ directory of the sd-card)
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 590, - "y": 120, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "7dc39bd847d16ded", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "Agree", - "cancel": "Disagree", - "raw": true, - "className": "", - "topic": "", - "name": "", - "x": 410, - "y": 300, - "wires": [ - [ - "5f849178998d9082" - ] - ] - }, - { - "id": "02858034e17b827f", + "id": "34374044c0030625", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "General", - "group": "4fe6b4c0ade0938a", + "group": "4390b2ebcbbe104c", "order": 1, "width": 6, "height": 1, @@ -4830,19 +3895,19 @@ "topic": "topic", "topicType": "msg", "x": 740, - "y": 240, + "y": 220, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "675d4933a44ae6b5", + "id": "b2b6bf23c9989133", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Pinout", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 1, "width": 6, "height": 1, @@ -4858,219 +3923,32 @@ "topic": "topic", "topicType": "msg", "x": 430, - "y": 200, + "y": 220, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "b0aa8ffae5a3578a", + "id": "441d3ef525e901da", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "smb", "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('smb'):\n save('smb', state)\nif state == True:\n os.system('/etc/init.d/smbd start')\nelse:\n os.system('/etc/init.d/smbd stop')\n\n\n", "outputs": 1, "x": 530, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "cc3cb10f2ea3f8b8", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "blink Light1", - "func": "import RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nfrom OpenScan import ringlight\nfrom time import sleep\n\ndelay = 0.1\nringlight(2,False)\n\nfor i in range (5):\n ringlight(1,True)\n sleep(delay)\n ringlight(1,False)\n sleep(delay)", - "outputs": 1, - "x": 290, - "y": 760, - "wires": [ - [] - ] - }, - { - "id": "d114f4d4d7f31981", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "reboot", - "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", - "outputs": 1, - "x": 270, - "y": 720, + "y": 400, "wires": [ [] ] }, { - "id": "79181ad3b56d5c62", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "4fe6b4c0ade0938a", - "order": 7, - "width": 2, - "height": 1, - "name": "", - "label": "Model", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 730, - "y": 620, - "wires": [] - }, - { - "id": "4d81bd138733c410", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "4fe6b4c0ade0938a", - "order": 9, - "width": 2, - "height": 1, - "name": "", - "label": "Camera", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 840, - "y": 420, - "wires": [] - }, - { - "id": "80b579a4220e5c23", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "model", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "4fe6b4c0ade0938a", - "order": 8, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Please Select", - "value": "None", - "type": "str" - }, - { - "label": "OpenScan Mini", - "value": "OSMini", - "type": "str" - }, - { - "label": "OpenScan Classic", - "value": "OSClassic", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 390, - "y": 620, - "wires": [ - [ - "896242c5a7e50fa7" - ] - ] - }, - { - "id": "a2c1dba3e67be015", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "Camera", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "4fe6b4c0ade0938a", - "order": 10, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Pi Cam v1 - 5mp", - "value": "ov5647", - "type": "str" - }, - { - "label": "Pi Cam v2 - 8mp", - "value": "imx219", - "type": "str" - }, - { - "label": "Pi Cam HQ - 12.3mp", - "value": "imx477", - "type": "str" - }, - { - "label": "Arducam IMX519 - 16mp", - "value": "imx519", - "type": "str" - }, - { - "label": "IMX290 a", - "value": "imx290a", - "type": "str" - }, - { - "label": "IMX290 b", - "value": "imx290b", - "type": "str" - }, - { - "label": "IMX378", - "value": "imx378", - "type": "str" - }, - { - "label": "OV9281", - "value": "ov9281", - "type": "str" - }, - { - "label": "DSLR (gphoto)", - "value": "gphoto", - "type": "str" - }, - { - "label": "USB Webcam", - "value": "usb_webcam", - "type": "str" - }, - { - "label": "External Camera", - "value": "external", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 400, - "y": 420, - "wires": [ - [ - "4058a31e942e8f95", - "6d68cccec646e0a0" - ] - ] - }, - { - "id": "9cf5d56263caada7", + "id": "3256bab150113a48", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Motor", - "group": "d49a6dfd7fb17096", + "group": "7a3279eea439bcdd", "order": 1, "width": 6, "height": 1, @@ -5086,19 +3964,19 @@ "topic": "topic", "topicType": "msg", "x": 430, - "y": 120, + "y": 140, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "72238e6a01d1152c", + "id": "7a186669a17daa71", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "camera", - "group": "93aadb71dee6d977", + "group": "d324f0b852c2df0a", "order": 1, "width": 6, "height": 1, @@ -5114,71 +3992,41 @@ "topic": "topic", "topicType": "msg", "x": 420, - "y": 160, + "y": 180, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "15a0a2f431ce55c3", + "id": "edac7dd292e7e486", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "General Settings", "info": "", "x": 120, - "y": 260, + "y": 280, "wires": [] }, { - "id": "87a403b9a09aa38d", + "id": "161b52034e578ee2", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Network", "info": "", "x": 100, - "y": 880, + "y": 720, "wires": [] }, { - "id": "896242c5a7e50fa7", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "model", - "func": "from OpenScan import load_str, save\n\nstate = msg['payload']\nmsg['state'] = state\n\nif state != load_str('model'):\n save('model', state)\n if state == 'OSMini':\n save('rotor_stepsperrotation',48000)\n save('cam_rotation',90)\n save('rotor_anglemin',-70)\n save('rotor_anglemax',20)\n \n\n if state == 'OSClassic':\n save('rotor_stepsperrotation',17067)\n save('cam_rotation',0)\n save('rotor_anglemin',-30)\n save('rotor_anglemax',30)\n\nif state == \"OSMini\":\n msg['crop2'] = 'Crop X (%)'\n msg['crop1'] = 'Crop Y (%)'\nelif state == \"OSClassic\":\n msg['crop1'] = 'Crop X (%)'\n msg['crop2'] = 'Crop Y (%)'\n\nreturn msg", - "outputs": 1, - "x": 530, - "y": 620, - "wires": [ - [ - "f358de1e64b491bb" - ] - ] - }, - { - "id": "4058a31e942e8f95", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "camera", - "func": "from OpenScan import load_str, save\nfrom json import load\nstate = msg['payload']\nstate_old = load_str('camera')\n\nif state_old != state:\n save('camera',state)\n return msg", - "outputs": 1, - "x": 540, - "y": 500, - "wires": [ - [ - "34b685aff2080d31" - ] - ] - }, - { - "id": "c833f6243a059d83", + "id": "f6d6cc35679ede63", "type": "ui_switch", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "more sets", "label": "Advanced Settings", "tooltip": "", - "group": "4fe6b4c0ade0938a", + "group": "4390b2ebcbbe104c", "order": 5, "width": 6, "height": 1, @@ -5198,71 +4046,47 @@ "animate": false, "className": "", "x": 400, - "y": 660, + "y": 480, "wires": [ [ - "8be8015931c663cc" + "f06a7bcad524e9f9" ] ] }, { - "id": "15fd1c9e5610cb85", + "id": "29745a36fc157f3f", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "more sets", "func": "from OpenScan import save\n\nif msg['payload'] != 'OK':\n msg['payload'] = False\n return None,msg\n \nsave('advanced_settings', True)\n\nreturn msg", "outputs": 2, "x": 820, - "y": 660, - "wires": [ - [ - "62cd775a1c02dac8" - ], - [ - "c833f6243a059d83" - ] - ] - }, - { - "id": "74c5c7cd2681045b", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "load camera&model", - "func": "from OpenScan import load_str, load_bool\n\nmodel = load_str('model')\ncamera = load_str('camera')\nupdate = load_bool('updateable')\nmsg['model'] = model\nmsg['camera'] = camera\nmsg2 = {}\nmsg3 = {}\nmsg4 = {}\n\nif camera in ('imx219','ov5647','imx477','imx290a','imx290b','imx378','ov9281','gphoto'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Arducam\"],\"show\":[\"Scan_Settings\",\"Scan_Picamera\"]}}\nelif camera in ('imx519'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Picamera\"],\"show\":[\"Scan_Settings\",\"Scan_Arducam\"]}}\nelif camera in ('external'):\n msg['payload'] = {\"group\":{\"hide\":[\"Scan_Arducam\",\"Scan_Picamera\"],\"show\":[\"Scan_Settings\"]}}\n\n\nif model == 'None' or model == '' or camera == 'None' or camera == '':\n msg2['payload']={\"tabs\": {\"hide\": [\"Scan\", \"Files&Cloud\",\"Settings\",\"Update & Info\"]}}\n msg3['payload'] = {\"group\":{\"hide\":[\"OpenScan_Home\"],\"show\":[\"OpenScan_Initialize\"]}}\nelse:\n msg2['payload']={\"tabs\": {\"show\": [\"Scan\", \"Files&Cloud\",\"Settings\",\"Update & Info\"]},\"hide\":{}}\n msg3['payload'] = {\"group\":{\"show\":[\"OpenScan_Home\"],\"hide\":[\"OpenScan_Initialize\"]}}\n\nif update == True:\n msg4['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg4['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\nreturn msg,msg2,msg3,msg4", - "outputs": 4, - "x": 340, - "y": 40, + "y": 480, "wires": [ [ - "b4db790aad28ba39" - ], - [ - "b4db790aad28ba39" - ], - [ - "b4db790aad28ba39" + "8750ad979e9ea246" ], [ - "b4db790aad28ba39" + "f6d6cc35679ede63" ] ] }, { - "id": "b4db790aad28ba39", + "id": "bf23328f9fb11b22", "type": "ui_ui_control", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "change visibility", "events": "all", "x": 600, - "y": 40, + "y": 60, "wires": [ [] ] }, { - "id": "eb8ccf2786ea3d63", + "id": "b37be1d222bc70c9", "type": "inject", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "1s_repeater", "props": [ { @@ -5281,60 +4105,62 @@ "payload": "", "payloadType": "date", "x": 150, - "y": 40, + "y": 60, "wires": [ [ - "74c5c7cd2681045b", - "9b756a1f9b0e7317" + "89eedf29b404f750" ] ] }, { - "id": "9b756a1f9b0e7317", + "id": "89eedf29b404f750", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "load advanced", - "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\nreturn msg", - "outputs": 1, - "x": 320, - "y": 80, + "func": "from OpenScan import load_bool\n\nif load_bool('advanced_settings') == False:\n msg['payload']={\"group\":{\"hide\":[\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\"]}}\nelse:\n msg['payload']={\"group\":{\"hide\":[],\"show\":[\"Settings_General\",\"Settings_Network\",\"Settings_OpenScanCloud\",\"Settings_Camera\",\"Settings_Motor\",\"Settings_Pinout\",]}}\n\nupdate = load_bool('updateable')\n\nmsg2 = {}\n\nif update == True:\n msg2['payload'] = {\"group\":{\"show\":[\"OpenScan_Update\"]}}\nelif update == False:\n msg2['payload'] = {\"group\":{\"hide\":[\"OpenScan_Update\"]}}\n\n\nreturn msg,msg2", + "outputs": 2, + "x": 360, + "y": 60, "wires": [ [ - "b4db790aad28ba39" + "bf23328f9fb11b22" + ], + [ + "bf23328f9fb11b22" ] ] }, { - "id": "ca4afadb5b21751f", + "id": "2050de5d9e02f69f", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Info Texts", "info": "", "x": 100, - "y": 120, + "y": 140, "wires": [] }, { - "id": "f393400.d87dcc", + "id": "ded3086945a6d4b5", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "check ip address", "func": "import socket\nimport subprocess\n\ntestIP = \"8.8.8.8\"\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((testIP, 0))\nipaddr = s.getsockname()[0]\nhost = socket.gethostname()\n\nmsg['ip']=ipaddr\n\nreturn msg", "outputs": 1, - "x": 410, - "y": 1060, + "x": 250, + "y": 940, "wires": [ [ - "bb789eed.9f73c" + "3cfe464506f46ecd" ] ] }, { - "id": "bb789eed.9f73c", + "id": "3cfe464506f46ecd", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "0fe66c9190b8a87c", - "order": 2, + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 1, "width": 0, "height": 0, "name": "", @@ -5342,299 +4168,26 @@ "format": "{{msg.ip}}", "layout": "row-spread", "className": "", - "x": 590, - "y": 1060, + "x": 430, + "y": 940, "wires": [] }, { - "id": "2a0f9919.4c9a86", + "id": "bd206ad109831e6a", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "OpenScanCloud", "info": "", "x": 120, - "y": 1240, + "y": 1260, "wires": [] }, { - "id": "27c6b221c90ed9e1", - "type": "exec", - "z": "017bd4e4a428bee5", - "command": "iwlist wlan0 scan | grep ESSID | sed 's/ESSID://g;s/\"//g;s/^ *//;s/ *$//'", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "winHide": false, - "oldrc": false, - "name": "scan", - "x": 250, - "y": 1040, - "wires": [ - [ - "b05cf92302a5c112", - "f393400.d87dcc" - ], - [ - "e9677b85856b5873" - ], - [] - ] - }, - { - "id": "b05cf92302a5c112", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "WIFI", - "func": "msg['options']=[]\n\nfor i in msg['payload'].split('\\n'):\n if i not in msg['options'] and i!=\"\":\n msg['options'].append(i)\n \nif len(msg['options']) != 0:\n msg['enabled']=True\n\nreturn msg", - "outputs": 1, - "x": 370, - "y": 1020, - "wires": [ - [ - "59c9f67283ba1709" - ] - ] - }, - { - "id": "da5ddaf4cc25b8c8", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "search", - "group": "0fe66c9190b8a87c", - "order": 4, - "width": 3, - "height": 1, - "passthru": false, - "label": "Search Wifi", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "true", - "payloadType": "bool", - "topic": "", - "topicType": "str", - "x": 90, - "y": 980, - "wires": [ - [ - "27c6b221c90ed9e1", - "51521bc6eb44cde5" - ] - ] - }, - { - "id": "59c9f67283ba1709", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "", - "label": "", - "tooltip": "", - "place": "Select Wifi", - "group": "0fe66c9190b8a87c", - "order": 3, - "width": 6, - "height": 1, - "passthru": true, - "multiple": false, - "options": [], - "payload": "", - "topic": "", - "topicType": "str", - "className": "", - "x": 520, - "y": 980, - "wires": [ - [ - "2bb52656f9554dab" - ] - ] - }, - { - "id": "b2d7d6a730f7dca6", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Reset Wifi", - "group": "0fe66c9190b8a87c", - "order": 5, - "width": 3, - "height": 1, - "passthru": false, - "label": "Reset Wifi", - "tooltip": "", - "color": "red", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "Delete all prior wifi connections? (You will need to reconnect to the OpenScan device by Ethernet or manually modify the wpa_supplicant.conf)", - "payloadType": "str", - "topic": "", - "topicType": "str", - "x": 110, - "y": 1140, - "wires": [ - [ - "78985ac6d3bcdf60" - ] - ] - }, - { - "id": "c3b8faac9ebb2c80", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "Reset Wifi", - "func": "from time import sleep\n\nif msg['payload']!=\"Yes\":\n return\n\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\nsleep(3)\nos.system('systemctl restart nodered')\nreturn msg", - "outputs": 1, - "x": 440, - "y": 1140, - "wires": [ - [] - ] - }, - { - "id": "78985ac6d3bcdf60", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "No", - "cancel": "Yes", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 270, - "y": 1140, - "wires": [ - [ - "c3b8faac9ebb2c80" - ] - ] - }, - { - "id": "4f7f49b12c2d2572", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "add Wifi", - "func": "from time import sleep\nsleep(0.1)\n\nos.system('wpa_cli -i wlan0 reconfigure')\n\nreturn msg", - "outputs": 1, - "x": 1320, - "y": 1000, - "wires": [ - [] - ] - }, - { - "id": "ebcc98685059b9d4", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "password", - "x": 780, - "y": 980, - "wires": [ - [ - "68204a14528ab842" - ] - ] - }, - { - "id": "68204a14528ab842", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "if msg['payload'] == 'Cancel':\n return\n\nmsg['password'] = msg['payload']\nmsg['payload']='Enter country code (ISO 3166-1 alpha-2, see: Wikipedia)'\n\n\nreturn msg", - "outputs": 1, - "x": 910, - "y": 980, - "wires": [ - [ - "852edf901bdec9c5" - ] - ] - }, - { - "id": "852edf901bdec9c5", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "Save", - "cancel": "Cancel", - "raw": true, - "className": "", - "topic": "", - "name": "country", - "x": 1040, - "y": 980, - "wires": [ - [ - "1b09d634e3d9357b" - ] - ] - }, - { - "id": "1b09d634e3d9357b", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "modWPA", - "func": "if msg['payload'] == 'Cancel':\n return\n\nif len(msg['payload'])!=2:\n msg['payload'] = 'invalid country code'\n return msg,None\n\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\ntemp_dir = '/home/pi/OpenScan/tmp/wpa'\n\ncode = msg['payload'].upper()\nssid = msg['ssid']\npassword = msg['password']\n\nif len(code) != 2:\n msg['topic'] = 'ERROR'\n msg['payload'] = 'invalid country code (see ISO 3166-1 alpha-2)'\n return msg\n\nwith open(wpa_dir, 'r') as file:\n for i in file.readlines():\n if 'country=' in i:\n code_old=i.split('country=')[1][0:2]\n break\n\nwith open(wpa_dir, 'r') as file:\n wpa = file.read()\n if ssid in wpa:\n msg['topic'] = 'ERROR'\n msg['payload'] = 'Network already exists! If you have trouble connecting, please consider resetting the saved Wifi connections.'\n return msg\n wpa=wpa.replace('country=' + code_old, 'country=' + code)\n wpa=wpa + '\\nnetwork={\\n priority=10\\n ssid=\"'+ssid+'\"\\n psk=\"'+password+'\"\\n}\\n'\n\nwith open(temp_dir,'w+') as file:\n file.write(wpa)\nos.system('mv '+temp_dir + ' ' + wpa_dir)\n\nmsg['topic'] = 'Updating Wifi'\nmsg['payload'] = 'reconnecting might take a moment'\nreturn msg,msg\n", - "outputs": 2, - "x": 1180, - "y": 980, - "wires": [ - [ - "03732a7d3b0c95aa" - ], - [ - "4f7f49b12c2d2572" - ] - ] - }, - { - "id": "03732a7d3b0c95aa", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 1330, - "y": 960, - "wires": [ - [] - ] - }, - { - "id": "e97d17c6590138e2", + "id": "b70a9a665c1e4d36", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Cloud-settings", - "group": "3b4bd36726be16d5", + "group": "12b719cba49817c9", "order": 1, "width": 6, "height": 1, @@ -5649,19 +4202,19 @@ "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 620, - "y": 160, + "x": 740, + "y": 260, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "f7bf47e3eec6d736", + "id": "c9f0566601a3e130", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 4, "width": 0, "height": 0, @@ -5671,14 +4224,14 @@ "layout": "row-spread", "className": "", "x": 410, - "y": 1380, + "y": 1400, "wires": [] }, { - "id": "b52d91c628b151a4", + "id": "9bd86d27ea499a2a", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 5, "width": 0, "height": 0, @@ -5688,14 +4241,14 @@ "layout": "row-spread", "className": "", "x": 390, - "y": 1420, + "y": 1440, "wires": [] }, { - "id": "1969c709ef2fd1d5", + "id": "2c37f7030810d234", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", + "z": "e43a27722b508115", + "group": "12b719cba49817c9", "order": 3, "width": 0, "height": 0, @@ -5705,32 +4258,32 @@ "layout": "row-spread", "className": "", "x": 370, - "y": 1460, + "y": 1480, "wires": [] }, { - "id": "88e92b621d2a3394", + "id": "f40286c18afd4501", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "save", "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload']!=\"Yes\":\n return None,msg\n\ntry:\n r = OpenScanCloud('getTokenInfo', {'token':msg['token']})\n if r.status_code != 200:\n msg['payload'] = 'Could not verify token'\n return msg \n \n msg1 = r.json()\n \n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n msg1['enabled'] = True\nexcept:\n pass\n\nsave('token',msg['token'])\n \nmsg['payload'] = 'Token verified and saved'\nreturn msg, msg1", "outputs": 2, "x": 750, - "y": 1320, + "y": 1340, "wires": [ [ - "76acd48a511a5e3e", - "b01581296b94dfcd" + "455a5266017ea121", + "50f73cee213ec05c" ], [ - "9c51aa678f16980f" + "264eece408043021" ] ] }, { - "id": "76acd48a511a5e3e", + "id": "455a5266017ea121", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5742,19 +4295,19 @@ "topic": "", "name": "", "x": 890, - "y": 1280, + "y": 1300, "wires": [ [] ] }, { - "id": "5f50ed3f6ba37cef", + "id": "c368df68593bc2bf", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "label": "Token", "tooltip": "", - "group": "3b4bd36726be16d5", + "group": "12b719cba49817c9", "order": 2, "width": 6, "height": 1, @@ -5766,69 +4319,69 @@ "className": "", "topicType": "str", "x": 350, - "y": 1340, + "y": 1360, "wires": [ [ - "cb62d30728af2968" + "18fd1afa768187b3" ] ] }, { - "id": "cb62d30728af2968", + "id": "18fd1afa768187b3", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Save?", "func": "msg['token'] = msg['payload']\n\nif len(msg['payload'])>=14:\n \n msg[\"payload\"]='Save and verify token: ' + msg['payload']\n return msg\nelse:\n return None,msg", "outputs": 2, "x": 470, - "y": 1340, + "y": 1360, "wires": [ [ - "94e503dd2e64d903" + "418aea2ec65573a0" ], [ - "d859bb39914d4999" + "9792c89c5f4429f9" ] ] }, { - "id": "0dd01eef6e70059e", + "id": "f90a98899b7a71d0", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "text", "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", "outputs": 1, "x": 230, - "y": 1340, + "y": 1360, "wires": [ [ - "5f50ed3f6ba37cef" + "c368df68593bc2bf" ] ] }, { - "id": "788fabff98c7973c", + "id": "b4c843620c251c43", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "token", "links": [ "960912e90ba5b5bc", - "b01581296b94dfcd", - "d859bb39914d4999", + "50f73cee213ec05c", + "9792c89c5f4429f9", "50eeb3e362f9027f" ], "x": 75, - "y": 1340, + "y": 1360, "wires": [ [ - "0dd01eef6e70059e" + "f90a98899b7a71d0" ] ] }, { - "id": "94e503dd2e64d903", + "id": "418aea2ec65573a0", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5841,75 +4394,75 @@ "topic": "", "name": "", "x": 610, - "y": 1320, + "y": 1340, "wires": [ [ - "88e92b621d2a3394" + "f40286c18afd4501" ] ] }, { - "id": "d859bb39914d4999", + "id": "9792c89c5f4429f9", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "mode": "link", "links": [ - "788fabff98c7973c" + "b4c843620c251c43" ], "x": 555, - "y": 1360, + "y": 1380, "wires": [] }, { - "id": "9c51aa678f16980f", + "id": "264eece408043021", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "links": [ "5d267acc10020091", - "397ab7f44b893c89" + "3876d5cbd248592b" ], "x": 835, - "y": 1360, + "y": 1380, "wires": [] }, { - "id": "397ab7f44b893c89", + "id": "3876d5cbd248592b", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "OSCparameters", "links": [ "960912e90ba5b5bc", - "9c51aa678f16980f", + "264eece408043021", "b42e061fb1f1f3d7", "50eeb3e362f9027f" ], "x": 75, - "y": 1380, + "y": 1400, "wires": [ [ - "a7fd00943edc380b" + "5daca3ec47f8e7fc" ] ] }, { - "id": "b01581296b94dfcd", + "id": "50f73cee213ec05c", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "links": [ - "788fabff98c7973c", + "b4c843620c251c43", "5d267acc10020091" ], "x": 835, - "y": 1320, + "y": 1340, "wires": [] }, { - "id": "bf6d941ad307ce22", + "id": "95578e54a9b61cba", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -5922,35 +4475,35 @@ "topic": "", "name": "", "x": 250, - "y": 1520, + "y": 1540, "wires": [ [ - "f22dfef37d5de773" + "d7a5693da7855da8" ] ] }, { - "id": "f22dfef37d5de773", + "id": "d7a5693da7855da8", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", "outputs": 2, "x": 390, - "y": 1520, + "y": 1540, "wires": [ [ - "54602ee49ca022e7" + "2b02b97dd1614e52" ], [ - "1505f3e72f971081" + "183a629accb417b1" ] ] }, { - "id": "1505f3e72f971081", + "id": "183a629accb417b1", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -5963,15 +4516,15 @@ "topic": "", "name": "", "x": 530, - "y": 1560, + "y": 1580, "wires": [ [] ] }, { - "id": "54602ee49ca022e7", + "id": "2b02b97dd1614e52", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -5984,17 +4537,17 @@ "topic": "", "name": "", "x": 530, - "y": 1520, + "y": 1540, "wires": [ [ - "f9efcb87b74abbd4" + "3e4c15d7b538f816" ] ] }, { - "id": "510dbe4d76253bd6", + "id": "3bf622f344172721", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "prompt", "displayTime": "3", "highlight": "", @@ -6007,35 +4560,35 @@ "topic": "", "name": "", "x": 810, - "y": 1520, + "y": 1540, "wires": [ [ - "600b2306caed1640" + "e431cb2b8d217cee" ] ] }, { - "id": "600b2306caed1640", + "id": "e431cb2b8d217cee", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", "outputs": 1, "x": 950, - "y": 1520, + "y": 1540, "wires": [ [ - "bbad1ab5f8f63fb7" + "106874534890f229" ] ] }, { - "id": "d34cd203725bac15", + "id": "a38d7fde5c73210f", "type": "ui_button", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Register", - "group": "3b4bd36726be16d5", - "order": 7, + "group": "12b719cba49817c9", + "order": 6, "width": 2, "height": 1, "passthru": false, @@ -6050,17 +4603,17 @@ "topic": "Requesting an OpenScanCloud Token", "topicType": "str", "x": 100, - "y": 1520, + "y": 1540, "wires": [ [ - "bf6d941ad307ce22" + "95578e54a9b61cba" ] ] }, { - "id": "bbad1ab5f8f63fb7", + "id": "106874534890f229", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -6073,67 +4626,67 @@ "topic": "", "name": "", "x": 1090, - "y": 1520, + "y": 1540, "wires": [ [] ] }, { - "id": "a7fd00943edc380b", + "id": "5daca3ec47f8e7fc", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n msg['limit_filesize'] = float(int(load_int('osc_limit_filesize')/10000000))/100\n msg['limit_photos'] = load_int('osc_limit_photos')\n return msg\nexcept:\n pass", "outputs": 1, "x": 230, - "y": 1380, + "y": 1400, "wires": [ [ - "f7bf47e3eec6d736", - "b52d91c628b151a4", - "1969c709ef2fd1d5" + "c9f0566601a3e130", + "9bd86d27ea499a2a", + "2c37f7030810d234" ] ] }, { - "id": "124459147143ec6a", + "id": "f34de19d4cf810a9", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Motor", "info": "", "x": 90, - "y": 1600, + "y": 1740, "wires": [] }, { - "id": "dbd62b91a6c9c412", + "id": "26c2b58e21f97475", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Camera", "info": "", "x": 90, - "y": 2240, + "y": 2500, "wires": [] }, { - "id": "842b6fe016087ce3", + "id": "a8ec972bad47a9a8", "type": "comment", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Pinout", "info": "", - "x": 110, - "y": 2860, + "x": 90, + "y": 2960, "wires": [] }, { - "id": "8c1a92f2dcc976c7", + "id": "b03e8b51187e88eb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "Rotor_delay (ms)", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 14, + "group": "7a3279eea439bcdd", + "order": 16, "width": 3, "height": 1, "passthru": false, @@ -6145,22 +4698,22 @@ "step": "0.005", "className": "", "x": 450, - "y": 1840, + "y": 2140, "wires": [ [ - "bb54bbdae6690576" + "11fd3363416433f9" ] ] }, { - "id": "2647111c06f2055d", + "id": "6aae9d4fddf08cc0", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt delay", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 27, + "group": "7a3279eea439bcdd", + "order": 30, "width": 3, "height": 1, "passthru": false, @@ -6172,22 +4725,22 @@ "step": "0.005", "className": "", "x": 420, - "y": 2080, + "y": 2380, "wires": [ [ - "fb8145a9f8d4f7b2" + "e50492d1e18f43c6" ] ] }, { - "id": "f9b51424edb0491c", + "id": "543e1690693acbeb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_acc", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 16, + "group": "7a3279eea439bcdd", + "order": 18, "width": 3, "height": 1, "passthru": false, @@ -6199,22 +4752,22 @@ "step": "0.1", "className": "", "x": 420, - "y": 1880, + "y": 2180, "wires": [ [ - "ea87ecfd2af3cc7f" + "e8b24efb0f30288e" ] ] }, { - "id": "1ab34b0a78b2c577", + "id": "9a56c087d941f1da", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_accramp", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 18, + "group": "7a3279eea439bcdd", + "order": 20, "width": 3, "height": 1, "passthru": false, @@ -6226,22 +4779,22 @@ "step": "100", "className": "", "x": 440, - "y": 1920, + "y": 2220, "wires": [ [ - "249f44c3a87793ba" + "29f576be9e292232" ] ] }, { - "id": "1d4230b3d9b93f63", + "id": "dfdebe10dbf0e198", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_stepsperrotation", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 12, + "group": "7a3279eea439bcdd", + "order": 14, "width": 3, "height": 1, "passthru": false, @@ -6252,19 +4805,19 @@ "className": "", "topicType": "msg", "x": 460, - "y": 1800, + "y": 2100, "wires": [ [ - "0bb56b1edb12c2cf" + "78e256083f59f66f" ] ] }, { - "id": "2e3222f0aba88040", + "id": "af8dfe78cbd0c301", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 17, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 19, "width": 3, "height": 1, "name": "rotor Accramp", @@ -6273,15 +4826,15 @@ "layout": "row-left", "className": "", "x": 780, - "y": 1880, + "y": 2180, "wires": [] }, { - "id": "9d50311679acf215", + "id": "ee4b8908a5b83880", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 11, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 13, "width": 3, "height": 1, "name": "rotor_Steps per Rotation", @@ -6290,15 +4843,15 @@ "layout": "row-spread", "className": "", "x": 810, - "y": 1920, + "y": 2220, "wires": [] }, { - "id": "25d7b4dd2aab8f05", + "id": "c4deaa38c1b0adbf", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 15, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 17, "width": 3, "height": 1, "name": "rotor Acc", @@ -6307,15 +4860,15 @@ "layout": "row-left", "className": "", "x": 760, - "y": 1840, + "y": 2140, "wires": [] }, { - "id": "15682cca9622831f", + "id": "baec873a95fff48a", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 13, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 15, "width": 3, "height": 1, "name": "rotor_delay", @@ -6324,15 +4877,15 @@ "layout": "row-left", "className": "", "x": 770, - "y": 1800, + "y": 2100, "wires": [] }, { - "id": "8e2d22042bfcb4e8", + "id": "355e89ab4e5484e4", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 23, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 26, "width": 6, "height": 1, "name": "tt", @@ -6341,18 +4894,18 @@ "layout": "row-center", "className": "", "x": 90, - "y": 2040, + "y": 2300, "wires": [] }, { - "id": "56bc3b93af2ebe16", + "id": "10687d331a732790", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_acc", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 29, + "group": "7a3279eea439bcdd", + "order": 32, "width": 3, "height": 1, "passthru": false, @@ -6364,22 +4917,22 @@ "step": "0.1", "className": "", "x": 410, - "y": 2120, + "y": 2420, "wires": [ [ - "35422077b53da9bf" + "af88b9da72917d62" ] ] }, { - "id": "6ef996f8a36f94c2", + "id": "721b9680a3fa460e", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_accramp", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 31, + "group": "7a3279eea439bcdd", + "order": 34, "width": 3, "height": 1, "passthru": false, @@ -6391,22 +4944,22 @@ "step": "1", "className": "", "x": 430, - "y": 2160, + "y": 2460, "wires": [ [ - "2c000bd53cdb98ca" + "b1b4678827d3a6dd" ] ] }, { - "id": "0c50fdbb5ac3c373", + "id": "c6642c7470d3820c", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_stepsperrotation", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 25, + "group": "7a3279eea439bcdd", + "order": 28, "width": 3, "height": 1, "passthru": false, @@ -6417,19 +4970,19 @@ "className": "", "topicType": "msg", "x": 450, - "y": 2040, + "y": 2340, "wires": [ [ - "485a4bed5a6bea23" + "eef89545ec0f6aa8" ] ] }, { - "id": "213ccfb441a42890", + "id": "18e5918748660109", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 30, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 33, "width": 3, "height": 1, "name": "ttAccramp", @@ -6438,15 +4991,15 @@ "layout": "row-left", "className": "", "x": 760, - "y": 2160, + "y": 2460, "wires": [] }, { - "id": "73c9b4d09dc25e54", + "id": "8e805244dc1899e8", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 24, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 27, "width": 3, "height": 1, "name": "tt_steps per Rotation", @@ -6455,15 +5008,15 @@ "layout": "row-spread", "className": "", "x": 800, - "y": 2040, + "y": 2340, "wires": [] }, { - "id": "a81824c92f22487d", + "id": "a09e5fbea861bfb1", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 28, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 31, "width": 3, "height": 1, "name": "tt Acc", @@ -6472,15 +5025,15 @@ "layout": "row-left", "className": "", "x": 750, - "y": 2120, + "y": 2420, "wires": [] }, { - "id": "9715161858f69649", + "id": "7b06448b3b222011", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 26, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 29, "width": 3, "height": 1, "name": "tt_delay", @@ -6489,18 +5042,18 @@ "layout": "row-left", "className": "", "x": 760, - "y": 2080, + "y": 2380, "wires": [] }, { - "id": "1b3ac50d2c6600c6", + "id": "0dfc86d90258f9bb", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_angle", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 20, + "group": "7a3279eea439bcdd", + "order": 22, "width": 3, "height": 1, "passthru": false, @@ -6512,19 +5065,19 @@ "step": "1", "className": "", "x": 430, - "y": 1960, + "y": 2260, "wires": [ [ - "e0d7c36daa42b3f3" + "c4b5a38c5c1df3d2" ] ] }, { - "id": "6dcd1f0ccb01a299", + "id": "9319d7d4f34c6d22", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 19, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 21, "width": 3, "height": 1, "name": "rotor_angle", @@ -6533,18 +5086,18 @@ "layout": "row-spread", "className": "", "x": 770, - "y": 1960, + "y": 2260, "wires": [] }, { - "id": "16e9a3a71c4bb916", + "id": "1610895f430b9aca", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_angle", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 33, + "group": "7a3279eea439bcdd", + "order": 36, "width": 3, "height": 1, "passthru": false, @@ -6556,19 +5109,19 @@ "step": "1", "className": "", "x": 420, - "y": 2200, + "y": 2500, "wires": [ [ - "c34111aaec734dd9" + "0f3367983bb8e159" ] ] }, { - "id": "888161059eb9c71c", + "id": "96a9febc0928b6f0", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 32, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 35, "width": 3, "height": 1, "name": "tt_angle", @@ -6577,15 +5130,15 @@ "layout": "row-spread", "className": "", "x": 760, - "y": 2200, + "y": 2500, "wires": [] }, { - "id": "f4fc72297074c7ae", + "id": "e2c5ea8c16a5ea32", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 4, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 2, "width": 6, "height": 1, "name": "rotor", @@ -6594,18 +5147,18 @@ "layout": "row-center", "className": "", "x": 90, - "y": 1680, + "y": 1820, "wires": [] }, { - "id": "9b1d8f9e21b34102", + "id": "277037c4716d85bf", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "tt_dir", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 35, + "group": "7a3279eea439bcdd", + "order": 38, "width": 3, "height": 1, "passthru": false, @@ -6617,22 +5170,22 @@ "step": "1", "className": "", "x": 410, - "y": 2240, + "y": 2540, "wires": [ [ - "89dbbe7d99ddbbaf" + "c9d2e31514def4fc" ] ] }, { - "id": "b2e839fe47a32b5f", + "id": "1361134e9847f003", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotor_dir", "label": "", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 22, + "group": "7a3279eea439bcdd", + "order": 24, "width": 3, "height": 1, "passthru": false, @@ -6644,19 +5197,19 @@ "step": "1", "className": "", "x": 420, - "y": 2000, + "y": 2300, "wires": [ [ - "204b0a5c8629d78a" + "523717b0f218a5fd" ] ] }, { - "id": "4519daf0b4b28aef", + "id": "6b0d58943ecb8bb2", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 34, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 37, "width": 3, "height": 1, "name": "tt_dir", @@ -6665,15 +5218,15 @@ "layout": "row-spread", "className": "", "x": 750, - "y": 2240, + "y": 2540, "wires": [] }, { - "id": "5f269ea2c8a53f6c", + "id": "08f93dd2aeedb391", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 21, + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 23, "width": 3, "height": 1, "name": "rotor_dir", @@ -6682,74 +5235,47 @@ "layout": "row-spread", "className": "", "x": 760, - "y": 2000, + "y": 2300, "wires": [] }, { - "id": "b67dfacfc9a23aa5", + "id": "46b91bef44714366", "type": "link in", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "advanced settings", "links": [ - "62cd775a1c02dac8" + "8750ad979e9ea246" ], "x": 95, - "y": 80, + "y": 100, "wires": [ [ - "9b756a1f9b0e7317" + "89eedf29b404f750" ] ] }, { - "id": "62cd775a1c02dac8", + "id": "8750ad979e9ea246", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "", "mode": "link", "links": [ - "b67dfacfc9a23aa5" + "46b91bef44714366" ], "x": 955, - "y": 660, + "y": 480, "wires": [] }, { - "id": "9d94dbc523d989a3", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_delay_after", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 16, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0", - "max": "5", - "step": "0.1", - "className": "", - "x": 450, - "y": 2460, - "wires": [ - [ - "b81e238ccd0a04fe" - ] - ] - }, - { - "id": "0558d6eb9a01862e", + "id": "2522f888dc58972f", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_delay_before", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 14, + "group": "d324f0b852c2df0a", + "order": 7, "width": 3, "height": 1, "passthru": false, @@ -6757,53 +5283,26 @@ "topic": "", "topicType": "str", "min": "0", - "max": "5", - "step": "0.1", - "className": "", - "x": 440, - "y": 2500, - "wires": [ - [ - "a0048747e7300bdc" - ] - ] - }, - { - "id": "d47515c9b208bfb7", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_timeout", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 12, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0.01", "max": "1", - "step": "0.01", + "step": "0.02", "className": "", - "x": 420, - "y": 2420, + "x": 430, + "y": 2680, "wires": [ [ - "9b0d5c521a7822cc" + "5c752757090c49d2" ] ] }, { - "id": "89c76766c7552b57", + "id": "30e8df3d616512d8", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_gain", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 22, + "group": "d324f0b852c2df0a", + "order": 11, "width": 3, "height": 1, "passthru": false, @@ -6814,77 +5313,23 @@ "max": "10", "step": "0.1", "className": "", - "x": 410, - "y": 2540, - "wires": [ - [ - "9b26ed02296d27c9" - ] - ] - }, - { - "id": "c385518eb65a1b27", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_awbg_red", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 18, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-10", - "max": "10", - "step": "0.1", - "className": "", - "x": 430, - "y": 2580, - "wires": [ - [ - "b0ac7e9a7c713b84" - ] - ] - }, - { - "id": "5c80833b718d9bf6", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "cam_awbg_blue", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 20, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-10", - "max": "10", - "step": "0.1", - "className": "", - "x": 430, - "y": 2620, + "x": 400, + "y": 2720, "wires": [ [ - "827b1a671a77037d" + "a1769f0277834f6d" ] ] }, { - "id": "5a3826e112fb24e6", + "id": "d855d926df89d65b", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_contrast", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 24, + "group": "d324f0b852c2df0a", + "order": 13, "width": 3, "height": 1, "passthru": false, @@ -6895,23 +5340,24 @@ "max": "5", "step": "0.1", "className": "", - "x": 430, - "y": 2660, + "x": 420, + "y": 2840, "wires": [ [ - "78a1536c167da741" + "1a8b0ba21b4f3005", + "654bc70a18820828" ] ] }, { - "id": "3182ed7ac02b1509", + "id": "7617517dc8ba2859", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_saturation", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 26, + "group": "d324f0b852c2df0a", + "order": 15, "width": 3, "height": 1, "passthru": false, @@ -6922,22 +5368,23 @@ "max": "5", "step": "0.1", "className": "", - "x": 430, - "y": 2700, + "x": 420, + "y": 2880, "wires": [ [ - "fe9a5b68fc8c2077" + "dc8fc962ff7d594b", + "e64feb03a791ca33" ] ] }, { - "id": "7fa6337cdf0a0bc8", + "id": "cbaa23c34e10fae1", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_jpeg_q", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", + "group": "d324f0b852c2df0a", "order": 3, "width": 3, "height": 1, @@ -6949,54 +5396,20 @@ "max": "100", "step": "1", "className": "", - "x": 420, - "y": 2740, + "x": 410, + "y": 2920, "wires": [ [ - "e27d2613e942f344" + "00e7836ccb3c4d0c" ] ] }, { - "id": "08275bf96f87b8ef", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 11, - "width": 3, - "height": 1, - "name": "timeout", - "label": "Timeout", - "format": "", - "layout": "row-spread", - "className": "", - "x": 760, - "y": 2420, - "wires": [] - }, - { - "id": "d2d028df4a139f41", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 15, - "width": 3, - "height": 1, - "name": "delay_after", - "label": "Delay after", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2460, - "wires": [] - }, - { - "id": "c6a65762aa4ffb7b", + "id": "bbe443b039a14e21", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 13, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 6, "width": 3, "height": 1, "name": "delay_before", @@ -7004,16 +5417,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 770, - "y": 2500, + "x": 760, + "y": 2680, "wires": [] }, { - "id": "780323fd4504b855", + "id": "d320ed3d701e6cc2", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 21, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 10, "width": 3, "height": 1, "name": "gain", @@ -7021,50 +5434,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2540, - "wires": [] - }, - { - "id": "780bf08b41202135", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 17, - "width": 3, - "height": 1, - "name": "awbg red", - "label": "AWBG red", - "format": "", - "layout": "row-spread", - "className": "", - "x": 760, - "y": 2580, - "wires": [] - }, - { - "id": "c0faf441fc918538", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 19, - "width": 3, - "height": 1, - "name": "awbg blue", - "label": "AWBG blue", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2620, + "x": 740, + "y": 2720, "wires": [] }, { - "id": "93d12b447a39c5bb", + "id": "f5834dd4646c8af9", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 23, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 12, "width": 3, "height": 1, "name": "contrast", @@ -7072,16 +5451,16 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2660, + "x": 750, + "y": 2840, "wires": [] }, { - "id": "e77e6dcd285d3062", + "id": "ae9a4e19469813ef", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 25, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 14, "width": 3, "height": 1, "name": "saturation", @@ -7089,15 +5468,15 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2700, + "x": 750, + "y": 2880, "wires": [] }, { - "id": "a7075bc8d5ee1138", + "id": "bd629d0d31233c8b", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", "order": 2, "width": 3, "height": 1, @@ -7106,18 +5485,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2740, + "x": 740, + "y": 2920, "wires": [] }, { - "id": "282681e7c4351f74", + "id": "e89f61dbe6a6cffe", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ext", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 3, "width": 2, "height": 1, @@ -7128,19 +5507,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2900, + "x": 390, + "y": 3080, "wires": [ [ - "b17e82651407d8e0" + "885bc559fafec5f2" ] ] }, { - "id": "da43c58979737fec", + "id": "ece38cb172a12d75", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 2, "width": 4, "height": 1, @@ -7149,18 +5528,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2900, + "x": 730, + "y": 3080, "wires": [] }, { - "id": "ef70d61678fe1f11", + "id": "70014da0b6ab6698", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "light1", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 5, "width": 2, "height": 1, @@ -7171,19 +5550,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2940, + "x": 390, + "y": 3120, "wires": [ [ - "2c812acffdb330c5" + "f70321c96bf81360" ] ] }, { - "id": "fec56a7e913b21d6", + "id": "29634ea5f6d666df", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 4, "width": 4, "height": 1, @@ -7192,18 +5571,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2940, + "x": 730, + "y": 3120, "wires": [] }, { - "id": "24929b4629f22070", + "id": "2544963852c6881a", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "light2", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 7, "width": 2, "height": 1, @@ -7214,19 +5593,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 2980, + "x": 390, + "y": 3160, "wires": [ [ - "ae0654af69446942" + "95e1603bbd06a69d" ] ] }, { - "id": "7c6bdc0504aa4cc7", + "id": "27903533cd85a59e", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 6, "width": 4, "height": 1, @@ -7235,18 +5614,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 2980, + "x": 730, + "y": 3160, "wires": [] }, { - "id": "8c396b060f3d2646", + "id": "a1394401246eb735", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotordir", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 9, "width": 2, "height": 1, @@ -7257,19 +5636,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3020, + "x": 400, + "y": 3200, "wires": [ [ - "58cf48cfacc979fb" + "a8f92ea6bf394640" ] ] }, { - "id": "97568610daccf74a", + "id": "bc0aa4bacdfa94ea", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 8, "width": 4, "height": 1, @@ -7278,18 +5657,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3020, + "x": 740, + "y": 3200, "wires": [] }, { - "id": "a3c58ea48c388215", + "id": "f15ca4518b5f223e", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotorstep", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 11, "width": 2, "height": 1, @@ -7300,19 +5679,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3060, + "x": 400, + "y": 3240, "wires": [ [ - "c7ae206f2fff6810" + "06397bb46b3bb541" ] ] }, { - "id": "6da92aeaeffd95e0", + "id": "0d2924b160e7e383", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 10, "width": 4, "height": 1, @@ -7321,18 +5700,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3060, + "x": 740, + "y": 3240, "wires": [] }, { - "id": "9b5da90eaf6ac562", + "id": "49900bb9047dd965", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "rotoren", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 13, "width": 2, "height": 1, @@ -7343,19 +5722,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3100, + "x": 400, + "y": 3280, "wires": [ [ - "cfebd4a47a68b319" + "687dcdc1ede11700" ] ] }, { - "id": "12623e4addfa2c22", + "id": "a4d743ca73ee1622", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 12, "width": 4, "height": 1, @@ -7364,18 +5743,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3100, + "x": 740, + "y": 3280, "wires": [] }, { - "id": "f24cb404d7d09f8a", + "id": "5a90224dc998b417", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ttdir", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 15, "width": 2, "height": 1, @@ -7386,19 +5765,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 3140, + "x": 390, + "y": 3320, "wires": [ [ - "90f4d220928e4727" + "e220740c0d38ccb0" ] ] }, { - "id": "542bfb9d92935c2c", + "id": "67dc1b544c4ddf9f", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 14, "width": 4, "height": 1, @@ -7407,18 +5786,18 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 3140, + "x": 730, + "y": 3320, "wires": [] }, { - "id": "1f79467df98ce894", + "id": "d2364ab09627fe94", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "ttstep", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", + "group": "70d0be671bf03ca7", "order": 17, "width": 2, "height": 1, @@ -7429,19 +5808,19 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 410, - "y": 3180, + "x": 390, + "y": 3360, "wires": [ [ - "b05e1e612887f9c2" + "79d7e5a705ab813a" ] ] }, { - "id": "170d3b925f7745cc", + "id": "145b67ac40721ba6", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", "order": 16, "width": 4, "height": 1, @@ -7450,19 +5829,19 @@ "format": "", "layout": "row-spread", "className": "", - "x": 750, - "y": 3180, + "x": 730, + "y": 3360, "wires": [] }, { - "id": "661614f5bd2c71d6", + "id": "eef25405472acfee", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "endstop1", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", - "order": 21, + "group": "70d0be671bf03ca7", + "order": 19, "width": 2, "height": 1, "passthru": false, @@ -7472,20 +5851,20 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3220, + "x": 400, + "y": 3400, "wires": [ [ - "2af447a6905b83bc" + "12d20f2274bcc511" ] ] }, { - "id": "c18b55859dae5f85", + "id": "35eb252a41413531", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", - "order": 20, + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 18, "width": 4, "height": 1, "name": "endstop1", @@ -7493,19 +5872,19 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3220, + "x": 740, + "y": 3400, "wires": [] }, { - "id": "e23a396162026618", + "id": "74e455136b5ca5dd", "type": "ui_text_input", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "endstop2", "label": "", "tooltip": "", - "group": "644b3bcc903d46ca", - "order": 23, + "group": "70d0be671bf03ca7", + "order": 21, "width": 2, "height": 1, "passthru": false, @@ -7515,20 +5894,20 @@ "sendOnBlur": true, "className": "", "topicType": "msg", - "x": 420, - "y": 3260, + "x": 400, + "y": 3440, "wires": [ [ - "787a128f84f747c0" + "a4a89668ce4c9f05" ] ] }, { - "id": "82c1a33014d003e9", + "id": "3a74f653800eb831", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "644b3bcc903d46ca", - "order": 22, + "z": "e43a27722b508115", + "group": "70d0be671bf03ca7", + "order": 20, "width": 4, "height": 1, "name": "endstop2", @@ -7536,14 +5915,14 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 3260, + "x": 740, + "y": 3440, "wires": [] }, { - "id": "5255759a7c5b2a74", + "id": "5fcef1cb2e9e4788", "type": "ui_toast", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "position": "dialog", "displayTime": "3", "highlight": "", @@ -7556,37 +5935,37 @@ "topic": "", "name": "confirm", "x": 680, - "y": 660, + "y": 480, "wires": [ [ - "15fd1c9e5610cb85" + "29745a36fc157f3f" ] ] }, { - "id": "8be8015931c663cc", + "id": "f06a7bcad524e9f9", "type": "python3-function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "msg", "func": "from OpenScan import save, load_bool\n\nif msg['payload'] == True and not load_bool('advanced_settings'):\n msg['payload'] = '''PLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", "outputs": 1, "x": 530, - "y": 660, + "y": 480, "wires": [ [ - "5255759a7c5b2a74" + "5fcef1cb2e9e4788" ] ] }, { - "id": "9d464b2ba1edaf48", + "id": "f455fb39039617ae", "type": "ui_slider", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "cam_rotation", "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 10, + "group": "d324f0b852c2df0a", + "order": 5, "width": 3, "height": 1, "passthru": false, @@ -7597,20 +5976,20 @@ "max": "270", "step": "90", "className": "", - "x": 420, - "y": 2780, + "x": 410, + "y": 2960, "wires": [ [ - "b7d3fe0c0b40b3e1" + "3019576de193d9d6" ] ] }, { - "id": "db98b95693ebce63", + "id": "fdfbc900fe424eb9", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 9, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 4, "width": 3, "height": 1, "name": "cam_rot", @@ -7618,14 +5997,14 @@ "format": "", "layout": "row-spread", "className": "", - "x": 760, - "y": 2780, + "x": 750, + "y": 2960, "wires": [] }, { - "id": "6659121906897a1f", + "id": "c3699d6b9664ccca", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7634,17 +6013,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1800, + "y": 2100, "wires": [ [ - "1d4230b3d9b93f63" + "dfdebe10dbf0e198" ] ] }, { - "id": "0bb56b1edb12c2cf", + "id": "78e256083f59f66f", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7653,15 +6032,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1800, + "y": 2100, "wires": [ [] ] }, { - "id": "569829eeff715c33", + "id": "0f9141b401322374", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7670,17 +6049,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1920, + "y": 2220, "wires": [ [ - "1ab34b0a78b2c577" + "9a56c087d941f1da" ] ] }, { - "id": "249f44c3a87793ba", + "id": "29f576be9e292232", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7689,15 +6068,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1920, + "y": 2220, "wires": [ [] ] }, { - "id": "c997e60519341afd", + "id": "23e3099b34c4e475", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7706,17 +6085,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1960, + "y": 2260, "wires": [ [ - "1b3ac50d2c6600c6" + "0dfc86d90258f9bb" ] ] }, { - "id": "e0d7c36daa42b3f3", + "id": "c4b5a38c5c1df3d2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7725,15 +6104,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1960, + "y": 2260, "wires": [ [] ] }, { - "id": "59ecf3a22cd3a669", + "id": "79a14162ac805fac", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7742,17 +6121,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2000, + "y": 2300, "wires": [ [ - "b2e839fe47a32b5f" + "1361134e9847f003" ] ] }, { - "id": "204b0a5c8629d78a", + "id": "523717b0f218a5fd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7761,15 +6140,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2000, + "y": 2300, "wires": [ [] ] }, { - "id": "15f02421b30a9ab6", + "id": "f5cf780f3fa8997e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", "outputs": 1, @@ -7778,17 +6157,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1840, + "y": 2140, "wires": [ [ - "8c1a92f2dcc976c7" + "b03e8b51187e88eb" ] ] }, { - "id": "bb54bbdae6690576", + "id": "11fd3363416433f9", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7797,15 +6176,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 1840, + "y": 2140, "wires": [ [] ] }, { - "id": "58928befcc61b1f7", + "id": "02060b3f3b294563", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, @@ -7814,17 +6193,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 1880, + "y": 2180, "wires": [ [ - "f9b51424edb0491c" + "543e1690693acbeb" ] ] }, { - "id": "ea87ecfd2af3cc7f", + "id": "e8b24efb0f30288e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'rotor_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7833,34 +6212,34 @@ "finalize": "", "libs": [], "x": 630, - "y": 1880, + "y": 2180, "wires": [ [] ] }, { - "id": "27bc56f273360ac7", + "id": "de1ad8b27b72a5ac", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", "outputs": 1, - "noerr": 0, + "noerr": 4, "initialize": "", "finalize": "", "libs": [], "x": 290, - "y": 2040, + "y": 2340, "wires": [ [ - "0c50fdbb5ac3c373" + "c6642c7470d3820c" ] ] }, { - "id": "f46ced86106306c8", + "id": "ed4d587cb4feb064", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7869,17 +6248,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2160, + "y": 2460, "wires": [ [ - "6ef996f8a36f94c2" + "721b9680a3fa460e" ] ] }, { - "id": "4339704cd8552eb3", + "id": "5b02160c33605ae7", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7888,17 +6267,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2200, + "y": 2500, "wires": [ [ - "16e9a3a71c4bb916" + "1610895f430b9aca" ] ] }, { - "id": "1ac53bb6150645fe", + "id": "304c135ec09801e3", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, @@ -7907,17 +6286,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2240, + "y": 2540, "wires": [ [ - "9b1d8f9e21b34102" + "277037c4716d85bf" ] ] }, { - "id": "9b89eb1eaf333c10", + "id": "a91dcbe0f9a2416a", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) * 1000;\nreturn msg", "outputs": 1, @@ -7926,17 +6305,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2080, + "y": 2380, "wires": [ [ - "2647111c06f2055d" + "6aae9d4fddf08cc0" ] ] }, { - "id": "2e8927be0e235fa1", + "id": "6b2eb1cb95e573f9", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, @@ -7945,17 +6324,17 @@ "finalize": "", "libs": [], "x": 290, - "y": 2120, + "y": 2420, "wires": [ [ - "56bc3b93af2ebe16" + "10687d331a732790" ] ] }, { - "id": "485a4bed5a6bea23", + "id": "eef89545ec0f6aa8", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7964,15 +6343,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2040, + "y": 2340, "wires": [ [] ] }, { - "id": "2c000bd53cdb98ca", + "id": "b1b4678827d3a6dd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_accramp'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7981,15 +6360,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2160, + "y": 2460, "wires": [ [] ] }, { - "id": "c34111aaec734dd9", + "id": "0f3367983bb8e159", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -7998,15 +6377,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2200, + "y": 2500, "wires": [ [] ] }, { - "id": "89dbbe7d99ddbbaf", + "id": "c9d2e31514def4fc", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nif (msg.payload === 1){\n content = '1'\n}\nelse{\n content = '-1'\n}\n\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -8015,15 +6394,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2240, + "y": 2540, "wires": [ [] ] }, { - "id": "fb8145a9f8d4f7b2", + "id": "e50492d1e18f43c6", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_delay'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload / 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -8032,15 +6411,15 @@ "finalize": "", "libs": [], "x": 630, - "y": 2080, + "y": 2380, "wires": [ [] ] }, { - "id": "35422077b53da9bf", + "id": "af88b9da72917d62", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", "func": "var file = 'tt_acc'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -8049,1083 +6428,1172 @@ "finalize": "", "libs": [], "x": 630, - "y": 2120, + "y": 2420, "wires": [ [] ] }, { - "id": "d5308090f2b7971a", + "id": "43fe948b3e7234e2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_timeout'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data) / 1000;\nreturn msg", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2420, + "x": 280, + "y": 2680, "wires": [ [ - "d47515c9b208bfb7" + "2522f888dc58972f" ] ] }, { - "id": "9b0d5c521a7822cc", + "id": "5c752757090c49d2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_timeout'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload * 1000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2420, + "x": 620, + "y": 2680, "wires": [ [] ] }, { - "id": "694d1068bea15171", + "id": "435681b3f7625a7e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2460, + "x": 280, + "y": 2720, "wires": [ [ - "9d94dbc523d989a3" + "30e8df3d616512d8" ] ] }, { - "id": "cec3e5e78a40476b", + "id": "a1769f0277834f6d", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2500, + "x": 620, + "y": 2720, "wires": [ - [ - "0558d6eb9a01862e" - ] + [] ] }, { - "id": "b81e238ccd0a04fe", + "id": "1de07c7d285cbaf3", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2460, + "x": 280, + "y": 2840, "wires": [ - [] + [ + "d855d926df89d65b" + ] ] }, { - "id": "a0048747e7300bdc", + "id": "1a8b0ba21b4f3005", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_delay_before'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2500, + "x": 620, + "y": 2840, "wires": [ [] ] }, { - "id": "6f524f9370a18482", + "id": "ebc9e283468eda31", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadF", - "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2540, + "x": 280, + "y": 2880, "wires": [ [ - "89c76766c7552b57" + "7617517dc8ba2859" ] ] }, { - "id": "9b26ed02296d27c9", + "id": "dc8fc962ff7d594b", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_gain'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2540, + "x": 620, + "y": 2880, "wires": [ [] ] }, { - "id": "1f87f473e327c3cc", + "id": "60d641613527c736", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_awbg_red'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2580, + "x": 280, + "y": 2920, "wires": [ [ - "c385518eb65a1b27" + "cbaa23c34e10fae1" ] ] }, { - "id": "b0ac7e9a7c713b84", + "id": "00e7836ccb3c4d0c", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_awbg_red'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2580, + "x": 620, + "y": 2920, "wires": [ [] ] }, { - "id": "cff7ac5f1e061855", + "id": "7f24c0c34a88ba04", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_awbg_blue'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2620, + "x": 280, + "y": 2960, "wires": [ [ - "5c80833b718d9bf6" + "f455fb39039617ae" ] ] }, { - "id": "827b1a671a77037d", + "id": "3019576de193d9d6", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_awbg_blue'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2620, + "x": 620, + "y": 2960, "wires": [ [] ] }, { - "id": "cf854461c37ca54f", + "id": "77bb7dc529d63a7e", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2660, + "x": 270, + "y": 3080, "wires": [ [ - "5a3826e112fb24e6" + "e89f61dbe6a6cffe" ] ] }, { - "id": "78a1536c167da741", + "id": "885bc559fafec5f2", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_contrast'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2660, + "x": 590, + "y": 3080, "wires": [ [] ] }, { - "id": "ba10e04dd1761692", + "id": "cc6dabe017a9c8a8", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadF", - "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2700, + "x": 270, + "y": 3400, "wires": [ [ - "3182ed7ac02b1509" + "eef25405472acfee" ] ] }, { - "id": "fe9a5b68fc8c2077", + "id": "12d20f2274bcc511", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_saturation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2700, + "x": 590, + "y": 3400, "wires": [ [] ] }, { - "id": "a69d216114f908a5", + "id": "dcb9fed8122759fd", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2740, + "x": 270, + "y": 3120, "wires": [ [ - "7fa6337cdf0a0bc8" + "70014da0b6ab6698" ] ] }, { - "id": "e27d2613e942f344", + "id": "f70321c96bf81360", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_jpeg_quality'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2740, + "x": 590, + "y": 3120, "wires": [ [] ] }, { - "id": "f02d4a036a225e87", + "id": "013d2057c2347a62", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2780, + "x": 270, + "y": 3160, "wires": [ [ - "9d464b2ba1edaf48" + "2544963852c6881a" ] ] }, { - "id": "b7d3fe0c0b40b3e1", + "id": "95e1603bbd06a69d", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_rotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2780, + "x": 590, + "y": 3160, "wires": [ [] ] }, { - "id": "612cccacda1a65aa", + "id": "f88bbf11d5aa9a14", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2900, + "x": 270, + "y": 3200, "wires": [ [ - "282681e7c4351f74" + "a1394401246eb735" ] ] }, { - "id": "b17e82651407d8e0", + "id": "a8f92ea6bf394640", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_external'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2900, + "x": 590, + "y": 3200, "wires": [ [] ] }, { - "id": "3b126549c03a872e", + "id": "301af70731e096e5", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3220, + "x": 270, + "y": 3240, "wires": [ [ - "661614f5bd2c71d6" + "f15ca4518b5f223e" ] ] }, { - "id": "2af447a6905b83bc", + "id": "06397bb46b3bb541", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_rotor_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3220, + "x": 590, + "y": 3240, "wires": [ [] ] }, { - "id": "954db931f87894ee", + "id": "0456a9ec4c236c9e", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2940, + "x": 270, + "y": 3280, "wires": [ [ - "ef70d61678fe1f11" + "49900bb9047dd965" ] ] }, { - "id": "2c812acffdb330c5", + "id": "687dcdc1ede11700", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_ringlight1'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2940, + "x": 590, + "y": 3280, "wires": [ [] ] }, { - "id": "6682c8057e89d087", + "id": "09d37ba08ec0f163", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2980, + "x": 270, + "y": 3320, "wires": [ [ - "24929b4629f22070" + "5a90224dc998b417" ] ] }, { - "id": "ae0654af69446942", + "id": "37d954a4cf7e87ea", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'pin_ringlight2'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 2980, + "x": 270, + "y": 3360, "wires": [ - [] + [ + "d2364ab09627fe94" + ] ] }, { - "id": "015be401d08047d2", + "id": "e220740c0d38ccb0", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3020, + "x": 590, + "y": 3320, "wires": [ - [ - "8c396b060f3d2646" - ] + [] ] }, { - "id": "58cf48cfacc979fb", + "id": "79d7e5a705ab813a", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_rotor_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3020, + "x": 590, + "y": 3360, "wires": [ [] ] }, { - "id": "1c6c0f8b9ac95659", + "id": "21dc963d967d9c99", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3060, + "x": 270, + "y": 3440, "wires": [ [ - "a3c58ea48c388215" + "74e455136b5ca5dd" ] ] }, { - "id": "c7ae206f2fff6810", + "id": "a4a89668ce4c9f05", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'pin_rotor_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'pin_tt_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3060, + "x": 590, + "y": 3440, "wires": [ [] ] }, { - "id": "dcee66c0d56c6934", + "id": "22ef66b0e2058be2", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3100, + "x": 270, + "y": 360, "wires": [ [ - "9b5da90eaf6ac562" + "cb3437ec113e1b6f" ] ] }, { - "id": "cfebd4a47a68b319", + "id": "9ce01c8ba97932c1", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'pin_rotor_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 610, - "y": 3100, + "x": 270, + "y": 400, "wires": [ - [] + [ + "60fd0adce1cfeb82" + ] ] }, { - "id": "6ec7d85bb17eb159", + "id": "81356177176eebcf", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_tt_dir'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'advanced_settings'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 3140, + "x": 270, + "y": 480, "wires": [ [ - "f24cb404d7d09f8a" + "f6d6cc35679ede63" ] ] }, { - "id": "4f42d02a3776a006", + "id": "b78346ca3ce70c68", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'pin_tt_step'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Refresh
You can refresh the status of the processing of your files in the OpenScanCloud. Make sure to read and agree the terms of use (in settings menu) before using the OpenScanCloud. Do not spam this button, as this might lead to temporary/permanent suspension of your IP address.
The status (in the table) of the individual sets in the file list will be updated to one of the following:
Created - you started the upload of your image set. If you are stuck on this status, please try to restart the upload.
Initialized - all files have been uploaded and processing will start as soon as possible
File approved - the server received and verified your files
Processing started - your files are currently being processed
Processing failed - there are various reasons why processing might fail. Please check the email for more details or contact me at cloud@openscan.eu
processing done - check your email, where you should find a link to the 3d model :)
Status (on the right column)
Indicates, what the device is currently up to.
Refreshing - updating all image set's status
Uploading - while transferring the image set to the OpenScanCloud servers. If the upload freezes, be patient. If nothing happens, reboot the device and restart the upload.
Project started - when the upload of a set was successful
Zipping - files larger then 200mb have to be split and re-zipped before uploading to the OpenScanCloud, the process might take a while depending on the filesize.
Combining - two sets into one might take up to a minute.
Set
select a set from the file list by clicking on a row in the table
Download
Download the selected set from the OpenScan device to your computer/mobile/tablet
Upload
Upload the selected file to the OpenScanCloud
Combine
In order to combine two sets, select one set. Click the combine button and select the second set. A pop-up will appear, and you can confirm the operation. All images from the two sets will be merged into one set. The original image sets will be deleted!
Delete Set/All
Please keep in mind, that the memory of the SD card is relatively small, and thus you will have to delete individual or all photo sets from time to time.
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 590, - "y": 200, + "topic": "", + "name": "Info", + "x": 1010, + "y": 140, "wires": [ - [ - "f304680180a23479" - ] + [] ] }, { - "id": "45df91cae421e8e1", + "id": "cca3300a8f0daf4d", "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Scan_settings", - "group": "7aaf184330605300", + "z": "e43a27722b508115", + "name": "Update&Info", + "group": "ddbd496e.93a288", "order": 1, "width": 6, "height": 1, @@ -9136,917 +7604,1071 @@ "bgcolor": "transparent", "className": "", "icon": "fa-question-circle", - "payload": "Current Status
--READY-- - everything is okay and ready to go :)
Routine-preparing - before starting the routine some time might pass depending on the number of photos
Routine-stopping - manually ending the routine by pressing the stop button
Routine-Photo X/Y - Showing the progress of the routine
No Camera Found - please check the camera ribbon cable
Error: XXX - Please contact info@openscan.eu or post an issue on Github.com
Projectname
Each photo set will be saved using the following pattern YYYY-MM-DD_hh-mm-ss_projectname.zip (e.g. 2022-04-05_12.12.12_toysoldier.zip). Keep your files organized by giving each set a new projectname. If not specified 'default' will be used.
Rotor
Moving the rotor by increments of 5°. Please make sure to start the routine with the camera in the horizontal position.
Turntable
Moving the turntable by increments of 15°.
Ringlight
Use the ring light for shadow-free illumination. It is highly recommended to use the polarizer in order to avoid reflections. Note, that the polarizer will absorb 75% of the light, so you might need to use both ring lights.
Photos
Set the number of photos for the current set. 60-120 photos should be more than enough for most objects. If the reconstruction fails or is very bad with 60 photos, increasing the number of photos will not help!
Shutter
Again: Less is more! If the value is too high, some areas might get overexposed and thus, the software will not be able to recognize the surface feature of the object. Here are some reference values:
- no polarizer: 5-20ms
- mostly white object, with polarizer + one ringlight: 50-200ms
Crop X/Y
Make sure to use the right object holder to place the object in the middle of the screen. Try to crop as many unnecessary areas as possible. This will greatly lower the file size and resulting transfer and reconstruction times!
Start/Stop
Use the buttons to start/stop the routine
Reboot/Shutdown
In case of an error, try to restart the device. Always use the shutdown button before powering-off the device!
", + "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 760, - "y": 120, + "x": 750, + "y": 180, "wires": [ [ - "f304680180a23479" + "5fff689f9f8bc1ca" ] ] }, { - "id": "e9677b85856b5873", + "id": "654bc70a18820828", "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "Reset rfkill", - "func": "from os import system\nif \"Interface doesn't support scanning\" in msg['payload']:\n system('rfkill unblock all')\n system('ifconfig wlan0 up')\n return msg", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/picam2_contrast?contrast=\" + str(msg['payload']))", "outputs": 1, - "x": 390, - "y": 1100, + "x": 660, + "y": 2800, "wires": [ [] ] }, { - "id": "91fe20cb16f54293", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglemin'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "id": "e64feb03a791ca33", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import camera\n\ncamera(\"/picam2_saturation?saturation=\" + str(msg['payload']))", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 1680, + "x": 660, + "y": 2760, + "wires": [ + [] + ] + }, + { + "id": "81bd4381cd029958", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "cam_delay_after", + "label": "", + "tooltip": "", + "group": "d324f0b852c2df0a", + "order": 9, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "0", + "max": "1", + "step": "0.02", + "className": "", + "x": 440, + "y": 2640, "wires": [ [ - "327c8bdde31033a4" + "e612073aded01a8f" ] ] }, { - "id": "add3e998b097c54f", + "id": "0d92559980944ae3", "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 7, + "z": "e43a27722b508115", + "group": "d324f0b852c2df0a", + "order": 8, "width": 3, "height": 1, - "name": "rotor_anglemin", - "label": "Min Angle", + "name": "delay_after", + "label": "Delay after", "format": "", - "layout": "row-left", + "layout": "row-spread", "className": "", - "x": 780, - "y": 1680, + "x": 760, + "y": 2640, "wires": [] }, { - "id": "da286366433c83a0", + "id": "6281b2e6e081104d", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", + "name": "loadF", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseFloat(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 280, + "y": 2640, + "wires": [ + [ + "81bd4381cd029958" + ] + ] + }, + { + "id": "e612073aded01a8f", + "type": "function", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'rotor_anglemin'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "func": "var file = 'cam_delay_after'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1680, + "x": 620, + "y": 2640, "wires": [ [] ] }, { - "id": "327c8bdde31033a4", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglemin", - "label": "", + "id": "e2411b49791840e0", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "reboot", + "func": "import os\nfrom time import sleep\nsleep(1.5)\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.cleanup()\nos.system('reboot -h')\n", + "outputs": 1, + "x": 270, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "01c882fcc51b349c", + "type": "link in", + "z": "e43a27722b508115", + "name": "reboot", + "links": [ + "16c76929f88df841", + "fe3a855fee9e28c6", + "09d4a9c756161e10" + ], + "x": 155, + "y": 520, + "wires": [ + [ + "e2411b49791840e0" + ] + ] + }, + { + "id": "e51dd5e5c0f050d6", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "SSID", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 8, - "width": 3, + "group": "8ab79a98e536e0d6", + "order": 4, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "mode": "text", + "delay": "0", + "topic": "ssid", + "sendOnBlur": true, "className": "", - "x": 440, - "y": 1680, + "topicType": "str", + "x": 210, + "y": 980, "wires": [ [ - "da286366433c83a0" + "a7d233f984009e2e" ] ] }, { - "id": "94288df4c6756197", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglemax", - "label": "", + "id": "9959649037cb063b", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Password", "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 10, - "width": 3, + "group": "8ab79a98e536e0d6", + "order": 5, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "mode": "password", + "delay": "0", + "topic": "password", + "sendOnBlur": true, "className": "", - "x": 440, - "y": 1720, + "topicType": "str", + "x": 220, + "y": 1020, "wires": [ [ - "e531ffe3dcf34eb4" + "a7d233f984009e2e" ] ] }, { - "id": "4702a4a09124e27d", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "rotor_anglestart", - "label": "", + "id": "1d42cb9a63409283", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "", + "label": "Country Code 2", "tooltip": "", - "group": "d49a6dfd7fb17096", + "group": "8ab79a98e536e0d6", "order": 6, - "width": 3, + "width": 6, "height": 1, "passthru": false, - "outs": "end", - "topic": "", + "mode": "text", + "delay": "0", + "topic": "country", + "sendOnBlur": true, + "className": "", "topicType": "str", - "min": "-90", - "max": "90", - "step": "5", + "x": 240, + "y": 1060, + "wires": [ + [ + "a7d233f984009e2e" + ] + ] + }, + { + "id": "84ecaafd629c0f7a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "", + "group": "8ab79a98e536e0d6", + "order": 7, + "width": 0, + "height": 0, + "passthru": false, + "label": "Connect to Wifi", + "tooltip": "", + "color": "", + "bgcolor": "", "className": "", - "x": 440, - "y": 1760, + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "connect", + "topicType": "str", + "x": 240, + "y": 1100, "wires": [ [ - "9ce407cb16f0419a" + "a7d233f984009e2e" ] ] }, { - "id": "2cf946c7aab2cbb4", + "id": "6ea3cdab41f20f92", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "8ab79a98e536e0d6", + "order": 2, + "width": 0, + "height": 0, + "name": "", + "label": "Hotspot Mode", + "format": "{{msg.mode}}", + "layout": "row-spread", + "className": "", + "x": 240, + "y": 900, + "wires": [] + }, + { + "id": "a7d233f984009e2e", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglemax'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "z": "e43a27722b508115", + "name": "function 1", + "func": "if (msg.topic == \"ssid\"){\n global.set('network_ssid',msg.payload)\n}\nelse if (msg.topic == \"password\"){\n global.set('network_password',msg.payload)\n}\nelse if (msg.topic == \"country\"){\n global.set('network_country',msg.payload)\n}\nelse if (msg.topic == \"connect\"){\n msg.ssid = global.get('network_ssid')\n msg.password = global.get('network_password')\n msg.country = global.get('network_country')\n msg.payload = \"\"\n return msg\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1720, + "x": 440, + "y": 980, "wires": [ [ - "94288df4c6756197" + "9b851aa999e86fd7", + "021dc780b478fee6", + "9ec0ad9fd3687e9f" ] ] }, { - "id": "e531ffe3dcf34eb4", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'rotor_anglemax'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 1720, + "id": "65518f3d4e3095e5", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 1", + "links": [ + "200d4b9951b6e066" + ], + "x": 85, + "y": 980, "wires": [ - [] + [ + "e51dd5e5c0f050d6", + "9959649037cb063b", + "1d42cb9a63409283" + ] ] }, { - "id": "4da5f650d3845baa", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'rotor_anglestart'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "id": "9b851aa999e86fd7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\nfrom time import sleep\n\nsleep(0.5)\n\nerror = \"\"\nif msg['ssid'] == \"\":\n error = \"SSID, \"\nif msg['password'] == \"\" or len(msg['password'])<8:\n error = error + \"password, \"\nif msg['country'] == \"\" or len(msg['country']) != 2:\n error = error + \"country code\"\n\nif error != \"\":\n msg['payload'] = error\n msg['topic'] = \"Invalid Input(s):\"\n if check_hotspot_mode():\n msg['mode'] = True\n else:\n msg['mode'] = False\n return msg\n\n\nmsg['result'] = add_wifi_network(msg['ssid'],msg['password'],msg['country'])\n\nsleep(3)\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nmsg['topic'] = \"Added wifi & connected\"\nmsg['payload'] = \"changes might take a moment ;)\"\n\nreturn msg", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 1760, + "x": 670, + "y": 980, "wires": [ [ - "4702a4a09124e27d" + "c994c779e4bad800", + "11b19e9c6a4ffd8d", + "36890eb99a2ca1cf" ] ] }, { - "id": "9ce407cb16f0419a", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'rotor_anglestart'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "id": "11b19e9c6a4ffd8d", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 1760, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 870, + "y": 980, "wires": [ [] ] }, { - "id": "fda776c5aa642867", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 9, - "width": 3, - "height": 1, - "name": "rotor_anglemax", - "label": "Max Angle", - "format": "", - "layout": "row-left", - "className": "", - "x": 780, - "y": 1720, - "wires": [] - }, - { - "id": "6e9af48a1c4c58c6", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "d49a6dfd7fb17096", - "order": 5, - "width": 3, - "height": 1, - "name": "rotor_anglestart", - "label": "Start Angle", - "format": "", - "layout": "row-left", - "className": "", - "x": 780, - "y": 1760, + "id": "021dc780b478fee6", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 640, + "y": 920, "wires": [] }, { - "id": "9b2bc9849aee310b", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "changeHostname", + "id": "c994c779e4bad800", + "type": "link out", + "z": "e43a27722b508115", + "name": "link out 2", + "mode": "link", "links": [ - "ec2db55a99bbe3ee", - "d5175561293ef490", - "960912e90ba5b5bc", - "50eeb3e362f9027f" + "592ec13d8f8923a9" ], - "x": 835, - "y": 900, - "wires": [ - [ - "8b9e3781511e9231" - ] - ] + "x": 815, + "y": 1020, + "wires": [] }, { - "id": "8b9e3781511e9231", + "id": "1eef47e0074545a9", "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "chk", - "func": "with open('/etc/hostname', 'r') as file:\n old_hostname = file.read().replace('\\n','')\nif old_hostname == 'raspberrypi':\n msg['hostname'] = 'openscan'\n msg['payload'] = 'OK'\n return msg", - "outputs": 1, - "x": 930, - "y": 900, - "wires": [ - [ - "ebce67b739d1891f" - ] - ] - }, - { - "id": "3fcbd9fe3acc3fb7", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "scan_arducam", - "group": "90223f7ddc082321", - "order": 1, - "width": 2, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "MF - Manual Focus
By default, the switch is 'off', which means that autofocus is active. For small objects, it might be necessary to use manual focus: activate the switch and set the focus by pressing + and - accordingly. The distance is measured between the camera lens and the focal plane (which should be in the center or slightly in front of the center of the object). Be aware, that the distance value is only a rough estimate (mm)
ST - Stacking
Stacking is disabled by default. Once activated, you will be able to set the following:
Stacksize - defines the number of photos between the minimal and the maximal focal distance
SET press this button to set the maximal/minimal focal distance. Pressing the button a third time will re-set the values.
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 760, - "y": 160, + "z": "e43a27722b508115", + "name": "", + "func": "from OpenScan import add_wifi_network, check_hotspot_mode\n\nif check_hotspot_mode():\n msg['mode'] = True\nelse:\n msg['mode'] = False\n\nreturn msg", + "outputs": 2, + "x": 670, + "y": 1100, "wires": [ [ - "f304680180a23479" - ] + "c994c779e4bad800", + "36890eb99a2ca1cf" + ], + [] ] }, { - "id": "6d68cccec646e0a0", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "enable routine", - "func": "msg_enable = {}\nmsg_disable = {}\n\nmsg_enable['enabled'] = True\nmsg_disable['enabled'] = False\n\nif msg['payload'] == 'external':\n return msg_enable, msg_disable\nif msg['payload'] == 'gphoto':\n return msg_enable, msg_enable, msg_disable\n\nreturn msg_enable", - "outputs": 3, - "x": 560, - "y": 440, + "id": "434b04d8a65951ce", + "type": "inject", + "z": "e43a27722b508115", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 440, + "y": 1140, "wires": [ [ - "a0ba1aa77c5c8b7c" - ], - [ - "a42c12e94f65fa01" - ], - [ - "2d76e5617f13cd6c" + "1eef47e0074545a9" ] ] }, { - "id": "a0ba1aa77c5c8b7c", - "type": "link out", - "z": "017bd4e4a428bee5", + "id": "9ec0ad9fd3687e9f", + "type": "ui_toast", + "z": "e43a27722b508115", + "position": "bottom right", + "displayTime": "5", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Adding new Wifi", "name": "", - "mode": "link", - "links": [ - "2aea1727dbea76ce", - "4f212b44aa487945", - "65cef204b16f8741", - "917a194be245384a" - ], - "x": 675, - "y": 420, + "x": 670, + "y": 1020, "wires": [] }, { - "id": "a42c12e94f65fa01", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "2aea1727dbea76ce", - "4f212b44aa487945", - "65cef204b16f8741", - "917a194be245384a" - ], - "x": 715, - "y": 440, + "id": "36890eb99a2ca1cf", + "type": "debug", + "z": "e43a27722b508115", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 940, "wires": [] }, { - "id": "2d76e5617f13cd6c", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "65cef204b16f8741" - ], - "x": 675, - "y": 460, - "wires": [] + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, + "wires": [ + [ + "85ad07b8f973bbe2" + ] + ] }, { - "id": "bd80ec228fb9a86d", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 135, - "y": 340, + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] + }, + { + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, "wires": [ - [ - "78351089ee9ebeaf", - "5fba78ae65eaaf5d", - "3492754252645e62", - "d16525a31223bc42", - "67206663b3881868" - ] + [] ] }, { - "id": "65b38bfeb3fee710", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 155, - "y": 760, + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, "wires": [ [ - "cc3cb10f2ea3f8b8" + "6b7245c3dcb694c8" ] ] }, { - "id": "d3fc91d87d5d5f62", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 135, - "y": 940, + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, "wires": [ [ - "725fd0cab0bddc0e" + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" ] ] }, { - "id": "cc9c4092edeb43cc", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 135, - "y": 1020, + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, "wires": [ [ - "27c6b221c90ed9e1", - "f393400.d87dcc" + "253feafa5a2f8b1d" ] ] }, { - "id": "f0b355967b33dfee", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 175, - "y": 1600, + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, "wires": [ - [ - "91fe20cb16f54293", - "2cf946c7aab2cbb4", - "4da5f650d3845baa", - "6659121906897a1f", - "15f02421b30a9ab6", - "58928befcc61b1f7", - "569829eeff715c33", - "c997e60519341afd", - "59ecf3a22cd3a669", - "27bc56f273360ac7", - "9b89eb1eaf333c10", - "2e8927be0e235fa1", - "f46ced86106306c8", - "4339704cd8552eb3", - "1ac53bb6150645fe", - "0d48bb415c584420", - "b6e420121e6466e7" - ] + [] ] }, { - "id": "d7c1fb4c028b21a5", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 155, - "y": 2280, + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 800, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 410, + "y": 1980, "wires": [ [ - "d5308090f2b7971a", - "694d1068bea15171", - "cec3e5e78a40476b", - "6f524f9370a18482", - "1f87f473e327c3cc", - "cff7ac5f1e061855", - "cf854461c37ca54f", - "ba10e04dd1761692", - "a69d216114f908a5", - "f02d4a036a225e87", - "1efd4a05aee0b86c", - "6841e5a392f0fb4f" + "69516440e3997111", + "f036424d79645761", + "fe62e12d458db2d4", + "aea4e51b20951560" ] ] }, { - "id": "a67c18aaca2f5fa5", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" - ], - "x": 155, - "y": 2900, + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, "wires": [ [ - "612cccacda1a65aa", - "954db931f87894ee", - "6682c8057e89d087", - "015be401d08047d2", - "1c6c0f8b9ac95659", - "dcee66c0d56c6934", - "6ec7d85bb17eb159", - "4f42d02a3776a006", - "3b126549c03a872e", - "58bbe9fc41e0d7b9" + "eefed04c25e3e4d6" ] ] }, { - "id": "c6d3821bc7f43f8e", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Reset default", - "group": "4fe6b4c0ade0938a", - "order": 14, - "width": 6, - "height": 1, - "passthru": false, - "label": "Restore default settings", - "tooltip": "", - "color": "red", - "bgcolor": "", + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, "className": "", - "icon": "", - "payload": "This can not be undone!", - "payloadType": "str", - "topic": "Restore default settings?", - "topicType": "str", - "x": 930, - "y": 300, + "x": 440, + "y": 440, "wires": [ [ - "e4be21c38b57f560" + "2aaf7c7f0f0c146f" ] ] }, { - "id": "e4be21c38b57f560", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", "outputs": 1, - "ok": "No", - "cancel": "Yes", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 1090, - "y": 300, + "x": 660, + "y": 440, "wires": [ - [ - "9f30de04ced693d3" - ] + [] ] }, { - "id": "9f30de04ced693d3", + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", "type": "function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "msg.overwrite = true\nif(msg.payload == \"Yes\"){\n return msg}", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 1230, - "y": 300, + "x": 190, + "y": 3560, "wires": [ [ - "80bccc884b0be297" + "d0a1a4947a1137ca" ] ] }, { - "id": "80bccc884b0be297", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "38783aea9cc317a6" - ], - "x": 1325, - "y": 300, - "wires": [] + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] }, { - "id": "34b685aff2080d31", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "boot-cam", - "func": "from OpenScan import load_str\n\ncamera_modules = ('imx519', 'imx219', 'ov5647', 'imx477', 'imx378', 'ov9281', 'imx290a', 'imx290b')\n\npt1 = \"[all]\\n\\ncamera_auto_detect=0\\ngpu_mem=256\\ndtoverlay=vc4-fkms-v3d\\ndtoverlay=\"\npt3 = \",media-controller=1\\n\"\n\nwith open('/boot/config.txt', 'r') as file:\n config = file.read()\n\ncamera = load_str('camera')\nif camera not in camera_modules:\n msg['payload'] = 'no changes'\n return\n\nif camera == 'imx290a':\n camera = 'imx290,clock-frequency=37125000'\nelif camera == 'imx290b':\n camera = 'imx290,clock-frequency=74250000'\n\nconfig_keep = config.split('[all]\\n')[0]\nconfig_new = config_keep + pt1 + camera + pt3\n\nwith open('/boot/config.txt', 'w') as file:\n file.write(config_new)\n\nmsg['topic'] = 'Camera configuration changed'\nmsg['payload'] = 'Please restart the device'\n\nreturn msg", + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, - "x": 680, - "y": 500, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, "wires": [ [ - "68cba0c530c6def6" + "28eeaa3a8eb77679" ] ] }, { - "id": "68cba0c530c6def6", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 830, - "y": 500, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, "wires": [ [] ] }, { - "id": "f304680180a23479", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": true, + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, "className": "", - "topic": "", - "name": "Info", - "x": 1010, - "y": 120, + "topicType": "msg", + "x": 350, + "y": 3640, "wires": [ - [] + [ + "b5aba11033c5f952" + ] ] }, { - "id": "0d48bb415c584420", + "id": "058743d0e5afb87b", "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadB", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1640, - "wires": [ - [ - "ce215e159ce7267f" - ] - ] - }, - { - "id": "ce215e159ce7267f", - "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Turntable Mode", - "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 2, - "width": 6, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "topicType": "str", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "animate": false, - "className": "", - "x": 440, - "y": 1640, + "x": 190, + "y": 3640, "wires": [ [ - "f95f528dec31425c" + "a26c0482377667c9" ] ] }, { - "id": "f95f528dec31425c", + "id": "b5aba11033c5f952", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1640, + "x": 550, + "y": 3640, "wires": [ [] ] }, { - "id": "4ebe5baece5ce9f2", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "preview_resolution", + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 5, - "width": 3, - "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0.5", - "max": "10", - "step": "0.5", + "color": "", + "bgcolor": "transparent", "className": "", - "x": 450, - "y": 2280, + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, "wires": [ [ - "60a415fff23cb55e" + "5fff689f9f8bc1ca" ] ] }, { - "id": "9ed0498cceceedde", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 4, - "width": 3, - "height": 1, - "name": "preview_res", - "label": "Preview Resolution (Mpx)", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2280, + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "69885a9ce218eb71", + "type": "comment", + "z": "e43a27722b508115", + "name": "Coloritos", + "info": "", + "x": 100, + "y": 3740, "wires": [] }, { - "id": "1efd4a05aee0b86c", + "id": "dc1cde67c3022e6b", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadI", - "func": "var file = 'cam_preview_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data)/1000000;\nreturn msg", + "func": "var file = 'interface_color'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 2280, + "x": 190, + "y": 3800, "wires": [ [ - "4ebe5baece5ce9f2" + "0dccca85770c7936" ] ] }, { - "id": "60a415fff23cb55e", + "id": "b63e8246ad14ad9d", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_preview_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload*1000000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "interface-color", + "func": "var file = 'interface_color'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 2280, + "x": 540, + "y": 3800, "wires": [ [] ] }, { - "id": "6f3d403e157163e4", + "id": "b7044aa75196b521", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 3", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3800, + "wires": [ + [ + "dc1cde67c3022e6b" + ] + ] + }, + { + "id": "0dccca85770c7936", "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "Camera", + "z": "e43a27722b508115", + "name": "interface_color", "label": "", "tooltip": "", "place": "Select option", - "group": "1f7f7e1e24f5ad9b", - "order": 5, - "width": 4, - "height": 1, + "group": "15edc2ce885dddb3", + "order": 1, + "width": 0, + "height": 0, "passthru": true, "multiple": false, "options": [ { - "label": "Pi Cam v1 - 5mp", - "value": "ov5647", - "type": "str" - }, - { - "label": "Pi Cam v2 - 8mp", - "value": "imx219", - "type": "str" - }, - { - "label": "Pi Cam HQ - 12.3mp", - "value": "imx477", - "type": "str" - }, - { - "label": "Arducam IMX519 - 16mp", - "value": "imx519", - "type": "str" - }, - { - "label": "IMX290 a", - "value": "imx290a", + "label": "Aburrido", + "value": "#097479", "type": "str" }, { - "label": "IMX290 b", - "value": "imx290b", + "label": "Morado", + "value": "#790974", "type": "str" }, { - "label": "IMX378", - "value": "imx378", + "label": "Berenjena", + "value": "#79093c", "type": "str" }, { - "label": "OV9281", - "value": "ov9281", + "label": "Azul", + "value": "#093c79 ", "type": "str" }, { - "label": "DSLR (gphoto)", - "value": "gphoto", - "type": "str" - }, - { - "label": "USB Webcam", - "value": "usb_webcam", - "type": "str" - }, - { - "label": "External Camera", - "value": "external", + "label": "Oliva", + "value": "#747909", "type": "str" } ], @@ -10054,154 +8676,133 @@ "topic": "topic", "topicType": "msg", "className": "", - "x": 400, - "y": 460, + "x": 360, + "y": 3800, "wires": [ [ - "6d68cccec646e0a0", - "4058a31e942e8f95" + "b63e8246ad14ad9d" ] ] }, { - "id": "c6138801b30f091d", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "model", - "label": "", - "tooltip": "", - "place": "Select option", - "group": "1f7f7e1e24f5ad9b", - "order": 3, - "width": 4, - "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "Please Select", - "value": "None", - "type": "str" - }, - { - "label": "OpenScan Mini", - "value": "OSMini", - "type": "str" - }, - { - "label": "OpenScan Classic", - "value": "OSClassic", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 390, - "y": 580, + "id": "667950f6671bd1a0", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'hostname'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 210, + "y": 840, "wires": [ [ - "896242c5a7e50fa7" + "b82a1cbefad51cd8" ] ] }, { - "id": "4da67c23c7a543a0", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "1f7f7e1e24f5ad9b", - "order": 4, - "width": 2, - "height": 1, - "name": "", - "label": "Camera", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 840, - "y": 460, - "wires": [] - }, - { - "id": "1fed8676078ea9a7", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "1f7f7e1e24f5ad9b", - "order": 2, - "width": 2, - "height": 1, - "name": "", - "label": "Model", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 730, - "y": 580, - "wires": [] - }, - { - "id": "a4b7eea9a9736b0a", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Update&Info", - "group": "ddbd496e.93a288", - "order": 1, - "width": 6, - "height": 1, - "passthru": false, - "label": "", + "id": "5f32d7e78e368454", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'hostname'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 510, + "y": 840, + "wires": [ + [] + ] + }, + { + "id": "b82a1cbefad51cd8", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "hostname", + "label": "Hostname", "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", - "payloadType": "str", + "group": "8ab79a98e536e0d6", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, "topic": "topic", + "sendOnBlur": true, + "className": "", "topicType": "msg", - "x": 750, - "y": 200, + "x": 360, + "y": 840, "wires": [ [ - "f304680180a23479" + "5f32d7e78e368454" ] ] }, { - "id": "b6e420121e6466e7", + "id": "5fd155711e29b1b8", + "type": "comment", + "z": "e43a27722b508115", + "name": "Monitoring", + "info": "", + "x": 100, + "y": 3860, + "wires": [] + }, + { + "id": "815702499384f118", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'routine_secondpass'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'datadog_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 290, - "y": 1600, + "x": 190, + "y": 3920, "wires": [ [ - "ab8d5cfe9190bb5f" + "bfdbdae28bf42ed4" ] ] }, { - "id": "ab8d5cfe9190bb5f", + "id": "464c8495f86daaa7", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "datadog_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('datadog_enable'):\n save('datadog_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3920, + "wires": [ + [] + ] + }, + { + "id": "bfdbdae28bf42ed4", "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Second pass", - "tooltip": "", - "group": "d49a6dfd7fb17096", - "order": 3, - "width": 6, - "height": 1, + "z": "e43a27722b508115", + "name": "datadog_enable", + "label": "Enable Datadog", + "tooltip": "Enable Datadog monitoring", + "group": "33aff36289823faa", + "order": 1, + "width": "6", + "height": "1", "passthru": true, "decouple": "false", - "topic": "", - "topicType": "str", + "topic": "topic", + "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", @@ -10213,206 +8814,348 @@ "offcolor": "", "animate": false, "className": "", - "x": 430, - "y": 1600, + "x": 340, + "y": 3920, + "wires": [ + [ + "464c8495f86daaa7" + ] + ] + }, + { + "id": "f93ce2d26953341f", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "datadog_api_token", + "label": "Datadog Api Token", + "tooltip": "Datadog Api Token", + "group": "33aff36289823faa", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3960, "wires": [ [ - "fa51327f0140b045" + "647641e79884eb87" ] ] }, { - "id": "fa51327f0140b045", + "id": "ee668e39d213070b", "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'routine_secondpass'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'datadog_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 630, - "y": 1600, + "x": 190, + "y": 3960, + "wires": [ + [ + "f93ce2d26953341f" + ] + ] + }, + { + "id": "647641e79884eb87", + "type": "function", + "z": "e43a27722b508115", + "name": "datadog_api_token", + "func": "var file = 'datadog_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3960, + "wires": [ + [] + ] + }, + { + "id": "ff2dea1ab9cb7776", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 4", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3960, + "wires": [ + [ + "815702499384f118", + "ee668e39d213070b" + ] + ] + }, + { + "id": "a1b81e7fe94ad4e5", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "", + "func": "import subprocess\nsubprocess.run([\"systemctl\",\"restart\",\"nodered\"])\nreturn msg", + "outputs": 1, + "x": 530, + "y": 3740, "wires": [ [] ] }, { - "id": "6841e5a392f0fb4f", + "id": "2f3a3c0e682ae862", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "restart_interface", + "group": "15edc2ce885dddb3", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Restart Interface", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 340, + "y": 3740, + "wires": [ + [ + "a1b81e7fe94ad4e5" + ] + ] + }, + { + "id": "fe62e12d458db2d4", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'cam_output_downscale'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'rotor_endstop_pushed'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = false;\n}\nelse{\n data = true;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 290, - "y": 2320, + "y": 2060, "wires": [ [ - "110216d678fad14f" + "96e2b45a7102156b" ] ] }, { - "id": "110216d678fad14f", + "id": "96e2b45a7102156b", "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Downscale output", + "z": "e43a27722b508115", + "name": "rotor_endstop_pushed", + "label": "", "tooltip": "", - "group": "93aadb71dee6d977", - "order": 6, - "width": 6, + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, "height": 1, "passthru": true, "decouple": "false", - "topic": "", - "topicType": "str", + "topic": "topic", + "topicType": "msg", "style": "", - "onvalue": "true", + "onvalue": "false", "onvalueType": "bool", "onicon": "", "oncolor": "", - "offvalue": "false", + "offvalue": "true", "offvalueType": "bool", "officon": "", "offcolor": "", "animate": false, "className": "", - "x": 450, - "y": 2320, + "x": 460, + "y": 2060, "wires": [ [ - "214d548d564f8ba2" + "df66caa5e0497e65" ] ] }, { - "id": "214d548d564f8ba2", + "id": "df66caa5e0497e65", "type": "function", - "z": "017bd4e4a428bee5", + "z": "e43a27722b508115", "name": "write", - "func": "var file = 'cam_output_downscale'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });\n \nmsg.enabled = msg.payload\nreturn msg", + "func": "var file = 'rotor_endstop_pushed'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 630, - "y": 2320, + "y": 2060, "wires": [ - [ - "1becbff4884b8c1a" - ] + [] ] }, { - "id": "8be1ca844a6caa54", - "type": "ui_slider", - "z": "017bd4e4a428bee5", - "name": "output_resolution", - "label": "", - "tooltip": "", - "group": "93aadb71dee6d977", - "order": 8, + "id": "aea4e51b20951560", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, "width": 3, "height": 1, - "passthru": false, - "outs": "end", - "topic": "", - "topicType": "str", - "min": "0.5", - "max": "20", - "step": "0.5", + "name": "rotor_endstop_pushed", + "label": "Reverse Endstop", + "format": "", + "layout": "row-left", "className": "", - "x": 450, - "y": 2360, + "x": 800, + "y": 2060, + "wires": [] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'meanwhile'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, "wires": [ [ - "a6b2c0a0604ccf14" + "e23c514008cad1a1" ] ] }, { - "id": "9ac09d89d791e953", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "93aadb71dee6d977", - "order": 7, - "width": 3, - "height": 1, - "name": "image_res", - "label": "Output Resolution (Mpx)", - "format": "", - "layout": "row-spread", - "className": "", - "x": 770, - "y": 2360, - "wires": [] + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] }, { - "id": "1becbff4884b8c1a", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadI", - "func": "var file = 'cam_output_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data)/1000000;\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 290, - "y": 2360, + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, "wires": [ [ - "8be1ca844a6caa54" + "4ce127c61c3c5966", + "beacc3dc5398fa79" ] ] }, { - "id": "a6b2c0a0604ccf14", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'cam_output_resolution'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload*1000000)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", + "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 630, - "y": 2360, + "x": 290, + "y": 220, "wires": [ [] ] }, { - "id": "f358de1e64b491bb", + "id": "beacc3dc5398fa79", "type": "link out", - "z": "017bd4e4a428bee5", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ - "b30d918661392ab3", - "44c598049cd533fd" + "38783aea9cc317a6" ], - "x": 635, - "y": 620, + "x": 195, + "y": 260, + "wires": [] + }, + { + "id": "e23c514008cad1a1", + "type": "debug", + "z": "a5557543ccff5889", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 480, + "y": 140, "wires": [] }, { "id": "b0629875a30ae1d7", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "get update", - "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", "outputs": 2, - "x": 350, - "y": 240, + "x": 390, + "y": 540, "wires": [ [ "1bbe2d769f42c313" @@ -10425,7 +9168,7 @@ { "id": "c7b6d05a62172432", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "ddbd496e.93a288", "order": 3, "width": 0, @@ -10435,19 +9178,19 @@ "format": "{{msg.status}}", "layout": "row-spread", "className": "", - "x": 170, - "y": 100, + "x": 210, + "y": 400, "wires": [] }, { "id": "fefe45404bdb19c4", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "check files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", "outputs": 1, - "x": 510, - "y": 260, + "x": 550, + "y": 560, "wires": [ [ "1bbe2d769f42c313", @@ -10458,14 +9201,14 @@ { "id": "d0104e0163745993", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "links": [ "960912e90ba5b5bc", "50eeb3e362f9027f" ], - "x": 75, - "y": 140, + "x": 115, + "y": 440, "wires": [ [ "ec30638407332e43", @@ -10477,7 +9220,7 @@ { "id": "ec30638407332e43", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadS", "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", "outputs": 1, @@ -10485,8 +9228,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 180, + "x": 210, + "y": 480, "wires": [ [ "2852023f3aa8db10" @@ -10496,7 +9239,7 @@ { "id": "2852023f3aa8db10", "type": "ui_dropdown", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "label": "", "tooltip": "", @@ -10510,21 +9253,26 @@ "options": [ { "label": "stable", - "value": "main", + "value": "stable", "type": "str" }, { "label": "beta", "value": "beta", "type": "str" + }, + { + "label": "meanwhile", + "value": "meanwhile", + "type": "str" } ], "payload": "", "topic": "topic", "topicType": "msg", "className": "", - "x": 300, - "y": 180, + "x": 340, + "y": 480, "wires": [ [ "1e10b387ee30c486" @@ -10534,7 +9282,7 @@ { "id": "1e10b387ee30c486", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "write", "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -10542,8 +9290,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 430, - "y": 180, + "x": 470, + "y": 480, "wires": [ [] ] @@ -10551,7 +9299,7 @@ { "id": "274129c51b0b87ef", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "ddbd496e.93a288", "order": 4, "width": 4, @@ -10561,14 +9309,14 @@ "format": "{{msg.payload}}", "layout": "row-spread", "className": "", - "x": 570, - "y": 180, + "x": 610, + "y": 480, "wires": [] }, { "id": "51cd8c8643e6b46a", "type": "ui_switch", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "label": "Auto-check update availability", "tooltip": "", @@ -10591,8 +9339,8 @@ "offcolor": "", "animate": false, "className": "", - "x": 370, - "y": 140, + "x": 410, + "y": 440, "wires": [ [ "1ab4c6b4b232a022" @@ -10602,7 +9350,7 @@ { "id": "38cbf7965d1c1834", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadB", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, @@ -10610,8 +9358,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 140, + "x": 210, + "y": 440, "wires": [ [ "51cd8c8643e6b46a" @@ -10621,7 +9369,7 @@ { "id": "1ab4c6b4b232a022", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "write", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", "outputs": 1, @@ -10629,8 +9377,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 570, - "y": 140, + "x": 610, + "y": 440, "wires": [ [] ] @@ -10638,7 +9386,7 @@ { "id": "ae92a328af306ebb", "type": "ui_toast", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "position": "dialog", "displayTime": "3", "highlight": "", @@ -10650,8 +9398,8 @@ "className": "", "topic": "", "name": "", - "x": 670, - "y": 260, + "x": 710, + "y": 560, "wires": [ [ "2de63e8e3ae5fb0c", @@ -10662,14 +9410,14 @@ { "id": "cbd0afc4aa7b302a", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "update status", "links": [ "1bbe2d769f42c313", "42061b28cff81f99" ], - "x": 75, - "y": 100, + "x": 115, + "y": 400, "wires": [ [ "c7b6d05a62172432", @@ -10680,20 +9428,20 @@ { "id": "1bbe2d769f42c313", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ "cbd0afc4aa7b302a" ], - "x": 625, - "y": 220, + "x": 665, + "y": 520, "wires": [] }, { "id": "7cf60615d93e696b", "type": "ui_button", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "group": "ddbd496e.93a288", "order": 7, @@ -10710,8 +9458,8 @@ "payloadType": "str", "topic": "topic", "topicType": "msg", - "x": 140, - "y": 260, + "x": 180, + "y": 560, "wires": [ [ "b0629875a30ae1d7" @@ -10721,12 +9469,12 @@ { "id": "2de63e8e3ae5fb0c", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "download files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", "outputs": 1, - "x": 840, - "y": 260, + "x": 880, + "y": 560, "wires": [ [ "42061b28cff81f99", @@ -10737,7 +9485,7 @@ { "id": "929281fef53e09f8", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "msg", "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", "outputs": 1, @@ -10745,8 +9493,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 810, - "y": 220, + "x": 850, + "y": 520, "wires": [ [ "42061b28cff81f99" @@ -10756,20 +9504,20 @@ { "id": "42061b28cff81f99", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ "cbd0afc4aa7b302a" ], - "x": 955, - "y": 220, + "x": 995, + "y": 520, "wires": [] }, { "id": "49f1ecb29a3f84f4", "type": "function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "loadB", "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", "outputs": 1, @@ -10777,8 +9525,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 170, - "y": 220, + "x": 210, + "y": 520, "wires": [ [ "b0629875a30ae1d7" @@ -10788,27 +9536,28 @@ { "id": "fe3a855fee9e28c6", "type": "link out", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "mode": "link", "links": [ - "9bb0adbd716ce347" + "9bb0adbd716ce347", + "01c882fcc51b349c" ], - "x": 955, - "y": 260, + "x": 995, + "y": 560, "wires": [] }, { "id": "5e7d5e4335d37794", "type": "link in", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "", "links": [ "960912e90ba5b5bc", "50eeb3e362f9027f" ], - "x": 55, - "y": 400, + "x": 95, + "y": 700, "wires": [ [ "2bb5fe78e09fec8a" @@ -10818,12 +9567,12 @@ { "id": "2bb5fe78e09fec8a", "type": "python3-function", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "name": "msg", "func": "\nfrom subprocess import getoutput\nimport os\n\nmsg['os'] = getoutput(\"cat /etc/os-release | grep -i 'PRETTY_NAME'\")[13:-1]\nmsg['device'] = getoutput(\"cat /proc/device-tree/model\")\nmsg['flask'] = getoutput(\"systemctl status flask |grep -i 'Active:'\").split(' ')[6]\nmsg['osdate'] = getoutput(\"vcgencmd version\").split('\\n')[0]\nmsg['temp'] = getoutput(\"vcgencmd measure_temp\").split('=')[1]\ncpu_total = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $2}'\")\ncpu_used = getoutput(\"free -m | head -n2 | tail -n1 |awk '{print $3}'\")\nswap_total = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $2}'\")\nswap_used = getoutput(\"free -m | head -n3 | tail -n1 |awk '{print $3}'\")\ndiskspace_used = getoutput(\"df -h / | tail -n1 |awk '{print $3}'\")\ndiskspace_total = getoutput(\"df -h / | tail -n1 |awk '{print $2}'\")\n\nmsg['cpu'] = cpu_used + '/' + cpu_total + 'MB'\nmsg['swap'] = swap_used + '/' + swap_total + 'MB'\nmsg['diskspace'] =diskspace_used + '/' + diskspace_total\n\nif msg['flask'] == 'inactive':\n os.system('systemctl restart flask')\n\nreturn msg", "outputs": 1, - "x": 170, - "y": 400, + "x": 210, + "y": 700, "wires": [ [ "dbc77052ac950624", @@ -10841,7 +9590,7 @@ { "id": "d97c3068ef5fef96", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 2, "width": 0, @@ -10851,14 +9600,14 @@ "format": "{{msg.os}}", "layout": "row-spread", "className": "", - "x": 450, - "y": 440, + "x": 490, + "y": 740, "wires": [] }, { "id": "73a3b828f862312b", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 8, "width": 0, @@ -10868,14 +9617,14 @@ "format": "{{msg.flask}}", "layout": "row-spread", "className": "", - "x": 450, - "y": 480, + "x": 490, + "y": 780, "wires": [] }, { "id": "dbc77052ac950624", "type": "ui_text", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "order": 1, "width": 0, @@ -10885,59 +9634,17 @@ "format": "{{msg.device}}", "layout": "row-spread", "className": "", - "x": 460, - "y": 400, + "x": 500, + "y": 700, "wires": [] }, - { - "id": "4c7fa5b5b27b83a5", - "type": "python3-function", - "z": "c8e7ecb5849edb9a", - "name": "create beta new", - "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'beta'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\ndel msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/Arducam.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/Arducam.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/OpenScan.py'\nmsg[scope]['3']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/config.txt'\nmsg[scope]['4']['dst'] = '/boot/config.txt'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/flows.json'\nmsg[scope]['5']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['6'] = {}\nmsg[scope]['6']['src'] = scope + '/settings.js'\nmsg[scope]['6']['dst'] = '/root/.node-red/settings.js'\n\nmsg[scope]['7'] = {}\nmsg[scope]['7']['src'] = 'files/logo.jpg'\nmsg[scope]['7']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", - "outputs": 1, - "x": 300, - "y": 820, - "wires": [ - [] - ] - }, - { - "id": "80175eb8dc6ad009", - "type": "inject", - "z": "c8e7ecb5849edb9a", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "", - "payloadType": "date", - "x": 140, - "y": 820, - "wires": [ - [ - "4c7fa5b5b27b83a5" - ] - ] - }, { "id": "3f42560297fe6978", "type": "ui_template", - "z": "c8e7ecb5849edb9a", + "z": "a5557543ccff5889", "group": "3ce32450.e0cffc", "name": "Download LOG", - "order": 9, + "order": 10, "width": 6, "height": 1, "format": "OpenScanCloud is a free/donation-based cloud processing service, which will convert your photos into 3d models using latest photogrammetry technology. Feel free to support the project with a small donation at BuyMeACoffee.
The only requirement to use this service is a one-time, free-of-charge registration (which is solely an anti-spam measure). By filling out the registration form, you will receive an individual access token.
Register
In order to use the OpenScanCloud, you will have to enter your name and email. It might take 1-3 days to create the access token, which will be sent to your mail address. Please check your spam folder.
Enter Token
Please enter your individual token here in order to activate the cloud functionality. The token will be verified immediately. In case of any problems, please contact cloud@openscan.eu
Terms
Please read the terms of use to understand what will happen to your data, when using the OpenScanCloud service.
Token
A shorted version of your token will be displayed here. Please include a copy of this shorted token in any support requests cloud@openscan.eu
Credit (GB)
Each token comes with a given amount of 'credit' which is another measure against spam. The given number in Gigabyte indicates the amount of data, that you can process on the servers.
IMPORTANT: The credit can be increased at any time by sending a (nice) mail to cloud@openscan.eu
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 250, - "y": 120, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "1969c709ef2fd1d5", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 7, - "width": 0, - "height": 0, - "name": "", - "label": "Credit (GB):", - "format": "{{msg.credit}}", - "layout": "row-spread", - "className": "", - "x": 730, - "y": 1140, - "wires": [] - }, - { - "id": "397ab7f44b893c89", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "OSCparameters", - "links": [ - "960912e90ba5b5bc", - "9c51aa678f16980f", - "b42e061fb1f1f3d7" - ], - "x": 465, - "y": 1140, - "wires": [ - [ - "a7fd00943edc380b" - ] - ] - }, - { - "id": "bf6d941ad307ce22", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 270, - "y": 960, - "wires": [ - [ - "f22dfef37d5de773" - ] - ] - }, - { - "id": "f22dfef37d5de773", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "import re\n\nif msg['payload'] == 'Cancel':\n return\n\nmail = msg['payload']\nemail_regex = re.compile(r\"[^@]+@[^@]+\\.[^@]+\")\n\nif email_regex.match(mail) != None:\n msg['mail'] = mail\n msg['topic'] = 'OpenScanCloud Registration (2/3)'\n msg['payload'] = 'Enter your first name'\n return msg\nmsg['payload'] = 'invalid input'\nreturn None,msg\n", - "outputs": 2, - "x": 410, - "y": 960, - "wires": [ - [ - "54602ee49ca022e7" - ], - [ - "1505f3e72f971081" - ] - ] - }, - { - "id": "1505f3e72f971081", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 550, - "y": 1000, - "wires": [ - [] - ] - }, - { - "id": "54602ee49ca022e7", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 550, - "y": 960, - "wires": [ - [ - "f9efcb87b74abbd4" - ] - ] - }, - { - "id": "510dbe4d76253bd6", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "SUBMIT", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 830, - "y": 960, - "wires": [ - [ - "600b2306caed1640" - ] - ] - }, - { - "id": "600b2306caed1640", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "import requests\nimport os\nfrom OpenScan import OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\nmsg['lastname'] = msg['payload']\n\nmsg2 = {}\n\nfor i in ['forename','lastname','mail']:\n msg2[i] = msg[i]\n\nr = OpenScanCloud('requestToken',msg2)\n\nstatus = r.status_code\n\nmsg['topic'] = 'OpenScanCloud Registration - Success'\nmsg['payload'] = 'registration done, you will get an email with your token within the next one or two days :)'\n\nif status != 200:\n msg['topic'] = 'OpenScanCloud Registration - Failed'\n msg['payload'] = 'Registration failed, please try again.'\n\nmsg['status'] = status\n\nreturn msg", - "outputs": 1, - "x": 970, - "y": 960, - "wires": [ - [ - "bbad1ab5f8f63fb7" - ] - ] - }, - { - "id": "d34cd203725bac15", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Register", - "group": "3b4bd36726be16d5", - "order": 5, - "width": 2, - "height": 1, - "passthru": false, - "label": "Register", - "tooltip": "", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "Please enter your email address:", - "payloadType": "str", - "topic": "Requesting an OpenScanCloud Token", - "topicType": "str", - "x": 120, - "y": 960, - "wires": [ - [ - "bf6d941ad307ce22" - ] - ] - }, - { - "id": "bbad1ab5f8f63fb7", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 1110, - "y": 960, - "wires": [ - [] - ] - }, - { - "id": "a7fd00943edc380b", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "from OpenScan import load_int\n\nmsg = {}\n\ntry:\n msg['credit'] = float(int(load_int('osc_credit')/10000000))/100\n return msg\nexcept:\n pass", - "outputs": 1, - "x": 590, - "y": 1140, - "wires": [ - [ - "1969c709ef2fd1d5" - ] - ] - }, - { - "id": "f99ec8781a33ec7d", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "msg.payload = 'This is a free piece of software and it is provided as is, without any warranty.Refresh
You can refresh the status of the processing of your files in the OpenScanCloud. Make sure to read and agree the terms of use (in settings menu) before using the OpenScanCloud. Do not spam this button, as this might lead to temporary/permanent suspension of your IP address.
The status (in the table) of the individual sets in the file list will be updated to one of the following:
Created - you started the upload of your image set. If you are stuck on this status, please try to restart the upload.
Initialized - all files have been uploaded and processing will start as soon as possible
File approved - the server received and verified your files
Processing started - your files are currently being processed
Processing failed - there are various reasons why processing might fail. Please check the email for more details or contact me at cloud@openscan.eu
processing done - check your email, where you should find a link to the 3d model :)
Status (on the right column)
Indicates, what the device is currently up to.
Refreshing - updating all image set's status
Uploading - while transferring the image set to the OpenScanCloud servers. If the upload freezes, be patient. If nothing happens, reboot the device and restart the upload.
Project started - when the upload of a set was successful
Zipping - files larger then 200mb have to be split and re-zipped before uploading to the OpenScanCloud, the process might take a while depending on the filesize.
Combining - two sets into one might take up to a minute.
Set
select a set from the file list by clicking on a row in the table
Download
Download the selected set from the OpenScan device to your computer/mobile/tablet
Upload
Upload the selected file to the OpenScanCloud
Combine
In order to combine two sets, select one set. Click the combine button and select the second set. A pop-up will appear, and you can confirm the operation. All images from the two sets will be merged into one set. The original image sets will be deleted!
Delete Set/All
Please keep in mind, that the memory of the SD card is relatively small, and thus you will have to delete individual or all photo sets from time to time.
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 470, - "y": 160, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "e9677b85856b5873", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "Reset rfkill", - "func": "from os import system\nif \"Interface doesn't support scanning\" in msg['payload']:\n system('rfkill unblock all')\n system('sudo ifconfig wlan0 up')\n return msg", - "outputs": 1, - "x": 410, - "y": 740, - "wires": [ - [] - ] - }, - { - "id": "9b2bc9849aee310b", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "changeHostname", - "links": [ - "ec2db55a99bbe3ee", - "d5175561293ef490", - "960912e90ba5b5bc" - ], - "x": 855, - "y": 580, - "wires": [ - [ - "8b9e3781511e9231" - ] - ] - }, - { - "id": "8b9e3781511e9231", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "chk", - "func": "with open('/etc/hostname', 'r') as file:\n old_hostname = file.read().replace('\\n','')\nif old_hostname == 'raspberrypi':\n msg['hostname'] = 'openscan'\n msg['payload'] = 'OK'\n return msg", - "outputs": 1, - "x": 950, - "y": 580, - "wires": [ - [ - "ebce67b739d1891f" - ] - ] - }, - { - "id": "65b38bfeb3fee710", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 175, - "y": 420, - "wires": [ - [ - "cc3cb10f2ea3f8b8" - ] - ] - }, - { - "id": "d3fc91d87d5d5f62", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 155, - "y": 620, - "wires": [ - [ - "725fd0cab0bddc0e" - ] - ] - }, - { - "id": "cc9c4092edeb43cc", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "enable projectname", - "links": [ - "960912e90ba5b5bc" - ], - "x": 155, - "y": 700, - "wires": [ - [ - "27c6b221c90ed9e1" - ] - ] - }, - { - "id": "80bccc884b0be297", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "38783aea9cc317a6" - ], - "x": 1435, - "y": 300, - "wires": [] - }, - { - "id": "25426d3582cc1236", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Enter Tk", - "group": "3b4bd36726be16d5", - "order": 3, - "width": 2, - "height": 1, - "passthru": false, - "label": "Enter Token", - "tooltip": "testtesttest", - "color": "", - "bgcolor": "", - "className": "", - "icon": "", - "payload": "Please enter your OpenScanCloud Token:", - "payloadType": "str", - "topic": "Token", - "topicType": "str", - "x": 120, - "y": 1060, - "wires": [ - [ - "c690fed61878ce83" - ] - ] - }, - { - "id": "c690fed61878ce83", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "prompt", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "Cancel", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 270, - "y": 1060, - "wires": [ - [ - "781f672b78ea70b2" - ] - ] - }, - { - "id": "781f672b78ea70b2", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "save", - "func": "import requests\nimport os\nfrom OpenScan import save, OpenScanCloud\n\nif msg['payload'] == 'Cancel':\n return\n\ntoken = msg['payload']\n\nif len(msg['payload']) >=14:\n try:\n r = OpenScanCloud('getTokenInfo', {'token':token})\n if r.status_code != 200:\n msg['topic'] = 'Error'\n msg['payload'] = 'Invalid Token'\n return msg \n \n msg1 = r.json()\n save('osc_credit',msg1['credit'])\n save('osc_limit_filesize',msg1['limit_filesize'])\n save('osc_limit_photos',msg1['limit_photos'])\n save('token',token)\n msg['topic'] = 'Success'\n msg['payload'] = 'Token verified and saved'\n except:\n msg['topic'] = 'Error'\n msg['payload'] = 'Could not verify token, please check your internet connection.'\n return msg \n\n\nelse:\n msg['topic'] = 'Error'\n msg['payload'] = 'Invalid tokenformat'\n\nreturn msg", - "outputs": 1, - "x": 430, - "y": 1060, - "wires": [ - [ - "5e4b3bdb0a26052d", - "4faf2fbd3cf6aa3a", - "a7fd00943edc380b" - ] - ] - }, - { - "id": "6d2c65d7e1d928ce", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 6, - "width": 0, - "height": 0, - "name": "", - "label": "Token", - "format": "{{msg.payload}}", - "layout": "row-spread", - "className": "", - "x": 710, - "y": 1100, - "wires": [] - }, - { - "id": "5e4b3bdb0a26052d", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "text", - "func": "from OpenScan import load_str\n\ntoken = load_str('token')[0:8]\nmsg['payload']= token + '...'\nif len(token)==0:\n msg['payload']=\"enter token\"\nreturn msg", - "outputs": 1, - "x": 590, - "y": 1100, - "wires": [ - [ - "6d2c65d7e1d928ce" - ] - ] - }, - { - "id": "e0965e490d53617f", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "token", - "links": [ - "960912e90ba5b5bc" - ], - "x": 465, - "y": 1100, - "wires": [ - [ - "5e4b3bdb0a26052d" - ] - ] - }, - { - "id": "4faf2fbd3cf6aa3a", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 610, - "y": 1060, - "wires": [ - [] - ] - }, - { - "id": "36b3b36c399ac7db", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "get update", - "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", - "outputs": 2, - "x": 310, - "y": 1380, - "wires": [ - [ - "1d9f24f41817a2de" - ], - [ - "0c1d054fa7f2afe8" - ] - ] - }, - { - "id": "48cd023b07c39a94", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 20, - "width": 0, - "height": 0, - "name": "", - "label": "Status:", - "format": "{{msg.status}}", - "layout": "row-spread", - "className": "", - "x": 170, - "y": 1300, - "wires": [] - }, - { - "id": "0c1d054fa7f2afe8", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "check files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\nfrom time import sleep\n\nsleep(1)\n\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter # new file counter\n\nreturn msg\n", - "outputs": 1, - "x": 470, - "y": 1400, - "wires": [ - [ - "1d9f24f41817a2de", - "7097687ddcc4fa8e" - ] - ] - }, - { - "id": "612a7556ab11cf7d", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "", - "links": [ - "960912e90ba5b5bc" - ], - "x": 75, - "y": 1340, - "wires": [ - [ - "e447af84ecc540ad", - "72ca6c281c43acd7", - "dadf823225aa34c4", - "9df2481a03f24d0a" - ] - ] - }, - { - "id": "7097687ddcc4fa8e", - "type": "ui_toast", - "z": "017bd4e4a428bee5", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "NO", - "cancel": "YES", - "raw": false, - "className": "", - "topic": "", - "name": "", - "x": 630, - "y": 1420, - "wires": [ - [ - "f9fe26a38501bcad", - "77859c0059f8a49e" - ] - ] - }, - { - "id": "9112e8b2865ea436", - "type": "link in", - "z": "017bd4e4a428bee5", - "name": "update status", - "links": [ - "1d9f24f41817a2de", - "26dae88a383eee97" - ], - "x": 75, - "y": 1300, - "wires": [ - [ - "48cd023b07c39a94" - ] - ] - }, - { - "id": "1d9f24f41817a2de", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "9112e8b2865ea436" - ], - "x": 575, - "y": 1380, - "wires": [] - }, - { - "id": "f9fe26a38501bcad", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "download files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", - "outputs": 1, - "x": 800, - "y": 1440, - "wires": [ - [ - "26dae88a383eee97", - "d663dd83d71b8693" - ] - ] - }, - { - "id": "77859c0059f8a49e", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "msg", - "func": "if (msg.payload == 'YES'){\n msg.status = 'Installing updates'\n return msg}", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 770, - "y": 1400, - "wires": [ - [ - "26dae88a383eee97" - ] - ] - }, - { - "id": "26dae88a383eee97", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "9112e8b2865ea436" - ], - "x": 925, - "y": 1400, - "wires": [] - }, - { - "id": "e447af84ecc540ad", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadB", - "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\n\nmsg.payload = data\n\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 170, - "y": 1380, - "wires": [ - [ - "36b3b36c399ac7db" - ] - ] - }, - { - "id": "d663dd83d71b8693", - "type": "link out", - "z": "017bd4e4a428bee5", - "name": "", - "mode": "link", - "links": [ - "9bb0adbd716ce347" - ], - "x": 925, - "y": 1440, - "wires": [] - }, - { - "id": "444acd32e7578254", - "type": "python3-function", - "z": "017bd4e4a428bee5", - "name": "create beta new", - "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'mini'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\ntry:\n del msg[scope]\nexcept:\n pass\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/Arducam.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/Arducam.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/OpenScan.py'\nmsg[scope]['3']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/config.txt'\nmsg[scope]['4']['dst'] = '/boot/config.txt'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/flows.json'\nmsg[scope]['5']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['6'] = {}\nmsg[scope]['6']['src'] = scope + '/settings.js'\nmsg[scope]['6']['dst'] = '/root/.node-red/settings.js'\n\nmsg[scope]['7'] = {}\nmsg[scope]['7']['src'] = 'files/logo.jpg'\nmsg[scope]['7']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", - "outputs": 1, - "x": 280, - "y": 1780, - "wires": [ - [ - "7f097823a90facb6" - ] - ] - }, - { - "id": "7f097823a90facb6", - "type": "debug", - "z": "017bd4e4a428bee5", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "statusVal": "", - "statusType": "auto", - "x": 430, - "y": 1780, - "wires": [] - }, - { - "id": "e547e40ff805742b", - "type": "inject", - "z": "017bd4e4a428bee5", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "", - "payloadType": "date", - "x": 120, - "y": 1780, - "wires": [ - [ - "444acd32e7578254" - ] - ] - }, - { - "id": "5fe2d831c3ab1cf4", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 570, - "y": 1340, - "wires": [ - [] - ] - }, - { - "id": "154716c51aae2b87", - "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Auto-check update availability", - "tooltip": "", - "group": "3b4bd36726be16d5", - "order": 21, - "width": 6, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "topicType": "str", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "animate": false, - "className": "", - "x": 370, - "y": 1340, - "wires": [ - [ - "5fe2d831c3ab1cf4" - ] - ] - }, - { - "id": "72ca6c281c43acd7", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadB", - "func": "var file = 'update_auto'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 170, - "y": 1340, - "wires": [ - [ - "154716c51aae2b87" - ] - ] - }, - { - "id": "a0e996cbd2b18363", - "type": "comment", - "z": "017bd4e4a428bee5", - "name": "Updates", - "info": "", - "x": 120, - "y": 1240, - "wires": [] - }, - { - "id": "0dcf979b126c3e33", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 1, - "width": 4, - "height": 1, - "name": "", - "label": "", - "format": "OPENSCANCLOUD", - "layout": "col-center", - "className": "", - "x": 290, - "y": 900, - "wires": [] - }, - { - "id": "50ab351d92165de8", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 9, - "width": 4, - "height": 1, - "name": "", - "label": "", - "format": "NETWORK SETTINGS", - "layout": "col-center", - "className": "", - "x": 270, - "y": 560, - "wires": [] - }, - { - "id": "726819d40397f3ce", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Wifi", - "group": "3b4bd36726be16d5", - "order": 10, - "width": 2, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "Hostname
The device can be accessed through any browser in the same network. Therefore, you can either enter the device's IP address or the given hostname. The standard name is 'openscan' but it is highly recommended to change the name, when using multiple devices (e.g. 'openscan1', 'openscan2' ...)
Select Wifi
After booting, the device will automatically search for available wireless networks and create a list. You can connect to a given network by entering the wifi password and country code. To find the right two-character country code, see the following list: ISO 3166 Country Code on Wikipedia
Search Wifi
You can manually refresh the list of available networks by pressing this button.
Reset Wifi
Delete the list of known wireless networks (and passwords) and reset the default. After this step, you will either need to use Ethernet or a modified wpa_supplicant.conf file. (see glennklockwood.com for more details about the wpa_supplicant.conf file, which has to be manually created and placed into the /boot/ directory of the sd-card)
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 250, - "y": 160, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "d07e9c092f0855eb", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 16, - "width": 4, - "height": 1, - "name": "", - "label": "", - "format": "UPDATES", - "layout": "col-center", - "className": "", - "x": 270, - "y": 1240, - "wires": [] - }, - { - "id": "a85de9dee94dc786", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Updates&LOG", - "group": "3b4bd36726be16d5", - "order": 17, - "width": 2, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 280, - "y": 200, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "2968c5996fb6d98c", - "type": "ui_template", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "name": "Download LOG", - "order": 25, - "width": 6, - "height": 1, - "format": "Current Status
--READY-- - everything is okay and ready to go :)
Routine-preparing - before starting the routine some time might pass depending on the number of photos
Routine-stopping - manually ending the routine by pressing the stop button
Routine-Photo X/Y - Showing the progress of the routine
No Camera Found - please check the camera ribbon cable
Error: XXX - Please contact info@openscan.eu or post an issue on Github.com
Projectname
Each photo set will be saved using the following pattern YYYY-MM-DD_hh-mm-ss_projectname.zip (e.g. 2022-04-05_12.12.12_toysoldier.zip). Keep your files organized by giving each set a new projectname. If not specified 'default' will be used.
Rotor
Moving the rotor by increments of 5°. Please make sure to start the routine with the camera in the horizontal position.
Turntable
Moving the turntable by increments of 15°.
Ringlight
Use the ring light for shadow-free illumination. It is highly recommended to use the polarizer in order to avoid reflections. Note, that the polarizer will absorb 75% of the light, so you might need to use both ring lights.
Photos
Set the number of photos for the current set. 60-120 photos should be more than enough for most objects. If the reconstruction fails or is very bad with 60 photos, increasing the number of photos will not help!
Shutter
Again: Less is more! If the value is too high, some areas might get overexposed and thus, the software will not be able to recognize the surface feature of the object. Here are some reference values:
- no polarizer: 5-20ms
- mostly white object, with polarizer + one ringlight: 50-200ms
Crop X/Y
Make sure to use the right object holder to place the object in the middle of the screen. Try to crop as many unnecessary areas as possible. This will greatly lower the file size and resulting transfer and reconstruction times!
Start/Stop
Use the buttons to start/stop the routine
Reboot/Shutdown
In case of an error, try to restart the device. Always use the shutdown button before powering-off the device!
MF - Manual Focus
By default, the switch is 'off', which means that autofocus is active. For small objects, it might be necessary to use manual focus: activate the switch and set the focus by pressing + and - accordingly. The distance is measured between the camera lens and the focal plane (which should be in the center or slightly in front of the center of the object).
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 470, - "y": 200, - "wires": [ - [ - "f304680180a23479" - ] - ] - }, - { - "id": "dadf823225aa34c4", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadB", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 170, - "y": 1620, - "wires": [ - [ - "60f6ee795446200d" - ] - ] - }, - { - "id": "60f6ee795446200d", - "type": "ui_switch", - "z": "017bd4e4a428bee5", - "name": "", - "label": "Turntable Mode", - "tooltip": "", - "group": "3b4bd36726be16d5", - "order": 26, - "width": 6, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "topicType": "str", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "animate": false, - "className": "", - "x": 320, - "y": 1620, - "wires": [ - [ - "227d89d897a8bdf5" - ] - ] - }, - { - "id": "227d89d897a8bdf5", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'turntable_mode'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 470, - "y": 1620, - "wires": [ - [] - ] - }, - { - "id": "8b317478e9d905b8", - "type": "ui_button", - "z": "017bd4e4a428bee5", - "name": "Other Settings", - "group": "3b4bd36726be16d5", - "order": 24, - "width": 2, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "transparent", - "className": "", - "icon": "fa-question-circle", - "payload": "Hostname
The device can be accessed through any browser in the same network. Therefore, you can either enter the device's IP address or the given hostname. The standard name is 'openscan' but it is highly recommended to change the name, when using multiple devices (e.g. 'openscan1', 'openscan2' ...)
Select Wifi
After booting, the device will automatically search for available wireless networks and create a list. You can connect to a given network by entering the wifi password and country code. To find the right two-character country code, see the following list: ISO 3166 Country Code on Wikipedia
Search Wifi
You can manually refresh the list of available networks by pressing this button.
Reset Wifi
Delete the list of known wireless networks (and passwords) and reset the default. After this step, you will either need to use Ethernet or a modified wpa_supplicant.conf file. (see glennklockwood.com for more details about the wpa_supplicant.conf file, which has to be manually created and placed into the /boot/ directory of the sd-card)
", - "payloadType": "str", - "topic": "topic", - "topicType": "msg", - "x": 280, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "814eaca62debe694", - "type": "ui_text", - "z": "017bd4e4a428bee5", - "group": "3b4bd36726be16d5", - "order": 23, - "width": 4, - "height": 1, - "name": "", - "label": "", - "format": "OTHER SETTINGS", - "layout": "col-center", - "className": "", - "x": 170, - "y": 1580, - "wires": [] - }, - { - "id": "9df2481a03f24d0a", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "loadS", - "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\n\nmsg.payload = String(data.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\nreturn msg", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 170, - "y": 1660, - "wires": [ - [ - "ecba1ecce99e3968" - ] - ] - }, - { - "id": "f1de798f2a68e76e", - "type": "function", - "z": "017bd4e4a428bee5", - "name": "write", - "func": "var file = 'update_type'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 470, - "y": 1660, - "wires": [ - [] - ] - }, - { - "id": "ecba1ecce99e3968", - "type": "ui_dropdown", - "z": "017bd4e4a428bee5", - "name": "Update_select", - "label": "", - "tooltip": "", - "place": "Select version", - "group": "3b4bd36726be16d5", - "order": 19, - "width": 0, - "height": 0, - "passthru": false, - "multiple": false, - "options": [ - { - "label": "Mini_simplified", - "value": "mini", - "type": "str" - }, - { - "label": "Advanced", - "value": "main", - "type": "str" - }, - { - "label": "Beta", - "value": "beta", - "type": "str" - } - ], - "payload": "", - "topic": "topic", - "topicType": "msg", - "className": "", - "x": 320, - "y": 1660, - "wires": [ - [ - "f1de798f2a68e76e" - ] - ] - } -] \ No newline at end of file diff --git a/update/stable/OpenScan.py b/update/stable/OpenScan.py new file mode 100644 index 0000000..681c78d --- /dev/null +++ b/update/stable/OpenScan.py @@ -0,0 +1,316 @@ +basepath = '/home/pi/OpenScan/' +from os.path import isfile +import os + +def load_bool(name): + filename = basepath+'settings/'+name + if not isfile(filename): + return + with open(filename, 'r') as file: + value = file.read().replace('\n','') + if value == '1' or value == 'True' or value =='true': + value = True + else: + value = False + return value + +def fade_led(pin_led, fade_steps, duty_max, dir = True): + import RPi.GPIO as GPIO + import time + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(pin_led, GPIO.OUT) + pwm = GPIO.PWM(pin_led, 200) + + if dir: + pwm.start(0) + for duty_cycle in range(0, fade_steps*10, 1): # Increase duty cycle in steps + pwm.ChangeDutyCycle(duty_max*duty_cycle/(10*fade_steps)) + time.sleep(0.001) # Pause between steps (adjust as needed) + else: + pwm.start(duty_max) + for duty_cycle in range(fade_steps*10,0, -1): # Increase duty cycle in steps + pwm.ChangeDutyCycle(duty_max*duty_cycle/(10*fade_steps)) + time.sleep(0.001) # Pause between steps (adjust as needed) + pwm.stop() + + +def check_hotspot_mode(interface="wlan0"): + import subprocess + try: + output = subprocess.check_output(["iwconfig", interface]).decode("utf-8") + if "Mode:Master" in output: + return True + elif "Mode:Managed" in output: + return False + else: + return False + except subprocess.CalledProcessError as e: + return False + + + +def add_wifi_network(ssid, password, country): + import re + conf_file = "/etc/wpa_supplicant/wpa_supplicant-wlan0.conf" + + if not os.path.exists(conf_file): + return False + + if not (ssid and password and country): + return False + + with open(conf_file, "r") as f: + content = f.read() + + updated_content = re.sub(r'country=\w+', f'country={country}', content) + + if f'ssid="{ssid}"' in content: + network_block_pattern = re.compile( + r'network=\{\s*ssid="' + re.escape(ssid) + r'".*?psk=".*?".*?\}', re.DOTALL + ) + updated_network_block = f'network={{\n ssid="{ssid}"\n psk="{password}"\n key_mgmt=WPA-PSK\n}}' + updated_content = network_block_pattern.sub(updated_network_block, updated_content) + else: + network_block = f'\nnetwork={{\n ssid="{ssid}"\n psk="{password}"\n key_mgmt=WPA-PSK\n}}\n' + updated_content += network_block + + with open(conf_file, "w") as f: + f.write(updated_content) + os.system("sudo systemctl restart wpa_supplicant@wlan0") + + return True + + +def load_str(name): + filename = basepath+'settings/'+name + if not isfile(filename): + return + with open(filename, 'r') as file: + value = file.read().replace('\n','') + return value + +def load_int(name): + filename = basepath+'settings/'+name + if not isfile(filename): + return + with open(filename, 'r') as file: + value = int(file.read().replace('\n','')) + return value + +def load_float(name): + filename = basepath+'settings/'+name + if not isfile(filename): + return + with open(filename, 'r') as file: + value = float(file.read().replace('\n','')) + return value + +def save(name, value): + filename = basepath+'settings/'+name + with open(filename, 'w+') as file: + file.write(str(value)) + return + +def OpenScanCloud(cmd, msg): + from requests import get + osc_user = 'openscan' + osc_pw = 'free' + osc_server = 'http://openscanfeedback.dnsuser.de:1334/' + + try: + r = get(osc_server + cmd, auth=(osc_user, osc_pw), params=msg) + except: + r = type('obj', (object,), {'status_code' : 404, 'text':None}) + return r + +def camera(cmd, msg = {}): + from requests import get + flask = 'http://127.0.0.1:1312/' + try: + r = get(flask + cmd, params=msg) + return r.status_code + except: + return 400 + +def motorrun(motor,angle,ES_enable=False,ES_start_state = True): + #motor can be "rotor", "tt" or "extra" + import RPi.GPIO as GPIO + from time import sleep + from math import cos + msg = {'cmd':'set'} + + GPIO.setwarnings(False) + GPIO.setmode(GPIO.BCM) + + spr = load_int(motor + '_stepsperrotation') + dirpin = load_int('pin_' + motor + '_dir') + steppin = load_int('pin_' + motor +'_step') + ES_pin = load_int('pin_' + motor + '_endstop') + dir = load_int(motor + '_dir') + ramp = load_int(motor + '_accramp') + acc = load_float(motor + '_acc') + delay_init = load_float(motor + '_delay') + delay = delay_init + + step_count=int(angle*spr/360) * dir + GPIO.setup(dirpin, GPIO.OUT) + GPIO.setup(steppin, GPIO.OUT) + GPIO.setup(ES_pin, GPIO.IN, pull_up_down = GPIO.PUD_UP) + + if (step_count>0): + GPIO.output(dirpin, GPIO.HIGH) + if(step_count<0): + GPIO.output(dirpin, GPIO.LOW) + step_count=-step_count + for x in range(step_count): + if ES_enable == True and GPIO.input(ES_pin) != ES_start_state: + i = 0 + while i <= 10: + if GPIO.input(ES_pin) == ES_start_state: + i = 11 + if i == 10: + return + i = i + 1 + + GPIO.output(steppin, GPIO.HIGH) + if x<=ramp and x<=step_count/2: + delay = delay_init * (1 + -1/acc*cos(1*(ramp-x)/ramp)+1/acc) + #delay=delay_init+(ramp-x)*(delay_init)/acc + elif step_count-x<=ramp and x>step_count/2: + delay = delay_init * (1-1/acc*cos(1*(ramp+x-step_count)/ramp)+1/acc) + #delay=delay_init+(ramp-step_count+x)*(delay_init)/acc + else: + delay = delay_init + sleep(delay) + GPIO.output(steppin, GPIO.LOW) + sleep(delay) + +def ringlight(number,state): + import RPi.GPIO as GPIO + msg = {'cmd':'set'} + pin = load_int('pin_ringlight' + str(number)) + GPIO.setwarnings(False) + GPIO.setmode(GPIO.BCM) + GPIO.setup(pin, GPIO.OUT) + GPIO.output(pin, state) + +def take_photo(file): + from os import system + filepath = basepath + file + + model=load_str('model') + + + + shutter = str(load_int('cam_shutter')) + saturation = load_str('cam_saturation') + contrast = load_str('cam_contrast') + awbg_red = load_str('cam_awbg_red') + awbg_blue = load_str('cam_awbg_blue') + gain = load_str('cam_gain') + quality = load_int('cam_jpeg_quality') + filepath2 = '/home/pi/OpenScan/tmp/tmp.jpg' + #width = load_str('cam_resx') + #height = load_str('cam_resy') + timeout = load_str('cam_timeout') + cropx = load_int('cam_cropx')/200 + cropy = load_int('cam_cropy')/200 + rotation = load_int('cam_rotation') + AF = load_bool('cam_AFmode') + camera = load_str('camera') + + + if camera == 'imx519' and AF == True: + autofocus = ' --autofocus ' + else: + autofocus = '' + + if camera == "usb_webcam": + cmd = 'fswebcam -i 0 -r "1280x720" -F 5 --no-banner --jpeg 95 --save ' + filepath2 + else: + cmd = 'libcamera-still -n --denoise off --sharpness 0 -o ' + filepath2 + ' -t ' + timeout +' --shutter ' + shutter + ' --saturation ' + saturation + ' --contrast ' + contrast + ' --awbgains '+awbg_red + "," + awbg_blue + ' --gain ' + gain + ' -q ' + str(quality) + autofocus + ' >/dev/null 2>&1' + # cmd = 'libcamera-still -n --denoise off --sharpness 0 -o ' + filepath2 + ' -t ' + timeout +' --shutter ' + shutter + ' --saturation ' + saturation + ' --contrast ' + contrast + ' --awbgains '+awbg_red + "," + awbg_blue + ' --gain ' + gain + ' -q ' + str(quality) + autofocus + + system(cmd) + return cmd + +def get_points(samples=1): + from math import pi, sqrt, acos, atan2, cos, sin + + points = [] + phi = pi * (3. - sqrt(5.)) + for i in range(int(samples)): + y = 1 - (i / float(samples - 1)) * 2 + radius = sqrt(1 - y * y) + theta = phi * i + x = cos(theta) * radius + z = sin(theta) * radius + r=sqrt(x*x+y*y+z*z) + theta_neu=acos(z/r)*180/pi + phi_neu=atan2(y,x)*180/pi + points.append((theta_neu-90,phi_neu)) + points.sort() + return points + +def create_coordinates(angle_min, angle_max,point_count): + point_count_final=point_count + if angle_max < angle_min: + a = angle_min + angle_min = angle_max + angle_max = a + point_count=point_count*90/(angle_max-angle_min) + actual_points=0 + while actual_pointsPLEASE READ :)
\nModifying the advanced settings can potentially damage your device and/or the connected peripherals.
\nPlease read the given information texts carefully and only change settings, when you are sure about the consequences!
\n'''\n return msg\nelif not msg['payload']: \n save('advanced_settings', False)\n", "outputs": 1, "x": 530, - "y": 460, + "y": 480, "wires": [ [ "5fcef1cb2e9e4788" @@ -6013,7 +5955,7 @@ "step": "90", "className": "", "x": 410, - "y": 2640, + "y": 2880, "wires": [ [ "3019576de193d9d6" @@ -6034,7 +5976,7 @@ "layout": "row-spread", "className": "", "x": 750, - "y": 2640, + "y": 2880, "wires": [] }, { @@ -6049,7 +5991,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1820, + "y": 2060, "wires": [ [ "dfdebe10dbf0e198" @@ -6068,7 +6010,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1820, + "y": 2060, "wires": [ [] ] @@ -6085,7 +6027,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1940, + "y": 2180, "wires": [ [ "9a56c087d941f1da" @@ -6104,7 +6046,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1940, + "y": 2180, "wires": [ [] ] @@ -6121,7 +6063,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1980, + "y": 2220, "wires": [ [ "0dfc86d90258f9bb" @@ -6140,7 +6082,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1980, + "y": 2220, "wires": [ [] ] @@ -6157,7 +6099,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2020, + "y": 2260, "wires": [ [ "1361134e9847f003" @@ -6176,7 +6118,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2020, + "y": 2260, "wires": [ [] ] @@ -6193,7 +6135,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1860, + "y": 2100, "wires": [ [ "b03e8b51187e88eb" @@ -6212,7 +6154,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1860, + "y": 2100, "wires": [ [] ] @@ -6229,7 +6171,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1900, + "y": 2140, "wires": [ [ "543e1690693acbeb" @@ -6248,7 +6190,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1900, + "y": 2140, "wires": [ [] ] @@ -6260,12 +6202,12 @@ "name": "loadI", "func": "var file = 'tt_stepsperrotation'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nsteps = parseInt(data);\nif (steps == 3600){\n steps = 3200\n}\n\nmsg.payload = steps\n\nreturn msg", "outputs": 1, - "noerr": 0, + "noerr": 4, "initialize": "", "finalize": "", "libs": [], "x": 290, - "y": 2060, + "y": 2300, "wires": [ [ "c6642c7470d3820c" @@ -6284,7 +6226,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2180, + "y": 2420, "wires": [ [ "721b9680a3fa460e" @@ -6303,7 +6245,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2220, + "y": 2460, "wires": [ [ "1610895f430b9aca" @@ -6322,7 +6264,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2260, + "y": 2500, "wires": [ [ "277037c4716d85bf" @@ -6341,7 +6283,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2100, + "y": 2340, "wires": [ [ "6aae9d4fddf08cc0" @@ -6360,7 +6302,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 2140, + "y": 2380, "wires": [ [ "10687d331a732790" @@ -6379,7 +6321,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2060, + "y": 2300, "wires": [ [] ] @@ -6396,7 +6338,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2180, + "y": 2420, "wires": [ [] ] @@ -6413,7 +6355,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2220, + "y": 2460, "wires": [ [] ] @@ -6430,7 +6372,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2260, + "y": 2500, "wires": [ [] ] @@ -6447,7 +6389,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2100, + "y": 2340, "wires": [ [] ] @@ -6464,7 +6406,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 2140, + "y": 2380, "wires": [ [] ] @@ -6481,7 +6423,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2360, + "y": 2600, "wires": [ [ "2522f888dc58972f" @@ -6500,7 +6442,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2360, + "y": 2600, "wires": [ [] ] @@ -6517,7 +6459,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2400, + "y": 2640, "wires": [ [ "30e8df3d616512d8" @@ -6536,7 +6478,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2400, + "y": 2640, "wires": [ [] ] @@ -6553,7 +6495,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2520, + "y": 2760, "wires": [ [ "d855d926df89d65b" @@ -6572,7 +6514,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2520, + "y": 2760, "wires": [ [] ] @@ -6589,7 +6531,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2560, + "y": 2800, "wires": [ [ "7617517dc8ba2859" @@ -6608,7 +6550,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2560, + "y": 2800, "wires": [ [] ] @@ -6625,7 +6567,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2600, + "y": 2840, "wires": [ [ "cbaa23c34e10fae1" @@ -6644,7 +6586,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2600, + "y": 2840, "wires": [ [] ] @@ -6661,7 +6603,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2640, + "y": 2880, "wires": [ [ "f455fb39039617ae" @@ -6680,7 +6622,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2640, + "y": 2880, "wires": [ [] ] @@ -6697,7 +6639,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2760, + "y": 3000, "wires": [ [ "e89f61dbe6a6cffe" @@ -6716,7 +6658,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2760, + "y": 3000, "wires": [ [] ] @@ -6733,7 +6675,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 3080, + "y": 3320, "wires": [ [ "eef25405472acfee" @@ -6752,7 +6694,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 3080, + "y": 3320, "wires": [ [] ] @@ -6769,7 +6711,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2800, + "y": 3040, "wires": [ [ "70014da0b6ab6698" @@ -6788,7 +6730,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2800, + "y": 3040, "wires": [ [] ] @@ -6805,7 +6747,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2840, + "y": 3080, "wires": [ [ "2544963852c6881a" @@ -6824,7 +6766,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2840, + "y": 3080, "wires": [ [] ] @@ -6841,7 +6783,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2880, + "y": 3120, "wires": [ [ "a1394401246eb735" @@ -6860,7 +6802,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2880, + "y": 3120, "wires": [ [] ] @@ -6877,7 +6819,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2920, + "y": 3160, "wires": [ [ "f15ca4518b5f223e" @@ -6896,7 +6838,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2920, + "y": 3160, "wires": [ [] ] @@ -6913,7 +6855,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 2960, + "y": 3200, "wires": [ [ "49900bb9047dd965" @@ -6932,7 +6874,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 2960, + "y": 3200, "wires": [ [] ] @@ -6949,7 +6891,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 3000, + "y": 3240, "wires": [ [ "5a90224dc998b417" @@ -6968,7 +6910,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 3040, + "y": 3280, "wires": [ [ "d2364ab09627fe94" @@ -6987,7 +6929,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 3000, + "y": 3240, "wires": [ [] ] @@ -7004,7 +6946,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 3040, + "y": 3280, "wires": [ [] ] @@ -7021,7 +6963,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 3120, + "y": 3360, "wires": [ [ "74e455136b5ca5dd" @@ -7040,7 +6982,7 @@ "finalize": "", "libs": [], "x": 590, - "y": 3120, + "y": 3360, "wires": [ [] ] @@ -7050,7 +6992,7 @@ "type": "function", "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'ssh'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", @@ -7069,7 +7011,7 @@ "type": "function", "z": "e43a27722b508115", "name": "loadB", - "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "func": "var file = 'smb'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", @@ -7095,7 +7037,7 @@ "finalize": "", "libs": [], "x": 270, - "y": 460, + "y": 480, "wires": [ [ "f6d6cc35679ede63" @@ -7169,7 +7111,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1700, + "y": 1820, "wires": [ [ "6ebd15c61a5ca891" @@ -7190,7 +7132,7 @@ "layout": "row-left", "className": "", "x": 780, - "y": 1700, + "y": 1820, "wires": [] }, { @@ -7205,7 +7147,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1700, + "y": 1820, "wires": [ [] ] @@ -7230,7 +7172,7 @@ "step": "5", "className": "", "x": 440, - "y": 1700, + "y": 1820, "wires": [ [ "acd10a4c99ee8063" @@ -7257,7 +7199,7 @@ "step": "5", "className": "", "x": 440, - "y": 1740, + "y": 1860, "wires": [ [ "031d7697768d0e77" @@ -7284,7 +7226,7 @@ "step": "5", "className": "", "x": 440, - "y": 1780, + "y": 1900, "wires": [ [ "be1954dd71d2c94c" @@ -7303,7 +7245,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1740, + "y": 1860, "wires": [ [ "3ad0f0f206e4a873" @@ -7322,7 +7264,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1740, + "y": 1860, "wires": [ [] ] @@ -7339,7 +7281,7 @@ "finalize": "", "libs": [], "x": 290, - "y": 1780, + "y": 1900, "wires": [ [ "3b6d759ed5be647f" @@ -7358,7 +7300,7 @@ "finalize": "", "libs": [], "x": 630, - "y": 1780, + "y": 1900, "wires": [ [] ] @@ -7377,7 +7319,7 @@ "layout": "row-left", "className": "", "x": 780, - "y": 1740, + "y": 1860, "wires": [] }, { @@ -7394,7 +7336,7 @@ "layout": "row-left", "className": "", "x": 780, - "y": 1780, + "y": 1900, "wires": [] }, { @@ -7403,8 +7345,8 @@ "z": "e43a27722b508115", "name": "enable projectname", "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" + "50eeb3e362f9027f", + "960912e90ba5b5bc" ], "x": 135, "y": 360, @@ -7412,7 +7354,8 @@ [ "22ef66b0e2058be2", "9ce01c8ba97932c1", - "81356177176eebcf" + "81356177176eebcf", + "d54b85891248ba88" ] ] }, @@ -7446,7 +7389,7 @@ "50eeb3e362f9027f" ], "x": 185, - "y": 1700, + "y": 1820, "wires": [ [ "0f0871baf322b6d0", @@ -7463,7 +7406,9 @@ "6b2eb1cb95e573f9", "ed4d587cb4feb064", "5b02160c33605ae7", - "304c135ec09801e3" + "304c135ec09801e3", + "f036424d79645761", + "b7db72b7f0599ebd" ] ] }, @@ -7473,11 +7418,11 @@ "z": "e43a27722b508115", "name": "enable projectname", "links": [ - "960912e90ba5b5bc", - "50eeb3e362f9027f" + "50eeb3e362f9027f", + "960912e90ba5b5bc" ], "x": 155, - "y": 2300, + "y": 2540, "wires": [ [ "43fe948b3e7234e2", @@ -7500,7 +7445,7 @@ "50eeb3e362f9027f" ], "x": 135, - "y": 2760, + "y": 3000, "wires": [ [ "77bb7dc529d63a7e", @@ -7636,7 +7581,7 @@ "bgcolor": "transparent", "className": "", "icon": "fa-question-circle", - "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", + "payload": "Status
See whether new updates are available. It is highly recommended to use the latest firmware version. See OpenScan2 on Github.com for details and the source code.
Updatetype
- stable: latest well-tested and mostly bug-free version for the OpenScanMini or Classic and various cameras
- beta: stable version + some experimental and new features, which might bring joy and some new bugs as well
- mini: very simplified firmware for the OpenScanMini + Arducam IMX519
Auto-Check update availability
Perform an automated update-check after each start of the device. If the device is connected to the internet, it will get the latest files from OpenScan2 on Github.com
This option is activated by default.
Check Updates
Alternatively, you can check for updates manually at any time by pressing this button.
Download Error Log
In case you encounter any errors with your device, please download the error log text and send a copy to info@openscan.eu or create an issue on Github.com
", "payloadType": "str", "topic": "topic", "topicType": "msg", @@ -7656,7 +7601,7 @@ "func": "from OpenScan import camera\n\ncamera(\"/picam2_contrast?contrast=\" + str(msg['payload']))", "outputs": 1, "x": 660, - "y": 2480, + "y": 2720, "wires": [ [] ] @@ -7669,7 +7614,7 @@ "func": "from OpenScan import camera\n\ncamera(\"/picam2_saturation?saturation=\" + str(msg['payload']))", "outputs": 1, "x": 660, - "y": 2440, + "y": 2680, "wires": [ [] ] @@ -7694,7 +7639,7 @@ "step": "0.02", "className": "", "x": 440, - "y": 2320, + "y": 2560, "wires": [ [ "e612073aded01a8f" @@ -7715,7 +7660,7 @@ "layout": "row-spread", "className": "", "x": 760, - "y": 2320, + "y": 2560, "wires": [] }, { @@ -7730,7 +7675,7 @@ "finalize": "", "libs": [], "x": 280, - "y": 2320, + "y": 2560, "wires": [ [ "81bd4381cd029958" @@ -7749,7 +7694,7 @@ "finalize": "", "libs": [], "x": 620, - "y": 2320, + "y": 2560, "wires": [ [] ] @@ -8098,84 +8043,585 @@ "wires": [] }, { - "id": "4c7fa5b5b27b83a5", - "type": "python3-function", - "z": "a5557543ccff5889", - "name": "create beta new", - "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'betaArdu'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", - "outputs": 1, - "x": 260, - "y": 140, + "id": "6b7245c3dcb694c8", + "type": "ui_slider", + "z": "e43a27722b508115", + "name": "endstop_angle", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 12, + "width": 3, + "height": 1, + "passthru": false, + "outs": "end", + "topic": "", + "topicType": "str", + "min": "-90", + "max": "90", + "step": "1", + "className": "", + "x": 440, + "y": 2020, "wires": [ [ - "e23c514008cad1a1" + "85ad07b8f973bbe2" ] ] }, { - "id": "80175eb8dc6ad009", - "type": "inject", - "z": "a5557543ccff5889", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "", - "payloadType": "date", - "x": 100, - "y": 140, - "wires": [ - [ - "4c7fa5b5b27b83a5" - ] - ] + "id": "69516440e3997111", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 11, + "width": 3, + "height": 1, + "name": "endstop_angle", + "label": "Endstop angle", + "format": "", + "layout": "row-left", + "className": "", + "x": 780, + "y": 2020, + "wires": [] }, { - "id": "d7362e6e0ec7bdaa", - "type": "inject", - "z": "a5557543ccff5889", - "name": "", - "props": [ - { - "p": "overwrite", - "v": "true", - "vt": "bool" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "x": 90, - "y": 220, + "id": "85ad07b8f973bbe2", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 2020, "wires": [ - [ - "4ce127c61c3c5966", - "beacc3dc5398fa79" - ] + [] ] }, { - "id": "4ce127c61c3c5966", - "type": "python3-function", - "z": "a5557543ccff5889", - "name": "prepare image creation", + "id": "f036424d79645761", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'rotor_endstop_angle'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = parseInt(data);\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 2020, + "wires": [ + [ + "6b7245c3dcb694c8" + ] + ] + }, + { + "id": "253feafa5a2f8b1d", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "rotor_enable_endstop", + "label": "", + "tooltip": "", + "group": "7a3279eea439bcdd", + "order": 10, + "width": 3, + "height": 1, + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 460, + "y": 1940, + "wires": [ + [ + "1916dc3fd04f0664", + "6cb92b9b9f0d6954" + ] + ] + }, + { + "id": "b7db72b7f0599ebd", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data = fs.readFileSync(filepath+file, 'utf8');\nif(data === '1' || data === 'True' || data === 'true'){\n data = true;\n}\nelse{\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 290, + "y": 1940, + "wires": [ + [ + "253feafa5a2f8b1d" + ] + ] + }, + { + "id": "1916dc3fd04f0664", + "type": "function", + "z": "e43a27722b508115", + "name": "write", + "func": "var file = 'rotor_enable_endstop'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n });", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 630, + "y": 1940, + "wires": [ + [] + ] + }, + { + "id": "de409e57a0c4bf41", + "type": "ui_text", + "z": "e43a27722b508115", + "group": "7a3279eea439bcdd", + "order": 9, + "width": 3, + "height": 1, + "name": "rotor_enable_endstop", + "label": "Enable Endstop", + "format": "", + "layout": "row-left", + "className": "", + "x": 800, + "y": 1940, + "wires": [] + }, + { + "id": "6cb92b9b9f0d6954", + "type": "function", + "z": "e43a27722b508115", + "name": "msg", + "func": "msg.enabled = msg.payload\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 410, + "y": 1980, + "wires": [ + [ + "69516440e3997111", + "f036424d79645761" + ] + ] + }, + { + "id": "d54b85891248ba88", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'group_stack_photos'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 270, + "y": 440, + "wires": [ + [ + "eefed04c25e3e4d6" + ] + ] + }, + { + "id": "eefed04c25e3e4d6", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "", + "label": "Group Stack Photos", + "tooltip": "Group photos that are part of the same focus photoset", + "group": "d324f0b852c2df0a", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 440, + "y": 440, + "wires": [ + [ + "2aaf7c7f0f0c146f" + ] + ] + }, + { + "id": "2aaf7c7f0f0c146f", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "group_stack_photos", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('group_stack_photos'):\n save('group_stack_photos', state)\n", + "outputs": 1, + "x": 660, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "84a1d063a2a2b018", + "type": "comment", + "z": "e43a27722b508115", + "name": "Messaging", + "info": "", + "x": 100, + "y": 3500, + "wires": [] + }, + { + "id": "a12ead9ccf239c19", + "type": "function", + "z": "e43a27722b508115", + "name": "loadB", + "func": "var file = 'telegram_enable'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nvar data;\ndata = fs.readFileSync(filepath + file, 'utf8');\nif (data === '1' || data === 'True' || data === 'true') {\n data = true;\n}\nelse {\n data = false;\n}\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3560, + "wires": [ + [ + "d0a1a4947a1137ca" + ] + ] + }, + { + "id": "9a4c3cbe89994626", + "type": "python3-function", + "z": "e43a27722b508115", + "name": "telegram_enable", + "func": "from OpenScan import load_bool, save\n\nstate = msg['payload']\n\nif state != load_bool('telegram_enable'):\n save('telegram_enable', state)\n", + "outputs": 1, + "x": 520, + "y": 3560, + "wires": [ + [] + ] + }, + { + "id": "d0a1a4947a1137ca", + "type": "ui_switch", + "z": "e43a27722b508115", + "name": "telegram_enable", + "label": "Enable Telegram", + "tooltip": "Enable telegram bot", + "group": "220493325bb79987", + "order": 1, + "width": "6", + "height": "1", + "passthru": true, + "decouple": "false", + "topic": "topic", + "topicType": "msg", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "animate": false, + "className": "", + "x": 340, + "y": 3560, + "wires": [ + [ + "9a4c3cbe89994626" + ] + ] + }, + { + "id": "28eeaa3a8eb77679", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "label": "Telegram Api Token", + "tooltip": "telegram api token", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "password", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3600, + "wires": [ + [ + "1c08a329bd2a669c" + ] + ] + }, + { + "id": "bf8e971a52cddab1", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3600, + "wires": [ + [ + "28eeaa3a8eb77679" + ] + ] + }, + { + "id": "1c08a329bd2a669c", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_api_token", + "func": "var file = 'telegram_api_token'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3600, + "wires": [ + [] + ] + }, + { + "id": "a26c0482377667c9", + "type": "ui_text_input", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "label": "Telegram Client Id", + "tooltip": "The Id of the user or channel to send the message to", + "group": "220493325bb79987", + "order": 5, + "width": 6, + "height": 1, + "passthru": false, + "mode": "text", + "delay": "0", + "topic": "topic", + "sendOnBlur": true, + "className": "", + "topicType": "msg", + "x": 350, + "y": 3640, + "wires": [ + [ + "b5aba11033c5f952" + ] + ] + }, + { + "id": "058743d0e5afb87b", + "type": "function", + "z": "e43a27722b508115", + "name": "loadI", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\nconst data = fs.readFileSync(filepath+file, 'utf8');\nmsg.payload = data;\nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 190, + "y": 3640, + "wires": [ + [ + "a26c0482377667c9" + ] + ] + }, + { + "id": "b5aba11033c5f952", + "type": "function", + "z": "e43a27722b508115", + "name": "telegram_client_id", + "func": "var file = 'telegram_client_id'\nlet fs = global.get('fs');\nvar filepath = '/home/pi/OpenScan/settings/';\n\nconst content = String(msg.payload)\nfs.writeFile(filepath + file, content, err => {\n if (err) {\n return\n }\n});", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 550, + "y": 3640, + "wires": [ + [] + ] + }, +{ + "id": "c59e7b205d80fe0a", + "type": "ui_button", + "z": "e43a27722b508115", + "name": "Messaging", + "group": "220493325bb79987", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "transparent", + "className": "", + "icon": "fa-question-circle", + "payload": "Telegram Messaging
This adds the capability to send OpenScan status messages to Telegram. Please refer to the appropiate documentation in order to configure it
", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 770, + "y": 300, + "wires": [ + [ + "5fff689f9f8bc1ca" + ] + ] + }, +{ + "id": "2afb6a45c73fa244", + "type": "link in", + "z": "e43a27722b508115", + "name": "link in 2", + "links": [ + "50eeb3e362f9027f", + "960912e90ba5b5bc" + ], + "x": 65, + "y": 3600, + "wires": [ + [ + "a12ead9ccf239c19", + "bf8e971a52cddab1", + "058743d0e5afb87b" + ] + ] + }, + { + "id": "4c7fa5b5b27b83a5", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "create beta new", + "func": "import json\nimport requests\nimport shutil\n\n#scope = 'main'\nscope = 'stable'\n\nupdatepath = '/home/pi/OpenScan/tmp/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\n\n## load update.json\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'download update.json failed'\n return msg\n\nmsg = {}\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg2 = msg.copy()\nif scope in msg:\n del msg[scope]\n\nmsg[scope]={}\nmsg[scope]['1'] = {}\nmsg[scope]['1']['src'] = scope + '/fla.py'\nmsg[scope]['1']['dst'] = '/home/pi/OpenScan/files/fla.py'\n\nmsg[scope]['2'] = {}\nmsg[scope]['2']['src'] = scope + '/OpenScan.py'\nmsg[scope]['2']['dst'] = '/usr/lib/python3/dist-packages/OpenScan.py'\n\nmsg[scope]['3'] = {}\nmsg[scope]['3']['src'] = scope + '/config.txt'\nmsg[scope]['3']['dst'] = '/boot/config.txt'\n\nmsg[scope]['4'] = {}\nmsg[scope]['4']['src'] = scope + '/flows.json'\nmsg[scope]['4']['dst'] = '/home/pi/OpenScan/settings/.node-red/flows.json'\n\nmsg[scope]['5'] = {}\nmsg[scope]['5']['src'] = scope + '/settings.js'\nmsg[scope]['5']['dst'] = '/root/.node-red/settings.js'\n\n#msg[scope]['6'] = {}\n#msg[scope]['6']['src'] = 'files/logo.jpg'\n#msg[scope]['6']['dst'] = '/home/pi/OpenScan/files/logo.jpg'\n\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n filesize = os.path.getsize(filepath)\n msg[scope][i]['filesize'] = filesize\n\nif os.path.isdir('/home/pi/OpenScan/tmp/update/'):\n os.system('rm -r /home/pi/OpenScan/tmp/update') \nos.makedirs('/home/pi/OpenScan/tmp/update/')\n\nwith open('/home/pi/OpenScan/tmp/update/update.json', 'w+') as f:\n json.dump(msg, f, indent=4)\n\nfor i in msg[scope]:\n if not os.path.isdir(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])):\n os.makedirs(os.path.dirname('/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src']))\n shutil.copy(msg[scope][i]['dst'], '/home/pi/OpenScan/tmp/update/' + msg[scope][i]['src'])\n\nmsg['payload'] = 'created with scope: ' + scope\n\nreturn msg", + "outputs": 1, + "x": 260, + "y": 140, + "wires": [ + [ + "e23c514008cad1a1" + ] + ] + }, + { + "id": "80175eb8dc6ad009", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 140, + "wires": [ + [ + "4c7fa5b5b27b83a5" + ] + ] + }, + { + "id": "d7362e6e0ec7bdaa", + "type": "inject", + "z": "a5557543ccff5889", + "name": "", + "props": [ + { + "p": "overwrite", + "v": "true", + "vt": "bool" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "x": 90, + "y": 220, + "wires": [ + [ + "4ce127c61c3c5966", + "beacc3dc5398fa79" + ] + ] + }, + { + "id": "4ce127c61c3c5966", + "type": "python3-function", + "z": "a5557543ccff5889", + "name": "prepare image creation", "func": "import os\n\n#factory reset, reset wpa, create wpa in boot, rm files\n#should be done before creating a new raspbian image\n\nbasepath = '/home/pi/OpenScan/'\n\n#remove files\n\ndir = basepath + 'scans/'\n\nfor i in ['scans/','tmp/']:\n os.system('rm -r ' + basepath + i)\n os.mkdir(basepath + i)\n\n#delete wifi\ntemp_dir = '/home/pi/OpenScan/tmp/wpa_empty.log'\nwpa_dir = '/etc/wpa_supplicant/wpa_supplicant.conf'\n\nwith open(temp_dir, 'w+') as file:\n file.write('update_config=1\\nctrl_interface=DIR=/var/run/wpa_supplicant\\ncountry=de\\n\\n')\nos.system('mv '+ temp_dir + ' ' + wpa_dir)\nos.system('wpa_cli -i wlan0 reconfigure')\n\n#create new wpa_supplicant.conf\nwith open('/boot/wpa_supplicant.conf','w+') as file:\n file.write('country=de\\nupdate_config=1\\nctrl_interface=/var/run/wpa_supplicant\\n\\nnetwork={\\n scan_ssid=1\\n ssid=\"wlan name\"\\n psk=\"xxxx\"\\n}')\nos.system(\"chmod a+rwx /boot/wpa_supplicant.conf\")\n\n\n#rm tmp dir\n\n\n#stop photos:\nos.system('systemctl stop flask')\nos.system('rm -r ' + basepath + 'tmp')\nos.system('mkdir ' + basepath + 'tmp')\n\nos.system('systemctl stop nodered')\n\n#reset factory\n\n", "outputs": 1, "x": 290, @@ -8219,7 +8665,7 @@ "type": "python3-function", "z": "a5557543ccff5889", "name": "get update", - "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", + "func": "import json\nimport requests\nfrom OpenScan import load_str\n\nif not msg['payload']:\n msg['status'] = '--READY--'\n return msg\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_temp = updatepath + 'update_temp.json'\nupdatepath_old = updatepath + 'update.json'\n\nr = requests.get(url + 'update.json')\n\nif r.status_code != 200:\n msg['status'] = 'no internet connection'\n return msg\n\nwith open(updatepath_temp, 'wb+') as file:\n file.write(r.content)\nwith open(updatepath_temp, 'r') as file:\n msg = json.load(file)\n\nmsg['status'] = 'checking updates'\n\nreturn msg, msg", "outputs": 2, "x": 390, "y": 540, @@ -8254,7 +8700,7 @@ "type": "python3-function", "z": "a5557543ccff5889", "name": "check files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str\n\nscope = load_str('update_type')\nmsg['scope'] = scope\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\nupdatepath_old = updatepath + 'update.json'\n\ncounter = 0\nfor i in msg[scope]:\n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n if os.path.isfile(temp):\n filesize = os.path.getsize(temp)\n msg[scope][i]['filesize2'] = filesize\n if filesize == msg[scope][i]['filesize']:\n msg[scope][i]['update'] = False\n continue\n msg[scope][i]['update'] = True\n\n counter += 1\n\nif counter == 0:\n msg['status'] = 'No new update available'\nelse:\n msg['status'] = 'New update available'\n msg['topic'] = msg['status']\n msg['payload'] = 'Install & reboot now?'\n\nmsg['counter'] = counter\n\nreturn msg\n", "outputs": 1, "x": 550, "y": 560, @@ -8320,7 +8766,7 @@ "options": [ { "label": "stable", - "value": "main", + "value": "stable", "type": "str" }, { @@ -8328,11 +8774,11 @@ "value": "beta", "type": "str" }, - { - "label": "betaArdu", - "value": "betaArdu", + { + "label": "meanwhile", + "value": "meanwhile", "type": "str" - } + } ], "payload": "", "topic": "topic", @@ -8538,7 +8984,7 @@ "type": "python3-function", "z": "a5557543ccff5889", "name": "download files", - "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/OpenScanEu/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", + "func": "import json\nimport requests\nimport shutil\nfrom OpenScan import load_str, save\n\n\nscope = msg['scope']\n\nupdatepath = '/home/pi/OpenScan/updates/'\nurl = 'https://raw.githubusercontent.com/stealthizer/OpenScan2/main/update/'\n\nif msg['payload'] != 'YES':\n return\n\ncounter = 0\n\nfor i in msg[scope]:\n if msg[scope][i]['update'] == False:\n continue\n \n filepath = msg[scope][i]['dst']\n temp = updatepath + os.path.basename(filepath)\n \n r = requests.get(url + msg[scope][i]['src'])\n if r.status_code != 200:\n msg['status'] = 'downloading ' + msg[scope][i]['src'] + ' failed'\n return msg\n with open(temp, 'wb+') as file:\n file.write(r.content)\n shutil.copy(temp, msg[scope][i]['dst'])\n \n if msg[scope][i]['dst'] == '/boot/config.txt':\n save('camera','')\n \n counter += 1\n\nmsg['status'] = 'Installed ' + str(counter) + ' of ' + str(msg['counter']) + ' - restarting ...'\n\nif counter == msg['counter']:\n updatepath_temp = updatepath + 'update_temp.json'\n updatepath_old = updatepath + 'update.json'\n shutil.move(updatepath_temp, updatepath_old)\n\nreturn msg\n", "outputs": 1, "x": 880, "y": 560, @@ -8898,7 +9344,7 @@ "type": "python3-function", "z": "a5557543ccff5889", "name": "Changelog", - "func": "import requests\n\ntempfile = '/home/pi/OpenScan/tmp/changelog'\n\nurl = 'https://raw.githubusercontent.com/OpenScan-org/OpenScan-Doc/main/docs/changelog.md'\nr = requests.get(url, allow_redirects=False)\n\nwith open(tempfile,'wb') as file:\n file.write(r.content)\n \nwith open(tempfile, 'r') as file:\n text = file.read()\n \ntext = text.replace('\\n','