Go to advanced search

by ghp
Fri Jan 24, 2020 9:12 pm
Forum: Python
Topic: Trouble writing BME280 sensor data to mariadb
Replies: 8
Views: 359

Re: Trouble writing BME280 sensor data to mariadb

There is a document available on python and mariadb https://mariadb.com/resources/blog/how-to-connect-python-programs-to-mariadb/ Related to your code, change it like (untested) ambient_temperature_value = 43.2 air_pressure_value = 32.4 humidity_value = 24.3 c.execute("INSERT INTO weather(AMBIENT_TE...
by ghp
Thu Jan 23, 2020 9:13 pm
Forum: Python
Topic: GPIO Behavior with python
Replies: 5
Views: 223

Re: GPIO Behavior with python

The timings are different. brightLED : high 1 , low 0.01 >> on-ratio 1 / (1+0.01) almost always on ledmain : high 0.05, low 0.01 + 0.06*3 >> on-ratio 0.05/ (0.05 + 0.19) prox 21% on ledOn-dimcode: high very short, low 1 >> on-ratio (almost zero) / 1 almost alway off You control brightness by pulsing...
by ghp
Tue Jan 21, 2020 6:22 am
Forum: Python
Topic: Relay Off + python + cron + sunwait not working
Replies: 1
Views: 147

Re: Relay Off + python + cron + sunwait not working

Hello, what are the differences: - the off-code uses cleanup() at the end, the on-code does not. cleanup() will set used outputs to inputs. Depends on how the relay is connected whether this makes problems. But as it works from terminal not a problem. - calling from cron or calling from the terminal...
by ghp
Sun Jan 19, 2020 12:20 pm
Forum: Python
Topic: Neopixel Stick
Replies: 14
Views: 428

Re: Neopixel Stick

the magic three steps are - solder the connections. - install the library (think you did with the corrected command "sudo pip3 install adafruit-circuitpython-neopixel") - run the sample code from adafruit web page(https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython, neopixel_...
by ghp
Sat Jan 18, 2020 6:02 pm
Forum: Python
Topic: Neopixel Stick
Replies: 14
Views: 428

Re: Neopixel Stick

define " editing?"
by ghp
Sat Jan 18, 2020 4:39 pm
Forum: Python
Topic: Neopixel Stick
Replies: 14
Views: 428

Re: Neopixel Stick

pip is a recursive acronym for "Pip Installs Packages". Packages are software packages for python.
pip3 is pip for python version 3.
The pi board version is not related to pip.
by ghp
Sat Jan 18, 2020 2:19 pm
Forum: Python
Topic: Neopixel Stick
Replies: 14
Views: 428

Re: Neopixel Stick

Hello, the screenshot is a little bit blurred, bit I think you misspelled the install command. Adafruit webpage says (https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython) sudo pip3 install adafruit-circuitpython-neopixel There is also a wiring diagram on this page. Compare wi...
by ghp
Sat Jan 18, 2020 10:01 am
Forum: Scratch
Topic: Scratch 1.4 Squeak is almost out of memory. Already compressed sounds
Replies: 14
Views: 1412

Re: Scratch 1.4 Squeak is almost out of memory. Already compressed sounds

scratchClient allows to play sounds using Linux aplay tool, see http://www.heppg.de/download/scratchCli ... line_aplay
There is also control for sonic pi available, there is an entry in my blog http://heppg.de/ikg/wordpress/?p=960
by ghp
Thu Jan 16, 2020 7:22 pm
Forum: Scratch
Topic: Using Scratch with Raspberry Pi (Analog inputs)
Replies: 5
Views: 453

Re: Using Scratch with Raspberry Pi (Analog inputs)

scratchClient supports some AD converters as MCP3202, MCP3008 (SPI) or ADS1015, PCF8591 (I2C). Also atmel328 on e.g. arduino nano boards with its ADC (connected by USB Serial).
scratchClient is available for scratch 2 and scratch 1.4.
by ghp
Sat Jan 11, 2020 9:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: 20x DS18B20 Temperature Sensors with 20M cabling each
Replies: 4
Views: 448

Re: 20x DS18B20 Temperature Sensors with 20M cabling each

Wireless communication is one solution. - ESP8266 are interesting for wifi, but use quite a lot of power. - RFM69HCW Packet Radio at 433MHz use less power and there are controller/radio boards around, even with lipoly support. With small solar panels there could be autonomous stations. - raspberry i...
by ghp
Sat Jan 11, 2020 6:52 pm
Forum: Python
Topic: Hangups python script to send messages automatically?
Replies: 2
Views: 199

Re: Hangups python script to send messages automatically?

What do you mean with "in case of a system trigger" ?
by ghp
Tue Jan 07, 2020 7:43 pm
Forum: Python
Topic: pwm.set_pwm(0, 0, pwm0), what does pwm0 equal??
Replies: 4
Views: 203

Re: pwm.set_pwm(0, 0, pwm0), what does pwm0 equal??

You do not provide much context. If my assumption holds true that you refer to adafruit-16-channel-servo-driver-with-raspberry-pi, then in https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/library-reference you find an explanation. look for set_pwm(channel, on, off): Argu...
by ghp
Tue Jan 07, 2020 6:01 pm
Forum: Python
Topic: multiple i2c sensores
Replies: 5
Views: 365

Re: multiple i2c sensores

With two VEML6070, connected to the setup described earlier here with two I2C bus, a sample program reads data: import smbus import time bus_1 = smbus.SMBus(1) bus_3 = smbus.SMBus(3) class VEML6070: _ADDR_CMD = (0x70 >> 1) _ADDR_LOW = (0x71 >> 1) _ADDR_HIGH = (0x73 >> 1) def __init__(self, nbus): se...
by ghp
Mon Jan 06, 2020 10:40 am
Forum: Python
Topic: installing latest meld
Replies: 4
Views: 296

Re: installing latest meld

There is a development page in the meld home page
https://meldmerge.org/development.html
According to these descriptions, this should be simple. I tried it here (get from git, run python code) but found various problems with the availability of supporting libraries.
by ghp
Mon Jan 06, 2020 10:25 am
Forum: Python
Topic: Digital reading of GPIO inputs from ADC converter /Digital osciloscope
Replies: 5
Views: 310

Re: Digital reading of GPIO inputs from ADC converter /Digital osciloscope

There is another post about an oscilloscope. https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=259535 The author reports 1500 samples per second. Which is good for python, but pretty slow compared to the 32MSPS which are possible with the AD converter on the board. cited from https://ez.analog...
by ghp
Mon Jan 06, 2020 9:43 am
Forum: Python
Topic: How to Upgrade Raspbian OS 4.14 to 4.19 via terminal
Replies: 5
Views: 214

Re: How to Upgrade Raspbian OS 4.14 to 4.19 via terminal

See https://docs.python-guide.org/scenarios/admin/ for a description of various software to remote admin computers. ansible is quite interesting, as it requires no agent to be installed on remote machine. When executing apt-tasks, add a '-y' option so the tools does not ask for confirmations. There ...
by ghp
Sun Jan 05, 2020 6:46 pm
Forum: Python
Topic: Using gpiozero with tkinter
Replies: 3
Views: 184

Re: Using gpiozero with tkinter

Possibly the problem is that the LED objects are created, but then deleted when methods are left. To check this, create all LED objects and keep them alive. For this, I propose to create a class which keeps the objects. Could look like the following. Could not test this so far. import tkinter as tk ...
by ghp
Sat Jan 04, 2020 8:49 am
Forum: Python
Topic: GPIO Zero: How to Increment Servo to Initial Angle instead of Max Angle.
Replies: 1
Views: 123

Re: GPIO Zero: How to Increment Servo to Initial Angle instead of Max Angle.

Assuming you use the AngularServo-class from gpio-zero, you could try something like wanted_angleNS = servoNS.angle + 1 # depends what you mean by 'middle angle'. # could be something like # -- zero value # -- arithmethic middle # middle_angle = 0 middle_angle = (servoNS.max_angle + servoNS.min_angl...
by ghp
Fri Jan 03, 2020 10:57 am
Forum: Python
Topic: Help with escaping python 3.8.1
Replies: 1
Views: 183

Re: Help with escaping python 3.8.1

Most possibly you have added a call to python somewhere in .bash-files for local user 'pi'.
Type 'quit()' into the command line and the python interpreter exits. Then correct the wrong commands.
by ghp
Fri Jan 03, 2020 7:48 am
Forum: Python
Topic: td6600 driver and nema 17 stepper RPM
Replies: 2
Views: 202

Re: td6600 driver and nema 17 stepper RPM

Hello, there are some discussions in other posts, e.g. https://www.raspberrypi.org/forums/viewtopic.php?t=242928 If you drive the motor with 1/32 microsteps, and 50 RPM, 200 steps per revolution, then you need 32 * 50 * 200 pulses in 60 secs. Which is 5333Hz, quite fast for python code. If you use a...
by ghp
Thu Jan 02, 2020 9:54 am
Forum: Python
Topic: Running a function from outside the script
Replies: 6
Views: 358

Re: Running a function from outside the script

You can periodically re-read the file in the script. So when the file changes, after some time the labels/colors change. tkinter provides a timer mechanism: def ledsUpdate(self): # Check remote switches status and show in leds # do the work here... # add a periodic call to this method root.after( 50...
by ghp
Tue Dec 31, 2019 8:01 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 656

Re: How to synchronize data on txt files between raspberrys

Did you remove the sudo from

Code: Select all

subprocess.call("sudo scp ...
??
by ghp
Mon Dec 30, 2019 7:11 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 656

Re: How to synchronize data on txt files between raspberrys

Let me again propose a MQTT solution for distributing switch state: Taken from http://www.steves-internet-guide.com/into-mqtt-python-client/ Sending (publish) state of a switch to the broker: import paho.mqtt.client as mqtt #import the client1 broker_address="192.168.1.184" # this is the one compute...
by ghp
Mon Dec 30, 2019 5:44 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 656

Re: How to synchronize data on txt files between raspberrys

to avoid asking for a password you could give the password on command line: subprocess.call("sshpass -p REMOTEPASSWORD scp /home/pi/Pi1-flags.txt pi@192.168.1.38:/home/pi/", shell=True) use "sudo apt-get install sshpass" once to install sshpass. You should probably add "-o StrictHostKeyChecking=no" ...

Go to advanced search