niijel
Posts: 7
Joined: Fri Dec 30, 2011 11:02 am

GAMBAS(basic)

Sat May 19, 2012 3:23 pm

:D

Getting there - have a look at this:

http://gambas.sourceforge.net/raspberrypi.png

Not my work but ... WOW

ulysess1966
Posts: 5
Joined: Mon Jun 11, 2012 11:10 am

Re: GAMBAS(basic)

Mon Jun 11, 2012 11:56 am

Very interested in this as I have managed to get some teachers who are competent in VB.net interested in Gambas.

I've used Gambas to build some good UI in the past for Linux projects, love it to bits.

ren41
Posts: 99
Joined: Sat May 26, 2012 8:00 pm

Re: GAMBAS(basic)

Tue Jun 19, 2012 9:49 pm

I've installed Gambas2 - think I will go back for Gambas3 if it's compatible - but although it appears under development in the GUI - xfce in my case - double clicking on it does produce a brief timer but it never gets any further. Can I only boot it in the CLI?

ren

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK

Re: GAMBAS(basic)

Tue Jun 19, 2012 9:53 pm

there is a bug in the 'official' builds of gambas2 and gambas3 which was well discussed on here a few weeks back
a kind soul fixed it and produced a manual download for both versions - I pulled the gambas2 version and it does indeed work great (if a little slow on the graphics examples) on the pi

Downloads can be found in this thread/post
http://www.raspberrypi.org/phpBB3/viewt ... =50#p70883
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

ren41
Posts: 99
Joined: Sat May 26, 2012 8:00 pm

Re: GAMBAS(basic)

Fri Jun 29, 2012 2:00 pm

Thanks, SN. I forgot to bookmark this topic and I've only just found it again.

ren

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Tue Jul 17, 2012 1:40 pm

I have been running Gambas3 for some time on the Debian image with no problems.

I would now like to move over to the new Raspbian image but although Gambas 3 is a known package and appears to install with no errors it won't run.

When I click the icon the CPU usage monitor goes to 100% just like it did on Debian but the Gambas IDE never starts. I left it for 10 minutes and the CPU Indication stayed at 100%. Although it indicates 100% CPU Usage LXDE still appears to be quite responsive with no significant slowing down. I had to kill the Gambas task from terminal to get the CPU usage back down again.

I have just tried the new 'official' Raspbian image as posted on the Rasbian forum but the problem persists.

Has anyone successfully installed Gambas3 on Raspbian?.

Any help appreciated.


....Colin

ren41
Posts: 99
Joined: Sat May 26, 2012 8:00 pm

Re: GAMBAS(basic)

Sat Jul 21, 2012 4:25 pm

no unfortunately I had the same problem as you - very disappointing.

ren

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Sat Aug 04, 2012 9:01 pm

Success!!!

After failing to get the package to work I decided to try building Gambas 3.2.1 from source on Raspbian. I have never done this in Linux before so it took a while to work through all the problems. You could say it was a good learning excercise but it got pretty frustrating at times!.

After several days of resolving dependencies, correcting filenames and copying into the correct directories I finally managed to get 3.2.1 running on Raspbian.

Before anyone asks, no, I can't give detailed instructions on how to do it because I didn't keep a step by step record. However if you try it yourself and get stuck somewhere I might be able to remember what I did to fix it.

I used synaptic to install the required packages as it allowed me to search until I found something that looked like what I wanted. Everything was in there somewhere, but it was not always obvious where.

Two components kept failing to configure when done from the root directory. From memory I think they were gb.ncurses and gb.jit .
gb.ncurses configured correctly if done individually by changing to the gb.ncurses directory and doing ./configure -C from there.
gb.jit was more tricky but I think in the end it was due to an incorrect file location which caused configure to fail.

When I finaly got everything to configure the make and make install went through with no errors. However when trying to run Gambas it came back with an error "gbr3: no project file in usr/bin/gambas3" After some investigation this was found to be due to Gambas3 looking in the /usr/ directory for its files when they were actually installed in /usr/local/ . I copied all the Gambas files and directories from /usr/local/ to /usr/ and then everything worked .
This looks like a path problem but the path environment variable was set to include both locations.

So I now have a working Gambas3 installation ( I think, I havn't tested it thoroughly yet but it seems to work with my application) . I will now make an image as a backup and then try to tidy it up a bit as I am sure there is lots of un-needed rubbish left over from my efforts. If that all goes to plan I will try to make the image available somehow. However my internet upload speed is so poor that it may not be possible.

.... Colin

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Sun Aug 05, 2012 11:46 pm

The resulting Image file is too big for me to upload so try this. Its a bit of a hack but It worked for me. (I am sure the Linux purists will have a heart attack!)

I suggest you do it on a fresh copy of Raspbian just in case it doesn't work for you.

sudo apt-get install gambas3

This will install all the necessary dependencies and create the required directories. But it won't run as there is some problem with the repository.

download this file http://www.filedropper.com/gambas3-2-1files_1 and unzip it.

This is a copy of the gambas files from /usr/lib/gambas3, /usr/share/gambas3, and /usr/bin from my working Gambas3.2.1 installation.

overwrite your existing files with these new versions.

Gambas3 should now work.

Colin..

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Wed Aug 08, 2012 2:49 pm

Hi,

after start a fresh system (2012-07-15-wheezy-raspbian.zip ) from SDCard, i did a apt-get update and installed "gambas3" package 3.1.1-2.
Installation itself seems to be successfully, but when start gambas3
the cpu usage goes to 100% and thats it.
Nothing else happens.
Any experiences and ideas are highly welcome

wally

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Wed Aug 08, 2012 11:33 pm

Hello Wally,

Have a look at the previous posts in this thread. The raspbian install of Gambas3 doesn't work but You will find a work-around that will give you a working 3.2.1 version.

Colin.

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Thu Aug 09, 2012 3:43 am

Colin,

Yes, it works nice. I tried yesterday late evening.
3.2.Version number makes me think you built it from SVN sources.
May you explain in few words how you get the working
3.2 version and on which system you compiled ?
I know how to build on OpenSuse. Does the same procedure
work for RPI ?

wally

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Thu Aug 09, 2012 8:13 pm

Hello Wally.

Yes, 3.2.1 is the latest version.
Its the first application I have built from source in Linux so it took me a while
to learn how to do it.

I did it all on the PI and basically just followed the instructions for debian on the Gambas wiki.
As far as I can tell the procedure on the pi is the same as on any Debian system. It's all a bit slow to build though.
There were a few glitches with library names and directories but it eventually all worked.
It took me about three days to do it though!

Colin.

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Thu Aug 09, 2012 8:23 pm

Thank You Colin.

i did this svn build several times on OpenSuse, so the principle is clear.
I'll try on RasPi too. Yes, i also met this libname problems.

cheers wally

fuller
Posts: 2
Joined: Sat Aug 04, 2012 12:31 am

Re: GAMBAS(basic)

Fri Aug 10, 2012 12:09 am

Thank you g4eml for sharing those files. It appears everything is working via your instructions. I've zipped the image and it's a little under 700megs. I don't have the fastest speed but I am trying to upload the file to file dropper overnight and will share the link once I get home from work if there is anyone wanting it. Assuming my upload doesn't fail.

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Sat Aug 11, 2012 9:55 am

Hello fuller.

Thanks for doing that. A working image is a better way of making gambas3 available on raspbian. Alternatively if someone could make a working .deb file that would be even better. Unfortunately I don't know how to do that.

So far I haven't found any problems with running Gambas 3.2.1 on the pi. Everything I have tried seems to work. It is also a bit faster under Raspbian than it was under Debian Squeeze.

I am currently experimenting with using the wiringPi C library to provide GPIO control in Gambas. I have had some success in using it to define external procedures. When I have done some more testing I will post the results.


Colin (g4eml)

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Sat Aug 11, 2012 10:02 am

Colin,

have a look in Gambas3 GSLSpline example, it uses externela lib.

fuller
Posts: 2
Joined: Sat Aug 04, 2012 12:31 am

Re: GAMBAS(basic)

Sat Aug 11, 2012 1:17 pm

Here is the link for the Raspbian Image. I hope some of you find it helpful. http://dl.dropbox.com/u/97096067/2012-0 ... ambas3.zip

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Sat Aug 11, 2012 5:25 pm

Gambas3 svn build
i have problems with dependencies for components:
|| - gb.jit
|| - gb.net.curl
which packages should be installed ?

thanks wally

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Sat Aug 11, 2012 8:06 pm

Hi wally,

gb.jit is one of the ones I had problems with. If I remember correctly it relies on LLVM. The package I installed was LLVM-3.1-dev .
However I still had problems after this, I think there was a problem with the location LLVM or one of its executables was installed on the Pi. I got a clue by looking at the configure files in the Gambas source. I think I had to manually edit them to get it to work. I did eventually manage to get it to make without errors though. I am not sure the JIT component will run on non-i86 hardware anyway, from the Gambas wiki description it only talks about it producing intel code.


I had no problem with gb.net.curl as far as I can remember. It depends on libcurl which is available in the repository.

Sorry if its all a bit vague but I didn't make notes as I went through it.

To track down the dependencies I installed synaptic which then allowed me to search the repository to find likely looking libraries.

One other thing I did notice a couple of times the ./configure and/or make when run from the top level directory gave errors for a couple of components. If I changed into the directory for that component and ran ./configure and/or make from there it worked OK. Probably a path problem.

Good luck... Colin

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Sat Aug 11, 2012 8:57 pm

I wanted to try to control the GPIO from Gambas. I know that this can be done using file system reads and writes but I wanted to get control at a bit lower level.

The wiringPi C library written by Gordon looked like a good place to start. This takes the form of a /usr/local/lib/libwiringPi.a library and a /usr/local/include/wiringPi.h C include file.

Unfortunately Gambas3's external function definition won't work with a .a library. It needs a shared object .so library instead.

Not expecting it to work I ran the command ' gcc -shared -o libwiringPi.so *.o ' in the wiringPi source directory. To my surprise it produced a .so file with no errors displayed.

The file produced is here:- http://www.filedropper.com/libwiringpi

When this was used in a this Gambas test project http://www.filedropper.com/gpiotest it worked as expected.

I am sure this is not a true .so file but for now it seems to work. Maybe someone with some more knowledge can produce a better one.

The test project drives 10 LEDs and monitors 5 switches. Everything seems to work just like the C version.

The only problem I had was that the wiringPi library can be configured to work with several pin numbering conventions. This is achieved by calling different setup functions. These in turn modify function pointers to point the published functions to the correct internal functions.

For example one of the published functions is digitalWrite() this is pointed at digitalWriteGpio() by the function wiringPiSetupGpio().
Gambas doesn't seem to be able to handle function pointers so it produced an error when I tried to use digitalWrite(). However using digitalWriteGpio() worked OK.

So far the following functions have been tested as working.

wiringPiSetupGpio() , pinModeGpio() , pullUpDnControlGpio(), digitalWriteGpio() , digitalReadGpio() all appear to work as they do in C.

Like most programs that talk directly to the hardware Gambas3 must be run from a root login to get this to work.

More later when I have had time to experiment some more...

...Colin

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Sun Aug 12, 2012 8:10 am

Maybe the following list is helpful and can be completed,
if not the moderator may remove it.

svn r5026

|OK| - gb.cairo
libcairo2
libcairo2-dev
|OK| - gb.compress.bzlib2
libbz2-dev
|OK| - gb.db.mysql
|OK| - gb.db.odbc
unixodbc-dev
|| - gb.db.postgresql
|| - gb.db.sqlite2
|OK| - gb.desktop
libgnome-keyring-dev
libxtst-dev
|OK| - gb.desktop.gnome
|OK| - gb.gsl
libgsl0-dev
|OK| - gb.gtk
libgtk2.0-dev
libsvga1-dev
libgtkglext1-dev
|OK| - gb.gtk.opengl
|OK| - gb.image.imlib
libimlib2-dev
|OK| - gb.image.io
|?| - gb.jit
llvm-dev
llvm-3.1-dev
libclang-dev
|OK| - gb.ncurses
|OK| - gb.net.curl
libcurl4-gnutls-dev
|OK| - gb.opengl
|OK| - gb.opengl.glsl
|OK| - gb.opengl.glu
|OK| - gb.pdf
libpoppler-*-dev (* all)
libpopplerkit-dev
|OK| - gb.qt4
libqtcore4
libqtgui4
libqxt-core0
libqt4-dev
|OK| - gb.qt4.ext
|OK| - gb.qt4.opengl
libqt4-opengl-dev
|OK| - gb.qt4.webkit
|OK| - gb.sdl
|OK| - gb.sdl.sound
libsdl-ttf2.0-dev
libsdl-sound1.2-dev
libsdl-mixer1.2-dev
libsdl-image1.2-dev
libsdl1.2-dev
libdirectfb-dev
libimlib2-dev
libtiff4-dev
|OK| - gb.v4l
libv4l-dev
libjpeg8-dev
libpng12-dev

PS: anybody knows, how to get rid of this message on startup:
"gb.qt4: warning: unable to load Qt translation: en_US.UTF-8"

wally

g4eml
Posts: 56
Joined: Wed Oct 05, 2011 1:50 pm

Re: GAMBAS(basic)

Mon Aug 13, 2012 10:47 am

That warning message seems to be common on other platforms. People have asked about it on the Gambas forums. The answer has always been to just ignore it! Not very satisfactory but it doesn't seem to affect the operation.

IRQ
Posts: 35
Joined: Thu Aug 09, 2012 4:56 pm

Re: GAMBAS(basic)

Tue Aug 14, 2012 3:30 pm

g4eml wrote: The wiringPi C library written by Gordon looked like a good place to start. This takes the form of a /usr/local/lib/libwiringPi.a library and a /usr/local/include/wiringPi.h C include file.

...snip...

So far the following functions have been tested as working.

wiringPiSetupGpio() , pinModeGpio() , pullUpDnControlGpio(), digitalWriteGpio() , digitalReadGpio() all appear to work as they do in C.

Like most programs that talk directly to the hardware Gambas3 must be run from a root login to get this to work.

More later when I have had time to experiment some more...
Good stuff!

I'm doing the same using Mike McCauley's C Library

http://www.open.com.au/mikem/bcm2835/

So far I have verified that my compiled shared version of the library works as it should and tested calling a few functions from Gambas3. Will post more info here when done and if anyone want's a copy of the shared library file (libbcm2835.so) just let me know.

BTW, another source of Gambas info is the Gambas-user mailing list where many of the developers hangs out as well and I recognize wally as well :)

https://lists.sourceforge.net/lists/lis ... ambas-user

wally
Posts: 54
Joined: Mon Aug 06, 2012 12:07 pm

Re: GAMBAS(basic)

Thu Aug 16, 2012 6:59 am

Colin,
When this was used in a this Gambas test project http://www.filedropper.com/gpiotest it worked as expected.
may you please upload your gambas_testproject again. Seems no longer available for download.

thx wally

Return to “Other programming languages”