Go to advanced search

by some_evil
Sun Feb 03, 2019 11:18 pm
Forum: Beginners
Topic: cron job has print statements, can I view these?
Replies: 6
Views: 204

Re: cron job has print statements, can I view these?

perfect, thanks for your help!
by some_evil
Sun Feb 03, 2019 11:31 am
Forum: Beginners
Topic: cron job has print statements, can I view these?
Replies: 6
Views: 204

Re: cron job has print statements, can I view these?

I have a follow up question... that stdout redirect seems to overwrite the log file each time the script is run. Can I tell cron to append to these files instead of overwriting entirely?

Cheers
by some_evil
Sun Feb 03, 2019 6:35 am
Forum: Beginners
Topic: cron job has print statements, can I view these?
Replies: 6
Views: 204

Re: cron job has print statements, can I view these?

man that was a simple answer, thanks heaps!
by some_evil
Sun Feb 03, 2019 4:50 am
Forum: Beginners
Topic: cron job has print statements, can I view these?
Replies: 6
Views: 204

cron job has print statements, can I view these?

Hey, I have a Pi 2 running Raspian Stretch. I have a python script that has been running for a while no worries on a recurring crontab job, and now I want to tweak it a bit. I left my print statements from when I was troubleshooting in this script as I was too lazy to remove them, now I am wondering...
by some_evil
Tue Jan 29, 2019 7:21 am
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

So I now have a fully functioning python script thanks to pcmanbob, below is the full code. I decided to not split out the other modules into other python flies, it is an all in one script. Working perfectly! # Created by BVK # 28/01/2019 # Simple script to alert me when internet connectivity change...
by some_evil
Tue Jan 29, 2019 2:46 am
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

excellent, thanks for that info, I will give that a crack when I get home from work. Just to clarify and get an understanding of what was happening with the way I have it setup, even though 99% of the time the code does not activate the buzzer, the mere fact that it was importing the gpiozero from t...
by some_evil
Mon Jan 28, 2019 8:58 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

Ok so the write.py is not going to cause a problem, but I wonder if the beep.py is resetting the gpio on exit. Try removing it from your main program and then see if the LED's stay on when it exits. The reason I suspect this is because there is nothing in you main program that causes a problem, and...
by some_evil
Mon Jan 28, 2019 8:35 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

I can't find this program so can you post a link to it please. I should have included it in my original post, here they are: beep.py : from gpiozero import Buzzer from time import sleep buzzer = Buzzer(21) def bop(tone=True): if tone: buzzer.on() sleep(.01) buzzer.off() else: buzzer.on() sleep(.01)...
by some_evil
Mon Jan 28, 2019 2:32 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

pcmanbob wrote:
Mon Jan 28, 2019 2:27 pm
Try this version of your code were I have removed the " main() " function and just made that code run as part of the main code of the program.
I just ran that code, it runs similar to mine, that time the green LED stays on for 1 second then turns off... :?:
by some_evil
Mon Jan 28, 2019 2:25 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

No if you just set a gpio high and then after a few seconds you exit the program the gpio will remain at what ever state you have set, unless you use gpio.cleanup(). you can test it for yourself using this import RPi.GPIO as GPIO import time # Set GPIO Pin Numbers green = 18 yellow = 24 red = 25 GP...
by some_evil
Mon Jan 28, 2019 2:10 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

Is the physical wiring ok? Note all three LED share the same negative rail on the breadboard, and there is a single common resistor back to the ground pin on my Pi, is this all OK? I have switched out to new LED's just to confirm it isnt a faulty LED, but the exact same results have been found with ...
by some_evil
Mon Jan 28, 2019 1:57 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

Thanks for the info pcmanbob, I have done exactly as you have described, to no avail. I did just add a time.sleep(5) to the end of my main() function, and this causes the green LED to stay on for five seconds before switching off... so I am beginning to wonder if the script completes does the PI res...
by some_evil
Mon Jan 28, 2019 1:37 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

Re: Py Script turns GPIO connected LED on, but it immediately turns it off, why?

I'd suggest that you use the debugger built in to an IDE like Thonny (installed standard on Raspbian) to help you step through the program to see which branches of your if-else structure are evaluated. I have put the different print statements in each of those branches, so I can see which one it is...
by some_evil
Mon Jan 28, 2019 12:49 pm
Forum: Python
Topic: [solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?
Replies: 18
Views: 681

[solved] Py Script turns GPIO connected LED on, but it immediately turns it off, why?

Hey, So I have a spare RasPi that I have finally found a useful project for. I live in Australia and our broadband network is at best, poor. i get consistent drop outs throughout the day. I decided that I will get this Pi to perform 3 simple tasks: Show a LED to indicate current connectivity status ...
by some_evil
Fri Jan 12, 2018 6:54 am
Forum: Troubleshooting
Topic: raspi-config options missing
Replies: 5
Views: 6303

Re: raspi-config options missing

rpdom wrote:
Fri Jan 12, 2018 6:47 am
Please don't do that.
You don't want me to say sorry?
by some_evil
Fri Jan 12, 2018 6:27 am
Forum: Troubleshooting
Topic: raspi-config options missing
Replies: 5
Views: 6303

Re: raspi-config options missing

Just FYI I was looking for the same items as OP, i see the answer must have been correct as at Feb 2017, I have just installed Raspian Stretch and I cannot find the option to enable Device Tree.. has this had a name change?

Thanks and sorry for the hijack.
by some_evil
Sun Dec 17, 2017 11:01 pm
Forum: Automation, sensing and robotics
Topic: Which Motor Controller?
Replies: 6
Views: 2502

Re: Which Motor Controller?

thanks for that. Now do these basic motors I have purchased simply run at ON/OFF? Or can I use something like that L298N to slowly start up my motor then run at full speed after a 2 second type startup? I see some sites mention stepper motors, does this mean variable speed? Or can I use something li...
by some_evil
Sun Dec 17, 2017 10:44 pm
Forum: Automation, sensing and robotics
Topic: Which Motor Controller?
Replies: 6
Views: 2502

Which Motor Controller?

Hey, I have just bought a few little 3v DC motors to be controlled by my raspberry pi, and I have come to realize that I will require a motor controller to control these things. https://www.aliexpress.com/item/10PCS-Micro-130-pony-up-to-four-drive-dc-motor-small-motor-production-of-3V/32702094003.ht...
by some_evil
Sun Aug 06, 2017 9:24 am
Forum: Beginners
Topic: Setup Pi to connect to specific WIFI network
Replies: 3
Views: 1518

Re: Setup Pi to connect to specific WIFI network

You can even add "priority=nnn" to those network blocks to control which one to choose when two networks are active and in range. Thats pretty cool, so I can set my hotspot as priority # 1 and do some testing while still within the home network range.. i can check it switches between no worries. Th...
by some_evil
Sun Aug 06, 2017 8:55 am
Forum: Beginners
Topic: Setup Pi to connect to specific WIFI network
Replies: 3
Views: 1518

Setup Pi to connect to specific WIFI network

Hey, So I have a Pi Zero, and when im at home I want it to connect to my home_network automatically, which it does fine right now, and I connect headless. When I take my Pi away from my home network, I want to get it to search for the home network, and when it realizes home_network is not available,...
by some_evil
Thu Aug 03, 2017 12:37 pm
Forum: Automation, sensing and robotics
Topic: Detect audio, preform function
Replies: 5
Views: 1795

Re: Detect audio, preform function

Well, as far as I understand, this module has two outputs: One analogic ('AO') that cannot be used by the Raspberry Pi directly as the Raspberry Pi does not have any analog input. One digital output ('DO') that changes state when the audio signal strength is above a threshold (this threshold being ...
by some_evil
Wed Aug 02, 2017 2:04 pm
Forum: Beginners
Topic: Simple SQL not acting how I imagine it would
Replies: 4
Views: 516

Re: Simple SQL not acting how I imagine it would

scotty101 wrote:
Wed Aug 02, 2017 2:00 pm
What's wrong with something simpler like this?

Code: Select all

SELECT objectid,ip_address FROM ip ORDER BY objectid DESC LIMIT 1
Nothing at all wrong with that, I have not used the LIMIT function before, that will work well! Thanks
by some_evil
Wed Aug 02, 2017 1:39 pm
Forum: Beginners
Topic: Simple SQL not acting how I imagine it would
Replies: 4
Views: 516

Simple SQL not acting how I imagine it would

Hey All, I have a basic SQL Server Running on my Pi and im using the PhpMyAdmin to administer tables and queries. I have just started a simple table, with an auto increment 'id' field, an 'ip address' field, and a 'previous ip' field. It looks like this (including sample data): http://i.imgur.com/Cl...
by some_evil
Wed Aug 02, 2017 10:04 am
Forum: Troubleshooting
Topic: crontab -e failing to send email correctly
Replies: 12
Views: 2540

Re: crontab -e failing to send email correctly

Thanks to everyone who posted advice, I greatly appreciate your time.
by some_evil
Wed Aug 02, 2017 10:02 am
Forum: Troubleshooting
Topic: crontab -e failing to send email correctly
Replies: 12
Views: 2540

Re: crontab -e failing to send email correctly

now this is why I have to stop trying to play with my toys so late at night, it was the simplest thing! Then in my crontab I have added MAILTO:[email protected].com Is that exactly how you specified it in your crontab? If so then that is wrong, MAILTO is a variable, you assign to it just like any other ...

Go to advanced search