 | I think I need to use OpenVG for 2D graphics:
https://www.khronos.org/openvg/ |
 | There is also OpenGL ES for 3D graphics |
 | In order to leave memory for graphics, need to use
the "Lite" version of Raspbian. |
 | Steps I took to get started over WiFi (no keyboard
or monitor):
 | Following guide here to install "Lite" version
of OS on RPi Zero W:
https://thisdavej.com/create-a-lightweight-raspberry-pi-system-with-raspbian-lite/ |
 | Flashed the lite version of Raspbian with Etcher |
 | Added two files to root folder ("boot" drive in
Windows) to enable ssh
connection over WiFi |
 | Followed rest of instructions (but, don't need
to add wifi and ssh because did it with those two files already). |
 | I wasn't able to change the keyboard layout, but
don't think it maters... |
|
 | For "memory split" setting, left at 64 MB. May
actually want to increase this later for more 2D graphics memory... |
 | For some reason, updates didn't work at first, had to do "sudo
mount
-o remount, rw /" as
described here |
 | Installed Samba, following
directions
|
 | Used Visual Studio 2019 to
blink LED over SSH
 | Had to run VS installer to add Linux project
type |
 | Used the Blink example to toggle pin#17 |
 | Had to install "wiringPi" on rpi before this
worked |
 | Also had to remount like above as file system
became write protected again somehow |
 | Figured out that BCM pin number is not
same as WiringPi pin#
. Not exactly sure why this code uses BCM pin# when we are using
WiringPi, but verified that BCM pin is actually toggling! |
|
 | Trying to complile an OpenVG example program:
 | Installed GIT: sudo apt-get install
wget git-core |
 | get openvg: git clone
git://github.com/ajstarks/openvg |
 | continute to make it using
rest
of these instructions |
 | Got an error about the font, had to do this:
sudo apt-get install ttf-dejavu |
 | get error making example due to no jpeglib.h, so
doing this: sudo apt-get install libjpeg-dev |
 | compiler can't find the VG/openvg.h file, giving
error
 | Had to add to Project Properties
->C/C++->Additional Include Directories and make it like this:
%(ClCompile.AdditionalIncludeDirectories);/opt/vc/include |
 | /opt/vc/include is where the VG headers are
... |
|
 | Also, need to add to linker...
 | Under Linker ->Additional dependencies at
this: wiringPi;pthread;rt;shapes |
|
|
 | Looks like I need to start over due to uSD card
corruption. Going to use Win32 Disk Imager to backup rpi's uSD card,
once I get it all set up and don't need to remount and Samba works again
 | Problems with disk imager... First, image is 60 GB, second
when zipped it didn't work with Etcher... Need to figure this out |
|
 | Installing VNC on headless RPi. Needed to update all first it
seems... Only been a week since OS installed, but VNC wouldn't install
via "sudo raspi-config" until updated
 | Had to go back into raspi-config to set screen resolution before VNC
would work... |
 | That didn't work, tried this: "sudo apt-get install
--reinstall lxsession" Maybe this is
because installed "lite" version of Raspian... This one takes a
long time to install... |
 | It works! Took a while for desktop to load at first... |
|
 | Now, to try FlexGui... Need git... "sudo
apt-get install git"
 | Then, get FlexGui : "git clone
https://github.com/totalspectrum/flexgui.git " |
 | Seems we need Tk... Trying " sudo apt-get install python-tk "
Didn't work... |
 | Trying this:
 |
sudo apt-get install tcl8.5 |
 |
sudo apt-get install tk8.5 |
|
 | Have to create symbolic link to wish "ln
-s wish8.4 wish" |
 | It works! run or type "FlexGui.tcl" to run. But, can't
compile... Seems fastspin is not included... |
 | Copying over fastspin source code using Windows Samba share. I
should have copied over the tarball instead of individual files, I
think...
 | Yes, much faster... do "gunzip spin2cpp-4.0.3.tar.gz" then do
"tar -xvf spin2cpp-4.0.3.tar". Then use GUI to move files back
into spin2cpp folder. |
|
 | Seems we need Bison to compile Fastspin... doing " sudo
apt-get install bison" |
 | Ok, now it compiles. Now, create "bin" folder and move
fastspin there (it's in a hidden folder named "build") |
 | Now we can compile. But, can't load... Seems we need
xterm. |
 | Ok, now we need loadp2. Have to download and compile as did
for fastspin...
 | Do "git clone
https://github.com/totalspectrum/loadp2.git" |
 | the linux build script doesn't seem to work as can't find
Mainloader.h... |
 | Trying "make" instead... That doesn't work because can't
find fastspin... |
 | So, edited makefile and changed this line to point to the bin
"PASM=../bin/fastspin -2"
 | does more, but then get error: loadp2.c:425:25: error:
‘MainLoader_bin’ undeclared (first use in this function); |
 | Editted loadp2.c and commented out the guts of the
loadfileFPGA routine where that error is because not using FPGA
here... |
|
 | It worked! now, copy loadp2 from build over to
flexgui\bin\ |
|
 | We're very close now! Some examples work... But, get
"Unable to open file `spin/SmartSerial': No such file or directory".
Need to copy these over...
 | Where does "include" folder belong? Using the flexgui
interface, found it should be in the flexgui folder. |
|
|
 | Can now compile and download to P2b wirelessly!
|