Go to advanced search

by MrYsLab
Wed Jul 26, 2017 5:05 pm
Forum: Python
Topic: Pi Camera Threading
Replies: 2
Views: 1065

Re: Pi Camera Threading

There is a python library I use that works well: https://pypi.python.org/pypi/APScheduler Here is a sample file I cobbled together (tested with Python 3): import time from apscheduler.schedulers.background import BackgroundScheduler class Stest: def __init__(self): self.scheduler = BackgroundSchedul...
by MrYsLab
Tue Jul 25, 2017 3:44 pm
Forum: Python
Topic: tracking with raspberry pi
Replies: 1
Views: 350

Re: tracking with raspberry pi

Please provide some additional information as to what you are trying to track.
For example, do you mean the position of a servo motor, or the position of a rotary encoder, or the position of a robot?
by MrYsLab
Mon Jul 24, 2017 1:25 pm
Forum: Python
Topic: Help with Python code interupts
Replies: 15
Views: 1785

Re: Help with Python code interupts

Glad you figured it out. BTW, the class I provided is unlikely to work since it contains the same logic as your original file. Once you get your code working, if you wish apply the same changes to the class and it too should work.
by MrYsLab
Sun Jul 23, 2017 8:43 pm
Forum: Python
Topic: Help with Python code interupts
Replies: 15
Views: 1785

Re: Help with Python code interupts

I don't know if this will make things more difficult for you or not, but I converted your original program to a python class. If you are able to fix your problem and understand the fix, and find classes too confusing, please ignore this code. Classes help get rid of global (truly evil things :D ). Y...
by MrYsLab
Fri Jul 21, 2017 5:11 pm
Forum: Python
Topic: Help with Python code interupts
Replies: 15
Views: 1785

Re: Help with Python code interupts

Sorry, I missed seeing that code. Not being familiar with your hardware design, are you sure that the home switch is being activated when operating the robot? What mechanically trigger it? The "simulation" was just removing all the gpio code and replacing it with a print statement in each function. ...
by MrYsLab
Fri Jul 21, 2017 2:36 pm
Forum: Python
Topic: Help with Python code interupts
Replies: 15
Views: 1785

Re: Help with Python code interupts

For question 1: I might be missing the obvious, but I just tried your code in simulation mode (removed all the GPIO stuff and replaced with prints) and never see the home function called. How and when is that called? For question 2: If you want to run on a tablet, will you be using WiFi or are you p...
by MrYsLab
Fri Jul 21, 2017 10:50 am
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

Sorry I misunderstood your comment, but when your stated *without a broker, you'll miss messages as they're basically 'fling and forget', it did not sound like you were talking about MQTT QOS. So we are both correct. You are correct in that ZeroMQ does not provide QOS on top of the transport, but on...
by MrYsLab
Thu Jul 20, 2017 5:47 pm
Forum: Python
Topic: Data consolidation
Replies: 5
Views: 782

Re: Data consolidation

Daniel, I don't have a lot of experience with "big data", but do have quite a bit of experience in collecting data and moving it off of multiple RPis. The way banyan works is that each RPi would do its normal data collection and when it is ready to move if off, would publish a banyan message. Anothe...
by MrYsLab
Thu Jul 20, 2017 4:35 pm
Forum: Python
Topic: Detecting long short press in a reliable manner
Replies: 4
Views: 1210

Re: Detecting long short press in a reliable manner

I am not familiar with RPi.GPIO, but the pigpio library might help. The library has a callback function http://abyz.co.uk/rpi/pigpio/python.html#callback that provides a time tick as part of its return value when a pin changes state.
by MrYsLab
Thu Jul 20, 2017 4:23 pm
Forum: Python
Topic: Data consolidation
Replies: 5
Views: 782

Re: Data consolidation

Daniel, Your description is somewhat vague and if you provide some more detail, that might help. 1. What types of devices are your talking about - digital, analog, i2c? 2. What does "uploaded somewhere" mean? Do you mean sending the collected data to another device for processing and possible displa...
by MrYsLab
Thu Jul 20, 2017 12:48 am
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

I respectfully disagree with @asanfords's assertions. First, Banyan is not brokerless - it uses its own form of broker, but unlike mqtt, Banyan does all message filtering at the endpoints making a much faster system. Check out http://mikehadlow.blogspot.com/2011/04/message-queue-shootout.html Next, ...
by MrYsLab
Wed Jul 19, 2017 6:08 pm
Forum: Python
Topic: serial communication
Replies: 2
Views: 551

Re: serial communication

How are you controlling the serial interface? Normally this is done with pyserial. Take a look at: https://pyserial.readthedocs.io/en/latest/
by MrYsLab
Wed Jul 19, 2017 12:52 am
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

Try changing

Code: Select all

sudo backplane &
to

Code: Select all

backplane &
in your rc.local.

To see if the backplane is running type:

Code: Select all

ps -eaf | grep backplane 
If it is, it should appear in the output of this command.
by MrYsLab
Tue Jul 18, 2017 10:00 pm
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

The code looks correct. To help debug, there is a monitor utility https://github.com/MrYsLab/python_banyan/blob/master/python_banyan/utils/monitor.py included in the distribution and is installed as a command line executable. This may help show what might be happening. The current version of the mon...
by MrYsLab
Tue Jul 18, 2017 6:18 pm
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

If you could share the code that would make it easier to determine what the problem might be.
by MrYsLab
Fri Jul 14, 2017 1:02 am
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

I think the first step is to make sure you can reliably detect the RF signals generated by the doorbell unit. If I understand what you are trying to accomplish, you will only need the receiver module of the 433Mhz RF Tx/Rx pair that you purchased. I found this article http://www.instructables.com/id...
by MrYsLab
Thu Jul 13, 2017 6:01 pm
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

I misunderstood the problem you are trying to solve and did not understand what the Lloytron door bell is. I am not very familiar with RFSniffer, but from what I gather it allows you to record and playback RF Streams using RPi.GPIO. There is no reason to try and convert to pigpio just for the sake o...
by MrYsLab
Thu Jul 13, 2017 3:57 pm
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

Sorry about the time to install. Not sure why that is so, but I think it is recompiling. If you are not using numpy, then no problem. Numpy is used for dealing with matrix data. The matrices can be quite large, and Banyan allows the transfer of a matrix as a single object. Just so you know, you can ...
by MrYsLab
Thu Jul 13, 2017 2:59 pm
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

To upgrade numpy, type the following in a terminal window: sudo pip3 install numpy --upgrade Also, if you wish to use python-banyan to transfer numpy data, you will need to add an additional parameter in the call to super for banyan_base for both the publisher and subscriber components. Here is an e...
by MrYsLab
Thu Jul 13, 2017 10:51 am
Forum: Python
Topic: Send message via network for multiple clients
Replies: 24
Views: 4310

Re: Send message via network for multiple clients

You might want to give python-banyan https://github.com/MrYsLab/python_banyann a try. It uses zeromq in conjunction with MessagePack to serialize the data. You just need to start up the backplane (the banyan equivalent of an mqtt broker) and the run the Banyan components. All Banyan components inher...
by MrYsLab
Mon Jul 10, 2017 11:41 am
Forum: Python
Topic: Detecting multiple button presses
Replies: 1
Views: 1204

Re: Detecting multiple button presses

I am not sure if this is going to help or perhaps confuse you more, but I prefer to work within a python class. It helps to organize things and usually makes things simpler. Here is an example using the pigpio GPIO library. Pigpio is included with the Raspbian distribution. You just need to start it...
by MrYsLab
Thu Jun 29, 2017 5:30 pm
Forum: Scratch
Topic: Learn to create your own custom scratch extension
Replies: 3
Views: 2912

Re: Learn to create your own custom scratch extension

I have just updated the documentation and created a pypi distribution. To install from pypi, open a terminal window and type: sudo pip3 install s2-pi Or download directly from github https://github.com/MrYsLab/s2-pi The documentation has been relocated here. https://mryslab.github.io/s2-pi/ The demo...
by MrYsLab
Wed Jun 28, 2017 1:24 pm
Forum: Scratch
Topic: Learn to create your own custom scratch extension
Replies: 3
Views: 2912

Re: Learn to create your own custom scratch extension

I am in the process of updating the distribution and this should be completed by the end of the week. The changes I am making are: 1. Improved documentation. 2. Simplified installation process from pypi (pip3 install). 3. When the server is started it will also automatically bring up the Scratch edi...
by MrYsLab
Mon Jun 26, 2017 8:47 pm
Forum: Scratch
Topic: Learn to create your own custom scratch extension
Replies: 3
Views: 2912

Learn to create your own custom scratch extension

Check out my 3 part tutorial on creating your own custom Scratch 2 extensions.
Tutroial: http://mryslab.blogspot.com/search/label/s2-pi
Code: https://github.com/MrYsLab/s2-pi
by MrYsLab
Fri Mar 20, 2015 2:14 pm
Forum: Python
Topic: Pymata Raspberrypi 2
Replies: 2
Views: 894

Re: Pymata Raspberrypi 2

As I mentioned in a private post, if you configure an SD card that works on the B+ and then plug it into the Rpi 2, it should work. In terms of the performance numbers you quote, my guess is that you have not enabled multi-threading in PyFirmata. When you enable multi-threading, please report the nu...

Go to advanced search