Go to advanced search

by richrarobi
Tue Jan 31, 2017 11:24 am
Forum: Advanced users
Topic: Remote PIR sensor
Replies: 6
Views: 1670

Re: Remote PIR sensor

May be interesting to someone : in my code in a previous post I have commented out the setting of a remote led using RPC via zeromq. I found that this actually is a good way for a remote sensor be it PIR or motion sensing camera to set off an alarm trigger. It is very simple to read the "LED" and ac...
by richrarobi
Sun Jan 29, 2017 1:34 pm
Forum: Camera board
Topic: simple motion responder with flask view
Replies: 0
Views: 667

simple motion responder with flask view

I wanted to generate an automatic response to detected motion, and have a way of viewing the generated pictures simply. Pulling in and modifying code from elsewhere (including flask examples by Michael Grinberg...) I have this so far: 1. added none /tmp tmpfs defaults 0 0 to end of /etc/fstab (and s...
by richrarobi
Fri Jan 27, 2017 9:42 am
Forum: Advanced users
Topic: Identifying Raspberry Pi version from MAC or serial number?
Replies: 6
Views: 1711

Re: Identifying Raspberry Pi version from MAC or serial numb

Does cat /proc/cpuinfo give what you want? I use this to tell if a processor is ARM or not - so I don't run pi stuff on my Linux system. def is_ARM(): tmp = runprc("cat /proc/cpuinfo") for line in tmp.splitlines(): if "model name" in line: x, t = line.split(": ") if "ARM" in t: return True return Fa...
by richrarobi
Fri Jan 27, 2017 8:27 am
Forum: Advanced users
Topic: Remote PIR sensor
Replies: 6
Views: 1670

Re: Remote PIR sensor

using Callbacks would free up the cpu to do other things. Your code seems to be polling (i.e. watching the pir). ssh needs you to be logged in - so is not so nice as using messaging..... I use the following code to have a pir on a b+ that uses rpc vis zeromq (see raspberry colloid ( https://www.rasp...
by richrarobi
Sat Jan 21, 2017 12:42 am
Forum: Python
Topic: omxplayer playlist from array
Replies: 2
Views: 2195

Re: omxplayer playlist from array

I use subprocess control as in the code I posted at the end of this viewtopic.php?f=91&t=170004
Dbus control is possible but obscure in comparison.
by richrarobi
Sat Jan 21, 2017 12:16 am
Forum: Python
Topic: how to play next .mp3 using omxplayer-wrapper / omxplayer
Replies: 4
Views: 1504

Re: how to play next .mp3 using omxplayer-wrapper / omxplaye

Could you use subprocess control as suggested in my code at the end of this viewtopic.php?f=91&t=170004?
It would do previous/next audio in the same way, although I can't see where you define a list of audio streams. Where does the list come from?
by richrarobi
Sat Jan 21, 2017 12:00 am
Forum: Networking and servers
Topic: How to setup RPi 3 connect with another RPi 3 automatically?
Replies: 1
Views: 514

Re: How to setup RPi 3 connect with another RPi 3 automatica

Not solely a pi problem -
Maybe:-
viewtopic.php?f=41&t=167174
or use another messaging service such as mqtt (mosquitto), or read about IOT....
by richrarobi
Sun Jan 15, 2017 4:50 pm
Forum: Python
Topic: Python 3 and XBee library
Replies: 6
Views: 4838

Re: Python 3 and XBee library

Bytes to ASCII seems to be one of the main differences between 2.7 and 3... I don't have xbee to test, but at a guess from the code and errors, I would suggest you try making those parameters into text strings (i.e. drop the b). DIOon = b'\x05' DIOoff = b'\x04' I have also found that I sometimes nee...
by richrarobi
Fri Jan 06, 2017 5:16 pm
Forum: Beginners
Topic: Omxplayer dbus control
Replies: 6
Views: 5371

Re: Omxplayer dbus control

I found another way (suggested on the forum - again I have lost the link - will post when I find it).The gist is that if you are using subprocess, why not do it all with subprocess - it looks better than dbus and is easier to understand. This took a while as python3 uses bytes, but it works now. #!/...
by richrarobi
Thu Jan 05, 2017 2:43 pm
Forum: Beginners
Topic: Omxplayer dbus control
Replies: 6
Views: 5371

Re: Omxplayer dbus control

Thanks, I have already had a look, a lot to take in......I tried running n python 3 - I think it will work except for around getting the user-name. I particularly like the preset codes!! I just found that without any more changes than below, I can use my code above to play internet radio! Definitely...
by richrarobi
Thu Jan 05, 2017 12:12 pm
Forum: Beginners
Topic: Omxplayer dbus control
Replies: 6
Views: 5371

Re: Omxplayer dbus control

Being finicky, I didn't like any of the offerings elsewhere - also they don't seem to work with Python3 - so, I started with some code I found elsewhere on the forum (will add link when I can find it again) - the original link:- https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=74321 - have ex...
by richrarobi
Sun Jan 01, 2017 8:36 pm
Forum: Other projects
Topic: Raspberry Colloid (?) Distributed Python Mayhem
Replies: 2
Views: 1255

Re: Raspberry Colloid (?) Distributed Python Mayhem

Example using a PIR to set LED on a remote pi :- zprox.py and zrep.py as previously posted, zprox on sender and zrep running on receiving server: on system c with PIR: #!/usr/bin/python3 # pir5.py on system c import RPi.GPIO as GPIO from time import sleep from zprox import ZProxy def callback(chan):...
by richrarobi
Sun Jan 01, 2017 8:06 pm
Forum: Python
Topic: TCP Network Messaging Startup Slow
Replies: 6
Views: 1676

Re: TCP Network Messaging Startup Slow

ZeroMQ uses TCP sockets http://zeromq.org/intro:read-the-manual , and I haven't seen any delays. I have a pi with PIR that sends message (RPC command) to another pi that has a LED. I can go in the room at any time and the LED switches on almost immediately. I think you are probably correct in thinki...
by richrarobi
Sun Jan 01, 2017 11:39 am
Forum: Other projects
Topic: Best bought 3 - 6 Pi 3 cluster case with active cooling?
Replies: 5
Views: 8198

Re: Best bought 3 - 6 Pi 3 cluster case with active cooling?

Been toying with this idea a while: Each pi to be individually accessible..... just before the ibm pc came out with its stupid monolithic motherboard, I was looking at eurocard sized boards - there was a 6502 board - I even acquired a eurocard rack and small case - unfortunately it went to the tip y...
by richrarobi
Sun Jan 01, 2017 10:57 am
Forum: Python
Topic: TCP Network Messaging Startup Slow
Replies: 6
Views: 1676

Re: TCP Network Messaging Startup Slow

Doesn't the scp process need to go through a login phase for each connection? That may be your initial delay? Have you considered using one of the popular messaging libraries to avoid all that low level code? MQTT, ZeroMQ, etc https://en.wikipedia.org/wiki/ZeroMQ While some do enjoy the intricacy of...
by richrarobi
Sat Dec 31, 2016 5:34 pm
Forum: Python
Topic: Python 2 or 3
Replies: 16
Views: 3627

Re: Python 2 or 3

I agree with Paeryn. Python 2 has an end of life (although they keep having to delay - some important features have also had to be backfitted) - but.... the documentation and libraries are better in 3. Everyone that tries to convert will put more pressure on the heeldraggers, eventually everything w...
by richrarobi
Sat Dec 31, 2016 11:20 am
Forum: Networking and servers
Topic: Swarm of RPs "calling home"
Replies: 6
Views: 1464

Re: Swarm of RPs "calling home"

As suggested by Dougie, messaging such as MQTT probably easier to handle. Another approach? I am tending towards an RPC approach, using zeromq through a small interface I created (from an original non-zeromq example in a book) - this means that each swarm member can RPC (remote procedure call) to an...
by richrarobi
Sat Dec 31, 2016 10:38 am
Forum: Python
Topic: OK, stupid question...
Replies: 4
Views: 1031

Re: OK, stupid question...

You may (or may not) find out later that mahjongg was also correct, except that your question was slightly unclear. Assuming you meant :- how do you exit a python program (that may be looping, etc) , and the answer....ctrl-c will provide a "keyboard interrrupt" that can be caught using try/except, b...
by richrarobi
Thu Dec 22, 2016 7:33 pm
Forum: Off topic discussion
Topic: i is tired.
Replies: 76
Views: 12083

Re: i is tired.

Jackson: I just had to google it to be sure...https://en.wikipedia.org/wiki/Jackson_s ... rogramming
Probably someone in the lowerarchy of gov't contracts thought they needed to write down what everyone was doing anyway? :P
by richrarobi
Thu Dec 22, 2016 2:53 pm
Forum: Off topic discussion
Topic: i is tired.
Replies: 76
Views: 12083

Re: i is tired.

I fear its an age thing, why does programing hurt so much? I can remember the pain when (jackson methodology(?)) effectively inverted the way people had to think about loops. I had started with a bit of Algol and Fortran, then low level Fixpac3 Autocode. Suddenly, labels and "if,then,goto" were ban...
by richrarobi
Wed Dec 21, 2016 8:06 pm
Forum: Other projects
Topic: Build your own CPU out of transistors
Replies: 10
Views: 2937

Re: Build your own CPU out of transistors

The Ferranti F1600 series had a 24 bit instruction code (Fixpac3 Autocode was the low level language) - the instruction set had 3 address fields, v0 to v31. v1 to v23 were registers. v0 (hazy?), v24 thru v31 had special uses (Hazy). I think v24 was "input from tape reader"?? There were also "index r...
by richrarobi
Wed Dec 21, 2016 5:15 pm
Forum: Troubleshooting
Topic: pin 7 goes from in to out
Replies: 6
Views: 1001

Re: pin 7 goes from in to out

This is not so much a reply as an extension to the original.... I am wondering how much I can expect to "get away with" on the GPIO software. I have a working setup where I can set/clear/toggle from remote systems using RPC. (see Raspberry Colloid in other projects) - I just also connected a PIR sen...
by richrarobi
Wed Dec 21, 2016 3:53 pm
Forum: Off topic discussion
Topic: i is tired.
Replies: 76
Views: 12083

Re: i is tired.

I believe the people working on the Coral 66 compiler at Ferranti were using Coral 66 to write their code. Theory, I think, was that they were producing more efficient code at each pass (?) Probably started with Coral 64, or maybe their (very, very, primitive) Algol compiler (that was on a reel of p...
by richrarobi
Fri Dec 16, 2016 8:36 pm
Forum: Python
Topic: Source code sharing
Replies: 4
Views: 1298

Re: Source code sharing

Go to advanced search