Go to advanced search

by saltydog
Sat Jun 22, 2019 6:07 am
Forum: Python
Topic: Problem running mypi.py on Pi Zero W
Replies: 9
Views: 2130

Re: Problem running mypi.py on Pi Zero W

The pi zero doesn't have an Ethernet port.
The wireless addr should return a result

Chris
by saltydog
Thu Jun 20, 2019 11:35 pm
Forum: Python
Topic: scipy.signals import issue
Replies: 3
Views: 345

Re: scipy.signals import issue

The debian repo's are going to be a long way behind. You would need to build from source. I wasn't successful last time I tried.
Others have been. See:
https://raspberrypi.stackexchange.com/q ... spberry-pi

Chris
by saltydog
Thu Jun 20, 2019 8:56 am
Forum: Python
Topic: scipy.signals import issue
Replies: 3
Views: 345

Re: scipy.signals import issue

What version scipy are you using?
by saltydog
Wed Aug 22, 2018 5:16 am
Forum: Python
Topic: Paho-mqtt does not work with raspberry pi zero w
Replies: 3
Views: 914

Re: Paho-mqtt does not work with raspberry pi zero w

Do you have a mqtt sever running? Mosquitto ??
by saltydog
Sun Jul 01, 2018 9:50 am
Forum: Python
Topic: [SOLVED] Python - Sainsoft USB 4 Relay Board
Replies: 14
Views: 1905

Re: Python - Sainsoft USB 4 Relay Board

Have you tried the python solution provided in this answer?
https://raspberrypi.stackexchange.com/q ... spberry-pi
Need to change the port No.

Chris
by saltydog
Wed Apr 11, 2018 10:53 pm
Forum: Python
Topic: Pi Servo Control - Stops Listening to Input
Replies: 13
Views: 766

Re: Pi Servo Control - Stops Listening to I`nput

lucasgg wrote:
Wed Apr 11, 2018 3:54 pm
Using this script, pi stops listening to input immediately. The servo continues to hold/readjust its position, however.
If the servo is still working (moving), then it is still listening, isn't it?

Chris
by saltydog
Sun Mar 25, 2018 10:59 am
Forum: Python
Topic: Fast, simple code to read and save accelerometer data
Replies: 8
Views: 3452

Re: Fast, simple code to read and save accelerometer data

The last line in 'main': sleep(1/10) Your only taking readings at 10 samples per second. If your using python2.7, then that is 0. which might explain why your getting readings at 70 per second. Is this code any easier to read (less features): https://github.com/DcubeTechVentures/LIS3DHTR/blob/master...
by saltydog
Mon Mar 19, 2018 7:20 am
Forum: General discussion
Topic: Lighting with raspberry pi3b+
Replies: 3
Views: 422

Re: Lighting with raspberry pi3b+

The easiest way is to find a LED driver with 3.3v PWM dimming, to match the specs of your LED chips.
What your trying to achieve is very common in the Reef Aquarium hobby.
Try googling: reef meanwell ldd led diy
That should help with understanding some of the basics.

Chris
by saltydog
Fri Jan 12, 2018 11:24 pm
Forum: General discussion
Topic: GPS module in Python
Replies: 17
Views: 18474

Re: GPS module in Python

Try: from gps import * import time import threading gpsd = None class GpsPoller(threading.Thread): def __init__(self): threading.Thread.__init__(self) global gpsd gpsd=gps(mode=WATCH_ENABLE) self.current_value = None self.running = True def run(self): global gpsd while gpsp.running: gpsd.next() if _...
by saltydog
Sun Jan 07, 2018 12:06 pm
Forum: Scratch
Topic: Scratch2 Motor Control
Replies: 4
Views: 3991

Re: Scratch2 Motor Control

Did you use pip or zip to install? I just tried installing it and pip created issues with python paths that caused library errors. Using the zip method worked without issues. Just had a quick play and PWM worked OK. Alternatively is there a way to call python functions from scratch Never tried in sc...
by saltydog
Fri Jan 05, 2018 9:34 am
Forum: Scratch
Topic: Scratch2 Motor Control
Replies: 4
Views: 3991

Re: Scratch2 Motor Control

GPIO PWM is not included with scratch2.

See for adding: s2-pi Creating Scratch 2 Extensions On Your Raspberry Pi

Chris
by saltydog
Wed Jan 03, 2018 5:32 am
Forum: General discussion
Topic: pigpio cleanup doesnt release gpio pin
Replies: 6
Views: 1357

Re: pigpio cleanup doesnt release gpio pin

Can you use a magnetometer to determine and set your current servo position?

Chris
by saltydog
Wed Jan 03, 2018 5:00 am
Forum: General discussion
Topic: pigpio cleanup doesnt release gpio pin
Replies: 6
Views: 1357

Re: pigpio cleanup doesnt release gpio pin

IIRC, pi.stop only cleans up the socket connection to the pigpio daemon, started when you created the instance pi = pigpio.pi()

Chris
by saltydog
Wed Jan 03, 2018 4:28 am
Forum: General discussion
Topic: pigpio cleanup doesnt release gpio pin
Replies: 6
Views: 1357

Re: pigpio cleanup doesnt release gpio pin

Set it to 0 (off)

Code: Select all

import pigpio
pi = pigpio.pi() # Connect to local Pi.
pi.set_mode(12, pigpio.OUTPUT)
pi.set_servo_pulsewidth(12, 1550) #closed
pi.set_servo_pulsewidth(12,1400) #open a little

pi.set_servo_pulsewidth(12,0)

pi.stop()
by saltydog
Thu Jun 15, 2017 2:05 pm
Forum: Python
Topic: gpiozero input/output
Replies: 9
Views: 1602

Re: gpiozero input/output

Thanks for the replies The code is for a 'line following sensor' that only has one control line. You need to charge a cap (output) and then read it's discharge time (input) Hi. If you wanted to use a Pin for both in and out you would need to first define as output then turn it on wait for some perio...
by saltydog
Thu Jun 15, 2017 12:35 am
Forum: Python
Topic: gpiozero input/output
Replies: 9
Views: 1602

gpiozero input/output

Is there a way to change the same pin from an output to an input.

Code: Select all

a = LED(23)
b = Button(23)
a.on()

sleep(0.01)

count  = 0

while b.is_pressed == True:
    count = count + 1
return count
The above code returns the error: pin GPIO23 already in use by another gpiozero object.

Cheers

Chris
by saltydog
Fri Apr 01, 2016 10:09 am
Forum: Automation, sensing and robotics
Topic: Easy project
Replies: 9
Views: 1813

Re: Easy project

try changing
tempdata = thetext.split("/n")[1].split(" ")[9]
to:
tempdata = thetext.split("\n")[1].split(" ")[9]
by saltydog
Fri Apr 01, 2016 9:18 am
Forum: Automation, sensing and robotics
Topic: Easy project
Replies: 9
Views: 1813

Re: Easy project

adding print lines is a great way to debug.

Just before line 7 in the file temperature3.py
tempdata = thetext.split("/n")[1].split(" ")[9]

can you add a line:

print(thetext)
by saltydog
Sun Mar 06, 2016 8:12 am
Forum: Scratch
Topic: Scratch servo control
Replies: 26
Views: 11002

Re: Scratch servo control

Thanks for checking it out.

Chris
by saltydog
Sat Feb 27, 2016 10:11 am
Forum: Scratch
Topic: Scratch servo control
Replies: 26
Views: 11002

Re: Scratch servo control

It would be nice if you could use the gpiozero library, which has a pigpio extension
That would possibly make a smoother transition moving from scratch to python.
gpiozero

Chris
by saltydog
Sun Jan 11, 2015 11:22 am
Forum: Advanced users
Topic: MPU6050 Interfacing with the pi
Replies: 1
Views: 715

Re: MPU6050 Interfacing with the pi

This might help with some of your questions:
http://blog.bitify.co.uk/2013/11/readin ... berry.html
by saltydog
Mon Aug 11, 2014 9:17 am
Forum: Automation, sensing and robotics
Topic: Yet another RF 433 MHz topic
Replies: 7
Views: 4338

Re: Yet another RF 433 MHz topic

One way is to use piscope to manually read the pulses and then use the python send script (ir_tx_micros.py) in this link to transmit the pulses

Chris
by saltydog
Tue Jun 17, 2014 1:17 am
Forum: General discussion
Topic: Web server security
Replies: 8
Views: 1621

Web server security

I'm using lighttpd and have a php tcp socket server script in the root directory of the server. In the home directory there is a python client script that also controls gpio. I don't need the site to be assessable to anyone but myself. Will password protecting the root folder, maybe also only allowi...
by saltydog
Sat Apr 12, 2014 12:48 pm
Forum: General discussion
Topic: Locking issues/Refund.
Replies: 39
Views: 5298

Re: Locking issues/Refund.

It's been this way since the removal of usb polyfuses: http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=23205. Thanks for the link. :D But if your USB devices are disconnecting when you wiggle them - that's a (design) fault of the devices not the Pi IMO. Yeah I tend to agree. But it's hard to...
by saltydog
Sat Apr 12, 2014 11:47 am
Forum: General discussion
Topic: Locking issues/Refund.
Replies: 39
Views: 5298

Re: Locking issues/Refund.

did all the dongle you tried have the same wireless chipset? The two wifi dongles are: http://www.jaycar.com.au/productView.asp?ID=YN8309 http://www.jaycar.com.au/productView.asp?ID=YN8307 Small dongle causes reboot when inserting and wiggling. I have four, all do the same. Large dongle causes rebo...

Go to advanced search