PrintFlow3D download


#61

While it DID go fullscreen after sudo reboot… these pop up and after I get rid of them and reload page (Try again), it appears.



#62

Darn, that’s going to be a bit of a dead end for you for a few minutes. Here is what is happening…
That last command in the start.sh file is getting executed so quickly, that the Photonic3d web server hasn’t had enough time to bootstrap itself and the web site isn’t yet available.

Instead we are going to try this in a slightly different way to make sure Photonic is running before we browse to it.

Photonic3D has the concept of a “Feature” which is nothing more than plugins that you can attach to it. Features only execute afterPhotonic3D has properly started. I’ll quick put together a CommandLineFeature to allow you to run commands after Photonic has properly started.

Do you know how to install from the development version of Photonic3D?


#63

I can not say that I do :frowning: but if it is what is detailed here (https://wiki.photonic3d.com/doku.php?id=developers), I am sure I can follow directions :wink:


#64

It’s actually what is listed here:
https://wiki.photonic3d.com/doku.php?id=linux

I’ll be releasing a version soon in the development branch that gives the functionality you are looking for.


#65

That is how I did mine currently :wink:


#66

Good deal, just make sure you perform the latest development steps as my changes will only be in that version and not in the stable release.

You will want to uncomment out the following lines in the config.properties file:

#feature.org.area515.resinprinter.util.cron.CronFeature=true
#featureSettings.org.area515.resinprinter.util.cron.CronFeature=[{“taskName”:“Run kweb browser after a Photonic3D restart”, “taskClassName”:“org.area515.resinprinter.actions.osscript.ExecuteNativeOSCommandRunnable”, “cronString”:"@reboot", “taskSettings”:{“shellCommands”:[“kweb”, “-KZJE”, “{0}”]}}]

Let me know how it works! :slight_smile:


#67

Where do I find the properties file?


#68

As documented here:
https://wiki.photonic3d.com/doku.php?id=default_file_locations

You can find it in your user directory or in the install directory:
/opt/cwh

If it doesn’t exist in the user directory you can create it and it will use it. Whatever properties you add to the user directory will override the system directory. This allows you to setup user specific instructions for whoever starts Photonic3D and they won’t get overwritten on upgrades.


#71

I have done what you have said to this point (I have since formatted SD card and reloaded the photonic-image.zip instead of Rasbian Stretch) and I got it working to a point. It auto loads to a page but still to the “Unable to load page” page. If I click try again, the localhost shows BUT 1/2 off screen.


#72

Something, is attempting to browse to http://localhost:9091. That shouldn’t be there still… Could you show me your start.sh and config.properties file. Something isn’t setup correctly and the nail in the coffin is the old version: 1.0.16. That’s production version which isn’t correct. That means you didn’t pick up my changes last night.


#73

I downloaded it this morning. I fell asleep after I wrote my last message… LOL


#74

Great news. After all of that, we may want to start a new thread for additional issues. After your experience, you could also make a page in our wiki showing everyone what you did with very little Linux experience.


#75

#!/bin/bash

if [[ $UID != 0 ]]; then
echo “Please run this script with sudo:”
echo “sudo $0 $*”
exit 1
fi

cpu=uname -m

if [ -z “$HOME” ] || [ “$HOME” == “/” ]; then
HOME=~root
fi

DEFAULT_REPO=“area515/Creation-Workshop-Host”
CONFIG_PROPS="${HOME}/3dPrinters/config.properties"

echo “Local Config: $CONFIG_PROPS”

if [ -f ${CONFIG_PROPS} ]; then
CONFIG_REPO=$(grep ‘^updateRepo’ “${CONFIG_PROPS}” | cut -d= -f 2 | awk ‘$1=$1’)
if [[ ${CONFIG_REPO} ]]; then
DEFAULT_REPO="${CONFIG_REPO}"
fi
fi

if [ -z “$1” ]; then
repo=${DEFAULT_REPO}
else
if [[ $1 =~ .Creation-Workshop-Host. ]] || [[ $1 =~ .Photonic3D. ]]; then
repo=$1
else
repo="$1/Creation-Workshop-Host"
fi;
fi;

if [ “$2” == “TestKit” ]; then
downloadPrefix=cwh$2-
installDirectory=/opt/cwh$2
else
downloadPrefix=cwh-
installDirectory=/opt/cwh
fi;

#Its pretty hard to keep these updated, let me know when they get too old
if [ “${cpu}” = “armv6l” -o “${cpu}” = “armv7l” ]; then
javaURL=“http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-arm32-vfp-hflt.tar.gz
elif [ “${cpu}” = “i686” ]; then
javaURL=“http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-i586.tar.gz
elif [ “${cpu}” = “x86_64” ]; then
javaURL=“http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz
elif [ “${cpu}” = “aarch64” ]; then
javaURL=“http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-arm64-vfp-hflt.tar.gz
fi

if [ ! -f “/usr/lib/jni/librxtxSerial.so” ]; then
echo Installing RxTx
apt-get install --yes --force-yes librxtx-java
fi

#This application will always need to have the display set to the following
export DISPLAY=:0.0
xinitProcess=ps -ef | grep grep -v | grep xinit
if [ -z “${xinitProcess}” ]; then
echo No X server running, starting and configuring one
startx &
xhost +x
fi

#Copy the zip file from the current directory into the cwh directory for offline install
mkdir -p ${installDirectory}
mv ${downloadPrefix}.*.zip ${installDirectory}

#install java if version is too old
javaInstalled=which java
if [ “$javaInstalled” = “” ]; then
javaMajorVersion=0
javaMinorVersion=0
else
javaMajorVersion=java -version 2>&1 | grep "java version" | awk -F[\".] '{print "0"$2}'
javaMinorVersion=java -version 2>&1 | grep "java version" | awk -F[\".] '{print "0"$3}'
fi

if [ “$javaMinorVersion” -lt 8 -a “$javaMajorVersion” -le 1 ]; then
downloadJavaFile=echo ${javaURL} | awk -F/ '{print $(NF)}'
echo Either Java is not installed, or an incorrect version of Java is installed. Installing from this URL: ${javaURL}
mkdir -p /usr/lib/jvm
cd /usr/lib/jvm
rm ${downloadJavaFile}
wget --no-cookies --no-check-certificate --header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “${javaURL}”

    firstSnapshot=`ls -1`
    echo Unzipping and installing Java now
    tar xzf ${downloadJavaFile}
    secondSnapshot=`ls -1`
    javaInstallFile=`echo "$firstSnapshot"$'\n'"$secondSnapshot" | sort | uniq -u`

    if [ -z "${javaInstallFile}" ]; then
            echo "A new version of Java is available, please update this script with the proper download URLS from: http://www.oracle.com/technetwork/java/javase/downloads/index.html"
            exit
    fi

    ln -sf /usr/lib/jvm/${javaInstallFile}/bin/java /usr/bin/java
    ln -sf /usr/lib/jvm/${javaInstallFile}/bin/javac /usr/bin/javac
    ln -sf /usr/lib/jvm/${javaInstallFile}/bin/keytool /usr/bin/keytool
    rm ${downloadJavaFile}

fi

#Determine if a new install is available
echo Checking for new version from Github Repo: ${repo}
cd ${installDirectory}
LOCAL_TAG=$(grep repo.version build.number | cut -d = -f 2 | tr -d ‘\r’)
NETWORK_TAG=$(curl -L -s https://api.github.com/repos/${repo}/releases/latest | grep ‘tag_name’ | cut -d" -f4)

echo Local Tag: ${LOCAL_TAG}
echo Network Tag: ${NETWORK_TAG}

if [ -f ${downloadPrefix}..zip ]; then
OFFLINE_FILE=$(ls ${downloadPrefix}.
.zip)
echo Performing offline install of ${OFFLINE_FILE}

    mv ${OFFLINE_FILE} ~
    rm -r ${installDirectory}
    mkdir -p ${installDirectory}

cd ${installDirectory}
mv ~/${OFFLINE_FILE} .
unzip ${OFFLINE_FILE}
chmod 777 *.sh
rm ${OFFLINE_FILE}
elif [ -z “${NETWORK_TAG}” ]; then
echo “Couldn’t fetch version from GitHub, launching existing install.”
elif [ “${NETWORK_TAG}” != “${LOCAL_TAG}” -o “$2” == “force” ]; then
echo Installing latest version of ${downloadPrefix}: ${NETWORK_TAG}

    DL_URL=$(curl -L -s https://api.github.com/repos/${repo}/releases/latest | grep 'browser_' | cut -d\" -f4 | grep -- -${NETWORK_TAG})
    DL_FILE=${DL_URL##*/}
    rm -f "/tmp/${DL_FILE}"
    wget -P /tmp "${DL_URL}"

if [ $? -ne 0 ]; then
echo “wget of ${DL_FILE} failed. Aborting update.”
exit 1
fi

    rm -r ${installDirectory}
    mkdir -p ${installDirectory}
    cd ${installDirectory}
    mv "/tmp/${DL_FILE}" .

    unzip ${DL_FILE}
    chmod 777 *.sh
    #grab dos2unix from the package manager if not installed
    command -v dos2unix >/dev/null 2>&1 || { apt-get install --yes --force-yes dos2unix >&2; }
    grep -lU $'\x0D' *.sh | xargs dos2unix
    #ensure the cwhservice always is linux format and executable
    grep -lU $'\x0D' /etc/init.d/cwhservice | xargs dos2unix
    chmod +x /etc/init.d/cwhservice
    rm ${DL_FILE}

else
echo No install required

fi

echo Turning off screen saver and power saving
xset s off # don’t activate screensaver
xset -dpms # disable DPMS (Energy Star) features
xset s noblank # don’t blank the video device

if [ ! -f “/etc/init.d/cwhservice” ]; then
echo Installing CWH as a service
cp ${installDirectory}/cwhservice /etc/init.d/
chmod 777 /etc/init.d/cwhservice
update-rc.d cwhservice defaults
fi

echo Determinging if one time install has occurred
performedOneTimeInstall=$(grep performedOneTimeInstall ${CONFIG_PROPS} | awk -F= ‘{print $2}’)
if [ -f “oneTimeInstall.sh” -a [${performedOneTimeInstall} != “true”] ]; then
./oneTimeInstall.sh
fi

if [ -f “eachStart.sh” ]; then
./eachStart.sh
fi

if [ “$2” == “debug” ]; then
pkill -9 -f “org.area515.resinprinter.server.Main”
echo “Starting printer host server($2)”
java -Xmx512m -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n -Dlog4j.configurationFile=debuglog4j2.properties -Djava.library.path=/usr/lib/jni:os/Linux/${cpu} -cp lib/:. org.area515.resinprinter.server.Main > log.out 2> log.err &
elif [ “$2” == “TestKit” ]; then
pkill -9 -f “org.area515.resinprinter.test.HardwareCompatibilityTestSuite”
echo Starting test kit
java -Xmx512m -Dlog4j.configurationFile=testlog4j2.properties -Djava.library.path=/usr/lib/jni:os/Linux/${cpu} -cp lib/
:. org.junit.runner.JUnitCore org.area515.resinprinter.test.HardwareCompatibilityTestSuite &
else
pkill -9 -f “org.area515.resinprinter.server.Main”
echo Starting printer host server
java -Xmx512m -Dlog4j.configurationFile=log4j2.properties -Djava.library.path=/usr/lib/jni:os/Linux/${cpu} -cp lib/*:. org.area515.resinprinter.server.Main > log.out 2> log.err &
fi
kweb -KZJE http://localhost:9091


#76
fakeserial=true
removeJobOnCompletion=false
printerHostPort=9091
visibleCards=printers,printJobs,printables,settings
performedOneTimeInstall=false
limitLiveStreamToOneCPU=false
scriptEngineLanguage=js
forceCalibrationOnFirstUse=false

#hostGUI is no longer used, the "skins" key should be used instead
#hostGUI=resources
#hostGUI=gui-prototypes/material-resin/app
#hostGUI=../../CWH-Reify3D/Customer/resources
skins=[{"name":"Main skin", "welcomeFiles":["index.html"], "resourceBase": "resourcesnew", "active": true}]

feature.org.area515.resinprinter.discover.UPNPAdvertiser=true
feature.org.area515.resinprinter.usbimport.USBUploader=true
feature.org.area515.resinprinter.util.cron.CronFeature=true
featureSettings.org.area515.resinprinter.util.cron.CronFeature=[{“taskName”:“Run kweb browser after a Photonic3D restart”, “taskClassName”:“org.area515.resinprinter.actions.osscript.ExecuteNativeOSCommandRunnable”, “cronString”:"@reboot", “taskSettings”:{“shellCommands”:[“kweb”, “-KZJE”, “{0}”]}}]

#notify.org.area515.resinprinter.notification.EmailOnCompletionNotifier=true
#notify.org.area515.resinprinter.notification.PauseOnErrorNotifier=true
notify.org.area515.resinprinter.notification.WebSocketPrintJobNotifier=true
notify.org.area515.resinprinter.notification.WebSocketPrinterNotifier=true
notify.org.area515.resinprinter.notification.WebSocketHostNotifier=true

printFileProcessor.org.area515.resinprinter.job.ZipImagesFileProcessor=true
printFileProcessor.org.area515.resinprinter.job.CreationWorkshopSceneFileProcessor=true
printFileProcessor.org.area515.resinprinter.job.STLFileProcessor=true
printFileProcessor.org.area515.resinprinter.minercube.MinerCubePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.printphoto.ImagePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.text.TextFilePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.printphoto.SVGImagePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.printphoto.micoin.CoinFileProcessor=true

displayDevice.org.area515.resinprinter.display.dispmanx.RaspberryPiMainLCDScreen=true
displayDevice.org.area515.resinprinter.display.dispmanx.RaspberryPiForceTVScreen=true
displayDevice.org.area515.resinprinter.display.LastAvailableDisplay=true
displayDevice.org.area515.resinprinter.display.SimulatedDisplay=true

#Only enable this when there is at least one admin user!!!
#useAuthentication=true
UserManagementFeatureImplementation=org.area515.resinprinter.security.keystore.KeystoreLoginService

#http://www.optoma.de/uploads/RS232/DS309-RS232-en.pdf
#https://github.com/area515/Creation-Workshop-Host/files/129785/RS232_codes.pdf
#https://github.com/area515/Creation-Workshop-Host/files/88303/RS232_Control_Codes_H6510BD.pdf
#http://www.viewsoniceurope.com/asset-files/files/user_guide/pjd7820hd/28077.pdf
hexCodeBasedProjectors=[{"name":"Optoma (HD141x)", "defaultComPortSettings":{"speed":9600, "databits":8, "parity":"None", "stopbits":"One"}, "onHex":"7E303030302031", "offHex":"7E303030302032", "bulbHoursHex":"7E30303135302031", "bulbHoursResponseRegex":"(?s:OK(?:0|1)(\\\\d{4}.*))", "bulbHoursConversion":"ASCII"},{$

SerialCommunicationsImplementation=org.area515.resinprinter.serial.JSSCCommPort
#3d firmware autodetection is unreliable on these implementations
#SerialCommunicationsImplementation=org.area515.resinprinter.serial.RXTXSynchronousReadBasedCommPort
#SerialCommunicationsImplementation=org.area515.resinprinter.serial.RXTXEventBasedCommPort

NetworkManagerImplementation=org.area515.resinprinter.network.LinuxNetworkManager
#NetworkManagerImplementation=org.area515.resinprinter.network.MockNetworkManager
#None of this is used...
#===============================
#Linux
#connectToWifiSSIDCommand=["/bin/sh", "-c", "iwconfig {0} essid {1} key s:{2}"]
#discoverSSIDCommand=["/bin/sh", "-c", "iwlist {0} scan 2>&1| grep ESSID | awk -F\\"\\\\\\"\\" '''{ print $2 }'''"]
#discoverNetworkInterfaceCommand=["/bin/sh", "-c", "ifconfig | grep Link | awk '''{ print $1 }'''"]
#Windows (I'm not sure who would ever use this)
#connectToWifiSSIDCommand=netsh wlan connect name={1}
#discoverSSIDCommand=powershell -Command "netsh wlan show profiles interface=Wi-Fi | %'{ $_.Split('':'')[1].trim(); }'"
#discoverNetworkInterfaceCommand=blank for windows
#fakedisplay=true


#0=x(width), 1=y(height)
imagingCommand=["raspistill", "-t", "1", "-n", "-w", "{0}", "-h", "{1}", "-o", "-"]
#Hack of the year award if you uncomment the following line!! Hey, it works awesome for testing...
#imagingCommand=["cmd", "/c", "java -cp C:\\\\Users\\\\wgilster\\\\git\\\\Creation-Workshop-Host\\\\host\\\\srcbin org.area515.resinprinter.image.ServerTimeJPEG {0} {1}"]
streamingCommand=["raspivid", "-ih", "-w", "{0}", "-h", "{1}", "-n", "-t", "0", "-o", "-"]
#streamingCommand=["cmd", "/c", "type c:\\\\Users\\\\wgilster\\\\desktop\\\\stuff.mp4"]

#0=Process id
#====================
#Linux
dumpStackTraceCommand=["kill", "-3", "{0}"]

#Linux
rebootCommand=["reboot"]

useSSL=false
#If the above option is true, all of the following must be specified
#===================================================================
keystoreFilename=web.keystore
keystorePassword=keystorePassword
keypairPassword=keypairPassword
securityRealmName=CWH3DPrinterRealm

#Don't use "realm.clientUsername and realm.clientPassword" in this file, users are now stored in an implementation specific fashion designated by the property: UserManagementFeatureImplementation
#If you are interested in adding a user to your implementation specific user manager then add these two parameters to the config.properties located in the 3dprinters directory. This will migrate that user automatically.
#CWH3DPrinterRealm.clientUsername=admin
#CWH3DPrinterRealm.clientPassword=password
#This class enforces all keys to have same password sun.security.ssl.SunX509KeyManagerImpl.SunX509KeyManagerImpl(KeyStore, char[])
#So we must have another keystore for users
userKeystoreFilename=users.keystore
userKeystorePassword=usersKeystorePassword

#The following is an optional parameter.
#You only need to specify this parameter if you have a certificate signed by a CA.
#This certificate must be imported into into the keystore specified in the "keystoreFilename" key in this property file.
#The certificate must be imported into the keystore using the alias specified below.
#This MUST also be the hostname that the certificate was issued to.
#*****************************************
#externallyAccessableName=Name of the alias AND hostname that CA issued cert to
#=================================================================================

printerProfileRepo=WesGilster/Photonic3D

#All of the following are for the email notification
#===================================================
#notify.org.area515.resinprinter.notification.EmailOnCompletionNotifier=true
toEmailAddresses=youremailaddress@gmail.com,anotherusername@gmail.com
serviceEmailAddresses=yourprintermanufacturer@gmail.com
username=username
password=password
smtpServer=smtp.googlemail.com
smtpPort=587
mail.smtp.starttls.enable=true

#77

You still have two problems.
#1 You are still using the old start.sh file I had you modify. That’s probably because my commands from here don’t overwrite the start.sh file when you run them. I’ve fixed the documentation to unconditionally overwrite the file.
#2 You are still running the old version from production(I can see the version is still 1.0.16). Make sure you run the development instructions(the ones for my repo), not the stable instructions.


#78

Notice the version number in the bottom left corner of the screen? That’s what you want to be running.


#79

Could it have been because I downloaded the img file from the downloads page and then used the dev instructions? So how am I to fix these issues? There are 2 images from the DL page, the system image and the Vendor Specific image. Which to use?


#80

Got the proper version now :wink: just need to have it fit properly lol BTW, it takes FOREVER to load to the kweb screen.Another thing noticed is that when in Photonic, Display 0.0 is the only option so when you connect to printer, screen goes blank


#81

Good deal. Yes, Display 0.0 is the only display available for Raspberry Pis. For some reason, the Raspberberry Pi folks didn’t decide to support two screens under XWindows and it doesn’t seem as though it’s planned for the future. This is pretty annoying, and it means that we had to write the low level display support directly into Photonic3D.

This explains the situation. Just choose the “Raspberry Pi Force TV” for your screen:
https://wiki.photonic3d.com/doku.php?id=dual_raspberry_pi_screens


#82

I don’t have the option for anything besides 0.0 and I am using the Raspberry pi image and not the Vendor specific image. Do I have to change that to get it to work? I did have it available the other day but I think that was using the new Stretch.