Go to advanced search

by neilgl
Wed Sep 18, 2019 8:32 pm
Forum: Python
Topic: IF...OR statement not working as expected
Replies: 7
Views: 134

Re: IF...OR statement not working as expected

Ok I am glad you got it working
by neilgl
Wed Sep 18, 2019 7:56 pm
Forum: General discussion
Topic: Relative newbie beginning a large, convoluted project - advice on feasibility welcomed!
Replies: 1
Views: 74

Re: Relative newbie beginning a large, convoluted project - advice on feasibility welcomed!

Is it a commercial project (The IP500 Alliance) or are you just learning stuff?
by neilgl
Wed Sep 18, 2019 7:50 pm
Forum: General discussion
Topic: Pi distros
Replies: 1
Views: 82

Re: Pi distros

Er, no-one wants to pay for add-ons do they?
by neilgl
Wed Sep 18, 2019 7:48 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

Ah, where is it located then?
by neilgl
Wed Sep 18, 2019 7:36 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

Ah, I never expected you were on Wheezy ready to upgrade to Jessie Version Code name Toy Story character 7 Wheezy Wheezy the penguin 8 Jessie Jessie the cowgirl 9 Stretch Rubber octopus from Toy Story 3 10 Buster Andy's pet dog I would use a new microSD card and install Raspbian Buster on it using e...
by neilgl
Wed Sep 18, 2019 6:54 pm
Forum: Troubleshooting
Topic: Unknown equations calculating pH Values
Replies: 1
Views: 50

Re: Unknown equations calculating pH Values

That is a mountain of work for someone to look into, but assuming a linear relationship between mV and pH in the two ranges (4 to 7 and 7 to 10) You have a mV per pH of -179 in the pH range 4 to 7 and -113 mV per pH in the pH range 7 to 10. So for a given mV reading (you have those), check which ran...
by neilgl
Wed Sep 18, 2019 6:20 pm
Forum: Python
Topic: Button under gpiozero not working properly
Replies: 3
Views: 53

Re: Button under gpiozero not working properly

This code (slight mod to your code) works as expected on GPIO17 with a button (to ground) #!/usr/bin/python3 from gpiozero import Button from signal import pause Button.was_held = False btn = Button(17, pull_up=True, hold_time = 2) def held(): print("button held") btn.was_held = True def released():...
by neilgl
Wed Sep 18, 2019 5:56 pm
Forum: Python
Topic: Button under gpiozero not working properly
Replies: 3
Views: 53

Re: Button under gpiozero not working properly

The code in the first part (bt3.py) worked fine on my pi3 - press button once, text appears

Code: Select all

python3 bt3.py
Button pressed
Don't forget that the gpiozero uses BCM pin numbering, not physical pin numbers, or it could be wiring is wrong.
See https://pinout.xyz/#
I'll look at the other one in a second
by neilgl
Wed Sep 18, 2019 2:25 pm
Forum: Python
Topic: IF...OR statement not working as expected
Replies: 7
Views: 134

Re: IF...OR statement not working as expected

It looks like we need to wait for events on the two devices, then do stuff

Code: Select all

from gpiozero import MotionSensor, Button
from signal import pause
def common():
    print("common routine triggered")
mag = Button(24)
pir = MotionSensor(18)
mag.when_released = common
pir.when_motion = common
pause()
by neilgl
Wed Sep 18, 2019 11:43 am
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

Yes new.jpg
Apache2 - have you done the

Code: Select all

sudo apt update
sudo apt upgrade
sudo apt install -y apache2
by neilgl
Wed Sep 18, 2019 10:53 am
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

ok so can you make a backup of it, then change that line to:

Code: Select all

os.system("raspistill -l /home/pi/new.jpg -o /home/pi/image%s.jpg"%(imageNumber)) 
by neilgl
Wed Sep 18, 2019 9:58 am
Forum: Beginners
Topic: Present and Simple: Installing Operation System on RSBP4
Replies: 16
Views: 166

Re: Present and Simple: Installing Operation System on RSBP4

The microSD card is shown on the left of the photo you posted, under the board.
The Raspbian Linux for the pi is excellent and has a full GUI and can be used remotely.
That Windows installation video is probably not legal.
by neilgl
Wed Sep 18, 2019 9:43 am
Forum: Advanced users
Topic: A compiled, working Node.js on 3B+
Replies: 6
Views: 103

Re: A compiled, working Node.js on 3B+

And your Perl/python will probably work fine with minor adjustments.
by neilgl
Wed Sep 18, 2019 9:35 am
Forum: Beginners
Topic: Present and Simple: Installing Operation System on RSBP4
Replies: 16
Views: 166

Re: Present and Simple: Installing Operation System on RSBP4

There is no hard drive, you install the operating system etc. Onto a microSD card that slots into the pi.
You can’t install Windows 7 or 10 on it.
What you can do is use it to learn about other operating systems (Linux) and physical computing using the GPIO pins - excellent.
by neilgl
Wed Sep 18, 2019 8:27 am
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

Can you post that time lapse script here?
Also, there may be other ways to do it - just look for the most recent image in a directory and upload it / show it on a web page.
e.g this gets the most recent jpg in the directory

Code: Select all

ls -tr image*.jpg | tail -1
by neilgl
Wed Sep 18, 2019 8:19 am
Forum: Beginners
Topic: Connecting camera to servo?
Replies: 2
Views: 53

Re: Connecting camera to servo?

Maybe have a look at "Motion" - it can invoke scripts when activities occur.
The script could be a python script to control a servo. And to test an SG90 servo on GPIO5 (PWM).

Code: Select all

sudo pigpiod
pigs s 5 512
pigs s 5 2500
will move it left and right
by neilgl
Tue Sep 17, 2019 9:01 pm
Forum: Beginners
Topic: MQTT Publisher Troubleshooting
Replies: 5
Views: 64

Re: MQTT Publisher Troubleshooting

Oh and have you done

Code: Select all

sudo apt update
sudo apt upgrade
by neilgl
Tue Sep 17, 2019 7:59 pm
Forum: Beginners
Topic: MQTT Publisher Troubleshooting
Replies: 5
Views: 64

Re: MQTT Publisher Troubleshooting

If it was going high you would publish the message. Anyway, try this test script for your switch - from a terminal: python check.py (not Thonny/Geany/mu) # python2 check microswitch 1 or 0 from gpiozero import Button from time import sleep # GPIO17 (BCM 17) is physical board pin 11 button = Button(1...
by neilgl
Tue Sep 17, 2019 7:30 pm
Forum: Beginners
Topic: MQTT Publisher Troubleshooting
Replies: 5
Views: 64

Re: MQTT Publisher Troubleshooting

Looks like 11 is never going high.
To debug your python script put print statements where you want to look at something.
Instead of setting 13 as an output, just connect that switch terminal to 3V3, so when switch closed, 11 goes high.
Also, create a much simpler script that just looks at GPIO 11.
by neilgl
Tue Sep 17, 2019 7:20 pm
Forum: Troubleshooting
Topic: pi4B lag issues.
Replies: 1
Views: 57

Re: pi4B lag issues.

Ah have you done a full update & upgrade.
What is test Q1.
Also my pi4 is a lot faster than my pi3 at all things.
by neilgl
Tue Sep 17, 2019 3:47 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

pi as webserver - see https://www.raspberrypi.org/documentati ... /apache.md. You won't need the PHP stuff for now.
Later if you want to connect that to the actual internet, you will need better security than that article shows.
by neilgl
Tue Sep 17, 2019 3:45 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

OK so update that raspistill command and add the -l new.jpg Now you will get new.jpg in your pictures folder. And, it always respresents the latest image so we can use it and its name does not change. That makes it easier to create a web page on your pi, or upload that file (new.jpg) regularly to so...
by neilgl
Tue Sep 17, 2019 1:01 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 25
Views: 363

Re: Upload a pic every minute

Sorry I did not explain it very well. The example I gave will create a folder full of images (one every minute) and also links the latest image to "new.jpg". So we can just use new.jpg every time; it will show the latest image. And the video creation will still work. Is your existing timelapse using...
by neilgl
Tue Sep 17, 2019 10:56 am
Forum: Beginners
Topic: Punching pads
Replies: 1
Views: 48

Re: Punching pads

Go to advanced search