Evening all,
I have written and application that can be used to turn the lights off and on in my house, i will post a youtube video when i have resolved a few minor problems.
The first is that in the case of a power failure i need the PI3 i have used to launch my program on reBoot.
Does anyone know if this is possible and if so how to do it?
The second is that it only works when I am in wifi range with my phone, i can not see away of making socklib work over the WAN, is this possible and if so how do i go about it?
Kind Regards Ric
Launch BASIC program on PI BOOT
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Launch BASIC program on PI BOOT
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
- JeremyNicoll
- Posts: 72
- Joined: Sun 26 Jul 2020, 22:22
- Location: Edinburgh
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
Thanks for the swift response Jeremy, unfortunately I don't know what it means, I don't know where to type the @reboot command nor what to type after it as I assume it's nothing to do with python. I am very new to this pi stuff, I managed to get bbcsdl on it but know no more other than to use bbcsdl. Could you be more specific. My program is in the @usr folder.
Cheers Ric
Cheers Ric
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
Thanks Richard, I assume I am using TCP sockets as I use FN_tcplisten. If I set the socket up everything works fine, but when I walk out of range of the WiFi I get invalid socket error. I am using FN_gethostname to return the IP address, which is in the form AAA.bbb.ccc.ddd which is my IPv4 address.
Kind regards Ric
Kind regards Ric
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
I haven't deliberately set anything up. My laptop is acting as the server and the phone and pi as clients, as per the example programs. The pi is not important at this stage because it will never leave range of the WiFi and it works perfectly. The phone and laptop as far as I am aware are connected to the wifi. At this point my knowledge runs out. I don't know if it's VPN(whatever that means) or other and as I said I used FN_gethostname. If that returns a static IP then I'm using one.
Kind regards Ric
Kind regards Ric
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
I have just discovered I have a static IP, the dhpc enabled says no.
Edit!! Just found another dhpc enabled that says yes.
So who knows
Kind regards a very dispondant Ric
Edit!! Just found another dhpc enabled that says yes.
So who knows
Kind regards a very dispondant Ric
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
The laptop (which will become a galaxy tablet), is the server and outputs to 6 PIs with relay information to alter the light poling, which in turn makes the lights go on or off. The light illumination state is then sent back to the laptop which displays the appropriate symbol, the phones of which there can be 5, send information to the server about which switch has been pressed by the user and then the laptop starts the cycle again with the PIs. My hub is BT. Hope this helps.
Kind regards Ric
Ps. we have lots of power cuts and the PIs are attached to the lighting mother board in the loft with no screens or manual input, so they need to self start on boot after each power cut.
It getting the phone to work outside WiFi that I am struggling with now.
The IP address has stayed the same all the time I have been working on the Program, about 4 months, does this mean it is static?
Kind regards Ric
Ps. we have lots of power cuts and the PIs are attached to the lighting mother board in the loft with no screens or manual input, so they need to self start on boot after each power cut.
It getting the phone to work outside WiFi that I am struggling with now.
The IP address has stayed the same all the time I have been working on the Program, about 4 months, does this mean it is static?
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
- JeremyNicoll
- Posts: 72
- Joined: Sun 26 Jul 2020, 22:22
- Location: Edinburgh
Re: Launch BASIC program on PI BOOT
The norm on a home network is that while replies (eg when you send a "gimme a webpage" request to a web server somewhere) /will/ be allowed back in to your network (& indeed sent to the right PC on your network), unsolicited data traffic will not be sent to any of your devices. That's what the firewall in your modem/[firewall]/router does. (I put "firewall in brackets because most people do not think of a combined modem/router as also any kind of firewall, because the manufacturers have become vague in their terminology so as not to scare 'ordinary people'.)
To allow some traffic to arrive at your modem/router & then get forwarded from your router to a specific PC on your LAN you need to "open a port" on the router & tell it (in its configuration pages) which device on the LAN should receive that traffic. It's very important that the device does not also get used for general computing, because potentially hackers can then access it. Some (all?) routers refer to fenced-off devices like this - accessible to the outside world, but segregated from your other devices - as being in a "DMZ".
It might do, but probably not. Static means: will never change; often that needs one to pay one's ISP more, if they offer the facility at all. Usually only businesses need it. If your ISP reconfigures their internal network, the next time you power-cycle your modem/router the IP address it has (as seen by the outside world might change), even if it's the same for months or years on end.
-
- Posts: 200
- Joined: Tue 17 Apr 2018, 21:03
Re: Launch BASIC program on PI BOOT
Thanks for the reply Jeremy,
How do I do the stuff you say?
Kind regards Ric
Ps. Richard makes no mention of this, does he do it some other way?
How do I do the stuff you say?
Kind regards Ric
Ps. Richard makes no mention of this, does he do it some other way?
Kind Regards Ric.
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
- JeremyNicoll
- Posts: 72
- Joined: Sun 26 Jul 2020, 22:22
- Location: Edinburgh
Re: Launch BASIC program on PI BOOT
Richard /did/ mention it. It's what he was referring to in the text:
"This is where it gets difficult to help you, because we don't know what you don't know! Presumably you are familiar with the admin interface of your router, at least; you're not going to be able to get very far without that knowledge (and because there's no consistency between different router manufacturers we're unlikely to be able to help with that unless, by chance, you have the same router as somebody else here).
If you're going to be accessing your system from the internet one thing that's particularly important, from a security perspective, is what port number you have chosen. Without actually telling us (which would in itself be a security breach!) can you confirm that you've taken due care to choose a number which (a) isn't a well-known port and (b) isn't easily guessable?"
This isn't specific to your PI or BBC BASIC. It's about (home) network security. I've never done it. I suppose you'd have to google for advice & mentally compare what you read in various places to see if you think you trust what you read, and get a thorough understanding of it.