Go to advanced search

by KeithSloan
Thu Nov 03, 2016 8:06 pm
Forum: General discussion
Topic: running system command from python.
Replies: 6
Views: 2150

Re: running system command from python.

Googling for the error message xcb_connection error I found that it seemed to be something to do with pulse audio.

On trying to debug took me back to trying festival from the command line and got the same two error messages. A reboot seems to have cleared the problem.

Thanks for all your help.
by KeithSloan
Thu Nov 03, 2016 4:52 pm
Forum: General discussion
Topic: running system command from python.
Replies: 6
Views: 2150

Re: running system command from python.

Okay now get two error messages
xcb_connection_has_error() returned true
xcb_connection_has_error() returned true

Also what is the correct way to close the spawned process down.
by KeithSloan
Thu Nov 03, 2016 3:32 pm
Forum: General discussion
Topic: running system command from python.
Replies: 6
Views: 2150

Re: running system command from python.

Tried with subprocess.Popen(["festival", "--tts"], stdin=subprocess.PIPE, universal_newlines=True) as festival: festival.communicate(l); But got Traceback (most recent call last): File "LetterBoard.py", line 123, in <module> with subprocess.Popen(["festival", "--tts"], stdin=subprocess.PIPE, univers...
by KeithSloan
Wed Nov 02, 2016 2:57 pm
Forum: General discussion
Topic: running system command from python.
Replies: 6
Views: 2150

running system command from python.

I am trying to run a system command from python.
The command I wish to run is echo "Some Text" | festival --tts
Python doc says system calls are all depreciated in favour of subprocess but I don't seem to be able to get subprocess to work, I assume because of the pipe
by KeithSloan
Tue Nov 01, 2016 2:21 pm
Forum: General discussion
Topic: Sonic Pi from Python.
Replies: 0
Views: 920

Sonic Pi from Python.

I would like to use Sonic Pi from Python. I tried the instructions at https://pypi.python.org/pypi/python-sonic/0.1.2 But I get error pip install python-sonic Downloading/unpacking python-sonic Could not find any downloads that satisfy the requirement python-sonic Cleaning up... No distributions at ...
by KeithSloan
Mon Oct 31, 2016 3:41 pm
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

Read the datasheet for MCP3551 more carefully it does continuous conversion and if the high order bit of a set of bytes is on it means its still reading the pressure difference. So whilst I have a pigpio version that works think I will stick with spidev and just ignore any set of bytes where the hig...
by KeithSloan
Mon Oct 31, 2016 2:20 pm
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

Fixed segmentation fault need to pass values to xfer as a list. Still cannot see a way of getting this to work with spidev and not get the rogue 255 values.
by KeithSloan
Mon Oct 31, 2016 2:08 pm
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

Got it working with pigpio but don't like pigpio as it uses a daemon, sockets and pipes seems totally overkill as a solution. Wow. PIGPIO is a tool, designed for multiple use cases, you don't need to use them all yourself, i don't think you even need to use the daemon if you use the C version. When...
by KeithSloan
Mon Oct 31, 2016 1:52 pm
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

All SPI is a two way street. You always have to write to an SPI device to read it. I think you might be wrong if I try a xfer it just gets a Segmentation fault import spidev import time spi = spidev.SpiDev() # create spi object spi.open(0, 0) # open spi port 0, device (CS) 1 spi.mode = 0b11 # 1,1 -...
by KeithSloan
Mon Oct 31, 2016 12:39 pm
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

Try Joan's pigpio. If you want to continue with spidev then try using spi.xfer (toggles the slave select between bytes) or spi.xfer2 (which does a single continuous transfer, slave select held low). I've got a sample for an MCP3002 but not for an MCP3551. Will try pigpio. As far as I can see spi.xf...
by KeithSloan
Mon Oct 31, 2016 11:54 am
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Re: Trying to read pressure difference via SPI.

Yes, it's not ready so SDO is high (being seen as a stream of 1 bits). Do the following. Assert slave select (set to zero) and then wait for SDO to go low (it may already be low). When SDO goes low you do the SPI transfer. Then set slave select back high. I.e. you need to control the slave select l...
by KeithSloan
Mon Oct 31, 2016 11:25 am
Forum: General discussion
Topic: Trying to read pressure difference via SPI.
Replies: 13
Views: 3153

Trying to read pressure difference via SPI.

I am trying to read the pressure difference as measured by a ClickDiffPressure see http://www.mikroe.com/click/diff-pressure/ I have written the following code import spidev import time spi = spidev.SpiDev() # create spi object spi.open(0, 0) # open spi port 0, device (CS) 1 spi.mode = 0b11 # 1,1 - ...
by KeithSloan
Sat Apr 23, 2016 6:13 am
Forum: Troubleshooting
Topic: usb error -32
Replies: 4
Views: 2552

Re: usb error -32

What does running the command dmesg just after you plug the device in say
by KeithSloan
Fri Apr 15, 2016 6:12 pm
Forum: General discussion
Topic: ARRGGH Power cuts.
Replies: 28
Views: 6584

Re: ARRGGH Power cuts.

Heater wrote: Either way, if I want a reliable system I would arrange for the root fs to be read only.
Lots of people recommend this. So why is the default Raspbian image not setup in this manner.

Or do you mean I would arrange for the only file system on the SD card to be a read only root fs
by KeithSloan
Fri Apr 15, 2016 10:48 am
Forum: General discussion
Topic: ARRGGH Power cuts.
Replies: 28
Views: 6584

Re: ARRGGH Power cuts.

Okay at the Winchester Pi meeting Dougie managed to fixed the corrupted superblock on the SD card. Any chance he could documented the process as I know he tried various approaches before being successful. Okay first part was to insert the external SD card reader and run dmesg to find out which devic...
by KeithSloan
Tue Apr 05, 2016 4:21 pm
Forum: General discussion
Topic: Cups & HP Business Inkjet 1200
Replies: 4
Views: 1249

Re: Cups & HP Business Inkjet 1200

for HP, try: sudo apt-get install hplip sudo hp-setup -i That got me further, but when I do a test print from ubuntu the job gets status held for authentication. If I right click and authenticate it does not work. But any way I think I have to change some option in /etc/cups/cupsd.conf In the bit t...
by KeithSloan
Tue Apr 05, 2016 3:19 pm
Forum: General discussion
Topic: Cups & HP Business Inkjet 1200
Replies: 4
Views: 1249

Re: Cups & HP Business Inkjet 1200

for HP, try: sudo apt-get install hplip sudo hp-setup -i That got me further, but when I do a test print from ubuntu the job gets status held for authentication. If I right click and authenticate it does not work. But any way I think I have to change some option in /etc/cups/cupsd.conf In the bit t...
by KeithSloan
Tue Apr 05, 2016 2:09 pm
Forum: General discussion
Topic: Cups & HP Business Inkjet 1200
Replies: 4
Views: 1249

Cups & HP Business Inkjet 1200

I had a problem with my Pi following a power failure and decided to rebuild my system using Jessie rather than Wheezy. I had it working as a Cups print server for an HP Business Inkjet 1200n with Wheezy. Installed a long time ago so not sure how I got it working. Under Jessie cups installation when ...
by KeithSloan
Mon Apr 04, 2016 7:07 pm
Forum: General discussion
Topic: ARRGGH Power cuts.
Replies: 28
Views: 6584

Re: ARRGGH Power cuts.

I've pulled power on many occasions and haven't corrupted an SDCard since the firmware was fixed a couple of years ago. If you're running 4.1.19 with matching firmware things should be stable. What are your RPis doing? How much data do you collect, how often? Have you thought about writing data to ...
by KeithSloan
Mon Apr 04, 2016 4:06 pm
Forum: General discussion
Topic: ARRGGH Power cuts.
Replies: 28
Views: 6584

ARRGGH Power cuts.

Yet another power cut today ARRRGH!!!!!

Two Pi SD-card trashed.

Giving up on Raspberry Pi's cannot be bothered with the hassle of re imaging everything when we get a power cut.

Will sleep on it but probably a couple of 2B's headed the way of ebay.
by KeithSloan
Fri Mar 18, 2016 11:19 am
Forum: The MagPi
Topic: Reading on a Kindle.
Replies: 3
Views: 1779

Re: Reading on a Kindle.

DougieLawson wrote:Try https://calibre-ebook.com/
Tried calibre but did not help that much
by KeithSloan
Thu Mar 17, 2016 5:48 pm
Forum: The MagPi
Topic: Reading on a Kindle.
Replies: 3
Views: 1779

Reading on a Kindle.

I have just brought a Kindle paperwhite for times when I travel by coach. One of the things I would like to read on it is the MagPi magazine. Just sending as a PDF to the kindle is not very satisfactory. Anybody worked out a good way of reformatting the magazine for the Kindle via something like cal...
by KeithSloan
Mon Mar 14, 2016 7:11 pm
Forum: General discussion
Topic: Any ideas for more secure semi-permanent GPIO connectors.
Replies: 4
Views: 2516

Re: Any ideas for more secure semi-permanent GPIO connectors

I use Mikrobus see http://www.mikroe.com/click/pi2-shield/ And Mikrobus Proto boards see https://github.com/KeithSloan/Mikrobus-Proto Having invested in a Mikrobus shield the Proto boards cost less than £15.00 for 10 boards from ITEAD https://www.itead.cc/open-pcb/pcb-prototyping.html You can use tw...
by KeithSloan
Mon Mar 07, 2016 11:01 am
Forum: General discussion
Topic: Trying to read values via I2C
Replies: 0
Views: 731

Trying to read values via I2C

I am having problems reading values via I2C from an Arduino nano slave. Whilst testing I have the I2C slave put out constant values, but what the Pi reads do not agree with those constant values sometimes it read 9 instead of 19 ( 0x13) I put in sleeps of 1 second between register reads which helped...

Go to advanced search