Go to advanced search

by joan
Sun Oct 21, 2018 9:46 am
Forum: General discussion
Topic: AM2302 DHT sensor on RPi3 not working after reboot of RPi
Replies: 6
Views: 147

Re: AM2302 DHT sensor on RPi3 not working after reboot of RPi

This highlights the importance of always doing your own research, even if you end up using a solution from a web site. The DHT22 sensor is packaged into various modules. One of these modules may be read using the I2C bus. None of the DHT22 sensor modules may be read using the SPI or the (Dallas) 1-w...
by joan
Thu Oct 18, 2018 7:36 am
Forum: General discussion
Topic: AM2302 DHT sensor on RPi3 not working after reboot of RPi
Replies: 6
Views: 147

Re: AM2302 DHT sensor on RPi3 not working after reboot of RPi

The last time I checked the 1-wire bus defaults to using GPIO 4.
by joan
Mon Oct 08, 2018 8:01 am
Forum: General discussion
Topic: Use pigs to control led strip
Replies: 4
Views: 132

Re: Use pigs to control led strip

LED strips vary, e.g. some have individually addressable LEDS, some do not. Do you know the LED strip model number?
by joan
Thu Oct 04, 2018 4:57 pm
Forum: Python
Topic: Wait for edge - false timeout
Replies: 20
Views: 371

Re: Wait for edge - false timeout

If cbf is a member of the class you refer to it as self.cbf within the class.
by joan
Thu Oct 04, 2018 7:49 am
Forum: Python
Topic: Wait for edge - false timeout
Replies: 20
Views: 371

Re: Wait for edge - false timeout

I'd guess the 1300 microseconds is too short a timeout. Perhaps add a 100 micros or so. In practice you probably want to know when a link recovers as well as when it fails. For that I would remove the glitch stuff and just use set_watchdog with a 2 millisecond timeout (it only works in milliseconds,...
by joan
Tue Oct 02, 2018 10:08 pm
Forum: Python
Topic: Wait for edge - false timeout
Replies: 20
Views: 371

Re: Wait for edge - false timeout

As I said wait_for_edge is only used for simple needs. The code I posted does not use wait_for_edge.
by joan
Tue Oct 02, 2018 8:08 pm
Forum: Python
Topic: Wait for edge - false timeout
Replies: 20
Views: 371

Re: Wait for edge - false timeout

To monitor multiple GPIO you could do something like the following: #!/usr/bin/env python import pigpio import time WATCH=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] cb=[None] * 32 TIMEOUT_MICROS=1300 pi = pigpio.pi() if not pi.connected: exit() def cbf(gpio, level, tick): print("GPIO {} level stead...
by joan
Tue Oct 02, 2018 5:53 pm
Forum: Automation, sensing and robotics
Topic: Problems with sudo i2cdetect -y 1
Replies: 2
Views: 95

Re: Problems with sudo i2cdetect -y 1

The 1-wire bus is not the same as the I2C bus. You will not see 1-wire devices with i2cdetect as i2cdetect checks the I2C bus.
by joan
Tue Oct 02, 2018 5:43 pm
Forum: Python
Topic: Wait for edge - false timeout
Replies: 20
Views: 371

Re: Wait for edge - false timeout

There are several ways of doing this with pigpio. One example follows. #!/usr/bin/env python import pigpio import time WATCH=4 TIMEOUT_MICROS=1300 count=0 pi = pigpio.pi() if not pi.connected: exit() def cbf(gpio, level, tick): global count count += 1 print("level steady too long: {}".format(count))...
by joan
Sun Sep 30, 2018 3:07 pm
Forum: General discussion
Topic: 5 volts 5 amps power supply on raspberry pi 3 model b+
Replies: 14
Views: 503

Re: 5 volts 5 amps power supply on raspberry pi 3 model b+

I dislike the term GPIO connector which is also misleading, I prefer the term expansion header. The problem with using terms such as powering via the GPIO is that it can be taken literally - which leads to a dead Pi.
by joan
Sun Sep 30, 2018 11:09 am
Forum: General discussion
Topic: 5 volts 5 amps power supply on raspberry pi 3 model b+
Replies: 14
Views: 503

Re: 5 volts 5 amps power supply on raspberry pi 3 model b+

The Pi can only allow about 2.6A of current through the micro USB port. You're more likely to power via the GPIO (or PP1 or PPQ and a GND point.) but I'd recommend keeping 2.6A as a safety guide. More may burn out the tracks, we won't know until someone tries. Anyway, power your sensors directly fr...
by joan
Thu Sep 27, 2018 9:02 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Need Advice: two 250hz square waves 180 out of phase @ 5V
Replies: 7
Views: 288

Re: Need Advice: two 250hz square waves 180 out of phase @ 5V

One way of generating the waves on GPIO 4 and 5.

Code: Select all

sudo pigpiod

pigs m 4 w
pigs m 5 w
pigs wvag 16 0 2000 0 16 2000
pigs wvag 32 0 1000 0 32 2000 32 0 1000 # merges with previous wave
pigs wvcre
pigs wvtxr 0
http://abyz.me.uk/rpi/pigpio/pigs.html#WVCRE
by joan
Wed Sep 26, 2018 2:22 pm
Forum: General discussion
Topic: Unable to read adc data from SPI0 bus in raspberry pi 3
Replies: 10
Views: 249

Re: Unable to read adc data from SPI0 bus in raspberry pi 3

It may be a limitation of the bcm2835 library. When it was written only two SPI chip selects were official on SPI0.
by joan
Wed Sep 26, 2018 7:26 am
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 344

Re: smbus read_block_data() definition

The pigpio documentation includes details of the transactions carried out by each SMBus command (see the note for http://abyz.me.uk/rpi/pigpio/python.html#i2c_open).

The Python smbus module (to my mind) is exceptionally poorly documented.
by joan
Tue Sep 25, 2018 10:04 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 344

Re: smbus read_block_data() definition

The example was for C/C++ and values is a return parameter. Presumably they will contain the values returned by the SMBus command.

This is all moot. What device are you trying to talk to? It is pretty unlikely it actually accepts SMBus commands. Most devices are I2C.
by joan
Tue Sep 25, 2018 7:26 am
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 344

Re: smbus read_block_data() definition

I do not think it does what you want. The device specifies the number of returned bytes, not the user.

http://abyz.me.uk/rpi/pigpio/python.htm ... block_data

You probably want read_i2c_block_data

http://abyz.me.uk/rpi/pigpio/python.htm ... block_data
by joan
Mon Sep 24, 2018 7:14 am
Forum: Beginners
Topic: Unsure how to link GPIO input (NC switch) to a Python command
Replies: 15
Views: 509

Re: Unsure how to link GPIO input (NC switch) to a Python command

Probably. Have you looked at any of the physical computing examples on the main site?
by joan
Thu Sep 20, 2018 5:44 pm
Forum: Compute Module
Topic: I2C Problems on SDA
Replies: 42
Views: 1152

Re: I2C Problems on SDA

I do not understand what you mean by "When I add 220 Ohm series resistors to SCL and SDA at the slave side". I guess one side is connected to SDA/SCL. What is the other end connected to?
by joan
Thu Sep 20, 2018 7:26 am
Forum: Python
Topic: abort pigpiod wave_chain?
Replies: 3
Views: 154

Re: abort pigpiod wave_chain?

wave_tx_stop() will work.
by joan
Wed Sep 19, 2018 7:30 am
Forum: Camera board
Topic: wildlife cam help
Replies: 14
Views: 613

Re: wildlife cam help

How much is in your budget. You could buy a decent motion detect security camera to record to internal SD card for less than a 100 GBP.
by joan
Mon Sep 17, 2018 5:22 pm
Forum: Beginners
Topic: i2c address conversion
Replies: 2
Views: 106

Re: i2c address conversion

I'm not sure what you want. You can write 3d as 0x3D if you want. I think you need to clarify what you want to achieve.
by joan
Sun Sep 16, 2018 10:05 pm
Forum: General discussion
Topic: If I connect 5V output sensor directly with raspberry pi 3b+ so it is harmful for my raspberry pi. Yes or No?
Replies: 4
Views: 332

Re: If I connect 5V output sensor directly with raspberry pi 3b+ so it is harmful for my raspberry pi. Yes or No?

There is no general answer for a sensor. There is not even a simple answer for the DHT11 as many are built into modules with extra circuitry on board. If you mean the 4 pin DHT11 sensor then the following applies. The DHT11 will work when powered from 3V3. If you do that you don't have to worry abou...
by joan
Sat Sep 15, 2018 5:34 pm
Forum: Beginners
Topic: reading and logging pin status of arduino with my rpi
Replies: 12
Views: 245

Re: reading and logging pin status or arduino with my rpi

You could use a resistor divider to drop the 5V Arduino output to a Pi safe 3V3. E.g. https://learn.sparkfun.com/tutorials/voltage-dividers https://en.wikipedia.org/wiki/Voltage_divider There will be plenty of Python code to base yours on. E.g. (my) http://abyz.me.uk/rpi/pigpio/examples.html#Python_...
by joan
Sat Sep 15, 2018 8:02 am
Forum: Graphics programming
Topic: gcc error: main.c No such file or directory
Replies: 4
Views: 311

Re: gcc error: main.c No such file or directory

Could you repeat the command and also do a ls -l before hand? Cut & paste the terminal input and output so we can double check the commands being given.

Go to advanced search