Go to advanced search

by ghp
Fri Jun 02, 2017 10:13 pm
Forum: Scratch
Topic: Pi Scratch new for free download now
Replies: 41
Views: 16473

Re: Pi Scratch new for free download now

Hello, the scratchClient lirc adapter reads the configured buttons from lirc config which is in /etc/lirc/lircd.conf. So there is no need to have the buttons individually configured in the scratchClient config file. The file config/config_lirc.xml is all you need to start scratchClient (as provided ...
by ghp
Wed May 31, 2017 5:42 pm
Forum: Scratch
Topic: pi2go Use Sonar or Led
Replies: 17
Views: 7112

Re: pi2go Use Sonar or Led

In the schema for pi2go, there is a STM8S003F3P6 controller, do you know what his thing is doing ?
by ghp
Wed May 31, 2017 5:00 pm
Forum: Scratch
Topic: pi2go Use Sonar or Led
Replies: 17
Views: 7112

Re: pi2go Use Sonar or Led

Hello, for scratchClient, there is no ready to use configuration available. Although I have adapters for some of the chips in pi2go there are still some missing. I ordered a copy of this vehicle and hopefully after next weekend there will be some progress. One of the advantages of scratchClient is i...
by ghp
Mon May 29, 2017 4:23 pm
Forum: Python
Topic: SPI exchange
Replies: 9
Views: 2006

Re: SPI exchange

Hello, usually SPI is sending out data and for each bit send out by the master (RPi) the slave chip returns an answer bit. There is also a method xfer2, which sends out a number of bytes, returns the received bytes AND keeps CS active, usually low. But the osci picture does not show any MISO signals...
by ghp
Mon May 29, 2017 4:00 pm
Forum: Python
Topic: use mysql time field
Replies: 4
Views: 771

Re: use mysql time field

Hello,
python has a type-operation which returns the type of an object.
Could help to apply this to the timestamp variable:
x = time_stamp_from_database
print( type(a) )
When you know 'what it is' further processing is easy.
Hope this helps,
Gerhard
by ghp
Sun May 28, 2017 2:16 pm
Forum: Python
Topic: SEND DATA TO A SERVER AND POST IN DATABASE
Replies: 8
Views: 14853

Re: SEND DATA TO A SERVER AND POST IN DATABASE

- then you have the message string on server. Use e.g. regular expressions to retrieve values
For the mysql part, browse the web for examples, e.g. https://www.tutorialspoint.com/python/p ... access.htm
by ghp
Sun May 28, 2017 8:29 am
Forum: Python
Topic: call a function at a particular time of day
Replies: 6
Views: 2833

Re: call a function at a particular time of day

Hello, for scenarios as described I use 'event based' pattern. Events are sent between quite independent classes and trigger action. Queues are used to transmit events. In case you have a SwitchOn_Wait_SwitchOff -class, this class just sits and waits for a START-Event from a queue. This event could ...
by ghp
Sat May 27, 2017 3:44 pm
Forum: Scratch
Topic: Pi Scratch new for free download now
Replies: 41
Views: 16473

Re: Pi Scratch new for free download now

Hello, have added lirc remote control to scratchClient today.
Hope this helps,
Gerhard
by ghp
Sat May 27, 2017 3:42 pm
Forum: Scratch
Topic: scratchClient infrared remote control
Replies: 0
Views: 1281

scratchClient infrared remote control

Infrared remote control for scratch is a nice thing and available now for scratchClient. The linux software used is lirc which is not simple to use and unfortunately this effort needs to be done manually once in an installation phase. There is a short description in the docs. Sample config for scrat...
by ghp
Sat May 27, 2017 6:11 am
Forum: Python
Topic: SEND DATA TO A SERVER AND POST IN DATABASE
Replies: 8
Views: 14853

Re: SEND DATA TO A SERVER AND POST IN DATABASE

Hello, I like the idea to build a wheel from scratch, as it is a good exercise to understand the basics of technology. So if you try to understand the basics, then - use tcpserver on the server side, example code is in https://wiki.python.org/moin/TcpCommunication - be aware that sockets are not tra...
by ghp
Fri May 26, 2017 12:41 pm
Forum: Python
Topic: SPI exchange
Replies: 9
Views: 2006

Re: SPI exchange

Hello, for most devices, there is MISO sending signals when SCK is activated. Your device either does not use MISO, has a different pin for MISO or CS is missing. Or - if its an FPGA - the program is not loaded. Or logic levels do not match, which is unlikely if its a FPGA running with 3.3V. If its ...
by ghp
Thu May 25, 2017 7:31 pm
Forum: Scratch
Topic: Pi Scratch new for free download now
Replies: 41
Views: 16473

Re: Pi Scratch new for free download now

Hello, I maintain scratchClient, which is a python framework supporting a few devices as GPIO, some chips, boards and other interfaces for twitter, openweathermap, mqtt. There is no support for lirc IR at the moment. For documentation, see http://www.heppg.de/ikg/administration/pi/scratchClient/doc/...
by ghp
Thu May 25, 2017 4:26 am
Forum: Scratch
Topic: Pi Scratch new for free download now
Replies: 41
Views: 16473

Re: Pi Scratch new for free download now

Hello, the latest version from this web page is 13,Apr 2015, so this software seems not to be actively maintained. Between pi2 and pi3 have been some changes in hardware addresses, so some functions might not work by this reason, or supporting libraries are no longer available. Which special hardwar...
by ghp
Thu May 25, 2017 4:18 am
Forum: Python
Topic: Strucs
Replies: 4
Views: 880

Re: Strucs

Hello,
in which structure is the arduino sending the data ? Perhaps you have the relevant arduino code snippet or an example on how the data are received ? You can get the example when connecting with arduino IDE and use the serial console.
Regards,
Gerhard
by ghp
Wed May 24, 2017 9:02 pm
Forum: Python
Topic: Running python script at startup...
Replies: 7
Views: 2165

Re: Running python script at startup...

Hello, tried to reproduce this setup here. Installed mysql, prepared a small python script and executed from command line. No problem, as expected. Then stopped mysql, executed from command line and get the error message as you have. So it looks as as if mysql is not running when the python script i...
by ghp
Tue May 23, 2017 5:04 pm
Forum: Java
Topic: MQTT Message Subscribing via Java
Replies: 7
Views: 2580

Re: MQTT Message Subscribing via Java

Hello,
eclipse paho library is very well documented: https://eclipse.org/paho/clients/java/
Hope this helps,
Gerhard
by ghp
Tue May 23, 2017 4:45 am
Forum: Java
Topic: Read a PWM with Java using Pi4j
Replies: 9
Views: 3415

Re: Read a PWM with Java using Pi4j

Hello, these chips provide frequency encoded values. So you need to count pulses in a fixed time interval or measure time between pulses to get the measured value. Frequencies are in kHz range. This is not a problem for a microcontroller, but difficult for a system running linux. Perhaps you get fas...
by ghp
Mon May 22, 2017 5:25 am
Forum: Python
Topic: Countdown timer
Replies: 4
Views: 1668

Re: Countdown timer

Hello, you should start the thread only once. In last code, you start the thread inside the loop, so you end with many of these parallel running segment drivers. A thread is similar to an independent process which runs in parallel to other code. In this special case, the thread contains the seg-meth...
by ghp
Sun May 21, 2017 8:58 am
Forum: Python
Topic: HC-SR04 via webpage using Flask
Replies: 3
Views: 1834

Re: HC-SR04 via webpage using Flask

Hello, for another thread, I provided an example using tornado which does similar things: - a web app using websockets - a python loop running in a thread and reading sensors - and a queue to connect things. See https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=178080&p=1147720&hilit=tornado#p...
by ghp
Sun May 21, 2017 7:14 am
Forum: Python
Topic: Countdown timer
Replies: 4
Views: 1668

Re: Countdown timer

Hello, when I look to your code, it seems as if you have six 7-segment LED connected and you drive the segments and the digits (anode or cathode) pins to multiplex. Pls give more details on how you connected the led. As you drive active signals high and active digit pins also high, there is a hardwa...
by ghp
Sun May 21, 2017 6:43 am
Forum: Python
Topic: calibrating sensors on python
Replies: 2
Views: 1661

Re: calibrating sensors on python

Hello, in python, there is no 'write eeprom' functionality as there is in arduino atmel328. You could write some code which is writing calibration values to a file, but you could also write these constants directly into the measuring code. The sample code for arduino calculates the pHValue from the ...
by ghp
Sat May 20, 2017 7:02 pm
Forum: Python
Topic: [SOLVED] GPIO relay
Replies: 16
Views: 3418

Re: GPIO relay

There is a sketch in http://ras-pi.de/wp-content/uploads/201 ... 00x149.png which explains how to connect the transistor.
by ghp
Sat May 20, 2017 5:32 pm
Forum: Python
Topic: [SOLVED] GPIO relay
Replies: 16
Views: 3418

Re: GPIO relay

Hello, looks as if this relais board is similiar to this one described in http://henrysbench.capnfatz.com/henrys-bench/arduino-output-devices/5-volt-4-channel-arduino-relay-module-user-manual/ When you are familiar with electronics, then disconnect GPIO and connect vcc1 to 5V vcc to 3.3V, disconnect...
by ghp
Sat May 20, 2017 3:55 pm
Forum: Python
Topic: [SOLVED] GPIO relay
Replies: 16
Views: 3418

Re: GPIO relay

Hello, which relais board do you use ? Perhaps you have a link to a datasheet, part number or alike ?
by ghp
Sat May 20, 2017 7:38 am
Forum: Python
Topic: [SOLVED] GPIO relay
Replies: 16
Views: 3418

Re: GPIO relay

Hello, your code is doing the following actions: setup ( pin = 18 dir= OUT) output ( pin = 18 level= HIGH) print OFF sleep(2.000000) setup ( pin = 27 dir= OUT) output ( pin = 27 level= HIGH) print OFF sleep(2.000000) cleanup Assuming that you want to turn off the relais by setting the GPIO to LOW, t...

Go to advanced search