Minimal Raspberry Pi 4 setup with Candle and firmware 1.1h

Post Reply
WZ9V
Posts: 2
Joined: Wed Aug 21, 2019 5:27 pm

Minimal Raspberry Pi 4 setup with Candle and firmware 1.1h

Post by WZ9V » Sun Mar 08, 2020 9:53 pm

Setup Protoneer CNC Shield on Raspbian Buster with VNC remote desktop (using RealVNC)

01) Image SD card with Raspbian desktop

02) Place empty file ssh in /boot

03) Boot Pi with ethernet attached and determine assigned IP address

04) ssh pi@<ip address> //password = raspberry

05) sudo raspi-config
// enable serial port for talking to Protoneer CNC Shield
- Interfacing Options
- Serial
- Turn off shell over serial
- Enable serial port
// For remote desktop through VNC
- Interfacing Options
- VNC
- Enable VNC server
- Advanced Options
- Memory Split
- 256
- Advanced Options
- Resolution
- DMT Mode 82 1920x1080 60hz 16:9
// reboot

06) Connect to Pi using RealVNC viewer
- run through start up script and reboot

07) Connect to Pi using RealVNC viewer

08) Open terminal and install minicom (optional)
- sudo apt install minicom

09) Check serial to Protoneer CNC Shield is working (optional)
- minicom -D /dev/ttyS0
- <Ctrl-X>
// should see GRBL version
- $$<enter>
// should see GRBL configuration dump

10) Install Candle (Version 1.1.8)
// install needed modules
- sudo apt-get install qtcreator qt5-default libqt5serialport5-dev
// get code and update
- git clone https://github.com/Denvi/Candle.git
- cd Candle/src
- nano frmmain.h
- add #include <QGLFormat>
- nano widgets/glwidget.cpp
- add #define GL_PROGRAM_POINT_SIZE 100
// compile
- qmake // ignore warning
- make //ignore warnings
// run and setup
- ./Candle //may need to resize window
//setup
- Service-> Settings
- Press Set to Defaults (to fix colors)
- Set Connection to Port=ttyS0 Baud=115200
// test
- In Console
- $I // display build version
- $$ // display GRBL parameters

11) Update firmware to 1.1h (does not require arduino ide install)
- sudo apt-get install avrdude
- mkdir ~/Documents/Protoneer
- cd ~/Documents/Protoneer
- get autoreset328 and modify to remove 2560 and aadpt to this directory
- Create autoreset with the following contents

#!/bin/bash

sudo strace -o "|/home/pi/Documents/Protoneer/autoreset328" -eioctl avrdude $@

- Create autoreset328 with the following contents

#!/usr/bin/python

import RPi.GPIO as GPIO
import sys, os, re, time, fcntl
import errno

fd = sys.stdin.fileno()
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
dtr = re.compile('.+TIOCM_DTR.+')
start = time.time()
pin = 11
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, GPIO.HIGH)

def reset():
GPIO.output(pin, GPIO.LOW)
time.sleep(0.32)
GPIO.output(pin, GPIO.HIGH)

def process():
while True:
try:
duration = time.time() - start
input = sys.stdin.readline().strip()
if input is None: # == "":
input = sys.stdin.readline().strip()
if dtr.match(input):
reset()
return
elif duration > 5000:
return
except Exception as e:
if hasattr(e, 'errno'):
if e.errno != 11: # Ignore resource unavailable
raise
else:
raise

process()
print "avrdude: Using autoreset DTR on GPIO Pin " +str(pin)
GPIO.cleanup()
exit

- download grbl 1.1h from github gnea/grbl releases
- ./autoreset -v -c arduino -p ATMEGA328P -P /dev/ttyS0 -b 115200 -U flash:w:grbl_v1.1h.20190825.hex

Bertus Kruger
Site Admin
Posts: 1594
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Minimal Raspberry Pi 4 setup with Candle and firmware 1.1h

Post by Bertus Kruger » Sun Mar 15, 2020 6:58 pm

How fast is Candle on the RPi 4?

I might just add this to the standard build image.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests