Go to advanced search

by joan
Sun Oct 15, 2017 11:22 am
Forum: Troubleshooting
Topic: echo 0 = 50% > /dev/servoblaster
Replies: 2
Views: 68

Re: echo 0 = 50% > /dev/servoblaster

In C open /dev/servoblaster for writing (you only need to open the device once, at the start of your program). Then write the string "0=50%\n" to the device. The new line is important. I don't think the command will be processed if it is absent. Use similar commands for each servo you have connected.
by joan
Thu Oct 05, 2017 9:37 pm
Forum: Troubleshooting
Topic: Additional I2C on Raspberry Pi3
Replies: 4
Views: 238

Re: Additional I2C on Raspberry Pi3

You can also now use device tree to generate software I2C on arbitrary GPIO. See /boot/overlays/README. Generally this is better than using pigpio bit banging as the device tree created devices are maintained by the Linux kernel and may be used with standard I2C code and tools.
by joan
Thu Oct 05, 2017 8:23 pm
Forum: C/C++
Topic: error problem transmitting spi data ..ioctl : invalid argument
Replies: 3
Views: 376

Re: error problem transmitting spi data ..ioctl : invalid argument

Are you zeroing the SPI data structure? One of the fields which was unused is now used and you will get errors if it isn't zeroed. This change was made in the last year or so.
by joan
Sun Oct 01, 2017 7:30 pm
Forum: Advanced users
Topic: RF 433 MHz Communication Between Raspberry Pi & Arduino Sending Data
Replies: 6
Views: 521

Re: RF 433 MHz Communication Between Raspberry Pi & Arduino Sending Data

Given the module you have bought you could try my Virtual Wire module. This lets you send/receive short messages of arbitrary content.
by joan
Thu Sep 28, 2017 7:51 pm
Forum: General discussion
Topic: Stretch vs. HC-SR04
Replies: 6
Views: 344

Re: Stretch vs. HC-SR04

From previous posts I think you will find the same issue with jessie. This is the method that I use for the HC-SR04 see code at bottom of page as well as the wireing instructions at top of page https://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi That code has several bu...
by joan
Tue Sep 26, 2017 8:50 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Are raspberry pi zero's 3 volt gpio pins above 0.4ampere?
Replies: 3
Views: 405

Re: Are raspberry pi zero's 3 volt gpio pins above 0.4ampere?

Depends on the particular Pi model you are using.
by joan
Thu Sep 14, 2017 4:59 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 42
Views: 2433

Re: SPI or BitBang via GPIO to 5v device and vice-versa

I have never considered that CB chains were the problem. Can you suggest an alternative?
by joan
Thu Sep 14, 2017 4:27 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 42
Views: 2433

Re: SPI or BitBang via GPIO to 5v device and vice-versa

My (userland) pigpio library uses DMA to sample the GPIO (the 32 in bank 0 which includes all those connected to the expansion header). The maximum rate supported is 1 MHz. At that rate system activity (in particular video) will perturb the timings because of memory bus contention (I think). Another...
by joan
Fri Sep 08, 2017 10:42 am
Forum: Beginners
Topic: Can't read a value of GPIO input pin from bash
Replies: 11
Views: 428

Re: Can't read a value of GPIO input pin from bash

Why not issue the commands and find out? That way you are armed with information.
by joan
Fri Sep 08, 2017 7:54 am
Forum: Beginners
Topic: Can't read a value of GPIO input pin from bash
Replies: 11
Views: 428

Re: Can't read a value of GPIO input pin from bash

I'm suggesting either 1) connect the GPIO to 3V3 through the button instead of the GPIO to ground through the button as done currently or 2) set the internal pull-up on the GPIO to high. Either method will work.
by joan
Thu Sep 07, 2017 9:33 pm
Forum: Beginners
Topic: Can't read a value of GPIO input pin from bash
Replies: 11
Views: 428

Re: Can't read a value of GPIO input pin from bash

You need to connect the GPIO to 3V3 if you want it to read as high. GPIO24 has a default low pull and the button also pulls low.

As a quick test you could change the default pull to high. It will then read 1 until the button is pressed.

sudo pigpiod
pigs pud 24 u
by joan
Thu Sep 07, 2017 4:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Concurrent DAC and ADC using pigpio?
Replies: 5
Views: 471

Re: Concurrent DAC and ADC using pigpio?

You have several choices. Merge both functions into a single C program. Leave one program as is and change the other to use pigpio daemon functions, e.g. from a Python script or using the C pigpiod_if2 library. See http://abyz.co.uk/rpi/pigpio/pdif2.html. The unchanged program will act as the pigpio...
by joan
Thu Sep 07, 2017 7:07 am
Forum: Advanced users
Topic: I2C Unreliability
Replies: 4
Views: 386

Re: I2C Unreliability

The Pi hardware does not support clock stretching.

I would at least try software I2C which may be configured to be a drop in replacement for the hardware version.

Look in /boot/overlays/README for details (search for i2c).
by joan
Thu Sep 07, 2017 7:01 am
Forum: Python
Topic: Read encoder signals and view them on a screen
Replies: 7
Views: 342

Re: Read encoder signals and view them on a screen

To autostart at boot use

sudo systemctl enable pigpiod

I may have got enable and pigpiod the wrong way around and it may be pigpio rather than pigpiod.

A somewhat complicated kivy example at http://abyz.co.uk/rpi/pigpio/examples.h ... vy_GPIO_py
by joan
Wed Sep 06, 2017 11:20 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Maximum Baudrate of UART in Raspberry Pi 3
Replies: 14
Views: 749

Re: Maximum Baudrate of UART in Raspberry Pi 3

You will learn more if you try communicating between two devices at such a high baud rate. The problems will soon become apparent.
by joan
Wed Sep 06, 2017 11:14 am
Forum: C/C++
Topic: High speed rotary encoder reading
Replies: 11
Views: 714

Re: High speed rotary encoder reading

pigpio is probably a better choice for this application. I would use C rather than Python as Python is likely to get swamped by the sheer volume of events.

I'd use the daemon and http://abyz.co.uk/rpi/pigpio/examples.html#pdif2_RED
by joan
Wed Sep 06, 2017 6:55 am
Forum: Python
Topic: Read encoder signals and view them on a screen
Replies: 7
Views: 342

Re: Read encoder signals and view them on a screen

The pigpio examples generally run for a few minutes then stop. Partly so that the example code can show a clean way to shut down. If you don't want that behaviour you need to edit the code.
by joan
Tue Sep 05, 2017 2:13 pm
Forum: Python
Topic: Read encoder signals and view them on a screen
Replies: 7
Views: 342

Re: Read encoder signals and view them on a screen

You need to clarify what you want to achieve.

In the meantime have a look at piscope.

http://abyz.co.uk/rpi/pigpio/piscope.html
by joan
Tue Sep 05, 2017 2:10 pm
Forum: C/C++
Topic: How to set a sampling rate using wiringPi SPI
Replies: 1
Views: 194

Re: How to set a sampling rate using wiringPi SPI

That is the correct way to set the sampling rate with wiringPi (delay between samples).

wiringPi uses the Linux SPI driver which tops out at about 70ksps on a Pi3 and at about 20ksps on other Pi models.
by joan
Sat Sep 02, 2017 10:14 am
Forum: Python
Topic: RF transmission and receiving using python
Replies: 3
Views: 243

Re: RF transmission and receiving using python

Virtual Wire may be used to send strings.

http://abyz.co.uk/rpi/pigpio/examples.html#Python_vw
by joan
Thu Aug 31, 2017 10:30 am
Forum: Automation, sensing and robotics
Topic: HC-SR05 distance cut off at +-60 cm (however arduino works well)
Replies: 6
Views: 333

Re: HC-SR05 distance cut off at +-60 cm (hoever arduino works well)

Are you powering the sensor from 5V? That looks like a chart I got when I mistakenly powered the device from 3V3.
by joan
Wed Aug 30, 2017 9:42 am
Forum: Troubleshooting
Topic: SI7021 Temp Humid sensor and SMbus
Replies: 10
Views: 400

Re: SI7021 Temp Humid sensor and SMbus

I don't remember using the code with Python 3 but neither can I think of a reason why it wouldn't work. You'll have to try and see.
by joan
Tue Aug 29, 2017 10:43 am
Forum: Troubleshooting
Topic: Configuring Remote GPIO
Replies: 2
Views: 215

Re: Configuring Remote GPIO

The instructions are probably for Linux. On Windows they may need modification.

I think you use the setx command in (recent) Windows to set an environment variable.

Try

setx PIGPIO_ADDR "192.168.0.13"

python gpiozeroTest.py
by joan
Tue Aug 29, 2017 8:37 am
Forum: Troubleshooting
Topic: SI7021 Temp Humid sensor and SMbus
Replies: 10
Views: 400

Re: SI7021 Temp Humid sensor and SMbus

The following code has an i2c class which is all you need. The read/write functions are the equivalent of pigpio's i2c_read_device/i2c_write_device. The extraneous SMBus code was simply used to test performance. #!/usr/bin/env python import io import fcntl # i2c.py # 2014-09-21 # Public Domain # Als...
by joan
Mon Aug 28, 2017 8:25 pm
Forum: Troubleshooting
Topic: SI7021 Temp Humid sensor and SMbus
Replies: 10
Views: 400

Re: SI7021 Temp Humid sensor and SMbus

Do you want to use pure Python? If so I have some code which will be a start which I'll dig out.

Go to advanced search