Go to advanced search

by ghp
Mon Jun 08, 2015 4:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: [SPI] Interfacing RPi B+ and ADE7758 for energy measurement
Replies: 24
Views: 5115

Re: [SPI] Interfacing RPi B+ and ADE7758 for energy measurem

... one possible cause of trouble could be the missing 10MHz clock for the ADE7758 in the attached schematics.
by ghp
Sun Jun 07, 2015 5:05 pm
Forum: Python
Topic: blink an led.
Replies: 3
Views: 1088

Re: blink an led.

Hello, blinking is easily done with threads. import time import threading def workerA(): """thread worker A function""" print 'WorkerA start' while True: time.sleep(0.5) print ("A high", time.time()) time.sleep(0.5) print ("A high", time.time()) # will not be executed, just for demonstration print '...
by ghp
Sun Jun 07, 2015 4:57 pm
Forum: Python
Topic: Custom IR Signals
Replies: 14
Views: 3383

Re: Custom IR Signals

Hello, unless you own a digital oscilloscope or a logic analyzer, it is best to start with a simple setup: send out bit pattern on one GPIO without a carrier, and connect this to another GPIO where a second program receives and decodes the signals. Try to implement a RC5 code or NEC code first. And ...
by ghp
Sat Jun 06, 2015 6:12 am
Forum: Python
Topic: python for mq-135 sensor
Replies: 5
Views: 5359

Re: python for mq-135 sensor

Hello,

MCP3008 is an ADC converter. Give it a try.

Regards,
Gerhard
by ghp
Sat Jun 06, 2015 5:25 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI WS2801 LED Strip control
Replies: 12
Views: 11667

Re: SPI WS2801 LED Strip control

Hello, some time ago, I wrote the following code for this chip class _Handler_WS2801: def __init__(self): pass def writeValue(self, spi, data): spi.max_speed_hz = 2000000 # print(data) r = spi.xfer2( list(data) ) return r According to the data sheet, the device needs >500us 'idle lead time'. You nee...
by ghp
Fri Jun 05, 2015 4:28 pm
Forum: Python
Topic: python for mq-135 sensor
Replies: 5
Views: 5359

Re: python for mq-135 sensor

Hello, there is a nice arduino-related tutorial for MQ 135 in http://playground.arduino.cc/Main/MQGasSensors . Assuming it is this sensor mentioned there, it provides a single voltage output only for it whatever the sensor is measuring. Unfortunately, this voltage is 0 to 5V (at least it is possible...
by ghp
Fri Jun 05, 2015 11:45 am
Forum: Python
Topic: Wifi Crack - NOT REAL
Replies: 10
Views: 1924

Re: Wifi Crack - NOT REAL

See the first entry: import hashlib # place a 'secret string' here, start with short ones like simple ABC secret = 'ABC' h_unknown = hashlib.md5(secret.encode('utf-8')).hexdigest() print( h_unknown) Please keep in mind that usual system use 'salt' to hash passwords, making even simple passwords a li...
by ghp
Fri Jun 05, 2015 8:37 am
Forum: Python
Topic: Wifi Crack - NOT REAL
Replies: 10
Views: 1924

Re: Wifi Crack - NOT REAL

Hello paddyg,

nice solution, good approach.
Although the idea was to get people using python coding and exercise some combinatorics. "selber denken macht schlau".

Regards,
Gerhard
by ghp
Fri Jun 05, 2015 5:54 am
Forum: Python
Topic: Wifi Crack - NOT REAL
Replies: 10
Views: 1924

Re: Wifi Crack - NOT REAL

Hello,
your time is lot faster than my solution. I needed 183sec on a PI2 with python2.7, and 72sec with pypy. Could you give some hints on how you solved it ?
Regards,
Gerhard
by ghp
Fri Jun 05, 2015 5:01 am
Forum: Python
Topic: LED Dimmer not Working on Pi2
Replies: 3
Views: 713

Re: LED Dimmer not Working on Pi2

Hello,

you are adressing in BCM-Mode, which uses the chip names for the GPIO.
GPIO.setmode(GPIO.BCM)

GPIO12 is located on pin 32 of the header.
See http://elinux.org/RPi_Low-level_peripherals for details.

Regards,
Gerhard
by ghp
Wed Jun 03, 2015 6:40 pm
Forum: Python
Topic: Wifi Crack - NOT REAL
Replies: 10
Views: 1924

Re: Wifi Crack - NOT REAL

Password challenge. Some time ago I have build a sample application to demonstrate the need for strong passwords. Passwords are stored on servers (hopefully) not as plain text, but as hash values. import hashlib # place a 'secret string' here, start with short ones like simple ABC secret = 'ABC' h_u...
by ghp
Tue Jun 02, 2015 7:24 pm
Forum: Python
Topic: Custom IR Signals
Replies: 14
Views: 3383

Re: Custom IR Signals

Hello, there is a library RPIO, which allows for repeating pulse pattern. See https://pythonhosted.org/RPIO/pwm_py.html Check the DMA channels, see https://pibrewstuff.wordpress.com/2015/01/13/raspberry-pi-dma-channels/ For a signal description, I found http://www.pcbheaven.com/userpages/The_Philips...
by ghp
Tue Jun 02, 2015 3:41 am
Forum: Python
Topic: GPIO issues on RASPBERRY PI2
Replies: 3
Views: 687

Re: GPIO issues on RASPBERRY PI2

Hello,

could be that the SPI driver and the serial driver block these pins. Try "sudo raspi-config", disable SPI and serial and reboot.

Regards,
Gerhard
by ghp
Tue Jun 02, 2015 3:36 am
Forum: Python
Topic: Cannot use pip to install any package
Replies: 8
Views: 26981

Re: Cannot use pip to install any package

Hello, the error message is "Cannot fetch index base URL http://pypi.python.org/simple/"; so couldbe a network setup problem. Can you get this page with a browser? On your pi, just paste "http://pypi.python.org/simple/" into the address line and look what happens. The command line tool wget does the...
by ghp
Thu May 28, 2015 5:52 pm
Forum: Python
Topic: Pulsing check
Replies: 4
Views: 1350

Re: Pulsing check

Hello, be careful when connecting to these devices! I had a short look to various devices and for most of them the (dangerous) power connectors are very close to the S0-connectors. And for one device, they mentioned that the contacts are connected to one pole of the mains connector. Be sure that saf...
by ghp
Wed May 27, 2015 6:59 pm
Forum: Scratch
Topic: Automate Home with Scratch?
Replies: 14
Views: 2783

Re: Automate Home with Scratch?

Hello,

between an app on a smartphone and a host computer, http is appropriate. SNMP is more 'technical' and used towards technical end points.

Regards,
Gerhard
by ghp
Tue May 26, 2015 4:39 pm
Forum: Python
Topic: mcp23017 input event
Replies: 3
Views: 1161

Re: mcp23017 input event

Hello, 23s17 or 23017 is a complicated device. Functionality of intA, intB is configured by commands send to the chip. And active low, high or open drain makes situation even more difficult. And when an interrupt condition occurred, the pin stays active till a read operation to some registers, see c...
by ghp
Mon May 25, 2015 8:35 pm
Forum: Python
Topic: python3 app crash after run GPIO.setup(1, GPIO.OUT)
Replies: 2
Views: 540

Re: python3 app crash after run GPIO.setup(1, GPIO.OUT)

Hello, GPIO1 was available in Rev1 only on P1.05 and was replaced by GPIO3.
P1-05 Rev 1:GPIO 1 Rev2: GPIO 3

GPIO1 is obviously not available. I do not know, but could be this pin is used for system purpose.

Regards,
Gerhard
by ghp
Mon May 25, 2015 9:43 am
Forum: Scratch
Topic: Arduino UNO by USB/serial to scratch
Replies: 1
Views: 1700

Arduino UNO by USB/serial to scratch

Arduino UNO has an USB connection, which supports serial connection to a host computer. The arduino can be used as a IO expander, connecting digital io lines, pwm, or adc-inputs directly to scratchClient. With the USB-connection, the UNO provides 5V-compatible inputs/outputs. This is an advantage in...
by ghp
Mon May 25, 2015 8:06 am
Forum: Python
Topic: Python SpiDev.
Replies: 4
Views: 4293

Re: Python SpiDev.

Hello, try using xfer2-command, which keeps CS active during transfer of blocks. In my code, I set speed separately before the transfer, sample: spi.max_speed_hz = 500000 What I also found is to embrace the blockdata by a list()-statement, which constructs a new list. This is because the xfer2 comma...
by ghp
Sun May 24, 2015 2:10 pm
Forum: Scratch
Topic: How to get someone interested in programming using Scratch?
Replies: 3
Views: 941

Re: How to get someone interested in programming using Scrat

Hello, I teach scratch in a school for 14 yr old kids, but my tutorials are in german (the school is in germany). One good book I found is "super scratch programming adventure". Tutorials on the web are https://download.scratch.mit.edu/ScratchGettingStartedv14.pdf One possible idea is to build birth...
by ghp
Sun May 24, 2015 7:32 am
Forum: Python
Topic: GPIO "channel is already in use" question
Replies: 7
Views: 86458

Re: GPIO "channel is already in use" question

Hello,

see http://raspi.tv/2013/rpi-gpio-basics-3- ... ct-your-pi, there is a nice explanation on what is going on.

Regards,
Gerhard
by ghp
Sat May 23, 2015 9:21 pm
Forum: Scratch
Topic: Automate Home with Scratch?
Replies: 14
Views: 2783

Re: Automate Home with Scratch?

Hello, home automation is basically possible with scratch, but there are many constraints. scratch 1.4 does not have system time available. I just added a TimeAdapter for scratchClient http://heppg.de/ikg/wordpress/?page_id=6 which provides current time.fields (which should also work on a common lin...
by ghp
Sat May 23, 2015 6:49 am
Forum: Python
Topic: Can't turn on the LED
Replies: 3
Views: 1795

Re: Can't turn on the LED

Hello, some precautions: - never use a led without a resistor 220 minimum when working with GPIO. - never connect the 5V-Connectors when using the GPIO (unless you precisely know what you are doing) When following the tutorial, there is a GND-connection to the (resistor+led-combo), taken from pin 6,...

Go to advanced search