Can't run on Pi any longer

Post

Posted
Rating:
#1 (In Topic #479)
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 I have been running some of my work on the raspberry pi. Works nice until now.
when I attempt to run a new verson of the programs I wrote I get this…

ERROR: #2: Cannot load class 'FMain': Bytecode too recent. Please upgrade Gambas.

Gambas is up to date on the pi. Version 3.12.2 When I to the apt-get upgrade Gambas3 it tells me everything is up to date. However attempting to run the program gives the error still. Any Help?
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
stevedee is in the usergroup ‘Regular’
This sounds familiar. Its probably due to Gambas version differences.

Try opening the project in Gambas on the Pi, then menu Project > Compile All. It should now run.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
nope. Tried that before posting and even attempting to run the project in a full gambas on the pi gives that same error in gambas editor. I tried making new executable on the pi and when I go to run it, same error.
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
That happens if an app has been compiled on a higher version gambas.
Is that the case? (initially)

There's an undocumented (and little known about) Environment variable to fix this.

In the project settings on the newer gambas IDE go to "Environment" and add a variable
GB_PCODE_VERSION and set it to 3.8

That will fix the bytecode error when running an app on a lesser gambas runtime and may fix your error too.

If you have compiled the app on the same gambas that it errors on then there must be a conflict somewhere,
ie an older version runtime on the system.
I'd recommend a re-install

or if you have downloaded and compiled gambas then your previous repository install and compilation install will conflict.


Hope this helps
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
Thanks for the advice. I put in the variable and made a new executable but same exact error. The problem does not exist on my fedora systems so must be problem on the pi version
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
 Sorry I can't see if i get the same error as i have Gambas 3.15 on my PI
maybe upgrade the gambas to 3.15?
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
Darn it lol  ,
There has to be a way…

Maybe deleting the contents of the .gambas directory in the projects folder could force a rebuild of the app?
Online now: No Back to the top

Post

Posted
Rating:
#8
Guru
BruceSteers is in the usergroup ‘Guru’
Sounds like it's not compiling/saving the exe properly.
The PCODE variable should make an app work on anything down do gambas 3.8

are write access permissions okay on the folder/files?

pcode variable set like this…
(attachment removed)

That should work unless the executable has not compiled correctly.
Maybe try compiling the app on another machine, even if has gambas 3.15 using the PCODE variable should make it compatible.
Unless the app has specific modern code that doesn't exist for a lesser gambas.
I have a few apps and none of them compiled on 3.15 fail to work on 3.12 with the GB_PCODE_VERSION=3.8 set in its settings.
Online now: No Back to the top

Post

Posted
Rating:
#9
Guru
BruceSteers is in the usergroup ‘Guru’
 One other thing to check to see if it's a problem with the specific app or a problem in gambas itself is to quickly make a hello world type new project on gambas on the pi and compile it and see if that runs okay.
If yes then it must be the app itself.

If so i'd recommend the best thing to do is open the .gambas folder in the projects directory and delete the FMain (and any other) file in there. then the compiler will re-make it for your gambas.
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 I originally set up using gambas 3.15 on other system. Never had a problem like this before. it just always worked. I tried to remove gambas on the pi and it didn't seem to actually remove it. But when I go to install gambas I only see 3.12 available. I am sure this needs to be updated which is what the message says but there is no upgrade…

As far as removing fmain that is the program. deleting that would be deleting the program? am I thinking right?

I can write a program on the pi (which is not what I usually do because the program goes many places) and that is ok, but instead of focusing on the program would it not be best to focus on updating gambas runtime? That seems to be the issue and all apt-get says that gambas 3.12 is the most up to date.
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Regular
stevedee is in the usergroup ‘Regular’
Many Linux distributions maintain their own Repositories, and many still have [very] old versions of applications like Gambas. Its no surprise to me that the OS on your Pi is running behind others.

If you want to be able to open and edit your Gambas projects on your systems (e.g. laptop, Pi & so on) I'd suggest you either upgrade or downgrade so that each system is running the same Gambas version. Although the Pi repository that you are using has an older version, you can usually still upgrade Gambas using another technique. See "Compilation & Installation" at http://gambas.sourceforge.net/en/main.html#  …or ask gbWilly who has been the guru for this for many years.

But if you only want to run your Gambas 'exe' on the Pi, then you could try creating an installation package via your 3.15 system, and install this on the Pi. This will probably work as long as there are no other fundamental dependency issues.
Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Guru
cogier is in the usergroup ‘Guru’
I installed Ubuntu Mate on a Pi 4 and was able to add the Gambas ppa and install Gambas 3.15.2.
Online now: No Back to the top

Post

Posted
Rating:
#13
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cogier said

I installed Ubuntu Mate on a Pi 4…

That's a good idea Charlie, its probably the Raspbian OS that doesn't have the up-to-date version.
Online now: No Back to the top

Post

Posted
Rating:
#14
Guru
BruceSteers is in the usergroup ‘Guru’

sadams54 said

As far as removing fmain that is the program. deleting that would be deleting the program? am I thinking right?

I can write a program on the pi (which is not what I usually do because the program goes many places) and that is ok, but instead of focusing on the program would it not be best to focus on updating gambas runtime? That seems to be the issue and all apt-get says that gambas 3.12 is the most up to date.

No if you have the Gambas IDE than the program is just the source code in the .src dir and a couple of settings files in the main dir.
when you compile and make the executable it makes the FMain file and any other class/form executables in the .gambas folder.

the compiler you are trying to use wont seem to overwrite the FMain you have as the interpreter is still saying a bytecode mismatch.

if you delete the files in the .gambas/ folder manually it should re-create them on the next compile.
That's technically what selecting "Compile All" should do.
I can only assume a folder/file permission/ownership issue is happening there.
It's worth a try.
easy enough to make a backup and then try.

And i'm working on installing 3.15 on raspian.  i got wiki up to date with dependencies but the compile failed complaining about PDFDoc problems.
I need to get some help from the folks on the mailing list i think.
Online now: No Back to the top

Post

Posted
Rating:
#15
Guru
BruceSteers is in the usergroup ‘Guru’

stevedee said

cogier said

I installed Ubuntu Mate on a Pi 4…

That's a good idea Charlie, its probably the Raspbian OS that doesn't have the up-to-date version.

It's not so much "Raspian" as it is "Debian" I've got Debian Buster on my proper pc and all i get is 3.12 on that too :(

Although compiling 3.15 was successful on my Debian.
Online now: No Back to the top

Post

Posted
Rating:
#16
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 OK, now this is making more sense. I will try the deletion of the .gambas folder and see if I can get it to clean compile. The program is already installed using the install package. By program I mean the one I wrote. I have the program on several computers. I have found that once you create the executable you can overwrite that on any other system and as long as the runtime is ok, it works. I used this to create an update feature in the program so it can download from my designated source and replace itself. Works beautifully by the way. I am using raspian on the one with issue.
I prefer to not compile my own full gambas just for that one. I like to stick to the repositories. Less work keeping things update for me that way.

Thank you all for the help so far. I will let you know how it goes.
Online now: No Back to the top

Post

Posted
Rating:
#17
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 removed the contents of .gambas but was not able to make progress. also could not compile anything. I put the files back in and was then able to run the program in the IDE but all complied versions on that machine said that now could not load fmain. Thinking I'll have to wait until the gambas runtime for raspian ver 3.15 is out. I just can't win either way it seems.
Online now: No Back to the top

Post

Posted
Rating:
#18
Guru
BruceSteers is in the usergroup ‘Guru’
Do you know if Raspian buster has "Sid"? (new debian unstable)

I added sid to my main pc's debian and found Gambas 3.15.2 is there but i do not know if raspian has it's own version as i couldn't add the debian sid to raspian :(

I understand about thinking the Debian/Raspian distros should be more up to date, it's a shame it's out of the Gambas developers hands.

And fully agree on not wanting to compile. especially on Raspberry, I've spent hours trying to compile gambas and it's still not working.
But for me gambas 3.12 works fine and all my projects load into it and re-compile okay.

I'm convinced your issue must be a folder/file permission/write access type of thing going on.
For gambas to not be able to create the exe's in the .gambas dir is a big issue and i think that the new version will probably have the same issue too.

My questions would be..
Did you copy or unpack the app folder as root?
If it is a permissions thing going on try running the gambas IDE as root (sudo gambas3) and see if app compiles then.
or try a chown on the folder to own it.
sudo chown -hR username projectfolder

Are you remembering to press the "Compile All" option in gambas before pressing the "run" button when moving app from one gambas version to the other.

It's a puzzle for sure :)
Never say die my friend, we'll crack this :)
Online now: No Back to the top

Post

Posted
Rating:
#19
Guru
BruceSteers is in the usergroup ‘Guru’
What "should" also be working too is entering the GB_PCODE_VERSION 3.8 Environment variable into your IDE for your app on the newer gambas and compiling.
That should totally work. !?  EVERY app i've compiled on 3.15 has worked for me without recompile on 3.12.
Are you sure you got that bit right?

But again you MUST remember to press "Compile All" to make sure ALL exe's in the .gambas dir get remade.

Post the project if you like. and i'll take a crack at it. i got a fresh Pi here with gambas 3.12 to test it on :)

hmmm, fresh PI  ;)
Online now: No Back to the top

Post

Posted
Rating:
#20
Avatar
Regular
stevedee is in the usergroup ‘Regular’
 Just a note on Debian/Raspbian releases for anyone not clear;

Debian 'stable' releases are typically released every 2 years or so and are very stable. That's the main reason for using Debian and one of the reasons for so many other distros using it as a base. However, if you need a Linux OS with a shorter release interval, there are plenty of others to choose from.

Raspbian is a special Pi version of Debian for Arm processors with a similar release interval. So Raspbian is also very stable, and there are other Pi OS alternatives with shorter release intervals.

Debian has a development branch code-named 'Sid' which is always unstable (think Toy Story). So Sid is generally best avoided. Debian also has a 'testing' branch which is a better bet than Sid (i.e. less likely to have unresolved problems).

Currently;
 stable = Buster
 testing = Bullseye
 unstable = Sid

I hope that helps.
Online now: No Back to the top

Post

Posted
Rating:
#21
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 I will keep working to get this to work but I wonder about how much energy to put in. I did the environment variable and confirmed it is still in there. But I wonder about all the work to patch around something that just needs updated. Raspian is behind due to this in my mind. I can work using the IDE for a short time but huge pain in the ass.
I used cut and paste to put the environment variable in. So as long as you typed it correctly in the first reference, it is right on mine. Raspian has not been my favorite distro, I would love to see fedora working reliably on pi3 and 4.
So we all keep it str8, I do not develop on the pi. I use a standard pc with fedora 32 on it. The pi is just in the background performing tasks and just accepts the program updates. That is of course how I ran into the issue of 3.15 vs 3.12.

New ideas welcome
Online now: No Back to the top

Post

Posted
Rating:
#22
Avatar
Regular
stevedee is in the usergroup ‘Regular’

sadams54 said

,,,New ideas welcome

OK, so my suggestion is that you zip up your project file and post it here. That will allow us to run it in the IDE on our own Pi hardware.

If you don't want us to see your project, just make a simple "Hello World" program, and as long as it exhibits the same problems, that will be fine for our testing.
Online now: No Back to the top

Post

Posted
Rating:
#23
Avatar
Guru
cogier is in the usergroup ‘Guru’
Apparently you can run Fedora on the pi, have a look here.
Online now: No Back to the top

Post

Posted
Rating:
#24
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
I tried fedora on the pi and it had serious deficiencies. Now of course I am using pi4 and fedora is not doing that one yet. At least according to what I read. I would love fedora on the pi4 it would be a dream.
Online now: No Back to the top

Post

Posted
Rating:
#25
Avatar
Regular
stevedee is in the usergroup ‘Regular’

BruceSteers said

What "should" also be working too is entering the GB_PCODE_VERSION 3.8 Environment variable into your IDE…

I checked this today by making a simple 'hello world' app using v3.15.2 and confirmed it would not run in the IDE when copied to systems running v3.8.4 and v3.12.2.

Back on the v3.15.2 system, I went to menu Project > Properties > Environment and added the variable "GB_PCODE_VERSION" and gave it the value "3.8"

I then did "Compile All" and saved the project, deleted the old folders on the v3.8.4 and 3.12.2 systems before copying the updated project folder to both. The project now runs on all 3 versions of Gambas. The v3.12.2 Gambas is on a Pi running Raspbian Buster.

This 'pcode' feature was added with the introduction of Gambas v3.4. When it has been correctly setup, the .project file should contain the string:-
Environment="GB_PCODE_VERSION=3.8"
Online now: No Back to the top
1 guest and 0 members have just viewed this.