Launch BASIC program on PI BOOT

Here you can talk about anything related to BBC BASIC, not covered in another category
User avatar
JeremyNicoll
Posts: 72
Joined: Sun 26 Jul 2020, 22:22
Location: Edinburgh

Re: Launch BASIC program on PI BOOT

Post by JeremyNicoll »

Ric wrote: Mon 19 Feb 2024, 22:10 I have just discovered I have a static IP, the dhpc enabled says no.
Edit!! Just found another dhpc enabled that says yes.
Your router almost certainly uses a DHCP server to hand out LAN addresses to the devices on your LAN, and possibly you have configured that yourself so that specific devices (often printers) have fixed addresses.

But the need(*) for the static address that Richard asked about is so that the outside world can send traffic to your modem/router, which has an address inside your ISP's network. Does THAT address ever change?

* - there are ways around this. Some people use public internet services that save their current WAN (ie public) IP address for them. Whenever someone sees that their public IP address has changed they log in to that service & update the stored information. Anyone (or anyone's app) that wants to access their system first queries the stored info, then sends their traffic to that address. Google for "dynamic DNS", DDNS etc.
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

Evening all
I am once again trying to launch a program on my Pi boot up. I have looked through the link that jeremy posted, but to be honest, it is beyond my knowledge, not least because it refers to how to launch a python script. Can any one help as how to launch a BBC.exe on boot?
I have looked on the net also, but this reveasls no clues either. Again it is all about python!
I know it should be simlpe, but so is driving when youve had years of practice and someone has shown you how to do it.
Heres hoping for a simple step by step reply.

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: Launch BASIC program on PI BOOT

Post by Richard Russell »

Ric wrote: Mon 06 Jan 2025, 16:50 I am once again trying to launch a program on my Pi boot up.
That question is not specific to BBC BASIC, the answer will be equally applicable to any programming or scripting language. A Google search finds several solutions, here is one hit which might be of particular interest because it offers multiple methods:

https://www.dexterindustries.com/howto/ ... t-startup/

Despite the examples given there being of running a Python program, simply replace any reference to python with bbcsdl (or /path/to/bbcsdl depending on how and where BBC BASIC is installed). Alternatively (and probably better) 'compile' your BBC BASIC program to an executable and run that.

Note the comment near the end of the article that "You can use any of these methods to run your program on boot as long as the point at which your Python script is run in the startup sequence is not vital". That proviso is equally applicable to BBC BASIC.

Don't be intimidated by unfamiliar instructions. Choose whichever method seems easiest and try it, if it doesn't work (it probably will) report back here with any error messages or other relevant diagnostic information.
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

Thanks for the swift reply,

Method 1
update rc.local

i have typed : sudo bbcsdl /home/xxx/yyy/zzz/PI1 I.exe
ctrlx and y

rebooted - nothing happens

Method 2
i have typed : sudo /hpme/pi/.bashrc

result - directory doesnt exist

Method 3
sorry i have no idea what or where the init directory is

Method 4
This appears to be for linux

Method 5
contrab ??????????????????


I thought id have more chance with method 1, but nothing happens.
the file i am trying to run is an exe file but does not show the extension displayed in the parent folder.

I need a lot more hand holding

kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

While im on the subject of rpi, i have discovered that one can set the pin inputs to pull down and puul up with software (GPIO.PUD_DOWN etc). can this be done from bbcsdl?

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: Launch BASIC program on PI BOOT

Post by Richard Russell »

Ric wrote: Mon 06 Jan 2025, 19:43 i have typed : sudo bbcsdl /home/xxx/yyy/zzz/PI1 I.exe
Did you see the hint to use only absolute file paths? Try doing that to see if it helps.

The .exe extension isn't likely to be correct, indeed it isn't commonly used in Linux as far as I'm aware. Probably should be .bbc.

If you didn't do so, check the command at a command prompt first to make sure it works.

I'm inclined to think that the crontab method may be the easiest and safest, it's also the method that Jeremy recommended earlier in the thread. So perhaps try that one.
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

Ive just read something abpout boot permissions. Could this be the problem. Ive no idea what they are tho'
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

I dont know what an 'absolute' path is?
I have tried just to get bbsdl to open with
sudo /home/xxx/Downloads/bbcsdl

but still nothing happens
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

Had a thought, put .bbc on the end of bbcsdl.
disaster! Now the Pi is stuck on the "welcome to the raspberry pi desktop" screen and wont boot up at all!!
HHHeeeeelllllppp.
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Launch BASIC program on PI BOOT

Post by Ric »

Turns out the old trick of turning it off has worked.
but still didnt boot bbcsdl
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023