Go to advanced search

by buxton_paul
Fri Jul 07, 2017 12:57 pm
Forum: AIY Projects
Topic: Turn on/off two GPIO at same time
Replies: 7
Views: 1029

Re: Turn on/off two GPIO at same time

So referring to the Code we had in the other thread for adding another LED import RPi.GPIO as GPIO class GpioWrite(object): '''Write the given value to the given GPIO.''' def __init__(self, gpio, value): GPIO.setmode(GPIO.BCM) GPIO.setup(gpio, GPIO.OUT) self.gpio = gpio self.value = value def run(se...
by buxton_paul
Thu Jul 06, 2017 7:45 am
Forum: AIY Projects
Topic: AIY-box "broke" since adding shutdown-command
Replies: 3
Views: 555

Re: AIY-box "broke" since adding shutdown-command

Try reflashing the SD card with the premade image?
by buxton_paul
Wed Jul 05, 2017 3:18 pm
Forum: AIY Projects
Topic: Turn on/off two GPIO at same time
Replies: 7
Views: 1029

Re: Turn on/off two GPIO at same time

So the thing to note, is that the the add_keyword function parameters are The keyword that you are wanting to respond to An object with a run method. You cannot simply pass a function to be called, you need to define a class that has a run method, and it is this run method that is invoked by the spe...
by buxton_paul
Wed Jul 05, 2017 7:43 am
Forum: AIY Projects
Topic: Turn on/off two GPIO at same time
Replies: 7
Views: 1029

Re: Turn on/off two GPIO at same time

Suggest you look at the rpi gpio documentation.
https://sourceforge.net/p/raspberry-gpi ... i/Outputs/
by buxton_paul
Tue Jul 04, 2017 11:58 am
Forum: AIY Projects
Topic: Robot AIY Project
Replies: 5
Views: 1342

Re: Robot AIY Project

So first thing, is that the idea of the board is to assist you rather than do everything, and remember that people replying can't always test things especially when you are using specific hardware!. So treat the comments people leave as suggestions you can build on, rather than simply relying on oth...
by buxton_paul
Mon Jul 03, 2017 11:49 am
Forum: AIY Projects
Topic: Robot AIY Project
Replies: 5
Views: 1342

Re: Robot AIY Project

You are defining the run function with a variable called command, but within the function you are using voice_command. Also when you initialise the actor I think you need to be passing the speech as a paramter (in the examples it is say). My attempt at fixing pasted below. # ========================...
by buxton_paul
Mon Jul 03, 2017 9:12 am
Forum: AIY Projects
Topic: DIY AIY with Adafruit breakout boards
Replies: 2
Views: 546

Re: DIY AIY with Adafruit breakout boards

Hmm, When I used the AIY with a USB microphone the scripts didn't run at all as they were specifically looking for the Voice hat driver. I don't know much about the Adafruit breakout boards, but you might need to modify the device that the audio scripts use. By default they are looking specifically ...
by buxton_paul
Mon Jul 03, 2017 8:01 am
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

Hmm,
I wonder if there is a clash between Google Home control of lights perhaps? That sounds like it is trying to access something like a Hue light but it isn't configured.
Try changing the commands to something that won't get picked up as a command to the google assistant light controls maybe?
by buxton_paul
Fri Jun 30, 2017 12:26 pm
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

What about the commands that are already part of the system.
I.e. if you go back to the plain out of the box software, can you tell it to change volume etc?

I do not recall seeing that socks warning on mine. Perhaps try installing pysocks in the virtual envinroment?
e.g. pip3 install pysocks?
by buxton_paul
Fri Jun 30, 2017 10:58 am
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

Does any speech work?
What about using the assistant API rather than the cloud speech API?
by buxton_paul
Fri Jun 30, 2017 10:26 am
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

So you should debug is it a) The speech recognition is not recognizing your command or b) The LED/code is not working First check that the LED is working as expected by running the GPIOWrite function in a seperate script to manually turn on a LED If that doesn't work check you have it plugged into t...
by buxton_paul
Fri Jun 30, 2017 8:06 am
Forum: AIY Projects
Topic: Additional Triggers (Including Amazon Dash Button!)
Replies: 3
Views: 1011

Re: Additional Triggers (Including Amazon Dash Button!)

Nice.
Rather than using the existence of a file, you could use a fifo the same way that the LED status light works...
I have written this up on my blog :-) http://www.sudorandom.co.uk/2017/06/26/ ... -thoughts/
by buxton_paul
Fri Jun 30, 2017 8:01 am
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

Ok, so you have pasted the whole code snippet from the instructions into one location. It is actually two seperate snippets, that are to be inserted at two seperate locations. The first one should be inserted BEFORE the make_actor function import RPi.GPIO as GPIO class GpioWrite(object): '''Write th...
by buxton_paul
Thu Jun 29, 2017 3:32 pm
Forum: AIY Projects
Topic: Connect and control another LED
Replies: 17
Views: 1431

Re: Connect and control another LED

Hi, It is difficult to see when you have pasted code in this way, as there is no indentation. The python language uses indentation to specify blocks of code, so without being able to see how the code is indented it is not easy to help. Based on the error message it could be a problem with your inden...
by buxton_paul
Thu Jun 29, 2017 12:02 pm
Forum: General programming discussion
Topic: start script on startup
Replies: 14
Views: 5469

Re: start script on startup

Hmm, once it is configured the systemd mechanism is nicer to use as you can start and stop services, and a dodgy systemctl file will not normally cause the system to fail to boot (as noted in the rc.local instructions it is quite easy to cause this to happen with rc.local). If someone put together s...
by buxton_paul
Thu Jun 29, 2017 8:25 am
Forum: Other projects
Topic: Python and HC-SR04 Ultrasonic sensor and 16 x 2 LCD
Replies: 16
Views: 3199

Re: Python and HC-SR04 Ultrasonic sensor and 16 x 2 LCD

Zipping through the post it sounds like you have things sorted, but are you aware that you are using the same pin for both the LCD enable, and the sensor echo?
Might that be a source of some of your problems?
by buxton_paul
Thu Jun 29, 2017 8:16 am
Forum: AIY Projects
Topic: Hardware - Using the Servo or Driver pins
Replies: 3
Views: 911

Re: Hardware - Using the Servo or Driver pins

I can confirm, I have used the yellow server pads as outputs to an 16x2 LCD display, and the yellow drivers as both inputs and outputs (one as a LCD backlight control, one as a GPIO interrupt pin).

Results here https://youtu.be/Nf9oabccU5E (Shameless plug!).
by buxton_paul
Fri May 26, 2017 9:07 am
Forum: The MagPi
Topic: Issue #57 Hack a Dash Button
Replies: 26
Views: 23100

Re: Issue #57 Hack a Dash Button

I think that this method should be better performance. Looking at the documentation for Scapy http://www.secdev.org/projects/scapy/doc/usage.html if you scroll down to the bit on ARP packet sniffing it mentions that the filtering is done in the kernel, and the only additional work is the callback fu...
by buxton_paul
Wed May 24, 2017 4:22 pm
Forum: The MagPi
Topic: Issue #57 Hack a Dash Button
Replies: 26
Views: 23100

Re: Issue #57 Hack a Dash Button

from scapy.all import sniff from scapy.all import ARP IGNORES = {"11:22:aa:bb:cc:dd":"some-server", "ab:cd:ef:12:34:56":"a phone", } BUTTONS = { "12:34:56:78:9a:bc":"Dash button1", } def arp_detect(pkt): if pkt[ARP].op == 1: #network request if pkt[ARP].hwsrc in BUTTONS: return "Button {} pressed"....
by buxton_paul
Wed May 24, 2017 12:37 pm
Forum: AIY Projects
Topic: "Local" voice is very crackly
Replies: 17
Views: 6346

Re: "Local" voice is very crackly

The MPlayer mod certainlys helps the audio clipping issues for me.
Note that changing the language to GB causes it to translate numbers differently, specifically asking it to read out the IP address becomes tricky! :-)
by buxton_paul
Wed May 24, 2017 9:04 am
Forum: The MagPi
Topic: Issue #57 Hack a Dash Button
Replies: 26
Views: 23100

Re: Issue #57 Hack a Dash Button

I have the method in the Magpi article working on my home server (not Raspberry Pi), I typed things in manually as the code was not up on github at the time, and corrected syntax errors as I went, and prodded code so that I could first use it as a mac address sniffer (it appears I have far too many ...
by buxton_paul
Fri May 12, 2017 8:36 am
Forum: AIY Projects
Topic: Unable to get your hands on The Google Kit, don't panic!
Replies: 4
Views: 1367

Unable to get your hands on The Google Kit, don't panic!

Something that perhaps you won't have realised, is that you can start playing with the google speech stuff today on a PC today. So long as you have a linux PC that can capture sound and play it back ok, chances are you can start prototyping your project straight away. The majority of the Google AIY ...

Go to advanced search