Go to advanced search

by MarkDH102
Thu Nov 29, 2018 2:17 pm
Forum: Beginners
Topic: Re start a program after it crashes
Replies: 4
Views: 345

Re: Re start a program after it crashes

My advice is to look at the error that is being generated (a http request timeout?) and trap it WITHIN your program. Enclose the call that is crashing within a Try..Catch block (language dependent of course). This is the RIGHT way to tackle such things. Here is an example of some Python code I use. ...
by MarkDH102
Mon Nov 26, 2018 5:04 pm
Forum: Python
Topic: How to update variable value in one line
Replies: 6
Views: 483

Re: How to update variable value in one line

Whenever I want to do this kind of thing, I use the curses library. import curses scr = curses.initscr() curses.noecho() scr.keypad(1) scr.nodelay(1) scr.clear() scr.addstr(0, 0, "") scr.clrtoeol() scr.addstr(0, 0, "Performing Morning request") scr.refresh() Bit old fashioned, but I used to do this ...
by MarkDH102
Mon Nov 26, 2018 4:57 pm
Forum: Advanced users
Topic: Run Python TKinter script on start up
Replies: 2
Views: 767

Re: Run Python TKinter script on start up

Put the complete path in when you access the config.txt file. That should solve your problem...
by MarkDH102
Sat Nov 17, 2018 7:12 am
Forum: Troubleshooting
Topic: VNC Desktop grainy...
Replies: 4
Views: 833

Re: VNC Desktop grainy...

In the VNC viewer start screen, right click on the computer you want to connect to and select properties.
Go to the options tab and select Picture Quality - High. I also select scaling 100%.
by MarkDH102
Sun Oct 28, 2018 7:10 am
Forum: General discussion
Topic: Right time - good news!
Replies: 0
Views: 219

Right time - good news!

I have just got up and VNC'd into my 8 Pi's (a mix of all models) all running Stretch - and they are all showing the correct time after our British Daylight Saving hour change.
It's a miracle. First time ever!
Very happy...
by MarkDH102
Wed Oct 17, 2018 6:17 am
Forum: Beginners
Topic: Serial transmission not working on Tkinter
Replies: 2
Views: 270

Re: Serial transmission not working on Tkinter

In tkinter, running mainloop() hands control over to the tkinter "engine". So you need to get your function up and running before calling mainloop(). And if you want your function to run repeatedly while the tkinter "engine" has control, then you need to use root.after() Also, using print() will jus...
by MarkDH102
Tue Oct 09, 2018 6:36 am
Forum: Beginners
Topic: Thread for keyboard input, passing boolean and variable
Replies: 2
Views: 287

Re: Thread for keyboard input, passing boolean and variable

I don't know if input() is a blocking function - I suspect it is, so it won't return until you press a key. I use the curses library for this kind of thing. Assuming your code runs in the terminal that is. import curses key = curses.initscr() curses.noecho() key.keypad(1) key.nodelay(1) key.clear() ...
by MarkDH102
Sat Oct 06, 2018 10:13 am
Forum: General discussion
Topic: How do I get around this update error?
Replies: 6
Views: 1249

Re: How do I get around this update error?

Ok, cheers for that. I don't have access to the device at the moment, but when I do I'll pull its disk out and check it. The device is working fine - for now. What I don't get, is that the card is a 16GB Sandisk Ultra. It has 10.8GB free from 14.6GB. My application makes very low use of resources - ...
by MarkDH102
Fri Oct 05, 2018 4:10 pm
Forum: General discussion
Topic: How do I get around this update error?
Replies: 6
Views: 1249

How do I get around this update error?

I have just updated and upgraded 2 of my Pi's and this has happened on the 3rd one. All Pi0w.
I use :

Code: Select all

sudo apt-get update && sudo apt-get upgrade
I have tried sudo apt-get clean but it made no difference...
Error.png
Error.png (177.03 KiB) Viewed 1249 times
by MarkDH102
Sun Sep 16, 2018 6:30 am
Forum: Python
Topic: GPIO and Serial device help!
Replies: 4
Views: 720

Re: GPIO and Serial device help!

I use import serial import threading import time A timeout in the setup of the serial port serialGPS = serial.Serial("/dev/serial0", 115200, timeout = 0.5, rtscts = 0) And then a function to read the port def readGPS(): global _strGPS while True : strX = serialGPS.readline().decode("utf-8") fields =...
by MarkDH102
Sat Sep 15, 2018 6:31 am
Forum: Python
Topic: GPIO and Serial device help!
Replies: 4
Views: 720

Re: GPIO and Serial device help!

Code: Select all

response = ser.readline()

This statement will not return to your code until it reads something.

You can put a timeout parameter in the call to setup the serial port.

I don't know if the add_event_detect buttonPress() function will still run while the call to readline() is blocking.
by MarkDH102
Sat Sep 15, 2018 6:22 am
Forum: Python
Topic: Python Logic + GPIO help maybe?
Replies: 3
Views: 386

Re: Python Logic + GPIO help maybe?

I could be wrong...but... if (GPIO.input(7) != BREAKRM): doorAjarAlert(nBREAKRM, BREAKRM) #set previous state STE5 = GPIO.input(14) All of the #set previous states will only happen if GPIO.input(7) != BREAKARM Shift your tabs back by one in all the STEx = Python is reliant on TABS to say which code ...
by MarkDH102
Sat Jul 14, 2018 6:03 am
Forum: Automation, sensing and robotics
Topic: Switching ON/OFF High Current Load
Replies: 13
Views: 1452

Re: Switching ON/OFF High Current Load

I did a commercial job a few years ago working on testing components within the joint strike fighter F35 aircraft.
We used 75A -> 150A CONTACTORS. However, I have just done a quick google search and they are - for you - I think prohibitively expensive.
by MarkDH102
Sat Jul 14, 2018 5:59 am
Forum: Off topic discussion
Topic: Connecting leads to a button/coin battery
Replies: 5
Views: 1274

Re: Connecting leads to a button/coin battery

You lot have done this before... :) Many thanks.
by MarkDH102
Fri Jul 13, 2018 6:22 am
Forum: Off topic discussion
Topic: Connecting leads to a button/coin battery
Replies: 5
Views: 1274

Re: Connecting leads to a button/coin battery

Clothes peg. Brilliant. Why couldn't I think of that. I had my g-clamps in mind but they're all metal...
by MarkDH102
Fri Jul 13, 2018 5:17 am
Forum: Off topic discussion
Topic: Connecting leads to a button/coin battery
Replies: 5
Views: 1274

Connecting leads to a button/coin battery

I don't have a holder for the coin battery. It is a temporary solution (but needs to work for a week of testing my RTC chip on my Pi). Anyone got ideas on how to semi permanently connect (reliable connection!) some power leads to it. Soldering is obviously out of the question. I've tried insulation ...
by MarkDH102
Tue Jul 10, 2018 6:13 am
Forum: Advanced users
Topic: Dual (small) touch display
Replies: 5
Views: 1042

Re: Dual (small) touch display

I use one of these on a pi0w. I link it via the serial port at 115200 baud rate. https://www.4dsystems.com.au/product/gen4_uLCD_32PT/ Don't know if it would be of any use to you. I know it has it's own built in intelligence, but I don't use any of it. It was in the 'discarded' parts bin at work, so ...
by MarkDH102
Mon Jul 09, 2018 12:52 pm
Forum: Automation, sensing and robotics
Topic: Wireless temp sensors
Replies: 4
Views: 3450

Re: Wireless temp sensors

Check out this thread : https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=182721&p=1162961#p1162961 My system consists of a MASTER pi0w connected to a small serial LCD (240*320 pixels) and to an ATMEGA 328 microcontroller via 2 I/O lines (and power). The microcontroller is connected to a BME28...
by MarkDH102
Fri Jul 06, 2018 6:57 am
Forum: General discussion
Topic: Email not working - again
Replies: 4
Views: 551

Re: Email not working - again

Well, they are all working again this morning. No intervention from me. So something must have been awry at Microsoft...
Thanks for your help along the way.
by MarkDH102
Thu Jul 05, 2018 3:58 pm
Forum: General discussion
Topic: Email not working - again
Replies: 4
Views: 551

Re: Email not working - again

Yes, all pi's are able to access the Internet.
by MarkDH102
Thu Jul 05, 2018 2:01 pm
Forum: General discussion
Topic: Email not working - again
Replies: 4
Views: 551

Email not working - again

I have 4 * Pi (0's and 0W's and 3's) all running the latest Stretch (updated last Friday). As of now, I cannot use Claws email to sign in to my account on any of them. They were sending me emails this morning from within my applications. I can VNC in no problem. Standard email account: [email protected]....
by MarkDH102
Sun Jun 17, 2018 1:56 pm
Forum: Python
Topic: Get tomorrow's weather
Replies: 7
Views: 1008

Re: Get tomorrow's weather

I use the following snippet of code to get the information from the UK Met Office. No registration. No costs. No API's. It has worked for over 18 months now. But I do understand that I am at the mercy of the Met Office changing their html or the URL. from lxml import html import requests page = requ...
by MarkDH102
Fri Jun 15, 2018 6:05 am
Forum: Troubleshooting
Topic: PiZeroW unrresponive to ping/SSH but still operational - Mystery!
Replies: 13
Views: 2710

Re: PiZeroW unrresponive to ping/SSH but still operational - Mystery!

I had the same problem with both a Pi0W and a Pi0 with an Edimax dongle using Jessie. I upgraded to Stretch a couple of months back and still had the problem. So I did the following : sudo nano /etc/modprobe.d/8192cu.conf # Disable Power Management options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 I hav...
by MarkDH102
Wed Jun 13, 2018 1:50 pm
Forum: Advanced users
Topic: Brief voltage drop on UPS like system. would a capacitor fix it?
Replies: 53
Views: 7402

Re: Brief voltage drop on UPS like system. would a capacitor fix it?

For an oscilloscope you could follow this tutorial : http://www.instructables.com/id/Girino-Fast-Arduino-Oscilloscope/ I use an Arduino UNO with a 256K FRAM attached to read and store analogue signals as quickly as possible. As I'm only messing about with +5V down to 0V, I just go direct into the Ar...
by MarkDH102
Wed Jun 13, 2018 6:20 am
Forum: Advanced users
Topic: Turning off power on a PI Zero W
Replies: 6
Views: 2195

Re: Turning off power on a PI Zero W

I have a couple of Pi0W doing data collection with batteries attached. Both also have a small 2*16 LCD attached. I also have two push buttons wired into the GPIO. My code repeatedly scans the buttons and if one of them is held down for 5s then I invoke a shutdown from software. The LCD shows me the ...

Go to advanced search