harish49477`
Posts: 16
Joined: Sun Jan 08, 2017 3:35 am

how to install b9 application on raspbian jessie

Tue Feb 28, 2017 5:00 pm

HI ktb, I wanted to run this dual screen project so that i can use my b9 3d printer using raspberry pi 3 and i also failed to install the b9 application on raspbian jessie. Can u help in installing (https://github.com/yuenar/B9Creator-QT5.X) pls

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Tue Feb 28, 2017 5:02 pm

Sure. I have to run some errands. BBL.

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Wed Mar 01, 2017 1:59 pm

Small update: no good news yet.

I've tried a few different approaches to getting that application to build, so far without success on the PI3B.

I did get the application to run on x86_64 Ubuntu 17.04 with Qt 5.7.1. It spits out a bunch of warnings/errors, but still seems to work. I don't have the required printer hardware, so who knows? I don't think this software was ever written for or tested on any ARM Linux SBC, certainly not any Raspberry Pi models. Is there a reason that you thought it would or should work on a Raspberry Pi? I have my doubts that you're ever going to get support here -- https://github.com/yuenar/B9Creator-QT5.X/issues/1

Beyond getting this to build (if I'm eventually successful), I don't think I can be of any further help in making sure it actually works for you. However, I do accept hardware donations. :)

Have you read through the following threads?
https://www.b9c.com/forum/viewtopic.php?f=21&t=869
https://www.b9c.com/forum/viewtopic.php?t=140

Have you tried TinyPrint?
https://github.com/YggdrasiI/TinyPrint

TinyPrint was apparently written with Raspberry Pi support in mind.

I'm currently trying to get B9Creator-QT5.X to build using Qt 5.7.1 from Raspbian Stretch. If I fail, you're on your own as far as B9Creator-QT5.X is concerned.

harish49477`
Posts: 16
Joined: Sun Jan 08, 2017 3:35 am

Re: how to install b9 application on raspbian jessie

Wed Mar 01, 2017 2:48 pm

its a big update as i was looking for ur feedback on this application, i am glad to know u worked on it

http://b9creator.pbworks.com/w/page/698 ... 20Software

this link also gives so details abt the installation of the application but not on raspberrypi3 and Thanks for going through all the effort

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Wed Mar 01, 2017 5:06 pm

You're welcome.

Thanks for the link.

I did get past the problem captured in the screenshot from that GitHub issue.

I tried to switch out GL headers for GLES headers, but that wasn't a solution -- seemingly due to a bunch of usage of GLU stuff in the project (maybe other issues too). I think that with some effort the project could be ported to GLES, but I'm not interested in doing that.

I wonder if building Qt from source might help (and not configuring it with -opengl es2), but building Qt on a Pi has never been fun (it's not fun on a desktop/laptop either, IMO). The last time I built Qt on a Pi, it took well over a day to finish and it wasn't even a full QT5 build.

Beyond that, I keep hitting errors such as:

Code: Select all

/usr/include/GL/glext.h:468: error: conflicting declaration ‘typedef ptrdiff_t GLsizeiptr’
 typedef ptrdiff_t GLsizeiptr;
                   ^~~~~~~~~~
/usr/include/GLES3/gl31.h:73: previous declaration as ‘typedef khronos_ssize_t GLsizeiptr’
 typedef khronos_ssize_t GLsizeiptr;
                         ^~~~~~~~~~

/usr/include/GL/glext.h:469: error: conflicting declaration ‘typedef ptrdiff_t GLintptr’
 typedef ptrdiff_t GLintptr;
                   ^~~~~~~~
/usr/include/GLES3/gl31.h:74: previous declaration as ‘typedef khronos_intptr_t GLintptr’
 typedef khronos_intptr_t GLintptr;
                          ^~~~~~~~
I even tried hacky things like modifying the types in those headers so they match.

Unless anybody has some brilliant ideas, suggestions or can point out some obvious errors I'm making I think I'm gonna call this effort a failure and be done with it.

harish49477`
Posts: 16
Joined: Sun Jan 08, 2017 3:35 am

Re: how to install b9 application on raspbian jessie

Wed Mar 01, 2017 5:39 pm

thanks for ur time n effort.

i found a link abt the /usr/include/GL/glext.h:468: error kindly go-through onces
http://stackoverflow.com/questions/3956 ... del-b-v1-2

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Thu Mar 02, 2017 12:47 am

harish49477` wrote:thanks for ur time n effort.

i found a link abt the /usr/include/GL/glext.h:468: error kindly go-through onces
http://stackoverflow.com/questions/3956 ... del-b-v1-2
Unfortunately, that's not really the same problem. I also ran into errors similar to those with one of the other approaches I took.

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Fri Mar 03, 2017 8:35 pm

To quote my deplorable president, this update is INCREDIBLY TERRIFIC! It's YUGE!

B9Creator cross-compiled on Ubuntu 17.04 and running on Raspbian Stretch with Qt 5.7.1 (-platform xcb, 60 FPS), vc4-fkms-v3d and the 7" Touchscreen Display!

Image
Image
Image
Image
Image
Image

I have notes for the whole process in case you're interested.

harish49477`
Posts: 16
Joined: Sun Jan 08, 2017 3:35 am

Re: how to install b9 application on raspbian jessie

Sat Mar 04, 2017 3:29 am

wow really that a great news indeed. pls do share the notes for the whole process im interested and eager to try it out

ktb
Posts: 1382
Joined: Fri Dec 26, 2014 7:53 pm

Re: how to install b9 application on raspbian jessie

Sat Mar 04, 2017 10:15 am

I hope this works for you. I tried to give as much information as possible without writing a completely new tutorial for you.

Code: Select all

### B9Creator on Raspberry Pi 3 B 
### -----------------------------
### Let me preface this by saying that I do not have much experience with Qt.
### It may be possible to improve the configuration and approach I took here,
### but this is what worked for me after over 20 attempts just to get Qt to
### finish building successfully. My previous approach to get B9Creator running
### on the Raspberry Pi 3 B involved porting the GL code to GLES, but after
### completely converting two of the files in the project to GLES, I got tired
### of working on it. Being that I have no use for this software and was just
### treating this as a small challenge, I decided porting the code wasn't worth
### it and instead tried to see if I could get the existing GL code working.

### I used guides and information at the following links to get this done:
### - https://www.ics.com/blog/configuring-qt-creator-raspberry-pi
### - https://wiki.qt.io/RaspberryPi2EGLFS
### - https://wiki.qt.io/Building_Qt_5_from_Git
### - http://doc.qt.io/qt-5/linux-requirements.html
### - http://doc.qt.io/qt-5/configure-options.html
### - and other Qt documentation

### - I used raspberrypi.local to connect to my Raspberry Pi 3 B, but you can
###   use an IP address instead.


# 1. Install Qt on the cross-compile host system
## - Qt 5.7.1 with qtcreator packages installed from APT on Ubuntu 17.04 x86_64


# 2. Install and configure Raspbian on a micro SD card for the Raspberry Pi 3 B
## - I began with Raspbian Jessie (2017-01-11-raspbian-jessie.img)
## - I ran rpi-update (kernel 4.9.9-v7+) and upgraded to Raspbian Stretch 
## - I tested the vc4-fkms-v3d overlay with the official 7" Touchscreen Display
## - I installed Qt build dependencies on the Raspberry Pi 3 B (You'll have to
##   figure out which packages you need, refer to the online Qt build docs and
##   compare your Qt configure output to my configure output included below in
##   step 4.)

## - My cmdline.txt:
video=HDMI-1:[email protected] video=DSI-1:[email protected] net.ifnames=0 dwc_otg.lpm_enable=0 console=tty1 fbcon=rotate:2 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

## - My config.txt:
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
dtparam=sd_overclock=63
dtparam=audio=on
audio_pwm_mode=2
enable_uart=1
lcd_rotate=2
ignore_lcd=0
#gpu_mem=32
gpu_mem=128
#dtoverlay=vc4-kms-v3d,cma-256,rpi-ft5406
dtoverlay=vc4-fkms-v3d,cma-192,rpi-ft5406
arm_freq=1200
arm_freq_min=600
core_freq=250
core_freq_min=250
h264_freq=300
isp_freq=250
v3d_freq=500
avoid_pwm_pll=1
sdram_freq=450
sdram_schmoo=0x02000020
over_voltage=2
over_voltage_sdram=2
decode_MPG2=0x3ab16f03
decode_WVC1=0x438a78fb


# 3. Create sysroot and download the toolchain on the cross-compile host system:
## - Commands on Ubuntu 17.04 x86_64 host:
mkdir ~/raspi
cd ~/raspi
mkdir sysroot sysroot/usr sysroot/opt
rsync -avz [email protected]:/lib sysroot
rsync -avz [email protected]:/usr/include sysroot/usr
rsync -avz [email protected]:/usr/lib sysroot/usr
rsync -avz [email protected]:/opt/vc sysroot/opt
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py
./sysroot-relativelinks.py sysroot
git clone https://github.com/raspberrypi/tools

## - I'm not sure if the following is necessary, but it helped get past an
##   error on one of my Qt compile attempts
cd sysroot/usr/include/EGL
ln -s ../../../opt/vc/include/EGL/eglext_brcm.h eglext_brcm.h
cd ../../../..


# 4. Build a cross-compiled Qt 5.7.1 for Raspberry Pi 3 B on the host system
wget http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.tar.gz
tar xzf qt-everywhere-opensource-src-5.7.1.tar.gz
cd qt-everywhere-opensource-src-5.7.1
./configure -release -opengl desktop -device linux-rpi3-vc4-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -nomake examples -nomake tests -no-use-gold-linker -skip webchannel -skip webengine -skip wayland -skip multimedia -skip winextras -skip websockets -skip webview -skip location -skip script

#    Configure summary
#
# Building on:   linux-g++ (x86_64, CPU features: mmx sse sse2)
# Building for:  devices/linux-rpi3-vc4-g++ (arm, CPU features: neon)
# Platform notes:
#
#             - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
#
# qmake vars .......... styles += mac fusion windows QT_LIBS_DBUS = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -ldbus-1 QT_CFLAGS_DBUS = -I/home/ktb/raspi/sysroot/usr/include/dbus-1.0 -I/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf/dbus-1.0/include QT_HOST_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include QT_CFLAGS_GLIB = -pthread -I/home/ktb/raspi/sysroot/usr/include/glib-2.0 -I/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_GLIB = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lgthread-2.0 -pthread -lglib-2.0 QT_CFLAGS_PULSEAUDIO = -D_REENTRANT -I/home/ktb/raspi/sysroot/usr/include/glib-2.0 -I/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_PULSEAUDIO = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lpulse-mainloop-glib -lpulse -lglib-2.0 QMAKE_CFLAGS_FONTCONFIG = -I/home/ktb/raspi/sysroot/usr/include/freetype2 QMAKE_LIBS_FONTCONFIG = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lfontconfig -lfreetype QMAKE_INCDIR_LIBUDEV =  QMAKE_LIBS_LIBUDEV = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -ludev QMAKE_INCDIR_XKBCOMMON_EVDEV =  QMAKE_LIBS_XKBCOMMON_EVDEV = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lxkbcommon QMAKE_LIBINPUT_VERSION_MAJOR = 1 QMAKE_LIBINPUT_VERSION_MINOR = 6 QMAKE_INCDIR_LIBINPUT =  QMAKE_LIBS_LIBINPUT = -L/home/ktb/raspi/sysroot/usr/lib/arm-linux-gnueabihf -linput QMAKE_X11_PREFIX = /usr DEFINES += QT_NO_XKB QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb sql-drivers =  sql-plugins =  sqlite sqlite2 tds qmake switches ......... 
#
# Build options:
#   Configuration .......... accessibility accessibility-atspi-bridge alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile cups dbus dbus-linked doubleconversion egl eglfs eglfs_egldevice eglfs_gbm egl_x11 enable_new_dtags evdev eventfd fontconfig full-config gbm getaddrinfo getifaddrs glib gstreamer-1.0 iconv inotify ipv6ifname kms large-config largefile libinput libudev linuxfb medium-config minimal-config mremap mtdev neon opengl openssl openvg png poll_ppoll posix_fallocate precompile_header pulseaudio qpa qpa reduce_exports release rpath shared small-config system-freetype system-harfbuzz system-jpeg system-png system-zlib threadsafe-cloexec tslib xcb xcb-glx xcb-plugin xcb-render xcb-xlib xinput2 xkbcommon-evdev xkbcommon-qt xlib xrender 
#   Build parts ............ libs
#   Mode ................... release
#   Using sanitizer(s)...... none
#   Using C++ standard ..... c++11
#   Using gold linker....... no
#   Using new DTAGS ........ yes
#   Using PCH .............. yes
#   Using LTCG ............. no
#   Target compiler supports:
#     Neon ................. yes
#
# Qt modules and options:
#   Qt D-Bus ............... yes (linked to dbus-1)
#   Qt Concurrent .......... yes
#   Qt GUI ................. yes
#   Qt Widgets ............. yes
#   Large File ............. yes
#   QML debugging .......... yes
#   Use system proxies ..... no
#
# Support enabled for:
#   Accessibility .......... yes
#   ALSA ................... yes
#   CUPS ................... yes
#   DoubleConversion........ yes (bundled copy)
#   Evdev .................. yes
#   FontConfig ............. yes
#   FreeType ............... yes (system library)
#   Glib ................... yes
#   GStreamer .............. yes (1.0)
#   GTK platformtheme ...... no
#   HarfBuzz ............... yes (system library)
#   Iconv .................. yes
#   ICU .................... no
#   Image formats: 
#     GIF .................. yes (plugin, using bundled copy)
#     JPEG ................. yes (plugin, using system library)
#     PNG .................. yes (in QtGui, using system library)
#   libinput................ yes
#   Logging backends: 
#     journald ............... no
#     syslog   ............... no
#   mtdev .................. yes (system library)
#   Networking: 
#     getaddrinfo .......... yes
#     getifaddrs ........... yes
#     IPv6 ifname .......... yes
#     libproxy.............. no
#     OpenSSL .............. yes (loading libraries at run-time)
#   OpenGL / OpenVG: 
#     EGL .................. yes
#     OpenGL ............... desktop
#     OpenVG ............... yes-auto
#   PCRE ................... system
#   pkg-config ............. yes 
#   PulseAudio ............. yes
#   QPA backends: 
#     DirectFB ............. no
#     EGLFS ................ yes
#       EGLFS i.MX6 ........ no
#       EGLFS i.MX6 Wayland. no
#       EGLFS EGLDevice .... yes
#       EGLFS GBM .......... yes
#       EGLFS Mali ......... no
#       EGLFS Raspberry Pi . no
#       EGLFS X11 .......... yes
#     LinuxFB .............. yes
#     Mir client............ no
#     XCB .................. yes (system library)
#       EGL on X ........... yes
#       GLX ................ yes
#       MIT-SHM ............ yes
#       Xcb-Xlib ........... yes
#       Xcursor ............ yes (loaded at runtime)
#       Xfixes ............. yes (loaded at runtime)
#       Xi2 ................ yes
#       Xrandr ............. yes (loaded at runtime)
#       Xrender ............ yes
#       XKB ................ no
#       XShape ............. yes
#       XSync .............. yes
#   Session management ..... yes
#   SQL drivers: 
#     DB2 .................. no
#     InterBase ............ no
#     MySQL ................ no
#     OCI .................. no
#     ODBC ................. no
#     PostgreSQL ........... no
#     SQLite 2 ............. yes (plugin)
#     SQLite ............... yes (plugin, using bundled copy)
#     TDS .................. yes (plugin)
#   tslib .................. yes
#   udev ................... yes
#   xkbcommon-x11........... yes (bundled copy, XKB config root: /usr/share/X11/xkb)
#   xkbcommon-evdev......... yes
#   zlib ................... yes (system library)
#
#
# NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
# Configure with '-qreal float' to create a build that is binary compatible with 5.1.
#
# Qt is now configured for building. Just run 'make'.
# Once everything is built, you must run 'make install'.
# Qt will be installed into /usr/local/qt5pi
#
# Prior to reconfiguration, make sure you remove any leftovers from
# the previous build.

make -j4
make install

cp qtbase/bin/rcc ~/raspi/qt5pi/bin/
cd ..


# 5. Install Qt from the cross-compile host system to the Pi.
rsync -avz qt5pi [email protected]:/usr/local


# 6. Build an example on the cross-compile host and install it on the Pi
cd qt-everywhere-opensource-src-5.7.1/qtbase/examples/opengl/qopenglwidget
~/raspi/qt5/bin/qmake
make
scp qopenglwidget [email protected]:/home/pi


# 7. On the Pi3B, Update the shared library cache with the qt5pi directory location:
echo /usr/local/qt5pi/lib | sudo tee /etc/ld.so.conf.d/qt5pi.conf
sudo ldconfig


# 8. Set some Qt environment variables and run qopenglwidget (in /home/pi) on the Raspberry Pi 3 B.
export QT_LOGGING_RULES=qt.qpa.*=true
export QT_QPA_PLATFORM=xcb
./qopenglwidget
## Note: You can also use "-platform xcb" when running your applications


### Refer to the instructions from step 5 "Configure Qt Creator" and on at
### https://www.ics.com/blog/configuring-qt-creator-raspberry-pi for
### instructions on configuring Qt Creator on the cross-compile host in order
### to build B9Creator on the cross-compile host system,  and then deploy and run
### it on the Raspberry Pi 3 B

Return to “General discussion”