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

Re: GAMBAS(basic)

Tue Feb 19, 2013 4:14 pm

A couple of new Gambas resources to check out, great initiative Willy & Co!

Show off what can be done with Gambas3
http://gambasshowcase.org

As set of good guides to learn develop applications with Gambas3
http://howtogambas.org

A complete distribution with Gambas3 development environment pre installed
http://gambos.org

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

Re: GAMBAS(basic)

Wed Feb 20, 2013 11:31 am

Anyone knows how to autostart a Gambas3 application at boot on Debian Squeeze? I've tried to put the script file "test.sh" in "/etc/init.d" and then run...

Code: Select all

update-rc.d test.sh defaults
but it does not start after a reboot (it does start if I run script manually in the shell). Any ideas?

Code: Select all

#!/bin/bash

### BEGIN INIT INFO
# Provides:          test
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Boot up script
# Description:
### END INIT INFO

# Start program
/home/test/test.gambas

exit 0

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: GAMBAS(basic)

Wed Feb 20, 2013 12:14 pm

IRQ wrote:Anyone knows how to autostart a Gambas3 application at boot on Debian Squeeze? I've tried to put the script file "test.sh" in "/etc/init.d" and then run...

Code: Select all

update-rc.d test.sh defaults
but it does not start after a reboot (it does start if I run script manually in the shell). Any ideas?

Code: Select all

#!/bin/bash

### BEGIN INIT INFO
# Provides:          test
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Boot up script
# Description:
### END INIT INFO

# Start program
/home/test/test.gambas

exit 0
Is this a console app(3) or graphical(5)? as starting in run level 2 is very strange... Have you checked the format of another init.d script, and paid notice to the case start) stop) etc.? Make it stop in all levels it does not start in. If it is a console app, and you startx, and then run it at run level 5, it will not display an xterm window. You wil have to start

Code: Select all

xterm /path/to/app
. The run level system will also not save any work when switching levels unless the app responds to sig HUP and sig KILL, and maybe some others.
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

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

Re: GAMBAS(basic)

Wed Feb 20, 2013 12:42 pm

Sorry for not being all clear.

It's a console app running as a daemon and I will do as you suggest...

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

Re: GAMBAS(basic)

Tue Feb 26, 2013 3:52 pm

This may be old news for some but may help newcomers to get started with Gambas3...

A Beginner's Guide to Gambas, Revised for Version 3
http://beginnersguidetogambas.com/

Kudos to John Rittinghouse and Jon Nicholson for writing this book!

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: GAMBAS(basic)

Wed Feb 27, 2013 3:53 pm

Gambas breaking audio on Pi

I seem to have a problem with a Gambas application since I moved from analogue audio to HDMI.

My Gambas app plays music files by simply running a command like this:-
hPlayer = EXEC ["ogg123", strMusicPath]

Typically, after playing a few files, audio "breaks" and what I hear is a fraction of a second of audio, nothing, a fraction of a second audio, nothing & so on (i.e. very roughly a 200ms burst of audio followed by a 3 second break) . Shutting down the application does not recover the situation (i.e. I can't play music or sound files again until after a re-boot).

My Pi was rebuilt using the latest Raspian download at the weekend.

I'm reluctant to post this bug with Gambas at this stage because (i) I'd like it validated by another user & (ii) I'm running Gambas 3.2.1. with the 3.2.1. Patch.

If anyone would like to test this for me, this is the process to reproduce.
(1) get a small collection of ogg music files and put into a dedicated directory (e.g. /home/pi/songs).
(2) install vorbis-tools (which includes the ogg123 player).
(3) initially (first test) run from a terminal: ogg123 -Z /home/pi/songs
This should play your songs indefinitely without error.
(4) stop ogg123 and create a very simple Gambas app which just includes:-

Code: Select all

Public Sub Form_Open()
	Exec ["ogg123","-Z","/home/pi/songs"]
End
(5) Now run this app and see if it breaks audio (usually fails with 20 minutes).

I get the same problem if I use mpg321 to play mp3 files.

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

Re: GAMBAS(basic)

Thu Feb 28, 2013 2:42 pm

Sorry to say I currently can't test it (running remote), hopefully someone else can. Maybe you should try to update to latest version (currently 3.4) and test again.

skorc99
Posts: 1
Joined: Mon Apr 08, 2013 8:56 am

Re: GAMBAS(basic)

Mon Apr 08, 2013 9:03 am

g4eml wrote:Hi kru64..

I have uploaded the Gambas 3.2.1 update files to wikisend http://wikisend.com/download/751020/Gam ... 0files.zip

As mentioned before, first install the raspbian version of Gambas3 from the repositiory (which won't run) then overwrite the installed files with those in this download.

Colin
Hello,

any new link to the file. Link is down...

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: GAMBAS(basic)

Sun May 12, 2013 7:16 am

wally wrote:Hello,
i think the patch-approach is not the real thing because it does not allow
updates. Gambas3 is updated daily and interesting changes occur....
Many thanks Wally.

I needed to move on from v3.2.1 so followed your guide. It looks like Gambas is working pretty well, although I am missing 4 components: gb.chart, gb.mysql, gb.opengl.sge & gb.option. I guess its just a case of working out which extra packages are required.

danidani
Posts: 1
Joined: Sat May 18, 2013 10:08 am

Re: GAMBAS(basic)

Sat May 18, 2013 1:23 pm

I am also looking for the patch. Can somebody please upload the file?

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: GAMBAS(basic)

Sat May 18, 2013 7:58 pm

SteveDee wrote:...although I am missing 4 components: gb.chart, gb.mysql, gb.opengl.sge & gb.option....
These "missing" components are experimental, and not normally included. So this method does work and gives you the latest development build: http://whiteislandsoftware.com/forum/in ... rst_unread

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

Re: GAMBAS(basic)

Sat Jul 27, 2013 10:37 am

Gambas 3.4.2 has been released. Recommended!

http://gambas.sourceforge.net/en/main.html

DiFranca
Posts: 5
Joined: Sat Aug 18, 2012 4:20 pm

Re: GAMBAS(basic)

Wed Aug 28, 2013 8:11 am

IRQ wrote:Gambas 3.4.2 has been released. Recommended!

http://gambas.sourceforge.net/en/main.html
Revision 5812 , cannot compile on Raspy
Qt4 problems during "make"

DiFranca
Posts: 5
Joined: Sat Aug 18, 2012 4:20 pm

Re: GAMBAS(basic)

Wed Aug 28, 2013 8:14 am

IRQ wrote:Anyone knows how to autostart a Gambas3 application at boot on Debian Squeeze? I've tried to put the script file "test.sh" in "/etc/init.d" and then run...

Code: Select all

update-rc.d test.sh defaults
but it does not start after a reboot (it does start if I run script manually in the shell). Any ideas?

Code: Select all

#!/bin/bash

### BEGIN INIT INFO
# Provides:          test
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Boot up script
# Description:
### END INIT INFO

# Start program
/home/test/test.gambas

exit 0



For auto starting a gambas compiled software i did in this way , and it works good :


• Create the folder home/pi/.config/lxsession/LXDE

• In this folder put a file named autostart containing one line specifying the full path of the file to be executed:

e.g. /home/test/test.gambas

• Make the autostart file executable by using the properties menu in the File Manager to alter the permissions on the file

gbWilly
Posts: 13
Joined: Sun Sep 01, 2013 12:18 am

Re: GAMBAS(basic)

Sun Sep 01, 2013 1:16 am

Hello all,

First let me say I'm new to this forum but no newbie to Gambas.

I've been reading this thread and decided to make an account to give some clarification on matters.
First let me say I don't own a Raspberry Pi ...yet...

I see a lot of you are struggling installing Gambas.
I would like to explain some basics in the hope this will clear some of the struggling (talking from a Debian 7 wheezy perspective here).

1. I see that those of you that compile Gambas from source (seems to take a while :D ) often choose the 'trunk' version. Let me remind you that 'trunk' version is the development branch (unstable) of Gambas and that it can have several updates in one day. Besides the fact that you need to compile a lot to keep up to date (a slow process on Raspberry Pi) you also have a chance of it NOT compiling (and not because of you doing something wrong).
For example: Benoit, the main developer) was on vacation for a few weeks. Last trunk revision when he left was revision #5812 and this didn't compile (last working one seemed to be revision #5802 or something). So people updating their trunk version where in for a surprise that lasted until Benoit came back from his vacation except if they knew how to revert back to and older revision.
svn also holds the branch for the current stable version (3.4. - branch) or any older stable release.
Instead of:

Code: Select all

svn checkout svn://svn.code.sf.net/p/gambas/code/gambas/trunk/
do:

Code: Select all

svn checkout svn://svn.code.sf.net/p/gambas/code/gambas/branches/3.4/
Installation is no different than installing the trunk version.
Advantages are you get a stable version and you don't need to compile Gambas that often (once every few months or so.)
2. Dependency problems: As the Gambas site doesn't mention the proper dependencies (those mentioned there for Debian are still Gambas 2) check out 'How To Gambas - Installing Gambas' (link below) for detailed instruction on dependencies -> you need the chapters for installing from official download or Installing from subversion and check the Debian chapters. Current version of the guide (1.1.0) has all dependencies for Gambas 3.3.4 (but they should be the same for Gambas 3.4. series, I'll check and post if there are more needed and update the guide).

Hope this will be helpful,

gbWilly

Link to How To Gambas - Installing Gambas: http://howtogambas.org/index.php?page=c ... c&id=1%2F2
Note: If you happen to do a fresh install of Gambas on Raspbian and are willing to document the process (screenshots and short instructions if they are different than the one for Debain installs in the guide) then I will add a chapter on Raspbian to the guide with instructions and screenshots and of course a mention of your contribution.
Last edited by gbWilly on Thu Sep 05, 2013 10:48 pm, edited 1 time in total.
Gambas ShowCase, a Gambas 3 software center (http://gambasshowcase.org/)
How To Gambas, a series of guides to learn programming in Gambas 3 (http://howtogambas.org/)
GambOS, a distribution aimed at being a Gambas 3 learning environment (http://gambos.org)

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: GAMBAS(basic)

Sun Sep 01, 2013 7:49 am

gbWilly wrote:....I've been reading this thread and decided to make an account to give some clarification on matters.....

Nice one Willy!

I'll certainly give it a go...but may take a few days to get on it.

gbWilly
Posts: 13
Joined: Sun Sep 01, 2013 12:18 am

Re: GAMBAS(basic)

Mon Sep 02, 2013 2:25 pm

Current version of the guide (1.1.0) has all dependencies for Gambas 3.3.4 (but they should be the same for Gambas 3.4. series, I'll check and post if there are more needed and update the guide).
I installed 3.4.90 (trunk version) on Debian 7 wheezy ( -> Not on a Raspberry Pi) and there are some dependency changes.
Note that these changes are NOT required for installing Gambas 3.4.2
1. libalure needs to be installed (needed by gb.openal)
2. gstreamer version now has to be 1.0. (and not 0.10 as before -> it is needed to get gb.media going). As this one is NOT in the wheezy repos but in unstable (sid), you will need to add that repo to your /ect/apt/sources.list (to edit do: sudo nano -w /etc/apt/sources.list):

Code: Select all

deb http://ftp.nl.debian.org/debian/ sid main
deb-src http://ftp.nl.debian.org/debian/ sid main
Next save and close the sources.list and download latest version for Gambas website and unpack (or use svn to get the source).

Open a terminal and type following commands (for Gambas 3.4.2 replace libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev with libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev:

Code: Select all

sudo apt-get update

sudo apt-get install build-essential g++ autoconf libbz2-dev libfbclient2 libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libldap2-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libsage-dev libxml2-dev libxslt1-dev libbonobo2-dev libcos4-dev libomniorb4-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libesd0-dev libdirectfb-dev libaa1-dev libxtst-dev libffi-dev kdelibs5-dev firebird-dev libqt4-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgsl0-dev libncurses5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgmime-2.6-dev libalure-dev
Note:
For wheezy and jessie you need to add llvm-3.1-dev to above if you need gb.jit working (JIT compiler)
For sid you need to add llvm-3.2-dev to above if you need gb.jit working.
But Raspberry can't do anything with gb.jit, so might as well just leave it out. ;)


Next run the script (./reconf-all)
Next do the whole installation of Gambas (./configure -C, make, make install).

In terminal type gambas3 and you should see it running. You can make a symlink on your desktop to use for starting Gambas if desired.

If you run into trouble with your installation, just post your problem and I'll see how I can help out.

gbWilly
Last edited by gbWilly on Sat Oct 05, 2013 12:16 pm, edited 1 time in total.
Gambas ShowCase, a Gambas 3 software center (http://gambasshowcase.org/)
How To Gambas, a series of guides to learn programming in Gambas 3 (http://howtogambas.org/)
GambOS, a distribution aimed at being a Gambas 3 learning environment (http://gambos.org)

gbWilly
Posts: 13
Joined: Sun Sep 01, 2013 12:18 am

Re: GAMBAS(basic)

Sat Oct 05, 2013 12:14 pm

New guide available to learn programming with Gambas -> How To Gambas 3 - Building GUI Applications

Image

Check here: http://howtogambas.org/index.php?page=c ... c&id=1%2F3
Gambas ShowCase, a Gambas 3 software center (http://gambasshowcase.org/)
How To Gambas, a series of guides to learn programming in Gambas 3 (http://howtogambas.org/)
GambOS, a distribution aimed at being a Gambas 3 learning environment (http://gambos.org)

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

Re: GAMBAS(basic)

Sun Oct 06, 2013 4:59 pm

Haven't had a chance to read it yet but looks great, thanks for sharing!

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

Re: GAMBAS(basic)

Wed Oct 23, 2013 7:55 am


carlsnilsson
Posts: 7
Joined: Sat Nov 16, 2013 11:50 am

Re: GAMBAS(basic)

Thu Nov 21, 2013 12:33 pm

To g4eml:
I'm almost a newbie too, although I have installed an earlier gambas on SUSE10.0 - although I can't recall exactly how I did it! I think I used zypper without really understanding what I was doing. I have bought a RPi and installed Raspbian and Gambas3 with the simple install commands for the debian repo and, as you know only too well, it installs but does not run. I have looked through this forum and followed your posting of the files for gambas 3.2.1, first on File Dropper and later on Wikisend, but they are not now available. Gambas is essential for my project (I'm not a C programmer, but I have written a lot in VB6), so I wonder if you would be so kind as to post me an updated source for your 3.2.1 files. I don't need the very latest gambas, so far as I'm aware.
Carl

carlsnilsson
Posts: 7
Joined: Sat Nov 16, 2013 11:50 am

Re: GAMBAS(basic)

Fri Nov 22, 2013 2:00 pm

fuller wrote: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
fuller: Thank you for that. More than a year now since you posted that, but I downloaded and used that tonight and it seems top work fine. Like many, I only have so much time to spend, and I would rather spend it right now getting into gambas directly than the seemingly mammoth task of learning my linux to compile a source distro! I would rather that proceeded more gently in the background. One question: when you installed wheezy did you select the spi capability? The whole purpose of my using a RPi is wrapped around using serial inputs from UART, SPI and I2C. So I guess I also need to try to talk to g4emi (Colin) again.
Regards and thanks again for taking the trouble to make that image available.
Carl

carlsnilsson
Posts: 7
Joined: Sat Nov 16, 2013 11:50 am

Re: GAMBAS(basic)

Fri Nov 22, 2013 2:14 pm

g4eml wrote: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.
(snip)
...Colin
G'day again Colin: I wonder how that project proceeded. As those files are no longer in place, I can only ask if you would be so kind as to make them availble again - or updated ones? I got my gambas 3.2.1 going thanks to fuller's image. I now need to get on with setting up SPI, I2C and UARTS to move my project along. Once I have satified myself that the software is doable (by me!), I'll get to work on the hardware, about which I'm pretty confident.
Regards Carl

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: GAMBAS(basic)

Fri Nov 22, 2013 5:03 pm

carlsnilsson wrote: ...I now need to get on with setting up SPI, I2C and UARTS to move my project along....

You can use Gordon's wiringPi with Gambas like this:-
http://captainbodgit.blogspot.co.uk/201 ... ambas.html

carlsnilsson
Posts: 7
Joined: Sat Nov 16, 2013 11:50 am

Re: GAMBAS(basic)

Sat Nov 23, 2013 12:27 pm

SteveDee wrote:
carlsnilsson wrote: ...I now need to get on with setting up SPI, I2C and UARTS to move my project along....
You can use Gordon's wiringPi with Gambas like this:-
http://captainbodgit.blogspot.co.uk/201 ... ambas.html
Used that. Loaded wiringPi just fine. captainbodgit's blog spelled out the procedure at just the level I could cope with. Thank you, Steve. A post like that helps a lot.
Carl

Return to “Other programming languages”