Denvi / Candle

GRBL controller application with G-Code visualizer written in Qt.
GNU General Public License v3.0
1.37k stars 548 forks source link

How to get candle or grblcontrol installed in raspberrypi #77

Closed jvarl closed 5 years ago

jvarl commented 7 years ago

Hi, in previous post (see #55) I was trying grblcontrol over different pc's. Also I tried to install this friendly program on my raspberry pi without success (see #72).

This time I announce that finally my efforts were crowned with success. I have installed grblcontrol and Candle in my raspi-3b raspbian on two different images, one in the traditional Jessie (2016-05-27-raspbian-jessie.zip image) and another in the new jessie PIXEL. In both cases I used micros-sd memory of 16GB Class 10.

I want to provide information about steps I walked for people interested in getting it and do not know how to achieve it:

Pay attention for changes to introduce in files there mentioned. Use “copy-paste” for text on the post and edit every line in your preferred text editor previously to paste it in the terminal command line to be executed. Pay attention using “sudo” were needed and change use permissions for private files.

If you intend compile Candle in qt-creator you must fix two present errors in the source code gave at present as .zip file:

#include <QGLFormat>
#define GL_PROGRAM_POINT_SIZE 100

If it were of interest to get a raspbian image with qt5.7.1 libraries installed and grblcontrol and Candle, please give me to know and I will introduce a link to download (dropbox or google drive). Best regards. JVARL

my-package-list.zip

Denvi commented 7 years ago

Hi, how it works on Raspberry? Some time ago I compiled the program for the 2 version of a board. But the program worked not in the best way. There were problems with visualizer/sender performance.

jvarl commented 7 years ago

With my CNC hardware setup it is working fine, like as runs bCNC and UGCS that I tried in raspian jessie too. Because it uses opengl it deploys only at full size window.

pihnat commented 7 years ago

Hi jvarl I'd love to try Candle on a raspi. Could you supply a link to download an image or maybe setup apt-get so I can install to a Jessie setup (with Pixel)?

jvarl commented 7 years ago

Hi Pihnat, As soon achieve upload the image to the cloud (google drive) I will include the link. This may take some time, since the compressed file (7z) weighs about 5GB. The first thing you should do when you have the image in your raspi-3b is set raspbian with data of your local area, language, keyboard and wifi. Mine is America, Argentina, Spanish, Buenos Aires

jvarl commented 7 years ago

Hi pihnat, I apologize for delay in answering. I lost a lot of time by faults in provision of internet and energy supply. After that I found several difficulties associated with uploading to the cloud a very large .7z file size, I decided to upload it in the form of smaller pieces. I did so, in order to achieve better control of progress uploading files. You will need to download and rebuild the large .7z file on the basis of small files, for which, I included details of how to do it as a README paragraph onto the .txt file included. The link for download is [https://drive.google.com/open?id=0B6LOs5zWeC-gLXR3QW1EUmt3Qzg] . While I remain for comments, I hope you enjoy the work I made. Best regards. JVARL.

pihnat commented 7 years ago

Hi jvarl I thought the large file size might have caused a problem with uploading but looks like you got around it. Thanks for your efforts. OK I downloaded it and the size of the img file is 15,523,119,104 bytes. I have the raspi at home so I will try it later today.

I'm using Win7 so for those who also want to try it I used this quick method:

pihnat commented 7 years ago

Wow, I must say congratulations! It works very well. Here's some feedback:

I'm using a raspi 3.

  1. the 3D manipulation is great, very smooth when you zoom in/out or rotate. This is where I thought there might be a speed problem with the raspi but it works surprisingly well.
  2. in 'CHECK' mode the mouse becomes sluggish. But that's OK because you wouldn't normally do much with the 3D view while it's doing the check. I tried it with a G-code file containing many lines and a few arcs as well as one which had many arcs (40,000 lines). The mouse is very sluggish in the latter case.
  3. during a normal Send ie while cutting, the mouse and 3D manipulation is good.
  4. there's a few quirks I found: a: after you run a CHECK or after cutting if you go back to the Service Menu it won't let you change settings like Query period, Rapid speed, etc. You have to quit Candle and re-start it. b: when you quit Candle there are a few funny things happening. On one occasion when I quit the web browser was open and connected to the qt site. On other occasions 2 FileManager windows were open, one was /home/pi and the other was /home/pi/.themes.

Overall it's great to see that Candle can run on the raspi and congratulations again for your efforts. I will continue with feedback and I hope others try running it on the raspi too.

jvarl commented 7 years ago

Hi pihnat, I am happy that you also enjoy this fantastic “like nix” operating system which is raspbian-jessie-pixel, also the powerful Qt5 programming libraries and IDE, at join with this friendly grbl controller what is “Candle” by Denvi. But, in my land is often said "Not everything that glitters is gold", and you must take these “as it is, at your proper risk”. So, I would like give some advice to you and people that could read the post. Sometime, I experienced that full screen got all blank color, without possibility of control the things. In this case, you must just press “ctrl-alt-backspace” and screen newly appears (I remembered older situations of “blue screens” in a popular OS). First, change your password and if possible user name too for enhance security against outer attacks. Second, using qtcreator IDE compile a fresh copy of Candle as a new project with a folder name that you only known. Third, if possible try to use Candle without 3w connection. If you were to experience case such I have mentioned, you will do “clean” and “recompile” the candle project in two situations, first on “debug” then same in “release” (on debug ever is responsive positively, because there not build executable, just work internally). For me, I have got success doing that, trying the project over a new folder. Finally, using mouse-right-button on candle-desktop-launch-icon (properties->entry_to_desktop->new_path_to_binary_executable) you can update the simlink to the new folder. Do not forget to introduce the two changes at the current source code, as I mentioned in previous entries. Sincerely: JVARL.

pihnat commented 7 years ago

Hi jvarl, Thanks for the extra information. I hope to re-compile Candle after a few modifications. I have done this under Windows so it will be interesting to try it under Raspian. A few comments:

  1. to run in Windows grblControl/Candle has all files in a folder which can be placed anywhere and a shortcut created to the exe file, no installation required. I have basic linux knowledge but can the same be done with Candle under Jessie, ie can I just copy the Candle release folder to another raspi and run it there without installing it or having Qt installed?
  2. when you uploaded the img file of Jessie/Qt/Candle would it have been OK to use Jessie lite instead of Jessie with Pixel? I'm thinking that the size of the img file would have been much smaller because there would be no LibreOffice, etc.

BTW I'd like to share with you a photo of the program running with the raspi 7" touch screen. Since it's only 800x480 there's some issues with seeing the whole control panel properly, eg in Settings you can't see or get to the OK button. But that is all fixable by re-arranging buttons, fonts, etc and re-compiling.

Many thanks again, you have started a new method of using grblControl/Candle which I'm sure will be expanded on. regards Peter

candle on raspi touchscreen

sico33 commented 7 years ago

Hola jvarl, disculpa mi ignorancia pero vengo siguiendo el hilo del tema y me puse muy contento al saber de tu trabajo. Mi proyecto sobre la construcción de mi propio CNC sigue cada vez mas cerca. No tengo conocimientos en Rasp y su sistema operativo, pero cada día aprendo mas.... toda la estructura la vengo construyendo saliendo desde el punto CERO ----ni siquiera sabia que existía Arduino ----

Necesito pedirte me puedas ayudar para poder ejecutar el Soft y así probarlo con la placa---

Aun estoy sin éxito de que la aplicación se ejecute --- ya probé con una instalación limpia nuevamente y todavía no logro ejecutarla.

Me podrías dar una mano???

Desde ya muchas gracias y saludos.

PD: Soy del interior de la prov. de Buenos Aires

cap 1

pihnat commented 7 years ago

Hi sicco33, if you double click the Candle shortcut on the desktop the program should run. Which raspi are you using and are you using a normal monitor plugged into the hdmi port on the pi?

sico33 commented 7 years ago

Estoy usando un RSpi 3 con VNC.....intentare realizar la prueba con HDMI.....ya ejecute el doble clic sobre el acceso directo pero no se ve la interfaz, si veo que el proceso se ejecuta por eso adjunte la imagen.

Voy a realizar la prueba con el monitor y realizo mis comentarios.

Saludos !!!

pihnat commented 7 years ago

A HDMI monitor (or VGA with a HDMI to VGA converter) is the way to run it on a raspi. Plug a USB mouse and keyboard into the raspi too.

But NOTE .... the raspi version is experimental and has some bugs. If you need a useable solution you should be using grblControl/Candle on a PC. It is much more reliable especially when connected to a CNC machine - you don't want the program crashing in the middle of machining or the CNC machine losing control. The PC version of grblControl has been well tested and de-bugged.

Since you are starting out and learning about CNC control + building a machine could I suggest that you use the PC version first until you become more experienced. It's a lot to get your head around Arduinos, grbl, grblControl, G-Code, etc and knowing that the control program on a PC works well is one less headache.

sico33 commented 7 years ago

pihnat muchas gracias por tus consejos....pude probar el sistema conectandolo a un monitor HDMI y todo corre OK. Voy a seguir investigando y probando con las difentes configuraciones del Soft y GRBL.

Muchas Gracias por todo !!!

Saludos!!!

jvarl commented 7 years ago

Hi, pihnat

  1. I do not think this possible. The executable binary file is not self content to run itself (not compiled in a completely static way), there are shared libraries (dynamic), called at runtime within the complex structure of QT5 (and the operating system itself). Try this could be simple and entertaining. I did not try this yet.
  2. You can choose from a minimal distribution and then add packages or a complete distribution and uninstall what is not used (it is simpler). On the Internet, the latest is advised for economy of effort. You have to think that installing libraries QT5 alone weighs about 3.5GB. Regards. JVARL
jvarl commented 7 years ago

Hola sico33 Un gusto en saludarte y decirte que en la medida de que pueda estoy dispuesto a ayudarte. Sería deseable que nos tuvieras al tanto de tus avances y dijeras como está constituido tu CNC hardware setup. Me alegro que pudieras hacer funcionar la imagen raspbian-jessie-pixel-candle en tu raspi. Saludos. JVARL

jvarl commented 7 years ago

Hi, pihnat. In this last days I tried installing qt5 libraries starting from lite in a 8GB micro-sd, but for giving to myself a good living I installed the light weight LXDE GUI (lite has not any GUI at all), and using iceweasel (firefox) instead of chromium. The initial starting size of lite in such condition was as only of 1.9GB. After installing my-package-list (base support for git clone qt5 and get it to run) the size was 2.6GB. Then I ran git cloning QT5 and “./init-repository”, which became the size 6.2GB (only 1GB less than the total size of the micro-sd, which was 7.2GB). This forces me to "change horses in midstream" and had to move to a micro-sd 16GB to continue the test. After of “./configure”, and previous to do “make”, the occupied size was 6.5GB. Again, after I did ”make &> output_make”, the occupied size became 10.1GB (free space 4GB from a total 14.1GB space of my 16GB micro-sd). If I compare the free space of 4GB obtained against 1.8GB in the previous case of using the complete raspbian-pixel, I arrive to the thinking that very probably I will get a similar free size (do not tried yet) starting from the latest, and removing everything what I do not need at all. Additionally in this case I remain using a more comfortable raspbian distribution. BTW. Firefox and chromium are similar. Keeping using chromium is a good choice. Regards. JVARL.

pihnat commented 7 years ago

Hi jvarl, I did the following but am now stuck:

SD card size 14.6G. Installed Jessie Lite then sudo apt-get update && sudo apt-get upgrade sudo apt-get install xserver-org sudo apt-get install xinit sudo apt-get install lxde-core lxterminal lxappearance sudo apt-get install lightdm sudo apt-get install chromium-browser sudo apt-get install qt5-default sudo apt-get install qtcreator

After the above I have 11.9G free on the SD card Using Chrome I downloaded Candle and unzipped it. Qt runs great and Candle source code opens OK. I also appended the lines you mentioned in frmmain.h and qlwidget.cpp

I had no problems under Windows but there are 2 problems on the raspi:

regards

jvarl commented 7 years ago

Hi pihnat, you can’t install qt5-default (see #72), hence arises the need to install qt5 cloning from github. The first steps you did are fine but only you missed install xserver-xorg too. Your option by chromium is OK. I haven’t clear why you mention mingw, which in linux isn’t needed at all. Within “my-package-list” that I gave, are included qtcreator, qtcreator-data, qtcreator-doc and qtserialport5-doc packages, so you don’t need install them separately, just sudo apt-get install "my-package-list”. Also, as “lite” is an absolutely minimal distribution, you should install git (“sudo apt-get install git”) before to “git clone anything”. You can optionally omit installing gparted and synaptic for saving an extra space. Even more, you don’t need a 3w browser at all for proceed, but it could be commode for you to read from an open window steps to follow when installing qt5 and you can copy candle.zip on raspi using pendrive. Regars. JVARL

pihnat commented 7 years ago

Hi jvarl, thanks for your reply. I'm not a Linux person so am a little lost. I need mingw because in my installation of Qt5 there is no compiler specified. Also Denvi mentions under "Build requirements" on the main page of the repository that it requires "Qt5.7.0 with MinGW compiler". BTW I had to install mingw separately with the Windows version of Qt5 I've been using too.

h2mille commented 7 years ago

Hello, thanks for this very nice project. I'm trying to make it work well too on my RPi, and I have the problem you solved, pihnat: I'm trying to change the resolution of the fullscreen without success. I never used qt before, but reach to recompile the project, changing resolution in ui, but no difference. can you tell me the magic?

jvarl commented 7 years ago

Hello h2mille, Tell me what you currently have installed on raspi. From what I understand, the image raspian with qt5.7.1 libraries and you cannot operate your touch screen 7" (800x480) after changing the graphics resolution, that is rigth? You could explain further what you have added/modified in source code candle project (and where). I'm like you in using qt (I have only basic knowledge), but I programmed GUI applications with GTK3+ libraries. I also would learn whether pihnat respond to you about the matter. But for this you have to specify clearly about steps you have made. Regards. JVARL

h2mille commented 7 years ago

Hello jvarl, I used the image [https://drive.google.com/open?id=0B6LOs5zWeC-gLXR3QW1EUmt3Qzg] you provided. I have an old hdmi screen with native resolution of 1280x800 that I want to use with my router, with the raspi. The image works directly well, I just update the resolution in /boot/config.txt). What I did is mostly nothing, after checking the source code and discovering the qtcreator, I tryed to change: frmmain.ui setting line 9 and 10 into : <width>1280</width> <height>800</height>, and compile it again (I need to select the compiler, I set gcc) but it's quite naive. I also tryed to understand what's the matter of openGL with Qt and windowed mode, but I have no clue, and failed finding something useful. Thanks for your help!

pihnat commented 7 years ago

Thanks jvarl, I tried to remember how I installed things and forgot to list the xserver line. I have edited the post.

Hi h2mille, Same problem, I have limited knowledge of Linux and Qt. I have been trying a few different things but I should summarise what I'm playing with:

  1. the reason I tried Jessie lite is only so after Candle is working the img of the SD card is small so it's easier to share, that's the only reason
  2. it would be good to change the size of buttons, etc so Candle's GUI would fit on the raspi LCD screen, resolution is 800x480
  3. this is more important for me since I will be running Candle on a pi with a larger LCD monitor - to be able to put or install Candle on other raspi's without having Qt5 installed, ideally like Windows where you just put the Candle folder anywhere and run the exe file.
davezdesignz commented 7 years ago

I recently installed this [https://drive.google.com/open?id=0B6LOs5zWeC-gLXR3QW1EUmt3Qzg] on a raspberry pi 2 model b+ and the program opens but when I connect my grbl CNC (uses an arduino mega - grbl 1.1) I get some strange characters in the Z axis machine coordinates after the 0.000 and the status comes up with unknown. I can use candle 1.1.5 on my windows laptop to run the CNC with no issues (that I have found yet). Any ideas what the issue could be? Has anyone been able to make the screen work for a 7" display?

thank you

downsun commented 7 years ago

我下载安装了jvarl 提供的镜像,发现一个问题,不论我在通过什么客户端启动程序:Xwindow clent or mstsc or vnc. grbl 都运行在显示器的窗口,应该是编译的时候设置的问题,其他程序就没有这个问题。

pihnat commented 7 years ago

Hi davezdesignz, Unfortunately I haven't had time to continue experimenting with grblControl on the raspi. But if you check my post on Oct 2016 you'll see grblControl running on the raspi 7" touchscreen monitor. It wasn't stable however and menus are squashed so the UI would need to be modified for it to work well.

Hi downsun, If I translated your message correctly you are trying to run grblControl on the raspi using a remote client as the interface. This won't work. You need to plug a HDMI monitor and mouse/keyboard into the raspi and use it that way.

downsun commented 7 years ago

Thank you very much.

PNixx commented 6 years ago

I try compile Candle for raspberry pi and I see error:

$ qmake
Project WARNING: GL ES detected. VAO will be disabled.

How I can fix it?

jvarl commented 6 years ago

Hi PNixx. This message is simply a warnning not an error. You'll have to get around compiling the Candle source using qt-5.7.0 (GUI) what is present into the downloable raspbian image I provided , as it is previously instaled. Regards, JVARL.

AlexeyKichev commented 5 years ago

Я не могу собрать Candle na Raspberry Pi 3 из за GL. В новой версии присутствует GLES 3!

1f7 commented 5 years ago

@AlexeyKichev sudo apt install libgles1-mesa-dev

jvarl commented 5 years ago

At the current time the thread is closed

WZ9V commented 4 years ago

I have not fully tested but I was able to get it to compile and run on a Raspberry Pi 4 4GB by installing Qt onto Raspbian 2/23/2020 with

sudo apt-get install qtcreator qt5-default libqt5serialport5-dev

Make the code changes from above

In frmmain.h you must append the following line:

#include <QGLFormat>

and in widgets/glwidget.cpp you must append:

#define GL_PROGRAM_POINT_SIZE 100

qmake Candle.pro
make
./Candle

Hope this helps

pihnat commented 4 years ago

Thanks for the update WZ9V. I'm still not that proficient with linux but when I run qmake I get the same message as PNixx on April 5, 2018, ie

$ qmake Project WARNING: GL ES detected. VAO will be disabled.

How do I get past that warning?

pihnat commented 4 years ago

OK problem solved, the message is definitely just a warning. I actually did have an error too where I typed

define GL-PROGRAM_POINT_SIZE 100 instead of

define GL_PROGRAM_POINT_SIZE 100

I found it easier to run QtCreator & loaded 'candle.pro'. I edited those 2 files there and then did the build. So Candle runs on my raspi3B+ but unfortunately I don't have any arduinos here at home (I have 2 at work) so have to wait till tomorrow to finish testing. Thanks again.

WZ9V commented 4 years ago

Thanks for the update WZ9V. I'm still not that proficient with linux but when I run qmake I get the same message as PNixx on April 5, 2018, ie

$ qmake Project WARNING: GL ES detected. VAO will be disabled.

How do I get past that warning?

You can safely ignore that warning.

pihnat commented 4 years ago

I have Candle running on a raspi3B+ now. First thing you need to do is change the colours used in the visualisation because the default is black for everything. The display runs at about 10fps but when sending a G-code program to the CNC machine it drops to 8fps. Overall operation is a bit sluggish but the fact that it runs at all is great. I'll try it on a raspi4 and will report back.

pihnat commented 4 years ago

Just updating - I have Candle running in a 2G raspi4. It's actually works extremely well, not sluggish at all, in fact it runs as fast as on a PC. The frame rate varies between roughly 50 and 70fps. As I mentioned in my last post you need to change the colours in the visualisation so they're not all black. I also changed the Status Query Period to 40ms so the tool movement is smoother.

Candle on Raspi4

On a PC you would place the folder with all the Candle files somewhere like C:/Program Files (x86) and then put a shortcut to Candle.exe on the Desktop. No installation is required. On the Raspi4 I've been able to do a similar thing - after building from the source code using qt5 I've copied the folder with the Candle files onto a different raspian SD card which doesn't have qt installed and it runs without problems. If anyone's interested I can post instructions on how to get it working.

Corteil commented 4 years ago

H pihnat, instructions would be great, I'm a little lost at the moment :-) or a download link to your working Candle folder.

pihnat commented 4 years ago

Hi Brian, Using the web browser on a raspi4, go to https://github.com/pihnat/rpi-Candle Scroll down to the Download section and download the zip file. NOTE - THIS WAS CHANGED FROM pihnat/Candle TO pihnat/rpi-Candle on 13 May 2020

Go right to the top of the page then click on the wiki button for detailed instructions on what to do. Let me know if you have any problems.

xingqianlilu commented 4 years ago

Hi pihnat,may I ask a question.First,thanks for your sharing.Candle have been running on my pi3b+,I feel very happy.But,it shows unconect now.I do not now why?How can I setup the file setting.ini.When I download the candle project for pi4 from https://github.com/pihnat/Candle,I find that there is not a setting.ini file in the project.How can I candle this problem.Thanks very much.

xingqianlilu commented 4 years ago

@jvarl @pihnat Hi jvarl,Hi pihnat,may I ask a question.First,thanks for your sharing.Candle have been running on my pi3b+,I feel very happy.But,it shows unconect now.I do not now why?How can I setup the file setting.ini.When I download the candle project for pi4 from https://github.com/pihnat/Candle,I find that there is not a setting.ini file in the project.How can I candle this problem.Thanks very much.

pihnat commented 4 years ago

Make sure the Arduino is plugged into your raspi. In the main menu click on Service then select Settings. Select ttyACM0 as the port and set Baud rate to 115200. When you click OK at the bottom of the page it will create a setting.ini file and save the settings there.

Serial Port

Note that Candle runs sluggishly on a pi3, I definitely recommend running it on a raspi4.

pihnat commented 4 years ago

I just checked and settings.ini is in the zip file. Note that if you download the project to build using qt there will be no settings.ini until you run Candle the first time. However if you download & unzip the Candle_1.1.8.zip file which is ready to run on a raspi then there will be a default settings.ini file already in the Candle folder.

xingqianlilu commented 4 years ago

OK,it is great , thank you very much.Now,as you say ,I lanuch Candle and move right!However,it runs sluggishly as you say.I open a 40000 gcode file which spend 1min to open.Wheth it runs very smootly on pi4?

xingqianlilu commented 4 years ago

image

pihnat commented 4 years ago
  1. The screenshot you posted is how Candle looks if there is no settings.ini file when you first run Candle. Under Service, Settings you would need to select colours for background (eg white), Tool (eg orange), Start Point, etc. When you press OK those colours will be saved. That is why I supplied a default .ini file in the zip file with colours already selected.

  2. On raspi4 I loaded a 36,400 line G-code file and it loads in less than 2 secs.

Actually thinking about it - don't go by the number of lines in the file because you can have 1 G-code command per line or several. Go by file size. The file I tried is about 700K in size. Also the file was on the raspi SD card. Loading speed will be different if you load your file from a USB thumbdrive.

xingqianlilu commented 4 years ago

Thanks for your patient reply.My pi3b+ is 2fps and it is so sluggishly. My test file is 2M which is loaded from SD card.The time spent loading file is about 2 min.I think I need buy a pi4 and test the speed.The picture below is my candle parameter when run on pi3b+.2fps. image

pihnat commented 4 years ago

Note - I changed the github site from pihnat/Candle to pihnat/rpi-Candle