Go to advanced search

by sandysound
Mon Jul 16, 2018 12:34 pm
Forum: Troubleshooting
Topic: crontab -e format
Replies: 6
Views: 455

Re: crontab -e format

Thanks for the tips, I have it working now, its not quite how I want it, but it is working! My goal was to run three scripts in order, one after the other. I wanted the second script to wait until the first script to finish, then the third script waits for the second script to finish. I have instead...
by sandysound
Tue Jul 10, 2018 9:00 pm
Forum: Troubleshooting
Topic: crontab -e format
Replies: 6
Views: 455

crontab -e format

I have this crontab setup on my pi, I can run all of these scripts individually by command, and they work well, but it is not running via cron for some reason - perhaps I have messed up the format somehow? I want the scripts to run one after the other concurrently, starting at 6am, 10am, 2pm, 6pm an...
by sandysound
Thu Jul 05, 2018 7:28 pm
Forum: Troubleshooting
Topic: Headerless Pi Zero W access
Replies: 5
Views: 342

Re: Headerless Pi Zero W access

route -n print
route: bad keyword: print
by sandysound
Thu Jul 05, 2018 3:21 pm
Forum: Troubleshooting
Topic: Headerless Pi Zero W access
Replies: 5
Views: 342

Re: Headerless Pi Zero W access

No, it does not show up as an ethernet device :-/

route -n bring up usage: route [-dnqtv] command [[modifiers] args]
by sandysound
Wed Jul 04, 2018 12:08 pm
Forum: Troubleshooting
Topic: Headerless Pi Zero W access
Replies: 5
Views: 342

Headerless Pi Zero W access

I have been happily using SSH for some time now over my local wifi to access my Pi Zero W on a fixed ip address, but I am now on holiday, and thought I would take it with me to work on some further projects. No worries I thought, I'll access it via USB but I am unable to make it happen! I am using a...
by sandysound
Sun May 06, 2018 3:26 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

Sorry, php got autocorrected to phone without me noticing.
by sandysound
Sat May 05, 2018 11:02 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

On the website I have this linking to a phone file. What is the correct way to do it if this is wrong? It does not load a new page, it did load error file not found when the link was broken, but not it directs to the correct file path it should work shouldn't it? <a href="file:/var/www/html/lxon.php...
by sandysound
Sat May 05, 2018 4:50 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

I have also tried using the full filepath to python without much luck.

Code: Select all

<?php
exec('/usr/bin/python /var/www/python/lxon.py');
?>
I am really lost with this and would appreciate any pointers.
by sandysound
Sat May 05, 2018 4:43 am
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

I should mention I am using nano as my php editor - perhaps this is part of the problem?
by sandysound
Sat May 05, 2018 4:33 am
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

When I hover over the html link to the php file, I can see the command as:
file:///var/www/html/lxon.php

Is this the correct filepath given that the file is located in /var/www/html/
?
by sandysound
Sat May 05, 2018 4:18 am
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

After a lot more research I think the issue I am having is regarding permission, something I have not encountered before, so new territory for me! I think this is what Dougie Lawson referred to above as user=www-data group=www-data. So even though I put the python scripts into /var/www/python/ folde...
by sandysound
Fri May 04, 2018 10:49 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

Code looks better with a space after exec and ' instead of " and I have put all the files in the same folder but it still doesn't work :-/

Code: Select all

{
    exec ('python /var/www/html/lxon.py');
}/code]
by sandysound
Fri May 04, 2018 10:26 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

Ok, it's not accessible from the www, only on the local network. Sudo is what I am used to using when I ssh into the pi from my computer, and I saw an example elsewhere online using it when I googled how to run a python script using php. I don't quite follow what you mean by users and groups. I will...
by sandysound
Fri May 04, 2018 9:19 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

Re: HTML - PHP - Python

Lol yes,
Is it correct the way I try to do this?
by sandysound
Fri May 04, 2018 8:41 pm
Forum: General discussion
Topic: HTML - PHP - Python
Replies: 14
Views: 1515

HTML - PHP - Python

Yes, I am trying to turn on and off a light from a webpage! I have a basic html file: <html> <head> <meta charset="UTF-8"> <title>ZWGarden</title> </head> <body> LIGHT 1 <a href="file:/var/www/html/lxon.php">ON</a> <a href="file:/var/www/html/lxoff.php">OFF</a> LIGHT 2 <a href="file:/var/www/html/lx...
by sandysound
Fri May 04, 2018 10:52 am
Forum: Automation, sensing and robotics
Topic: IOT power control for EU
Replies: 3
Views: 553

Re: IOT power control for EU

Thats a nice solution but I prefer something wired...
by sandysound
Fri May 04, 2018 9:32 am
Forum: Automation, sensing and robotics
Topic: IOT power control for EU
Replies: 3
Views: 553

IOT power control for EU

I am looking for a product similar to the Power Switch Tail or:

https://www.adafruit.com/product/2935

Does anybody know of anything built for EU power? 240v?
by sandysound
Thu May 03, 2018 12:43 am
Forum: Troubleshooting
Topic: crontab scheduling 6:01am - 0:01
Replies: 4
Views: 445

Re: crontab scheduling 6:01am - 0:01

Thank you!
by sandysound
Wed May 02, 2018 10:26 pm
Forum: Troubleshooting
Topic: crontab scheduling 6:01am - 0:01
Replies: 4
Views: 445

crontab scheduling 6:01am - 0:01

I have a script I want to run 1 min past the hour, every hour using crontab:

1 6-0 * * * python script.py &

Will it work like this?
by sandysound
Thu Apr 12, 2018 9:44 pm
Forum: Python
Topic: 100 % processing power
Replies: 15
Views: 1031

Re: 100 % processing power

Reset shorts to ground, essentially restarting the board. It is not connected to the relay. However after removing the resets from the script it is now functioning as it should. Each side of the relay is activated by a 0.01s pulse to the corresponding pin. It does not need to be 1 constantly, hence ...
by sandysound
Thu Apr 12, 2018 7:55 am
Forum: Python
Topic: 100 % processing power
Replies: 15
Views: 1031

Re: 100 % processing power

Ahh, in the Envirophat tutorial it says: "To get a more accurate colour reading, we've added two white LEDs either side of the light/colour sensor that should reflect more light back to the sensor." Which I took to mean its best to use them so you get a better reading. But i take your point that it'...
by sandysound
Wed Apr 11, 2018 6:11 pm
Forum: Python
Topic: 100 % processing power
Replies: 15
Views: 1031

Re: 100 % processing power

Yes good point about the GPIO clean, it was a quick cut and paste to get it happening.

Script did not turn off the light this evening, which is disappointing.

Will go back through now and see if I can find where I have gone wrong.
by sandysound
Wed Apr 11, 2018 12:20 pm
Forum: Python
Topic: 100 % processing power
Replies: 15
Views: 1031

Re: 100 % processing power

I have taken your code and adjusted as such: from datetime import timedelta,datetime from threading import Timer from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) #RESET GPIO.setup(27, GPIO.OUT) #OPEN on GPIO.setup(22, GPIO.OUT) #CLOSE off GPIO.output(17,...
by sandysound
Wed Apr 11, 2018 9:53 am
Forum: Python
Topic: 100 % processing power
Replies: 15
Views: 1031

Re: 100 % processing power

Cool, I like both of those timer ideas, a hardware and a software solution. About the software solution, part of the complexity about having the light turn on and off is the initial state when it first turns on. I don't want it to have to wait for a set time to take an action to start with, I want i...
by sandysound
Wed Apr 11, 2018 8:51 am
Forum: Beginners
Topic: Copy files from Pi using SSH
Replies: 6
Views: 3296

Re: Copy files from Pi using SSH

Ahh marvelous, thank you.

I needed to give the destination file2 path.

This worked:
scp pi@192.168.1.3:zwgarden/daycamtwit.py daycamtwit.py

Thanks everyone!

Go to advanced search