Go to advanced search

by Ace Rimmer
Thu Feb 08, 2018 4:49 am
Forum: Beginners
Topic: Get by password and run a cmd on startup? pls help
Replies: 3
Views: 468

Re: Get by password and run a cmd on startup? pls help

Sorry Ace, but that's a really bad idea..... Ooops! :oops: I used to use the rc.local method but heard it can be quite unforgiving so when I read in a book (wish I could remember which one) about using /etc/profile it sounded a lot better, hence I used it, but in my case on power-up once the script...
by Ace Rimmer
Mon Feb 05, 2018 4:37 am
Forum: Camera board
Topic: record video and power off
Replies: 5
Views: 1545

Re: record video and power off

Try using an interrupt to finish the recording (or stills capture) and then shutdown. If you're interested let me know and I'll try and find the code I used in a similar situation.
by Ace Rimmer
Mon Feb 05, 2018 4:08 am
Forum: Beginners
Topic: Get by password and run a cmd on startup? pls help
Replies: 3
Views: 468

Re: Get by password and run a cmd on startup? pls help

Hi mono78v, to automatically run something on start up try this sudo nano /etc/profile add your command line to the end of the file, save and exit. Every time your Pi starts up it should run your command. To auto login from my memory I believe this can be set with raspiconfig - but I'm not sure if t...
by Ace Rimmer
Tue Nov 14, 2017 4:58 am
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

Yep, that worked - once I'd figured out how to concanate the components of the string - "print" is much easier! But oh for days of Qbasic with -

Code: Select all

locate (row,column)
:roll:
by Ace Rimmer
Mon Nov 13, 2017 3:42 am
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

Thanks Dougie, I'll give it a try this arvo if the boss doesn't catch me. I gather I just use "sys.stdout.write" instead of "print", I haven't used that method before. Cheers.
by Ace Rimmer
Sun Nov 12, 2017 11:16 pm
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

OK, my next problem, this code works great import serial ser=serial.Serial(' /dev/ttyUSB0',9600) while 1: textln=ser.readline() if ( '$GPGGA' ) in textln: listba=textln.split( ' , ') print ' your altitude is ',listba[9], ' metres above sealevel' but instead of printing line after line I would like i...
by Ace Rimmer
Sat Nov 11, 2017 6:06 am
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

That's a lot of legs Dom. I think I know how the old ones feel! Just had great success with the above line of code that ghp supplied. I'm now able to pick out whichever NMEA sentence I require, turn it into a list and then pick out different elements (altitude etc).

Thanks again ghp
by Ace Rimmer
Fri Nov 10, 2017 11:17 pm
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

Thanks ghp that code does just what I wanted it to. I was a bit worried at first as I ran it from the Python shell and it returned an error (something to do with tuples or bytes) however when the py file was run from the command line it worked 8-) So tell me Dom, what is the count now - reply in oct...
by Ace Rimmer
Fri Nov 10, 2017 10:11 pm
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Re: Finding a Line of GPS data

Thanks for the replies,
Long time no "see" Dom. ;)
ghp - I'll try that code, it looks like it might do what I want. I'll let you know. :)
by Ace Rimmer
Fri Nov 10, 2017 3:33 am
Forum: Python
Topic: Finding a Line of GPS data
Replies: 11
Views: 1514

Finding a Line of GPS data

Hi, I'm able to read all the lines of data from a GPS module connected via usb, but I only want to see one or two of the lines.. import serial ser=serial.Serial('dev/ttyUSB0',9600) textln=ser.readline() while 1: print (textln ) All lines ( and there are many :o ) start with "$GP". How do I pick out ...
by Ace Rimmer
Mon Aug 28, 2017 5:37 am
Forum: Camera board
Topic: Picamera & Interrupts
Replies: 0
Views: 481

Picamera & Interrupts

Hi, I hope someone can help me solve my problem. I am writing a small script which "interrupts" a video recording and then starts recording to a new file. The script works when I run it in the Python shell, however when I try to run it from the command line it fails in one of two ways - if run using...
by Ace Rimmer
Fri Apr 07, 2017 5:32 am
Forum: Beginners
Topic: RTC & JESSE
Replies: 2
Views: 423

Re: RTC & JESSE

Thanks W.H. I'll give that a try this evening, looks easy enough even for me!
by Ace Rimmer
Thu Apr 06, 2017 3:42 am
Forum: Beginners
Topic: RTC & JESSE
Replies: 2
Views: 423

RTC & JESSE

Hi, I've just installed Jesse on my B+ and I'm trying to add an RTC (DS3231) to the system. I had it running successfully on the B+ with Wheezy but I've had no luck installing it with Jesse :( . I'd like to start from scratch, any help would be appreciated.
by Ace Rimmer
Fri Sep 30, 2016 9:50 pm
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

That's right tom, when the module I wrote didn't work I neglected to delete it before I moved to the next method. Mea culpa.
by Ace Rimmer
Fri Sep 30, 2016 6:04 am
Forum: Troubleshooting
Topic: Pi boots with LED on.
Replies: 2
Views: 441

Re: Pi boots with LED on.

Hi rpdom, you're up early this morning! GPIO 4 (pin 7) is used for the w1 (one-wire) bus, most commonly used for the DS18B20 temperature sensors. The driver will be polling the bus to look for devices every 10 seconds or so, and the rest of the time the pin will be used as input. Check your /boot/co...
by Ace Rimmer
Fri Sep 30, 2016 3:42 am
Forum: Troubleshooting
Topic: Pi boots with LED on.
Replies: 2
Views: 441

Pi boots with LED on.

I have an RGB led attached to pins GPIO pins 18,4 & 27 respectively on my B+. The led is used as an indicator at various times during program execution. When the program finishes all LEDs are off, however the next time the PI bootsup the green led (GPIO 4) is on although not as bright as normal :? D...
by Ace Rimmer
Fri Sep 30, 2016 2:13 am
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

I almost made the mistake of deleting the offending file and running the script again while I was half way through my reply.
A good thing I woke up in time as it now shuts down as it should. 8-)
Thanks again.
by Ace Rimmer
Fri Sep 30, 2016 2:05 am
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

Thanks tom, you're a genius. Before I added the extra bit of code that you suggested I had a look in /Pi and sure enough there was a file called subprocess.pyc. That jogged my memory, I made that file in one of my many attempts to get "shutdown" happening and forgot to delete it. The print out after...
by Ace Rimmer
Fri Sep 30, 2016 12:05 am
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

Better late than never. Below isn't the original bit of code I was using but it produces the same errorcode. #!/usr/bin/env python2.7 print (' INITIALISING >>>>>>') import datetime as dt from time import *#time import RPi.GPIO as GPIO import subprocess GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) ...
by Ace Rimmer
Sun Sep 25, 2016 9:32 pm
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

Thanks Tom & elP' , may take a while to get things back the way they were in order to replicate the error.
Cheers.
by Ace Rimmer
Sat Sep 24, 2016 10:01 pm
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

Hi again, the code I used was exactly as the above example

Code: Select all

import subprocess
.
.#my code
.
subprocess.call(["shutdown", "-h", "now"])
I tried several variations, all to no avail. I don't know if it makes any difference but I'm using Python 2 under Wheezy.
by Ace Rimmer
Sat Sep 24, 2016 6:11 am
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

I just tried

Code: Select all

os.system('shutdown now -h')
and it works a treat :D
by Ace Rimmer
Sat Sep 24, 2016 4:19 am
Forum: Python
Topic: How do I implement a Linux shutdown -h now command from pyth
Replies: 19
Views: 4884

Re: How do I implement a Linux shutdown -h now command from

Hi, I've been trying to use the above code to shutdown my pi when python script finishes. When the script finishes instead of shutting down I get the following

TypeError: 'str' object is not callable

What am I doing wrong?
by Ace Rimmer
Fri Sep 23, 2016 9:57 pm
Forum: Beginners
Topic: Backing up with ImageWriter
Replies: 3
Views: 572

Re: Backing up with ImageWriter

Thanks topguy and drgeoff, yes I'm using an old "very ordinary" card reader - I'll try another one. I'll try raspi-config also.
I didn't realize it at the time I made the post but both cards don't load the time from my hardware clock now.
by Ace Rimmer
Fri Sep 23, 2016 5:06 am
Forum: Beginners
Topic: Backing up with ImageWriter
Replies: 3
Views: 572

Backing up with ImageWriter

Hi, I've just used Win32Imagewriter to make a backup of my Pi's SD card, all up it took about 4.5 hours :shock: to read the old card and then write the new one! Does this sound right? Also the old card was 8Gb and I backed it up to a 16Gb card but when I booted up with the new card File Manager repo...

Go to advanced search