Go to advanced search

by RogerW
Wed Dec 13, 2017 2:49 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Cannot connect with SSH
Replies: 3
Views: 422

Re: Cannot connect with SSH

I have found a way to fix it.
Edit the file /etc/ssh/sshd_config to comment out the line
PasswordAuthentication no

This now seems to work like Raspbian but it would be nice if someone could fill in the background.
by RogerW
Wed Dec 13, 2017 10:14 am
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Cannot connect with SSH
Replies: 3
Views: 422

Cannot connect with SSH

I have stretch running on a PC from a USB stick with persistence. I have enabled SSH and run sudo apt-get update. If I try to connect with FileZilla or putty I get: "Disconnected. No supported authentication methods available." Both work fine to a Pi with an apparently similar stretch installed. Any...
by RogerW
Tue Nov 21, 2017 3:46 pm
Forum: Python
Topic: tkinter
Replies: 4
Views: 684

Re: tkinter

I should have read your code properly. Try this from tkinter import * #import tkinter as tk #import platform def raise_frame(frame): global current current.grid_forget() #frame.tkraise() frame.grid(row=0,column=0) current=frame def quitprog(): global root root.destroy() root = Tk() root.attributes('...
by RogerW
Tue Nov 21, 2017 10:03 am
Forum: Python
Topic: tkinter
Replies: 4
Views: 684

Re: tkinter

Perhaps this will help.

Code: Select all

import tkinter as tk

main = tk.Tk()
main.attributes('-fullscreen',True)
tk.Button(main,text='Quit',command=main.destroy).pack()
main.mainloop()
by RogerW
Wed Aug 16, 2017 9:29 am
Forum: Python
Topic: Reading GPIO with interrupts - wrong values
Replies: 6
Views: 1470

Re: Reading GPIO with interrupts - wrong values

I had a similar problem. I only want to detect the switch closing (not releasing) so my my event_detect is for FALLING only. I was getting spurious callbacks and came to the conclusion that I was getting bounce signals when the switch was released. My solution was to check again in the callback func...
by RogerW
Fri Jul 28, 2017 3:02 pm
Forum: HATs and other add-ons
Topic: Support for Adafruit 3.5" TFT in latest kernels ?
Replies: 4
Views: 1325

Re: Support for Adafruit 3.5" TFT in latest kernels ?

I have tried adding the line

Code: Select all

dtoverlay pitft35-resistive
to /boot/config.txt but output still goes to the hdmi screen.
Can anyone help please?
by RogerW
Thu Jul 27, 2017 4:42 pm
Forum: HATs and other add-ons
Topic: Support for Adafruit 3.5" TFT in latest kernels ?
Replies: 4
Views: 1325

Re: Support for Adafruit 3.5" TFT in latest kernels ?

It seems that there is an overlay pitft35-resistive which looks to be suitable. I can see that adding an entry to the device tree would enable support but I need the screen to take over from the normal hdmi screen. What do I need to do? I am a beginner on linux internals and the project is to make a...
by RogerW
Wed Jul 26, 2017 8:31 am
Forum: Python
Topic: Keyboard input from GPIO
Replies: 1
Views: 2669

Re: Keyboard input from GPIO

I forgot to say that there is also a facility to make one GPIO force a shutdown if pressed for more than 2 seconds. Not had any interest so far but here is the code anyway. # GPIOkbd.py # written by Roger Woollett # This is a python equivalent to the Adafruit Retrogame program. # It translates GPIO ...
by RogerW
Sat Jul 22, 2017 1:41 pm
Forum: Python
Topic: Keyboard input from GPIO
Replies: 1
Views: 2669

Keyboard input from GPIO

I have written a python program whuch does much the same as Adafruit's Retrogame. Grounding a GPIO by pressing a button causes a (virtual) keyboard press. This is usefull for game emulators like Retropie but may have other uses. It uses the Rpi.GPIO and uinput import libraries. Is anyone interested?...
by RogerW
Thu Jul 13, 2017 12:42 pm
Forum: Python
Topic: How to create a constantly updating label in Python
Replies: 4
Views: 12628

Re: How to create a constantly updating label in Python

I assume you are using tkinter to construct your GUI. There is a function called after which will call a given function after a set interval. This example program might help. It is supposed to show a temperature but in fact GetTemp just incremaents a counter. import tkinter as tk class Mainframe(tk....
by RogerW
Fri Jun 02, 2017 1:30 pm
Forum: Beginners
Topic: 16x2 LCD python 3
Replies: 10
Views: 2957

Re: 16x2 LCD python 3

Thank you - its good to get nice feedback.
by RogerW
Fri Jun 02, 2017 8:30 am
Forum: Beginners
Topic: 16x2 LCD python 3
Replies: 10
Views: 2957

Re: 16x2 LCD python 3

>(at least one person has reported using it successfully)
I think we can make that two.

viewtopic.php?f=32&t=185066
by RogerW
Thu Jun 01, 2017 9:30 pm
Forum: Python
Topic: 16x2 CharLCD
Replies: 9
Views: 2347

Re: 16x2 CharLCD

p1 is the most significant bit so probably corresponds to d7. E is strobe cmd is RS. I think that is right - come back if it does not work.
by RogerW
Thu Jun 01, 2017 5:08 pm
Forum: Python
Topic: 16x2 CharLCD
Replies: 9
Views: 2347

Re: 16x2 CharLCD

If you just want to get the display working I posted some code here:
viewtopic.php?f=32&t=180036&p=1145305#p1145305

It is a python class that uses RPi.GPIO to drive the display.
by RogerW
Wed May 17, 2017 3:43 pm
Forum: Python
Topic: Disable exit button
Replies: 2
Views: 3705

Re: Disable exit button

I am not sure how to remove the X button but you can stop it doing anything.

Code: Select all

import tkinter as tk

def donothing():
    pass

main = tk.Tk()
main.protocol('WM_DELETE_WINDOW',donothing)
main.mainloop()
by RogerW
Sun Apr 23, 2017 4:00 pm
Forum: Beginners
Topic: One power source for 3 Pis
Replies: 9
Views: 1084

Re: One power source for 3 Pis

This might do. Only 4.8A but if you don't run all the pis flat out all the time it might be ok.

http://cpc.farnell.com/powerpax/sw4638/ ... dp/PW03952
by RogerW
Wed Apr 12, 2017 8:29 am
Forum: Python
Topic: LCD class and 4x7 segment-display
Replies: 9
Views: 2524

Re: LCD class and 4x7 segment-display

As you probably know the Raspbery Pi does not have analog input gpios so to read an analog (voltage) signal you will need some additional electronics. A popular choice is the MCP3008 A to D converter. It would be helpfull to know what you propose to use. I have not used a 4x7 segment display and aga...
by RogerW
Mon Apr 10, 2017 8:56 am
Forum: Python
Topic: LCD class and 4x7 segment-display
Replies: 9
Views: 2524

Re: LCD class and 4x7 segment-display

I am not certain but it looks like the value in cmd is wrong. Try printing it out.

It may be relavent that I use python 3 not the default 2.7
by RogerW
Sun Apr 09, 2017 3:14 pm
Forum: Python
Topic: LCD class and 4x7 segment-display
Replies: 9
Views: 2524

Re: LCD class and 4x7 segment-display

Here are two files. The first, lcd.py, contains a class definition to allow you to use a 2 or 4 line display. # lcd.py # written by Roger Woollett import RPi.GPIO as gp from time import sleep class LCD(): # class to control a Hitachi type LCD display row_offsets16 = (0,0x40,0x10,0x50) row_offsets20 ...
by RogerW
Sat Mar 18, 2017 5:09 pm
Forum: Gaming
Topic: PiGRRL and Pi Zero-W
Replies: 3
Views: 1485

Re: PiGRRL and Pi Zero-W

Thanks for that. That seems to be based on the original PiGRRL case rather than the newer PiGRRL-Zero one. I don't think that will be a problem (but I just started printing the new case). We think we will leave out the battery and PowerBoost initially and run direct from a Pi power supply. Does that...
by RogerW
Sat Mar 18, 2017 4:00 pm
Forum: Gaming
Topic: PiGRRL and Pi Zero-W
Replies: 3
Views: 1485

PiGRRL and Pi Zero-W

My grandson and I are about to embark on a PiGRRL Zero build. It would seem sensible to use a zero-W but does anyone know if the Adafruit software supports the Zero-W.
by RogerW
Tue Mar 07, 2017 2:04 pm
Forum: Python
Topic: Display a Meter
Replies: 11
Views: 1673

Re: Display a Meter

There are times when a line gets too long to be convenient. You can break the line to make it more readable. There are rules to say when you can do this. One of the times you can is with expressions inside brackets. I choose to do this by breaking the line just before the comma but that is just my c...
by RogerW
Tue Mar 07, 2017 10:15 am
Forum: Python
Topic: Display a Meter
Replies: 11
Views: 1673

Re: Display a Meter

I think time spent getting to grips with classes will be well spent although others here might disagree. My view is that they come into there own as your program becomes more complicated. If you only want one meter then separating the code into a separate class may be questionable but when you want ...
by RogerW
Mon Mar 06, 2017 11:51 am
Forum: Python
Topic: Display a Meter
Replies: 11
Views: 1673

Re: Display a Meter

In meter.py make this change in the function set. # call this to set the hand # convert value to range 0,100 #deg = 300*(value - self.start)/self.range - 240 deg = 180*(value - self.start)/self.range - 180 I think you need to understand how tkinter works and (maybe) get used to using class objects. ...
by RogerW
Mon Mar 06, 2017 10:02 am
Forum: Python
Topic: Display a Meter
Replies: 11
Views: 1673

Re: Display a Meter

Glad to help. The first file (meter.py) contains the meter class. The second file (trymeter.py) is just a testbed. You can write your own tkinter program to include a meter object and drive it any way you like. It should not be too difficult to modify the meter class to have the needle start horizon...

Go to advanced search