From 77759dc582480f6a09b3db5d43bc0614bdbec98d Mon Sep 17 00:00:00 2001 From: Duane Bishop Date: Mon, 2 Mar 2015 02:52:28 +0000 Subject: [PATCH 1/3] updated install script to include windows file sharing. --- PocketNC.ini | 3 +- dtc.sh | 0 grep | 0 install | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 89 insertions(+), 3 deletions(-) mode change 100644 => 100755 dtc.sh create mode 100644 grep mode change 100644 => 100755 install diff --git a/PocketNC.ini b/PocketNC.ini index 1bc60bc..fd52982 100644 --- a/PocketNC.ini +++ b/PocketNC.ini @@ -42,7 +42,8 @@ POSITION_FEEDBACK = COMMANDED MAX_FEED_OVERRIDE = 3 # Prefix to be used -PROGRAM_PREFIX = ~/linuxcnc/nc_files/ +#PROGRAM_PREFIX = ~/linuxcnc/nc_files/ +PROGRAM_PREFIX = /mnt/usbdrive/ # Introductory graphic #INTRO_GRAPHIC = linuxcnc.gif diff --git a/dtc.sh b/dtc.sh old mode 100644 new mode 100755 diff --git a/grep b/grep new file mode 100644 index 0000000..e69de29 diff --git a/install b/install old mode 100644 new mode 100755 index fff36f6..40cec51 --- a/install +++ b/install @@ -1,8 +1,12 @@ #!/bin/bash -echo "To start LinuxCNC preconfigured for PocketNC, simply type:" -echo " PocketNC" +if (( $EUID != 0 )); then + echo "Try sudo ./install" + exit +fi +clear + echo '#!/bin/bash' > /usr/bin/PocketNC echo "linuxcnc $PWD/PocketNC.ini" >> /usr/bin/PocketNC chown 750 /usr/bin/PocketNC @@ -11,3 +15,84 @@ chmod +x /usr/bin/PocketNC chmod +x dtc.sh ./dtc.sh +declare mountdir=/mnt/usbdrive + +read -p "Would you like to enable windows drag&drop file uploading? (y/n)" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + #Test for inet access to repository. + wget -q --spider http://repos.rcn-ee.net + if [ $? -gt 0 ]; then + #Not online. Try to connect. + echo "Your BBB may need to gather some additional files from the internet." + read -p "Would you like to use the ethernet jack to download them?(y/n)" -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Getting IP address..." + dhclient eth0 + else + echo "Skipping internet connection." + fi + fi + #check if mount directory exists. + if [ -d $mountdir ]; then + #Check for for existing mount point. + echo "Found existing mount point." + else + echo "Creating mount point to access USB storage." + mkdir -p /mnt/usbdrive + fi + + #Now that the mount point is setup, add it to /etc/fstab for auto-mount at boot. + if ! grep -Fq "$mountdir" /etc/fstab + if ! mount | grep -q /mnt/usbdrive;then + mount /dev/sda1 /mnt/usbdrive > /dev/null + fi + then + #Found an existing entry. + echo "Existing mount point entry found in /etc/fstab" + echo " If you are just re-installing PocketNC settings dont worry about it." + echo " Otherwise you will need edit the file by hand to mount" + echo " your storage device to /mnt/usbdrive" + else + echo "Adding auto-mount entry to /etc/fstab" + echo "/dev/sda1 /mnt/usbdrive autofs rw,users,exec,nofail" >> /etc/fstab + fi + + #Check for samba, and if needed, install it. + if ! which smbstatus > /dev/null; then + wget -q --spider http://repos.rcn-ee.net + if [ $? -gt 0 ]; then + echo "Samba server not found, unable to continue without downloading it." + exit 1; + else + echo "Updating package lists." + apt-get update + echo "Installing Samba server." + apt-get install samba + #wait for samba server to init. + echo "waiting 10sec for samba to setup..." + sleep 10 + fi + if grep -Fxq "[PocketNC]" /etc/samba/smb.conf + then + echo "PocketNC networking share previously setup, skipped." + else + echo "Creating PocketNC network share." + echo "[PocketNC]" >> /etc/samba/smb.conf + echo "comment = PocketNC G-Code Files" >> /etc/samba/smb.conf + echo "path = /mnt/usbdrive" >> /etc/samba/smb.conf + echo "browseable = yes" >> /etc/samba/smb.conf + echo "writeable = yes" >> /etc/samba/smb.conf + echo "guest ok = yes" >> /etc/samba/smb.conf + echo "read only = no" >> /etc/samba/smb.conf + fi + fi + echo "Network file sharing (aka Drive-mapping) should now be available to any" + echo " computers the BBB is networked with." +else + echo "Sharing skipped." +fi + +echo "To start LinuxCNC preconfigured for PocketNC, simply type:" +echo " PocketNC" From 508c3d9f8830873996ed7f6bf9003b4ae465f9a8 Mon Sep 17 00:00:00 2001 From: Duane Bishop Date: Mon, 2 Mar 2015 02:56:10 +0000 Subject: [PATCH 2/3] deleted spurious empty file 'grep' --- grep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 grep diff --git a/grep b/grep deleted file mode 100644 index e69de29..0000000 From 16716e6b777fa441993f6afbe138663d0bdec8be Mon Sep 17 00:00:00 2001 From: Duane Bishop Date: Wed, 15 Jul 2015 14:34:34 -0500 Subject: [PATCH 3/3] Test commit just testing --- README | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/README b/README index a129677..dbb193b 100644 --- a/README +++ b/README @@ -1,23 +1 @@ - -This configuration drives a standard 4-axis 3D printer using the PRU for -high speed step/dir pulse generation and a BeBoPr driver board. The -BeBoPr configuration is for the original version of the BeBoPr board and a BeagleBoneWhite and -requires you disable HDMI. - -The BeBoPr-Bridge configuration is for use with the new bridge board -that shuffles pins around so you can leave HDMI enabled. - -There are currently no limit switches configured, so adjust the MIN_LIMIT -and MAX_LIMIT axis settings in the ini file if your printer has less than -200 mm of X/Y travel. - -Current X and Y settings are appropriate for a typical "MendelMax" style -printer, with the following settings: - -max vel = 200 mm/s -max accel = 3000 mm/s/s -scale = 80 steps/mm - -Adjust as required for your machine. Make scale negative to invert any -axis that is moving 'backwards'. - +Testing 123