GAMBAS(basic)


104 posts   Page 2 of 5   1, 2, 3, 4, 5
by g4eml » Thu Aug 16, 2012 3:34 pm
Hi Wally,

I have had a lot of trouble with filedropper. It doesn't seem to be very reliable.

I have uploaded the GPIO test project to http://wikisend.com/download/434336/gpiotest.zip
and also the libwiringPi.so file http://wikisend.com/download/430700/libwiringPi.zip

Lets see if that works more reliably.


Colin
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Thu Aug 16, 2012 4:12 pm
Thank You !
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by wally » Thu Aug 16, 2012 5:09 pm
Colin,

may you please check the "gpiotest.zip".
I do not see any class in it.
I know that the content is hidden.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Thu Aug 16, 2012 10:35 pm
Wally,

All I did was to zip up the entire project folder so it should all be there. It should be just a single form. I will try to load it to another system tomorrow to check it out.

Colin.
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Fri Aug 17, 2012 3:30 pm
Colin,

maybe it's a good idea just to use "Project -> Make -> Source archive"
from inside the Gambas IDE.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Fri Aug 17, 2012 4:41 pm
Hi Wally,

Why have I never spotted that option before??? That makes it a lot easier. The way Gambas uses hidden files is one of the things I find very confusing.

Hopefully this time it will work...

http://wikisend.com/download/822696/gpiotest-0.0.1.tar.gz


Colin
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Fri Aug 17, 2012 4:48 pm
Now it works, thank you :)
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by wally » Sat Aug 18, 2012 4:33 pm
Colin,

when i try on real RPI (not qemu etc.) i get : "wiringPiSetup: Unable to open /dev/mem: Permission denied"
Seems it wnats me to run the testproject as root.
How did you manage this ?

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by DiFranca » Sat Aug 18, 2012 4:39 pm
Hi Colin

I try to use gpiotest-0.0.1.tar.gz , in gambas on UBUNTU 12.04 LTS machine , but i got error for library location !
i put libwiringPi.so on /usr/local/lib/ i make ldconfig to have acces on it
but gambas still give me error "Canot find dynamic library /usr/local/lib/libwiringPi.so"
Can you help me ?

Thank's
Francesco
Posts: 5
Joined: Sat Aug 18, 2012 4:20 pm
by g4eml » Sat Aug 18, 2012 11:06 pm
Hello Wally,

Yes, to access the GPIO on the Pi from any program it has to be run as root. I just logged in as root instead of pi. Gambas will then run with root privileges. I dont think the root login is enabled by default in the raspbian distro. You need to do a 'sudo passwd'. To set a root password.

It might also be possible to start Gambas from a terminal window with 'sudo gambas3' but I havn't tried this.


Francesco,

Can't help with that one, I can only suggest you check the spelling of the library name and make sure it is in the right location.

Colin
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by glenn66 » Sun Aug 19, 2012 7:37 pm
I just want to thank you guys for all the work done on Gambas 3 for the RaspberryPi. After a bit of messing around, I have it working and it isn't too bad at all.

http://rgwni.blogspot.co.uk/2012/08/ras ... ambas.html

I'll be following the work on the GPIO. My current projects are using PICs which communicate with the RPi via serial-USB. I'm working on a level shifter for the RS232 port on the GPIO. The main reason for this is that in the vehicle set-up I'm experimenting with, the microcontroller must run immediately and the boot time for the RPi rules it out of the control side, but the graphics capabilities make it a strong contender for the graphing and analysis side.
Posts: 54
Joined: Fri Nov 25, 2011 4:06 pm
Location: Belfast
by wally » Mon Aug 20, 2012 3:34 am
i do not understand this 3 periods in a wiringPi function

wiringSerial.c line 160
Code: Select all
void serialPrintf (int fd, char *message, ...)


How this might be declared as Gambas extern ?
Code: Select all
Public Extern serialPrintf(fd As Integer, message As Pointer, ...)


thx wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by wally » Mon Aug 20, 2012 9:29 am
OK, found the explanation of this "..." in stdarg.h docs.

And i got a information from gambas mailinglist, the declaration should looks like this:
Code: Select all
Public Extern serialPrintf(fd As Integer, message As String, ...) In ...

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Mon Aug 20, 2012 10:01 am
Hi Wally..

Looks like you have found the answer, you don't need the 'In' part of the definition if the library has already been identified with the LIBRARY command.

I have not tried the serialPrintf() function but I have tested the lcdprintf() with a 2x40 character LCD attached and this works fine.

I also confirmed that you can start as root from a terminal window using ' sudo gambas3'
I am sure you could also create a new desktop icon to do the same thing.

Colin.
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Mon Aug 20, 2012 10:14 am
i do not have a monitor for hdmi/dvi
for now i work with "ssh -X" and do not know yet how to get root access this way. I think i need to edit the udev-rules but not sure how to do this.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Mon Aug 20, 2012 10:46 am
glenn66....

Yes, I find that Gambas3 works fairly well on the Pi. Having done a lot of VB6 programming on Windows I find it is very easy to use. It's certainly one of the simplest ways (for me) of quickly writing a GUI application on the Pi. Some things are a bit slow such as reading and writing files but I think that is down to the way the Pi uses the SD card.

I agree the PI would make a good front end with a PIC handling the hardware interfacing side of things when speed is important. I haven't tried this yet but having a lot of experience with PICs I know it would be quite straight forward to do.
Having now found out a bit about using the external C library to drive the GPIO I can see how it would be possible to write my own to handle anything that was required.


...Colin
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Tue Aug 21, 2012 5:18 am
How can i make the RPI hardware accessible by gambas NOT running as root. This also might be interesting for C and shell programms.
I tried "gpio-admin" but this seems not to work for gambas and C testprojects
or i messed up the pin numbering.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Tue Aug 21, 2012 9:18 am
The wiringPi library had a mode that uses the sys/class/gpio file system access to the gpio. This is a lot slower but apparently works without root access. I haven't tried it but it uses the *sys version of the library routines, so for Gambas the definitions would need to be changed to point to these instead of the *gpio versions.

To use it this way it is necessary to export the relevant pins before using them, this needs to be done from command line as far as I can tell using the wiringPi 'gpio' command which is supposed to work as a non-root user. It might be possible to issue these gpio operating system commands from a gambas program or from a script file that does it before starting the gambas project.

Haven't tried any of this...


Colin.
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by vinmao » Tue Aug 21, 2012 4:03 pm
Hi people am new at gambas any one who can help me develop cyber POS billing timer,i will appreciate if you suggest an english cyber timer on the open source.


Thanks
Posts: 1
Joined: Tue Aug 21, 2012 3:55 pm
by mpthompson » Tue Aug 28, 2012 2:49 pm
Has anyone produced fixes to the Gumbas3 package that can be updated in the Raspbian repository? Seems there are enough users of the package to warrant getting it fixed for future uses to get a working version using "apt-get". I'm personally not familiar with Gambas and don't really have the time to work on fixing the package, but if someone could help create a recipe for fixing the existing Gambas3 package I can work to make sure it gets into the the repository. Based on some of the posts above, it seems a working package of version 3.21 shouldn't be too hard to produce.

Mike
User avatar
Moderator
Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by wally » Tue Aug 28, 2012 3:42 pm
Mike,

the actual SVN version compiles without any problem. Only install the necessary dev packages (see above, all available on wheezy) and you can build runtime , all components (except gb.jit), and the IDE. It takes of course much more time on Raspi but who cares. Unfortunately i do not know how to make deb-packages.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by g4eml » Tue Aug 28, 2012 3:51 pm
Hello Mike,

I agree it would be nice to have a working version in the repository. I don't have much experience with Linux so I have been on a steep learning curve. I have done a lot of VB programming in Windows so I find Gambas to be a easy and quick way of getting a GUI program working in Linux.

I built version 3.2.1 from the Gambas source and managed to get it working on Raspbian after about three days work. However I got very confused with all the dependencies so I am not sure I could repeat it again without a similar amount of effort.

I did come up with a work around which works on a fresh Raspbian Install.

First use apt-get to install the current repository version and the required dependencies.

Then overwrite the files in /usr/lib/gambas3 /usr/share/gambas3 and /usr/bin with the new versions which I built from 3.2.1 source.
(See previous post for the relevant files. If they are not still available on filedropper.com then I can upload them again.)

After this everything appears to work as it should.

I don't have any experience of how the apt-get packages work so I don't know if it would be possible just to update the files concerned in the existing package.

I am happy to help try to get it working with some assistance.

Colin.
Posts: 55
Joined: Wed Oct 05, 2011 1:50 pm
by wally » Tue Aug 28, 2012 4:08 pm
Dear Forum Moderator,

maybe it's possible to make my posting "by wally » Sun Aug 12, 2012 9:10 am" in this thread editable for all, so we can collect all necessary dev-packages and particularly component experience. Thank you.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm
by mpthompson » Tue Aug 28, 2012 6:10 pm
I'm going to rebuild the current 3.1 version in the Raspbian repository with JIT disabled using the --disable-jit flag to configure. Hopefully that will yield a working Debian package. It's going to be a LONG build so I'll post back once it's done.

Mike
User avatar
Moderator
Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by mpthompson » Wed Aug 29, 2012 5:00 am
Sadly, my attempt to rebuild gambas3 with the jit disabled did not yield a working package for Raspbian. I'll have to consider a different approach to getting a working package with the newer versions that do seem to work.
User avatar
Moderator
Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA